Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In 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".



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: