Using an object inside a class
jonnojohnson at gmail.com
Mon Jan 23 14:44:35 EST 2012
I have a pretty complicated bit of code that I'm trying to convert to more
Without getting too heavy into the details I have an object which I am
trying to make available inside another class. The reference to the object
is rather long and convoluted but what I find is that within my class
definition this works:
But this tells me "global name foo is not defined":
Obviously I want the object to be available throughout the class (I left
out the self.object = etc for simplicity).
Any ideas why I can reference foo inside the method but not in __init__?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list