O'Reilly logo
  • Sebastian Stabinger thinks this is interesting:

Boolean Value of a Custom Type

From

Cover of Fluent Python

Note

Does not work in Python 2 (You have to overload nonzero)