4 ms·
Why not just: if i["DupilcateAssets"] is there some Python subtlety I am missing?
by aerique 13y ago
Why not just:
if i["DupilcateAssets"]
is there some Python subtlety I am missing?
- cma 13y agoIn python some things evaluate as false in an if or boolean conversion (0, an empty list/tuple/set/dict/user_defined, an empty string "", and more). None evaluates as false as well, but is still distinguishable from the rest. In ruby you likewise sometimes need to use object.nil? because nil and False are both "false-ish".