Allow whitespace around a slash in fraction string inputs (GH-96496)

This commit is contained in:
Raymond Hettinger 2022-09-02 11:10:58 -05:00 committed by GitHub
parent 91f40f3f78
commit 656167db81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View file

@ -98,6 +98,9 @@ another rational number, or from a string.
:class:`Fraction` implements ``__int__`` now to satisfy
``typing.SupportsInt`` instance checks.
.. versionchanged:: 3.12
Space is allowed around the slash for string inputs: `Fraction('2 / 3')`.
.. attribute:: numerator
Numerator of the Fraction in lowest term.