mirror of
https://github.com/python/cpython.git
synced 2025-10-07 15:42:02 +00:00
Allow whitespace around a slash in fraction string inputs (GH-96496)
This commit is contained in:
parent
91f40f3f78
commit
656167db81
4 changed files with 7 additions and 4 deletions
|
@ -26,7 +26,7 @@ _RATIONAL_FORMAT = re.compile(r"""
|
|||
(?=\d|\.\d) # lookahead for digit or .digit
|
||||
(?P<num>\d*|\d+(_\d+)*) # numerator (possibly empty)
|
||||
(?: # followed by
|
||||
(?:/(?P<denom>\d+(_\d+)*))? # an optional denominator
|
||||
(?:\s*/\s*(?P<denom>\d+(_\d+)*))? # an optional denominator
|
||||
| # or
|
||||
(?:\.(?P<decimal>d*|\d+(_\d+)*))? # an optional fractional part
|
||||
(?:E(?P<exp>[-+]?\d+(_\d+)*))? # and optional exponent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue