Guido van Rossum wrote: > > > http://effbot.org/ideas/time-type.htm > > > > I can produce PEP and patch if necessary. > > Yes, a PEP, please! Jim Fulton has been asking for this for a long > time too. His main requirement is that timestamp objects are small, > both in memory and as pickles, because Zope keeps a lot of these > around. They are currently represented either as long ints (with a > little under 64 bits) or as 8-byte strings. A dedicated timestamp > object could be smaller than that. > > Your idea of a base type (which presumably standarizes at least one > form of representation) sounds like a breakthrough that can help > satisfy different other needs. Sounds like a plan :-) In order to make mxDateTime subtypes of this new type we'd need to make sure that the datetime type uses a true struct subset of what I have in DateTime objects now: typedef struct { PyObject_HEAD /* Representation used to do calculations */ long absdate; /* number of days since 31.12. in the year 1 BC calculated in the Gregorian calendar. */ double abstime; /* seconds since 0:00:00.00 (midnight) on the day pointed to by absdate */ ...lots of broken down values needed to assure roundtrip safety... } Depending on the size of PyObject_HEAD, this should meet Jim Fultons requirements (the base type would of course not implement the "..." part :-). -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4