[Python-checkins] python/nondist/sandbox/datetime datetime.py,1.153,1.154

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 30 Jan 2003 06:54:17 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv753/datetime

Modified Files:
	datetime.py 
Log Message:
doctools has served its purpose; inspect and pydoc are standard modules.

Index: datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.py,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -d -r1.153 -r1.154
*** datetime.py	30 Jan 2003 06:01:06 -0000	1.153
--- datetime.py	30 Jan 2003 14:54:13 -0000	1.154
***************
*** 665,669 ****
          """
          if isinstance(year, str):
!             # From pickle __getstate__
              self = object.__new__(cls)
              self.__setstate__((year,))
--- 665,669 ----
          """
          if isinstance(year, str):
!             # Pickle support
              self = object.__new__(cls)
              self.__setstate__((year,))
***************
*** 923,934 ****
              return dt
  
-     # pickle support
-     # XXX Should do something with __new__ instead
- 
-     __safe_for_unpickling__ = True
- 
-     def __reduce__(self):
-         return type(self), (), self.__dict__
- 
  _tzinfo_class = tzinfo   # so functions w/ args named "tinfo" can get at it
  
--- 923,926 ----
***************
*** 968,978 ****
          self = object.__new__(cls)
          if isinstance(hour, str):
!             # Call from protocol 2 unpickling
!             assert len(hour) == 6
!             assert minute == 0 or isinstance(minute, _tzinfo_class), `minute`
!             self.__hour, self.__minute, self.__second, us1, us2, us3 = \
!               map(ord, hour)
!             self.__microsecond = (((us1 << 8) | us2) << 8) | us3
!             self._tzinfo = minute or None
              return self
          _check_tzinfo_arg(tzinfo)
--- 960,965 ----
          self = object.__new__(cls)
          if isinstance(hour, str):
!             # Pickle support
!             self.__setstate__((hour, minute or None))
              return self
          _check_tzinfo_arg(tzinfo)