[Tutor] [Fwd: Please help, I'm a newbie]
Dick Kniep
d.j.kniep@chello.nl
23 Sep 2002 16:45:53 +0200
Hi Russel,
Helas, that is not that the problem. I copied the routine into the
message, and it seems to have screwed up the indentation somewhat. But
indentation doesn't seem to be the problem, the problem occurs when I am
importing the module. Perhaps someone can explain to me how import
checks these kind of things.
Kind regards,
D. Kniep
On Mon, 2002-09-23 at 16:35, Big Mad Drongo wrote:
> --- Dick Kniep <d.j.kniep@chello.nl> wrote:
> > def __init__(self, db, table, columns=[],
> > updatecolumns=[]):
> <snip code>
> > if not columns:
>
> >The error I get is that the name "columns" is not
> >defined. But that is weird because it gets the error
> >on the "if not columns", and I would expect the error
>
> >on the statement before that, because there columns
> >is referenced.
>
> Is this an indentation problem? Your "if" statement
> appears to be at the same indentation as the def for
> __init__ so at that level of the class the name
> columns is not defined, it is only defined *inside*
> __init__ where the "if" is not.
>
> I am myself only at newbie at python, so I may be
> incorrect, in fact this is my first attempt at
> answering somebody elses problem on Tutor rather than
> causing trouble for all the other wonderful people on
> the list, so fingers crossed for the both of us...
>
> Russell
>
>
> =====
> --
> Tulips Ate My Socks
> http://www.bigmaddrongo.com
> Chair of The York Glee Singers:
> http://www.gleesingers.co.uk
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
> _______________________________________________
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor