I don't understand the truth table on slide 9 for
" - vs None " and
"__nonzero__ (2.x) " __bool__ (3.x) vs __nonzero__ (2.x) " __bool__ (3.x) "
As an example, you might represent __bool__ on a database connection object to reflect whether there is a live connection, allowing you to:
if not conn:
conn = MySQLdb.Connect()[1] http://docs.python.org/2/reference/datamodel.html#object.__n...
[2] http://docs.python.org/3/reference/datamodel.html#object.__b...