[Tutor] [Fwd: Please help, I'm a newbie]

Big Mad Drongo bigmaddrongo@yahoo.co.uk
Mon, 23 Sep 2002 15:35:15 +0100 (BST)


 --- 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