A little debugging advice (was Re: None)
Neal Norwitz
neal at metaslash.com
Tue Oct 23 18:02:38 EDT 2001
Huaiyu Zhu wrote:
>
> On Tue, 23 Oct 2001 13:01:09 -0500, Larry Whitley <ldw at us.ibm.com> wrote:
> >But Python complains that None is a variable that has not been previously
> >set.
>
> It's most likely that you have a typo, like none, Non, N0ne, etc.
>
> If you have double checked it carefully and still cannot figure out, there
> is one trick that almost always works: start a Python interpreter and
> copy-paste the variable name (don't type them!), like
>
> >>> None
> >>> `None`
> 'None'
[snip]
You can also use pychecker (http://pychecker.sourceforge.net).
It will generally find typos and other errors.
Neal
More information about the Python-list
mailing list