[Tutor] problem with class - get message that self is not defined

Python python at venix.com
Mon May 22 20:56:52 CEST 2006


On Mon, 2006-05-22 at 14:28 -0400, Andrew Robert wrote:
> When I try to use the class listed below, I get the statement that
> self
> is not defined.
>                 
> test=TriggerMessage(data)
> var = test.decode(self.qname)
		    ^^^^
Perhaps
	var = test.decode()

would do what you want.  

It is not clear why you are trying to use a "qname" argument when
decode's only argument is self.  test.decode will bind self to the test
object.

Alan Gauld's web site has a useful discussion of OOP programming.
http://www.freenetpages.co.uk/hp/alan.gauld

-- 
Lloyd Kvam
Venix Corp



More information about the Tutor mailing list