[pypy-commit] pypy py3k: port datetime changes in b62868397a09

bdkearns noreply at buildbot.pypy.org
Tue Mar 5 05:14:59 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: py3k
Changeset: r62044:768e6f96277d
Date: 2013-03-04 22:15 -0500
http://bitbucket.org/pypy/pypy/changeset/768e6f96277d/

Log:	port datetime changes in b62868397a09

diff --git a/lib-python/3/datetime.py b/lib-python/3/datetime.py
--- a/lib-python/3/datetime.py
+++ b/lib-python/3/datetime.py
@@ -930,6 +930,7 @@
     Subclasses must override the name(), utcoffset() and dst() methods.
     """
     __slots__ = ()
+
     def tzname(self, dt):
         "datetime -> string name of time zone."
         raise NotImplementedError("tzinfo subclass must override tzname()")
@@ -1016,6 +1017,7 @@
     Properties (readonly):
     hour, minute, second, microsecond, tzinfo
     """
+    __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo'
 
     def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None):
         """Constructor.
@@ -1308,10 +1310,8 @@
     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 or longs.
     """
+    __slots__ = date.__slots__ + time.__slots__
 
-    __slots__ = date.__slots__ + (
-        '_hour', '_minute', '_second',
-        '_microsecond', '_tzinfo')
     def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
                 microsecond=0, tzinfo=None):
         if isinstance(year, bytes) and len(year) == 10:


More information about the pypy-commit mailing list