techtonik / rainforce

Automatically exported from code.google.com/p/rainforce
0 stars 0 forks source link

python: date/time is a mess #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is so annoying?
date/time API from standard python library is a mess. `time` module 
"provides various time-related functions"; `datetime` "supplies classes" - 
each of them is "module in a module" - _timedelta_, _date_, _datetime_, 
_time_, _tzinfo_; `calendar` "provides additional useful functions related 
to the calendar". The API seems bloated, but still requires custom coding 
and deep knowledge (mostly of limitations of different parts). The API is 
C-centric and hence not very intuitive/pythonic. Work with UTC/time zones 
is complicated. The documentation is overloaded with important low level 
details.

What should be done?
Refactor date/time/calendar API:
 - list user stories / common usage scenarios that include general 
explanation of task to be done and examples using current API
 - gather date/time issues from bugs.python.org
 - draft high-level API to make most common usage examples a one-call 
commands
 - deprecation plan for duplicate/obsolete/low-level API
 - leave only OS data extraction logic in C and port the rest Python
 - update documentation to concentrate on usage scenarios

Skills/tools required?
python, c, communication

Any specific conditions, products, versions?
py3k

Please provide any additional information below.
UTC Complications - http://bugs.python.org/issue7582
RFC 3339 Support - http://bugs.python.org/issue7584
Recipes from Python Cookbook http://oreilly.com/catalog/9780596007973

Original issue reported on code.google.com by techtonik@gmail.com on 9 Feb 2010 at 7:33

GoogleCodeExporter commented 9 years ago
More open UTC-related Python issues:
http://bugs.python.org/issue1647654  No obvious and correct way to get the time 
zone 
offset
http://bugs.python.org/issue1667546  Time zone-capable variant of time.localtime
http://bugs.python.org/issue7662     time.utcoffset()
http://bugs.python.org/issue7229     [PATCH] Manual entry for time.daylight can 
be 
misleading
http://bugs.python.org/issue5094     datetime lacks concrete tzinfo impl. for 
UTC
http://bugs.python.org/issue7584     datetime.rfcformat() for Date and Time on 
the 
Internet (support RFC 3339, ISO 8601 datetime format)
http://bugs.python.org/issue665194   datetime-RFC2822 roundtripping
http://bugs.python.org/issue6280     calendar.timegm() belongs in time module, 
next 
to time.gmtime()

Original comment by techtonik@gmail.com on 9 Feb 2010 at 3:17