Stef Mientki wrote: > ... I've defined a class, like this, ... > > class T6963_device (tDevice): > def __init__ (self): > global LCD > LCD = self > ... In the same module I've a function, > that runs a method of the above class instance, ... > > def Write_LCD_Data ( data ): > global LCD > LCD.Write_Data ( data )
The global statement in Write_LCD_Data is completely unnecessary. The only time you need "global" is if you want to reassociate the global name to another object (such as LCD = LCD + 1 or whatever). You only read the global name-to-object mapping (though you may be using methods on the named object to alter the referenced object). You only need "global" when you need to "write" (re-bind) the global name-to-object mapping. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list