variable in Python
Steve Holden
sholden at holdenweb.com
Sat Apr 19 09:50:21 EDT 2003
"Jp Calderone" <exarkun at intarweb.us> wrote in message
news:mailman.1050730020.31828.python-list at python.org...
> 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".
>
Of course, there's always
del cursor
but even that will fail if the name isn't currently bound.
and-now-back-to-the-angles-on-the-head-of-a-pin-debate-ly y'rs - steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
More information about the Python-list
mailing list