calendar lameness!

Terry Hancock hancock at anansispaceworks.com
Mon Jul 22 09:35:29 EDT 2002


I was shopping around the Python standard library
for interesting modules to incorporate in future
projects. (Got to test the batteries before you
can use 'em).

"calendar" is pretty neat -- except it has pretty
annoying arbitrary limits on the date:

1900-1/1 to 2038-1/18

I can see that this is adequate for a business
planner, but for historical or astronomical uses,
it's really inadequate.  (e.g. "What day of the
week was the US Declaration of Independence signed
on?"  I'm sure I could look that up, but gee it
would've been nice to just type:

calendar.weekday(1776, 7, 4)

).

It's less useful to get:

calendar.prmonth(2153, 9)

unless of course, you're an SF writer, and you
want to be accurate.  Anyway, I'll be pretty old
in 2038, but hopefully not dead.

This is Python 2.1. Anyway -- any chance these got
fixed in a later release?  Why the range? Is this
some kind of overflow problem?

Actually, it looks like maybe it's "mktime" that
is the limiter here (?).  How hard would it be to
replace that call with something smarter?  It seems
like Python longs would make it unnecessary to
have such arbitrary limits.

Thanks,
Terry

-- 
------------------------------------------------------
Terry Hancock
hancock at anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------





More information about the Python-list mailing list