[Python-checkins] CVS: python/nondist/sandbox/datetime datetime.py,1.44,1.45

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 04 Mar 2002 12:24:14 -0800


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

Modified Files:
	datetime.py 
Log Message:
Get rid of datetime.new() as an alias for datetime().  YAGNI.


Index: datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.py,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** datetime.py	4 Mar 2002 19:51:32 -0000	1.44
--- datetime.py	4 Mar 2002 20:24:12 -0000	1.45
***************
*** 434,438 ****
      Constructors:
  
!     __init__() == new()
      now(), utcnow()
      fromtimestamp(), utcfromtimestamp()
--- 434,438 ----
      Constructors:
  
!     __init__()
      now(), utcnow()
      fromtimestamp(), utcfromtimestamp()
***************
*** 501,509 ****
      # Additional constructors
  
-     def new(cls, *args, **kwds):
-         "Constructor.  Same arguments as __init__."
-         return cls(*args, **kwds)
-     new = classmethod(new)
- 
      def fromtimestamp(cls, t):
          "Construct a datetime from a POSIX timestamp (like time.time())."
--- 501,504 ----
***************
*** 691,697 ****
                        self.__microsecond + other.microseconds)
              self._checkOverflow(t.year)
!             result = datetime.new(t.year, t.month, t.day,
!                                   t.hour, t.minute, t.second,
!                                   t.microsecond, self.__tzoffset)
              return result
          raise TypeError
--- 686,692 ----
                        self.__microsecond + other.microseconds)
              self._checkOverflow(t.year)
!             result = datetime(t.year, t.month, t.day,
!                               t.hour, t.minute, t.second,
!                               t.microsecond, self.__tzoffset)
              return result
          raise TypeError