]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-109495: Remove unused slots from the Python implementation of datetime (GH-109494)
authorJames Hilton-Balfe <gobot1234yt@gmail.com>
Fri, 29 Sep 2023 16:57:32 +0000 (17:57 +0100)
committerGitHub <noreply@github.com>
Fri, 29 Sep 2023 16:57:32 +0000 (19:57 +0300)
Lib/_pydatetime.py
Misc/NEWS.d/next/Library/2023-09-16-15-44-16.gh-issue-109495.m2H5Bk.rst [new file with mode: 0644]

index 88275481e7002b0f0e79fbb0da63751e0d09500a..bca2acf1fc88cf95d29229b60d245a9d089a944d 100644 (file)
@@ -1684,7 +1684,7 @@ class datetime(date):
     The year, month and day arguments are required. tzinfo may be None, or an
     instance of a tzinfo subclass. The remaining arguments may be ints.
     """
-    __slots__ = date.__slots__ + time.__slots__
+    __slots__ = time.__slots__
 
     def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
                 microsecond=0, tzinfo=None, *, fold=0):
diff --git a/Misc/NEWS.d/next/Library/2023-09-16-15-44-16.gh-issue-109495.m2H5Bk.rst b/Misc/NEWS.d/next/Library/2023-09-16-15-44-16.gh-issue-109495.m2H5Bk.rst
new file mode 100644 (file)
index 0000000..a7e1b3a
--- /dev/null
@@ -0,0 +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