Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-11 Thread djc
On 11/03/13 17:27, Adam Tauno Williams wrote: Because date/time management in Python is *@*&@R&*(R *@&Y terrible! Period, full-stop, awful, crappy, lousy, and aggravating. The design is haphazard and error inducing. +1 -- djc -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-11 Thread Adam Tauno Williams
On Fri, 2013-03-08 at 13:41 -0500, Roy Smith wrote: > To make a long (and painful) story short, I've got a (large) list of > datetimes, and was getting some bizarre errors working with it. One of > the things I tried while debugging the problem was verifying that all > the elements of the list

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-09 Thread Nobody
On Sat, 09 Mar 2013 14:40:14 -0500, Roy Smith wrote: > Future scheduled activities (which I assume is what you > mean by "appointments") should be kept in whatever timezone makes sense > for that activity. For example, I'm on NASA's mailing list to receive > alerts when the ISS is going to be

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-09 Thread Chris Angelico
On Sun, Mar 10, 2013 at 6:14 AM, Nobody wrote: > On Sat, 09 Mar 2013 09:01:17 +1100, Chris Angelico wrote: > >> As I see it, a naive datetime simply does not have a timezone. > > The distinction between aware and naive isn't whether the .tzinfo member > is None, but whether self.utcoffset() return

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-09 Thread Roy Smith
In article , Nobody wrote: > The distinction may actually matter for times in the far future, as you > can't reliably predict how or when timezone defintions will change. Sadly, this is true. > For this reason, "appointments" should always be > kept in local time, so that you don't get errors

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-09 Thread Nobody
On Sat, 09 Mar 2013 09:01:17 +1100, Chris Angelico wrote: > As I see it, a naive datetime simply does not have a timezone. The distinction between aware and naive isn't whether the .tzinfo member is None, but whether self.utcoffset() returns None (which can occur either if self.tzinfo is None or

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-08 Thread Chris Angelico
On Sat, Mar 9, 2013 at 8:33 AM, Nobody wrote: > On Fri, 08 Mar 2013 13:41:27 -0500, Roy Smith wrote: > >> So, the question is, WHY aren't aware and naive datetimes separate >> classes? They share many attributes and methods, but not all. > > They share all attributes and methods. > > You could ju

Re: Why are timezone aware and naive datetimes not distinct classes?

2013-03-08 Thread Nobody
On Fri, 08 Mar 2013 13:41:27 -0500, Roy Smith wrote: > So, the question is, WHY aren't aware and naive datetimes separate > classes? They share many attributes and methods, but not all. They share all attributes and methods. You could just as well ask why positive and negative floats aren't se

Why are timezone aware and naive datetimes not distinct classes?

2013-03-08 Thread Roy Smith
To make a long (and painful) story short, I've got a (large) list of datetimes, and was getting some bizarre errors working with it. One of the things I tried while debugging the problem was verifying that all the elements of the list were indeed datetimes: In [59]: set(type(foo) for foo in x