tuple unpacking

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Jun 5 02:38:30 CEST 2003

>>>>> "jhsieh" == jhsieh  <jhsieh at jpl.nasa.gov> writes:

   self.Controls, self.Buttons = self.InitGUI(self)

I'm assuming the 'self' arg to InitGUI above is a TheFrame instance,
no?  Ie, do you mean to do

   self.Controls, self.Buttons = self.InitGUI(TheFrame=self)

Also, in the InitGUI code, you don't make any reference to TheFrame.
I'm assuming you snipped something.  Perhaps in the snipped section,
there is a return statement, perhaps one that doesn't return a
sequence?  The reason I suspect this that the return statement you

  return TheControls, TheButtons

is a 2-tuple and should work just fine when you try to unpack it .
Can you post a complete InitGUI func with no snips?


More information about the Python-list mailing list