Class instantiation

Fredrik Lundh fredrik at pythonware.com
Wed Aug 23 15:37:02 EDT 2006


Colin J. Williams wrote:

> In the example below, with the disassembly following that, we run into 
> trouble with the line:
>     self.connect(fileID, mode= 'r')       # open sheet in the read mode
> 
> the traceback is:
> Traceback (most recent call last):
>    File "C:\Documents and Settings\cjw\My Documents\OODev\tArray.py", 
> line 26, in __init__
>      self.connect(fileID, mode= 'r')       # open sheet in the read mode
> NameError: global name 'fileID' is not defined
> 
> At line 26, location 31, why is LOAD_GLOBAL generated for fileId, when 
> LOAD_FAST has done the job at locations 0 and 20?

hint: Python is case-sensitive.

</F>




More information about the Python-list mailing list