Hi,

When I search around tutorial about None, I came across this link:

http://jaredgrubb.blogspot.ca/2009/04/python-is-none-vs-none.html

I don't understand what use of this class example:



>>> class Zero(): # a class that is zero
...    def __nonzero__(self):
...       return False


I can only get the following code running:

cz1=Zero()
cz1.__nonzero__()
Out[119]: False


Here are my questions:
1. Is there any other means to use class Zero?
2. What connection to None on the original author's intention?


Thanks,
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to