optparse compatibility - add float and complex

also documents the implementation quality
fixes #457
This commit is contained in:
Ronny Pfannschmidt 2016-07-19 10:20:41 +02:00
parent 2b9973846e
commit 317b3f257d
1 changed files with 9 additions and 2 deletions

View File

@ -552,11 +552,18 @@ class ArgumentError(Exception):
class Argument:
"""class that mimics the necessary behaviour of optparse.Option """
"""class that mimics the necessary behaviour of optparse.Option
its currently a least effort implementation
and ignoring choices and integer prefixes
https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
"""
_typ_map = {
'int': int,
'string': str,
}
'float': float,
'complex': complex,
}
# enable after some grace period for plugin writers
TYPE_WARN = False