What if they add a perfectly sensible __bool__ that nonetheless is incorrect in the context you wrote if foo? For instance, one that makes the class truthy or falsey based solely on data which was not part of the original class.
As I said, if I want an "is None" comparison, I write an "is None" comparison. I write a truthiness comparison when it makes sense to do one (even if I do not currently have objects that support it). Then it's on the users to not add a truthiness operator that only makes sense in their special context instead of implementing the general "false means no data" idea.
So, I don't know, say, if somebody gives me a "find_person(name)" function, it would be nice to allow them to return a rich "nobody found by that name" object instead of plain None if they want. More Pythonic. I'd rather allow that instead of allowing someone to make a Person class that evaluates to False if they have not submitted their yearly performance evaluation report yet.
Personally, I'd have the find_person() function raise an exception in that case (probably KeyError or ValueError). Besides, why do you need a rich empty object when None exists?
1
u/moor-GAYZ Mar 27 '14