4 ms·
I sometimes think that way, but when I do ask I ask why you can use any non-Boolean in a conditional? That's optional too. As for uses: because empty lists, ze
by hyperpape 13y ago
I sometimes think that way, but when I do ask I ask why you can use any non-Boolean in a conditional? That's optional too.
As for uses: because empty lists, zero and empty strings are false, you can do things like:
if validation_errors:
if special_instructions:
if unusued_widgets:
Of course those are just saved keystrokes, and can lead to bugs, but so is being able to throw a list into a condition.