I propose adding a basic time type (or time base type ;-) to the standard library, which can be subclassed by more elaborate date/time/timestamp implementations, such as mxDateTime, custom types provided by DB-API drivers, etc. The goal is to make it easy to extract the year, month, day, hour, minute, and second from any given time object. Or to put it another way, I want the following to work for any time object, including mxDateTime objects, any date/timestamp returned by a DB-API driver, and weird date/time-like types I've developed myself: if isinstance(t, basetime): # yay! it's a timestamp print t.timetuple() The goal is not to standardize any behaviour beyond this; anything else should be provided by subtypes. More details here: http://effbot.org/ideas/time-type.htm I can produce PEP and patch if necessary. </F>
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