D
Denis S. Otkidach
DateTime objects always compare equal to instances of
user-defined classes:
Python 2.3.2 (#1, Nov 27 2003, 18:07:14)
[GCC 3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.True
Documentations states that "DateTime and DateTimeDelta instances
can be compared and hashed, making them compatible to the
dictionary implementation Python uses (they can be used as
keys)", but there is at least race condition when instance of
user defined class has the same hash value. Moreover, making
DateTime objects to be always equal to instances with unknown
nature is a bad idea.
user-defined classes:
Python 2.3.2 (#1, Nov 27 2003, 18:07:14)
[GCC 3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.True
Documentations states that "DateTime and DateTimeDelta instances
can be compared and hashed, making them compatible to the
dictionary implementation Python uses (they can be used as
keys)", but there is at least race condition when instance of
user defined class has the same hash value. Moreover, making
DateTime objects to be always equal to instances with unknown
nature is a bad idea.