Files
cpython/Modules
Tim Peters 521fc15e62 A new, and much hairier, implementation of astimezone(), building on
an idea from Guido.  This restores that the datetime implementation
never passes a datetime d to a tzinfo method unless d.tzinfo is the
tzinfo instance whose method is being called.  That in turn allows
enormous simplifications in user-written tzinfo classes (see the Python
sandbox US.py and EU.py for fully fleshed-out examples).

d.astimezone(tz) also raises ValueError now if d lands in the one hour
of the year that can't be expressed in tz (this can happen iff tz models
both standard and daylight time).  That it used to return a nonsense
result always ate at me, and it turned out that it seemed impossible to
force a consistent nonsense result under the new implementation (which
doesn't know anything about how tzinfo classes implement their methods --
it can only infer properties indirectly).  Guido doesn't like this --
expect it to change.

New tests of conversion between adjacent DST-aware timezones don't pass
yet, and are commented out.

Running the datetime tests in a loop under a debug build leaks 9
references per test run, but I don't believe the datetime code is the
cause (it didn't leak the last time I changed the C code, and the leak
is the same if I disable all the tests that invoke the only function
that changed here).  I'll pursue that next.
2002-12-31 17:36:56 +00:00
..
2002-12-06 12:48:53 +00:00
2002-12-31 17:34:30 +00:00
2000-06-30 16:09:01 +00:00
2002-07-17 16:30:39 +00:00
2002-07-17 16:30:39 +00:00
2002-11-09 19:54:06 +00:00
2002-12-06 12:48:53 +00:00
2002-12-31 16:16:07 +00:00
2002-12-06 12:48:53 +00:00
2002-11-08 12:53:11 +00:00
2002-12-30 16:25:41 +00:00
2002-08-07 16:21:51 +00:00
2002-12-30 22:08:05 +00:00
2002-10-30 21:08:34 +00:00
2002-07-17 16:30:39 +00:00
2002-12-07 14:56:36 +00:00