Andrew Robert wrote:
> wes weston wrote:
>> Andrew Robert wrote:
>>> Hi Everyone,
>>>
>>> I am having a problem with a class and hope you can help.
>>>
>>> When I try to use the class listed below, I get the statement that self
>>> is not defined.
>>>        
>>> test=TriggerMessage(data)
>> self is not known here; only inside the class.
>>
>>> var = test.decode(self.qname)
>>>
> <snip>
> 
> I guess I was barking up the wrong tree on that one.
> 
> How would I go about getting the required values out of the class?
> 
> Return self?

You can refer to the variables inside the class as test.version;
for example - as they are not protected. Or, you could add access
methods in the class like def GetVersion(self): return self.version
If you want to protect version, call it self.__version which mangles
the name from outside.
wes
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to