[Python-checkins] CVS: python/nondist/sandbox/datetime datetime.py,1.7,1.8

Tim Peters tim_one@users.sourceforge.net
Fri, 01 Mar 2002 16:09:57 -0800


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

Modified Files:
	datetime.py 
Log Message:
Added XXX comment noting a nasty bug in datetime.__hash__().


Index: datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** datetime.py	1 Mar 2002 23:55:55 -0000	1.7
--- datetime.py	2 Mar 2002 00:09:55 -0000	1.8
***************
*** 222,225 ****
--- 222,228 ----
      def __hash__(self):
          """Hash."""
+         # XXX Bug:  objects that compare equal must have equal hashcodes,
+         # XXX and two datetimes can be equal even if their fields aren't
+         # XXX (due to tzoffset).  Do we have to hash the timestamp instead?
          y, m, d = self.__year, self.__month, self.__day
          hh, mm, ss = self.__hour, self.__minute, self.__second