2 ms·
False = None = True Is probably the most ridiculous thing for a language to support. And yet...
by klyrs 5y ago
False = None = True
Is probably the most ridiculous thing for a language to support. And yet...
- anttihaapala 5y ago... and yet, it is a SyntaxError. False = True = None works in Python 2, and it is just because the separate Boolean type was a late addition.
- klyrs 5y agoOops, yep. I've seen somebody overwrite False in the wild, but I thought None was writable too. Glad for that smidgen of sanity...
- wmanley 5y ago$ python2 -c 'False = None = True' File "<string>", line 1 SyntaxError: cannot assign to None $ python3 -c 'False = None = True' File "<string>", line 1 SyntaxError: cannot assign to False