[Python-ideas] bool(datetime.time(0, 0))
Yuval Greenfield
ubershmekel at gmail.com
Tue May 8 09:17:31 CEST 2012
On Tue, May 8, 2012 at 8:42 AM, Steven D'Aprano <steve at pearwood.info> wrote:
[...]
> It's only midnight if you don't specify a tzinfo, or
> if you do and happen to be using GMT.
>
Arbitrary and unexpected times evaluating to False is a bug waiting to
happen. Personally I'd prefer all datetime.time objects had no boolean
value at all.
The only good defence for keeping it, in my opinion, would be fear that
> there is working code that relies on this.
+1
Yuval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120508/a5afd94b/attachment.html>
More information about the Python-ideas
mailing list