- 07 Haz, 2004 1 kayıt (commit)
-
-
Tim Peters yazdı
datetime.datetime and datetime.time could yield insane objects. Thanks to Jiwon Seo for the fix. Bugfix candidate. I'll backport it to 2.3.
-
- 21 Mar, 2004 1 kayıt (commit)
-
-
Tim Peters yazdı
It's possible to create insane datetime objects by using the constructor "backdoor" inserted for fast unpickling. Doing extensive range checking would eliminate the backdoor's purpose (speed), but at least a little checking can stop honest mistakes. Bugfix candidate.
-
- 02 Mar, 2004 1 kayıt (commit)
-
-
Brett Cannon yazdı
are within proper boundaries as specified in the docs. This can break possible code (datetime module needed changing, for instance) that uses 0 for values that need to be greater 1 or greater (month, day, and day of year). Fixes bug #897625.
-
- 20 Eki, 2003 1 kayıt (commit)
-
-
Walter Dörwald yazdı
(From SF patch #810751)
-
- 12 Eki, 2003 1 kayıt (commit)
-
-
Raymond Hettinger yazdı
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
-
- 27 Haz, 2003 1 kayıt (commit)
-
-
Raymond Hettinger yazdı
The interning of short strings violates the refcnt==1 assumption for _PyString_Resize(). A simple fix is to boost the initial value of "totalnew" by 1. Combined with an NULL argument to PyString_FromStringAndSize(), this assures that resulting format string is not interned. This will remain true even if the implementation of PyString_FromStringAndSize() changes because only the uninitialized strings that can be interned are those of zero length. Added a test case.
-
- 18 May, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
perpetrated by the time and datetime classes.
-
- 17 May, 2003 2 kayıt (commit)
-
-
Tim Peters yazdı
one good use: a subclass adding a method to express the duration as a number of hours (or minutes, or whatever else you want to add). The native breakdown into days+seconds+us is often clumsy. Incidentally moved a large chunk of object-initialization code closer to the top of the file, to avoid worse forward-reference trickery.
-
Tim Peters yazdı
-
- 16 May, 2003 2 kayıt (commit)
-
-
Tim Peters yazdı
-
Tim Peters yazdı
-
- 02 May, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
s/isofomat/isoformat/, by Steven Taschuk.
-
- 14 Nis, 2003 1 kayıt (commit)
-
-
Guido van Rossum yazdı
(This is only the tip of the iceberg; the time and datetime classes need the same treatment.)
-
- 08 Şub, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
of datetime does, accept instances of subclasses too.
-
- 07 Şub, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
__ne__ no longer complain if they don't know how to compare to the other thing. If no meaningful way to compare is known, saying "not equal" is sensible. This allows things like if adatetime in some_sequence: and somedict[adatetime] = whatever to work as expected even if some_sequence contains non-datetime objects, or somedict non-datetime keys, because they only call __eq__. It still complains (raises TypeError) for mixed-type comparisons in contexts that require a total ordering, such as list.sort(), use as a key in a BTree-based data structure, and cmp().
-
- 04 Şub, 2003 1 kayıt (commit)
-
-
Neal Norwitz yazdı
-
- 01 Şub, 2003 5 kayıt (commit)
-
-
Tim Peters yazdı
functions. Reworked {time,datetime}_new() to do what their corresponding setstates used to do in their state-tuple-input paths, but directly, without constructing an object with throwaway state first. Tightened the "is this a state tuple input?" paths to check the presumed state string-length too, and to raise an exception if the optional second state element isn't a tzinfo instance (IOW, check these paths for type errors as carefully as the normal paths).
-
Tim Peters yazdı
anymore either, so don't. This also allows to get rid of obscure code making __getnewargs__ identical to __getstate__ (hmm ... hope there wasn't more to this than I realize!).
-
Tim Peters yazdı
attr, and copy_reg.safe_constructors.
-
Tim Peters yazdı
not the maze it was.
-
Tim Peters yazdı
delta_reduce(): Simplified.
-
- 31 Ock, 2003 2 kayıt (commit)
-
-
Tim Peters yazdı
(pickling no longer needs them, and immutable objects shouldn't have visible __setstate__() methods regardless). Rearranged the code to put the internal setstate functions in the constructor sections. Repaired the timedelta reduce() method, which was still producing stuff that required a public timedelta.__setstate__() when unpickling.
-
Tim Peters yazdı
is just as easy.
-
- 30 Ock, 2003 1 kayıt (commit)
-
-
Guido van Rossum yazdı
classes have a __reduce__ that returns (self.__class__, self.__getstate__()). tzinfo.__reduce__() is a bit smarter, calling __getinitargs__ and __getstate__ if they exist, and falling back to __dict__ if it exists and isn't empty.
-
- 24 Ock, 2003 2 kayıt (commit)
-
-
Tim Peters yazdı
compare against "the other" argument, we raise TypeError, in order to prevent comparison from falling back to the default (and worse than useless, in this case) comparison by object address. That's fine so far as it goes, but leaves no way for another date/datetime object to make itself comparable to our objects. For example, it leaves Marc-Andre no way to teach mxDateTime dates how to compare against Python dates. Discussion on Python-Dev raised a number of impractical ideas, and the simple one implemented here: when we don't know how to compare against "the other" argument, we raise TypeError *unless* the other object has a timetuple attr. In that case, we return NotImplemented instead, and Python will give the other object a shot at handling the comparison then. Note that comparisons of time and timedelta objects still suffer the original problem, though.
-
Tim Peters yazdı
changes (and there were a lot of relevant changes!).
-
- 23 Ock, 2003 5 kayıt (commit)
-
-
Neal Norwitz yazdı
-
Tim Peters yazdı
This gives much the same treatment to datetime.fromtimestamp(stamp, tz) as the last batch of checkins gave to datetime.now(tz): do "the obvious" thing with the tz argument instead of a senseless thing.
-
Tim Peters yazdı
-
Tim Peters yazdı
-
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).
-
- 20 Ock, 2003 1 kayıt (commit)
-
-
Tim Peters yazdı
When daylight time ends, an hour repeats on the local clock (for example, in US Eastern, the clock jumps from 1:59 back to 1:00 again). Times in the repeated hour are ambiguous. A tzinfo subclass that wants to play with astimezone() needs to treat times in the repeated hour as being standard time. astimezone() previously required that such times be treated as daylight time. There seems no killer argument either way, but Guido wants the standard-time version, and it does seem easier the new way to code both American (local-time based) and European (UTC-based) switch rules, and the astimezone() implementation is simpler.
-
- 11 Ock, 2003 2 kayıt (commit)
-
-
Tim Peters yazdı
-
Tim Peters yazdı
HASTZINFO() macro.
-
- 10 Ock, 2003 3 kayıt (commit)
-
-
Neal Norwitz yazdı
-
Tim Peters yazdı
hoped it would be, but not too bad. A test had to change: time.__setstate__() can no longer add a non-None tzinfo member to a time object that didn't already have one, since storage for a tzinfo member doesn't exist in that case.
-
Tim Peters yazdı
-
- 08 Ock, 2003 3 kayıt (commit)
-
-
Tim Peters yazdı
unreachable now.
-
Tim Peters yazdı
into time. This is little more than *exporting* the datetimetz object under the name "datetime", and similarly for timetz. A good implementation of this change requires more work, but this is fully functional if you don't stare too hard at the internals (e.g., right now a type named "datetime" shows up as a base class of the type named "datetime"). The docs also need extensive revision, not part of this checkin.
-
Jack Jansen yazdı
-