Re: scopes of local and global variable

2006-12-22 Thread Fredrik Lundh
Pyenos wrote: > does class WORK inherit t_len=0 from line1? > > does def getwork() inherit t_len=0 from line1? > > does def formattable(table_to_process,type) inherit t_len=0 from line1? > > does def format_t() inherit t_len=0 from line1? you may want to read the documentation: http://do

Re: scopes of local and global variable

2006-12-22 Thread Fredrik Lundh
Pyenos wrote: > does class WORK inherit t_len=0 from line1? > > does def getwork() inherit t_len=0 from line1? > > does def formattable(table_to_process,type) inherit t_len=0 from line1? > > does def format_t() inherit t_len=0 from line1? you may want to read the documentation: http://do

Re: scopes of local and global variable

2006-12-22 Thread Gabriel Genellina
At Friday 22/12/2006 20:45, Pyenos wrote: # Error message says: # # UnboundLocalError: local variable 't_len' referenced before assignment# See item 6 in "10 Python pitfalls": -- Gabriel Gen

Re: scopes of local and global variable

2006-12-22 Thread Pyenos
"Max Wilson" <[EMAIL PROTECTED]> writes: > Pyenos wrote: > > does class WORK inherit t_len=0 from line1? > > > > does def getwork() inherit t_len=0 from line1? > > > > does def formattable(table_to_process,type) inherit t_len=0 from line1? > > > > does def format_t() inherit t_len=0 from line1? >

Re: scopes of local and global variable

2006-12-22 Thread Max Wilson
Pyenos wrote: > does class WORK inherit t_len=0 from line1? > > does def getwork() inherit t_len=0 from line1? > > does def formattable(table_to_process,type) inherit t_len=0 from line1? > > does def format_t() inherit t_len=0 from line1? Not really, no. The global t_len is different than the loca

Re: scopes of local and global variable

2006-12-22 Thread Pyenos
James Stroud <[EMAIL PROTECTED]> writes: > >>>#CODE## > >>>t_len=0 > >>>class WORK: > >>>def getwork(self): > >>>def formattable(table_to_process,type): > >>>TYPE=["p","t","T","s","i"] #list of types to format > >>>if t

Re: scopes of local and global variable

2006-12-22 Thread James Stroud
Pyenos wrote: > Fredrik Lundh <[EMAIL PROTECTED]> writes: > > >>Pyenos wrote: >> >> >>>#CODE## >>>t_len=0 >>>class WORK: >>>def getwork(self): >>>def formattable(table_to_process,type): >>>TYPE=["p","t","T","s","i"] #list of type

Re: scopes of local and global variable

2006-12-22 Thread Pyenos
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Pyenos wrote: > > > #CODE## > > t_len=0 > > class WORK: > > def getwork(self): > > def formattable(table_to_process,type): > > TYPE=["p","t","T","s","i"] #list of types to format > >

Re: scopes of local and global variable

2006-12-22 Thread Fredrik Lundh
Pyenos wrote: > #CODE## > t_len=0 > class WORK: > def getwork(self): > def formattable(table_to_process,type): > > TYPE=["p","t","T","s","i"] #list of types to format >

scopes of local and global variable

2006-12-22 Thread Pyenos
#CODE## t_len=0 class WORK: def getwork(self): def formattable(table_to_process,type): TYPE=["p","t","T","s","i"] #list of types to format if type==TYPE[1]: