Skip to content

Commit

Permalink
Updates from Christopher Craig.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodger committed Jan 18, 2003
1 parent f6e3df2 commit 3719ffd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pep-0240.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ Backwards Compatibility
The only backwards compatible issue is the type of literals
mentioned above. The following migration is suggested:

1. "from __future__ import rational_literals" will cause all such
literals to be treated as rational numbers.
1. The next Python after approval will allow
"from __future__ import rational_literals"
to cause all such literals to be treated as rational numbers.

2. Python 2.2 will have a warning, turned off by default, about
2. Python 3.0 will have a warning, turned on by default, about
such literals in the absence of a __future__ statement. The
warning message will contain information about the __future__
statement, and indicate that to get floating point literals,
they should be suffixed with "e0".

3. Python 2.3 will have the warning turned on by default. This
3. Python 3.1 will have the warning turned off by default. This
warning will stay in place for 24 months, at which time the
literals will be rationals and the warning will be removed.

Expand All @@ -61,6 +62,12 @@ Common Objections
(Relax, I'm not taking floats away, I'm just adding two more characters.
1e0 will still be a float)

Rationals must present themselves as a decimal float or they will be
horrible for users expecting decimals (i.e. str(.5) should return '.5' and
not '1/2'). This means that many rationals must be truncated at some
point, which gives us a new loss of precision.



References

Expand Down

0 comments on commit 3719ffd

Please sign in to comment.