Visitar URL original
_pydatetime.datetime has extra unnecessary slots · Issue #109495 · python/cpython · GitHub
Skip to content

_pydatetime.datetime has extra unnecessary slots #109495

Closed

Description

@Gobot1234

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

Activity

  1. added
    performancePerformance or resource usage
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Sep 16, 2023
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    3.13only security fixes
    on Sep 29, 2023
  3. added a commit that references this issue on Sep 29, 2023
  4. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesperformancePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directory

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions