This is the obvious intuition, which doesn't match the current implementation.
> Why would anyone evaluate dates in a boolean context?
I'd guess, usually to tell whether a variable has a date or None. For example, maybe you have some kind of GUI with a form where the user is supposed to fill in a time, and some variable somewhere in the code is set to None [1] when the time field is blank [2], and a time object representing the time entered by the user otherwise.
Maybe you want to require the user to fill in all fields in the form before advancing to the next step in your program's workflow. If you like falsiness, you might write:
if not form.time_field:
show_warning("You must enter a time to proceed")
continue_current_phase()
else:
proceed_to_next_phase()
You actually intended the first line to be:
if form.time_field is not None:
But the only way you'd find this bug is when a user on the East Coast complains that the form won't accept 7:00 (UTC midnight). It will accept 6:59 or 7:01, but not 7:00. Of course you're on the West Coast, so you close their ticket as "can't reproduce" since 7:00 works just fine for you...
[1] None is the Python equivalent of other programming languages' null (or NULL).