7 ms·
Both behaviors are documented and "if not midnight" adds a fair bit of complexity, probably a good idea to know exactly what happens when you write that. [1] h
by joshz 11y ago
Both behaviors are documented and "if not midnight" adds a fair bit of complexity, probably a good idea to know exactly what happens when you write that.
[1] https://docs.python.org/2/library/stdtypes.html#truth-value-testing https://docs.python.org/2/library/stdtypes.html#truth-value-...
[2] https://docs.python.org/2/library/datetime.html#time-objects https://docs.python.org/2/library/datetime.html#time-objects
- dalke 11y agoThe midnight behavior was found to be too buggy and surprising, with little to no real-world use, so has been removed from more recent Python versions.