Midnight Doesn't Exist?
Explore the unexpected behavior of the datetime.time object representing midnight in Python versions prior to 3.5. Learn why it evaluates as False in boolean contexts and how this can cause errors when checking if an object is null or empty. This lesson helps you recognize subtle pitfalls in Python's handling of time objects to write more robust code.
We'll cover the following...
We'll cover the following...
Just like Cinderella, Python also misses midnight.
⚠️ The following code is meant for < Python 3.5 ...