optparse compatibility - add float and complex
also documents the implementation quality fixes #457
This commit is contained in:
parent
2b9973846e
commit
317b3f257d
|
@ -552,11 +552,18 @@ class ArgumentError(Exception):
|
||||||
|
|
||||||
|
|
||||||
class Argument:
|
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 = {
|
_typ_map = {
|
||||||
'int': int,
|
'int': int,
|
||||||
'string': str,
|
'string': str,
|
||||||
}
|
'float': float,
|
||||||
|
'complex': complex,
|
||||||
|
}
|
||||||
# enable after some grace period for plugin writers
|
# enable after some grace period for plugin writers
|
||||||
TYPE_WARN = False
|
TYPE_WARN = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue