mirror of
https://github.com/python/cpython.git
synced 2025-09-11 11:17:16 +00:00
"Premature" doc changes, for new astimezone() rules, and the new
tzinfo.fromutc() method. The C code doesn't implement any of this yet (well, not the C code on the machine I'm using now), nor does the test suite reflect it. The Python datetime.py implementation and test suite in the sandbox do match these doc changes. The C implementation probably won't catch up before Thursday (Wednesday is a scheduled "black hole" day this week <0.4 wink>).
This commit is contained in:
parent
51f3f1b7dc
commit
f196a0a4dd
3 changed files with 180 additions and 60 deletions
|
@ -27,7 +27,7 @@ class FixedOffset(tzinfo):
|
|||
"""Fixed offset in minutes east from UTC."""
|
||||
|
||||
def __init__(self, offset, name):
|
||||
self.__offset = timdelta(minutes = offset)
|
||||
self.__offset = timedelta(minutes = offset)
|
||||
self.__name = name
|
||||
|
||||
def utcoffset(self, dt):
|
||||
|
@ -116,9 +116,9 @@ class USTimeZone(tzinfo):
|
|||
def dst(self, dt):
|
||||
if dt is None or dt.tzinfo is None:
|
||||
# An exception may be sensible here, in one or both cases.
|
||||
# It depends on how you want to treat them. The astimezone()
|
||||
# implementation always passes a datetime with
|
||||
# dt.tzinfo == self.
|
||||
# It depends on how you want to treat them. The default
|
||||
# fromutc() implementation (called by the default astimezone()
|
||||
# implementation) passes a datetime with dt.tzinfo is self.
|
||||
return ZERO
|
||||
assert dt.tzinfo is self
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue