variable in Python

Jp Calderone exarkun at intarweb.us
Sat Apr 19 01:24:57 EDT 2003


On Sat, Apr 19, 2003 at 04:53:55AM +0000, berg_ wrote:
> 
> > object it refers to; additionally, there is no concept of a "null"
> > reference.
> 
> Python does have the concept of null, it is represented by None.
> 
> cursor = None
> 

  This is merely semantic quibbling, of course - but None is an object.  Is
it often used like NULL?  Sure, but then, [] and () and '' are also often
used like NULL (They all have a false truth value, after all).  The concept
of a variable that doesn't point to anything, though, doesn't exist in
Python.  "cursor = None" binds cursor to the immutable singleton object
"None".

  Jp

-- 
Seduced, shaggy Samson snored.
She scissored short.  Sorely shorn,
Soon shackled slave, Samson sighed,
Silently scheming,
Sightlessly seeking
Some savage, spectacular suicide.
                -- Stanislaw Lem, "Cyberiad"
-- 
 up 30 days, 1:02, 5 users, load average: 0.03, 0.01, 0.00





More information about the Python-list mailing list