On 1 mar, 04:46, Daniel Klein <[EMAIL PROTECTED]> wrote: > On Wed, 28 Feb 2007 22:03:13 +0100, Bruno Desthuilliers > > > > <[EMAIL PROTECTED]> wrote: > >Daniel Klein a écrit : > >> The arguments for TransitionError must be a tuple, > > >Err... > > >> eg: > > >> msg = "Going to error state %d from state %d" % (self.curr_state, > >> newstate) > >> raise TransitionError(self, curr_state, newstate, msg) > > >Where did you see a tuple here ? You're code is *calling* > >TransitionError, passing it the needed arguments. > > >Note that it's the correct syntax - but not the correct explanation !-) > > My bad :-( > > Thanks for setting me straight. I had (wrongly) thought that the stuff > inside of () was a tuple.
For the record, it's the ',' that makes the tuple. The () are (in this context) the call operator. >>> t = 1, 2, 3 >>> t (1, 2, 3) >>> type(t) <type 'tuple'> >>> t2 = 1, >>> t2 (1,) >>> def toto(): >>> return "it's me" ... >>> toto <function toto at 0xb7d18c34> >>> toto() "it's me" >>> -- http://mail.python.org/mailman/listinfo/python-list