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

sys.getsizeof(0) is incorrect #72285

Closed
mdickinson opened this issue Sep 12, 2016 · 3 comments
Closed

sys.getsizeof(0) is incorrect #72285

mdickinson opened this issue Sep 12, 2016 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@mdickinson
Copy link
Member

BPO 28098
Nosy @mdickinson

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 = 'https://github.com/mdickinson'
closed_at = <Date 2016-09-12.08:25:20.808>
created_at = <Date 2016-09-12.07:59:33.473>
labels = ['interpreter-core', 'type-bug']
title = 'sys.getsizeof(0) is incorrect'
updated_at = <Date 2016-09-12.08:25:20.806>
user = 'https://github.com/mdickinson'

bugs.python.org fields:

activity = <Date 2016-09-12.08:25:20.806>
actor = 'mark.dickinson'
assignee = 'mark.dickinson'
closed = True
closed_date = <Date 2016-09-12.08:25:20.808>
closer = 'mark.dickinson'
components = ['Interpreter Core']
creation = <Date 2016-09-12.07:59:33.473>
creator = 'mark.dickinson'
dependencies = []
files = []
hgrepos = []
issue_num = 28098
keywords = []
message_count = 3.0
messages = ['275987', '275989', '275994']
nosy_count = 1.0
nosy_names = ['mark.dickinson']
pr_nums = []
priority = 'low'
resolution = 'wont fix'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue28098'
versions = ['Python 3.5', 'Python 3.6']

@mdickinson
Copy link
Member Author

Low-priority issue, possibly not worth fixing at all, but maybe worth recording.

sys.getsizeof(0) currently reports 24 on a 64-bit machine using 30-bit limbs. That's inaccurate, since we're actually allocating 28 bytes for 0 as part of the small-int cache. PyLong_FromLong also always requests at least one limb.

@mdickinson mdickinson self-assigned this Sep 12, 2016
@mdickinson mdickinson added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Sep 12, 2016
@mdickinson
Copy link
Member Author

Related: http://bugs.python.org/issue3690

@mdickinson
Copy link
Member Author

I don't think anything has changed substantially since the discussion in bpo-3690. Closing as "won't fix".

@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
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant