loading...

re: What's your favorite Python idiom? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: # l is a list if l: # If we got here, l is not empty. In short, empty lists in Python evaluate to false, non-empty lists evaluate to true. ...
 

Love how data structures in Python have falsy/truthy evaluations ❤️

 

Agreed. I've never understood dynamically typed languages where container types unconditionally evaluate to true when used like a boolean.

Code of Conduct Report abuse