New submission from Lakin Wecker <lakin.wec...@gmail.com>: midnight is represented by datetime.time(0,0,0). However, this time (unlike all other valid times, including datetime.time(0,0,1)) evalutes to false in if conditions:
import datetime if datetime.time(0,0,0): print "datetime.time(0,0,0) is not a bug!" else: print "datetime.time(0,0,0) is a bug!" if datetime.time(0,0,1): print "datetime.time(0,0,1) is not a bug!" else: print "datetime.time(0,0,1) is a bug!" ---------- messages: 152556 nosy: Lakin.Wecker priority: normal severity: normal status: open title: datetime.time(0,0,0) evaluates to False despite being a valid time _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13936> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com