what exactly is "None" ?

phil hunt philh at cabalamat.org
Tue Mar 4 16:15:35 EST 2003


On Tue, 4 Mar 2003 16:37:11 +0100, Andrei Doicin <Andrei.Doicin at cern.ch> wrote:
>I know that "None" is the Boolean false value that
>gets thrown out when there's nothing to return or a
>function doesn't manage to reach the end of itself and thus "return
>whatever", but *what* (in Python terms) exactly is equal to "None" ???

None is equal to None. All values other than None are not equal t 
None.

>I ask this as I'm trying to set up some conditional statements that do
>something if "whatever" is equal to "None".

if whatever == None:
   print "(whatever) is None"
else:
   print "(whatever) is some value other than None"


-- 
|*|*|  Philip Hunt <philh at cabalamat.org>  |*|*|
|*|*|  "Memes are a hoax; pass it on"     |*|*|





More information about the Python-list mailing list