[Tutor] Problem with a class

Terry Carroll carroll at tjc.com
Mon May 22 19:38:22 CEST 2006


On Mon, 22 May 2006, Andrew Robert wrote:

> class TriggerMessage:
> 	
> 	def __init__(self,data):


This suggests that it's to be invoked along the lines of:

  foo = TriggerMessage(data)

> 	def decode(self):

And this as:

 bar = foo.decode() 

> test = TriggerMessage.decode(data)

I think you wanted something like:

  test1 = TriggerMessage(data)
  test2 = test1.decode()



More information about the Tutor mailing list