Files
cpython/Lib
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-16 13:54:02 +00:00
2002-12-24 18:31:27 +00:00
2002-12-31 16:52:44 +00:00
2002-06-11 06:22:31 +00:00
2002-11-23 12:09:28 +00:00
2002-10-28 18:09:41 +00:00
2002-12-26 18:22:54 +00:00
2002-12-31 01:08:35 +00:00
2002-10-30 06:09:58 +00:00
2002-08-04 17:22:59 +00:00
2002-11-13 14:38:17 +00:00
2002-11-24 02:35:35 +00:00
2002-12-16 13:11:57 +00:00
2002-11-24 02:35:35 +00:00
2002-11-30 03:53:15 +00:00
2002-11-09 05:08:07 +00:00
2002-06-01 16:07:16 +00:00
2002-11-24 02:35:35 +00:00
2002-10-09 17:23:29 +00:00
2002-12-17 16:15:34 +00:00
2002-06-01 16:07:16 +00:00
2002-12-16 13:11:57 +00:00
2002-06-02 00:40:05 +00:00
2002-06-02 00:40:05 +00:00
2002-12-30 22:08:05 +00:00
2002-11-22 14:22:49 +00:00
2002-11-09 05:08:07 +00:00
2002-08-15 14:59:02 +00:00
2002-10-11 14:36:24 +00:00
2002-10-16 21:21:39 +00:00
2002-07-16 21:35:23 +00:00
2002-11-25 17:25:04 +00:00
2002-11-01 17:14:16 +00:00
2002-12-12 12:23:32 +00:00