None assigment

Aahz Maruch aahz at
Thu Feb 8 12:58:42 EST 2001

In article <mailman.981652444.20002.python-list at>,
Gregoire Welraeds  <greg at> wrote:
>Always according to this logic, I have tried to run the following:
>>>> a= [1,'',3]
>>>> b= 0 # b could be anything
>>>> del b
>>>> filter(b,a)
>but this won't work either as stated in the documentation. Referencing a
>"deleted" variable is an error at least until another value is assigned to
>it (see del statement section in the tutorial).
>It seems that (the so called variable) None is neither a variable like any
>other, nor is it a label as stated by Simon Brunning in another post.

What you're missing is the issue of Python scopes.  Try this:

def foo():
    print b
    del b
    global b
    print b

None has a bit of magic associated with it, but not much.
                      --- Aahz (Copyright 2001 by aahz at

Androgynous poly kinky vanilla queer het    <*>
Hugs and backrubs -- I break Rule 6

"Actually, I've found that Usenet has helped a lot with my terror of
social stupidity.  Seeing people I really like and respect behave like
idiots in public has been very beneficial."  --Rachael Lininger

More information about the Python-list mailing list