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

_pydatetime.datetime has extra unnecessary slots #109495

Closed
Gobot1234 opened this issue Sep 16, 2023 · 0 comments
Closed

_pydatetime.datetime has extra unnecessary slots #109495

Gobot1234 opened this issue Sep 16, 2023 · 0 comments
Labels
3.13 new features, bugs and security fixes performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@Gobot1234
Copy link
Contributor

Gobot1234 commented Sep 16, 2023

Bug report

Bug description:

Pre patch

from _pydatetime import datetime
import sys

sys.getsizeof(datetime(1970, 1, 1))  # 152

Post patch

from _pydatetime import datetime
import sys

sys.getsizeof(datetime(1970, 1, 1))  # 120

I had a look round for any other cases of this but couldn't find any just using a simple GitHub search. It might in the future be useful to use https://github.com/ariebovenberg/slotscheck (which I wasn't personally able to figure out how to run on cpython) in CI to prevent things like this in the future.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@Gobot1234 Gobot1234 added the type-bug An unexpected behavior, bug, or error label Sep 16, 2023
@terryjreedy terryjreedy added performance Performance or resource usage and removed type-bug An unexpected behavior, bug, or error labels Sep 16, 2023
@AA-Turner AA-Turner added stdlib Python modules in the Lib dir 3.13 new features, bugs and security fixes labels Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 new features, bugs and security fixes performance Performance or resource usage stdlib Python modules in the Lib dir
Projects
Archived in project
Development

No branches or pull requests

3 participants