• Tim Peters's avatar
    Bringing the code and test suite into line with doc and NEWS changes · 52dcce24
    Tim Peters yazdı
    checked in two days agao:
    
    Refactoring of, and new rules for, dt.astimezone(tz).
    
    dt must be aware now, and tz.utcoffset() and tz.dst() must not return None.
    The old dt.astimezone(None) no longer works to change an aware datetime
    into a naive datetime; use dt.replace(tzinfo=None) instead.
    
    The tzinfo base class now supplies a new fromutc(self, dt) method, and
    datetime.astimezone(tz) invokes tz.fromutc().  The default implementation
    of fromutc() reproduces the same results as the old astimezone()
    implementation, but tzinfo subclasses can override fromutc() if the
    default implementation isn't strong enough to get the correct results
    in all cases (for example, this may be necessary if a tzinfo subclass
    models a time zone whose "standard offset" (wrt UTC) changed in some
    year(s), or in some variations of double-daylight time -- the creativity
    of time zone politics can't be captured in a single default implementation).
    52dcce24
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...