mirror of
https://github.com/python/cpython.git
synced 2025-12-09 02:35:14 +00:00
GH-124693: Support parsing negative scientific and complex numbers argparse (GH-124823)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
52f70da19c
commit
0c5a48c1c9
3 changed files with 22 additions and 8 deletions
|
|
@ -1367,7 +1367,7 @@ class _ActionsContainer(object):
|
|||
self._defaults = {}
|
||||
|
||||
# determines whether an "option" looks like a negative number
|
||||
self._negative_number_matcher = _re.compile(r'^-(?:\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?|\.\d+(?:_\d+)*)$')
|
||||
self._negative_number_matcher = _re.compile(r'-\.?\d')
|
||||
|
||||
# whether or not there are any optionals that look like negative
|
||||
# numbers -- uses a list so it can be shared and edited
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue