On 7/15/2012 9:38 PM, Steven D'Aprano wrote: >> I would expect None to mean "doesn't exist" or "unknown" or >> something like that - e.g., a value of 0 means 0 jelly beans in the jar >> and None means there isn't a jar. > > How you interpret some_variable = None depends on what some_variable > represents. If some_variable represents "number of jelly beans in a jar", > then that should be 0 if there is no jar. What is None supposed to mean then, and what should I do when I have to make a distinction between "doesn't exist" and "empty"? Sure, if I need to count the total number of jelly beans in all my stores, the distinction is meaningless, but if I need to find out which stores sell jelly beans so I know which stores need to be restocked, the distinction is quite important. -- CPython 3.3.0b1 | Windows NT 6.1.7601.17803 -- http://mail.python.org/mailman/listinfo/python-list
- Re: Implicit conversion to boolean in if and whil... Steven D'Aprano
- Re: Implicit conversion to boolean in if and ... Chris Angelico
- Re: Implicit conversion to boolean in if and ... Andrew Berg
- Re: Implicit conversion to boolean in if and while stateme... Steven D'Aprano
- Re: Implicit conversion to boolean in if and while st... Ranting Rick
- Re: Implicit conversion to boolean in if and whil... Chris Angelico
- Re: Implicit conversion to boolean in if and whil... Steven D'Aprano
- Re: Implicit conversion to boolean in if and while st... Ethan Furman
- Re: Implicit conversion to boolean in if and while st... Steven D'Aprano
- Re: Implicit conversion to boolean in if and while stateme... Steven D'Aprano
- Re: Implicit conversion to boolean in if and while st... Andrew Berg
- Re: Implicit conversion to boolean in if and whil... Ethan Furman
- Re: Implicit conversion to boolean in if and whil... Steven D'Aprano
- Re: Implicit conversion to boolean in if and ... Andrew Berg
- Re: Implicit conversion to boolean in if ... Chris Angelico
- Re: Implicit conversion to boolean in if and ... Steven D'Aprano
- Re: Implicit conversion to boolean in if ... Andrew Berg
- Re: Implicit conversion to boolean in if ... Ethan Furman
- Re: Implicit conversion to boolean in if ... Steven D'Aprano
- Re: Implicit conversion to boolean in if ... Andrew Berg
- Re: Implicit conversion to boolean in if ... Chris Angelico