Skip to content
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

Bug in lots of 0s #83789

Closed
wyz23x2 mannequin opened this issue Feb 11, 2020 · 3 comments
Closed

Bug in lots of 0s #83789

wyz23x2 mannequin opened this issue Feb 11, 2020 · 3 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@wyz23x2
Copy link
Mannequin

wyz23x2 mannequin commented Feb 11, 2020

BPO 39608
Nosy @stevendaprano, @serhiy-storchaka, @isidentical, @wyz23x2

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-02-11.12:21:08.430>
created_at = <Date 2020-02-11.11:04:06.377>
labels = ['3.8', 'invalid', 'type-bug', '3.7', 'build']
title = 'Bug in lots of 0s'
updated_at = <Date 2020-02-11.12:21:08.156>
user = 'https://github.com/wyz23x2'

bugs.python.org fields:

activity = <Date 2020-02-11.12:21:08.156>
actor = 'steven.daprano'
assignee = 'none'
closed = True
closed_date = <Date 2020-02-11.12:21:08.430>
closer = 'steven.daprano'
components = ['Build']
creation = <Date 2020-02-11.11:04:06.377>
creator = 'wyz23x2'
dependencies = []
files = []
hgrepos = []
issue_num = 39608
keywords = []
message_count = 3.0
messages = ['361796', '361797', '361805']
nosy_count = 4.0
nosy_names = ['steven.daprano', 'serhiy.storchaka', 'BTaskaya', 'wyz23x2']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39608'
versions = ['Python 3.7', 'Python 3.8']

@wyz23x2
Copy link
Mannequin Author

wyz23x2 mannequin commented Feb 11, 2020

Why is this?
>>> 0000000000000000000000000000000 # No error
0
>>> 0000000000000000000000000000002
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

@wyz23x2 wyz23x2 mannequin added 3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error labels Feb 11, 2020
@wyz23x2 wyz23x2 mannequin changed the title Bug in 00000000000000000 Bug in lots of 0s Feb 11, 2020
@wyz23x2
Copy link
Mannequin Author

wyz23x2 mannequin commented Feb 11, 2020

0000000000002 is not supported;
So 000000000000000 should not too.

@stevendaprano
Copy link
Member

Its not a bug, it's deliberately designed that way. 0000 is not ambiguous: it's just zero, in any base. 0012 is ambiguous.

There's a recent thread about it here:

https://mail.python.org/archives/list/python-ideas@python.org/message/7IKEXSMVVDOTLHA7CNI7MIOBK4EU2ZSG/

If you want to change the behaviour, your first step is to get a consensus on the mailing list that it should change.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant