Skip to content

_pydatetime.datetime has extra unnecessary slots #109495

@Gobot1234

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesperformancePerformance or resource usagestdlibPython modules in the Lib dir

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy