-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-46820: Refactor tests for ambiguous end of numerical literal #31494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-46820: Refactor tests for ambiguous end of numerical literal #31494
Conversation
with self.assertWarns(DeprecationWarning): | ||
compile(test, "<testcase>", "eval") | ||
|
||
for num in "0xf", "0o7", "0b1", "9", "0", "1.", "1e3", "1j": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is now a better time to suggest adding an underscore literal 1_000
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are too many different use cases with underscores: 0x_f
, 0x1_f
, 0o_7
, 0o1_7
, 0b_1
, 0b1_1
, 1.
, 1_0.
, 1.0_0
, etc. And none of them is related because an underscore cannot ends the numeric literal, and it does not affect interpretation of other characters.
It will increase test coverage.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-31566 is a backport of this pull request to the 3.10 branch. |
…honGH-31494) (cherry picked from commit 98c3bea) Co-authored-by: Serhiy Storchaka <[email protected]>
…31494) (cherry picked from commit 98c3bea) Co-authored-by: Serhiy Storchaka <[email protected]>
https://bugs.python.org/issue46820