Skip to content

Commit d8c46cc

Browse files
Gobot1234pull[bot]
authored andcommitted
gh-109495: Remove unused slots from the Python implementation of datetime (GH-109494)
1 parent 6baca03 commit d8c46cc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/_pydatetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ class datetime(date):
16841684
The year, month and day arguments are required. tzinfo may be None, or an
16851685
instance of a tzinfo subclass. The remaining arguments may be ints.
16861686
"""
1687-
__slots__ = date.__slots__ + time.__slots__
1687+
__slots__ = time.__slots__
16881688

16891689
def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
16901690
microsecond=0, tzinfo=None, *, fold=0):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove unnecessary extra ``__slots__`` in :py:class:`datetime`\'s pure python implementation to reduce memory size, as they are defined in the superclass. Patch by James Hilton-Balfe

0 commit comments

Comments
 (0)