Optimisation problem
sismex01 at hebmex.com
sismex01 at hebmex.com
Tue Nov 12 13:30:23 EST 2002
> From: gabor [mailto:gabor at realtime.sk]
>
> On Tue, 2002-11-12 at 16:50, Michael Hudson wrote:
> > anton at vredegoor.doge.nl (Anton Vredegoor) writes:
> > > m,x,y,z = self.matrix,self.x,self.y,self.z
> > >
> > > This is faster
> >
> > Don't be so sure: this creates a tuple.
> >
> >
> this is interesting....
>
> you're saying that for example
>
> x,y = 2,4
>
> creates a tuple?
>
> i thought thatr x,y=2,4 is the same as x=2;y=4
>
> bye,
> gabor
Nope; when declaring tuples, unless stated otherwise,
using parenthesis is optional; so you are in fact creating
a tuple on both sides of the assignment, and unpacking
it into variables on the left side.
HTH (Handle This Harefully)
-gustavo
More information about the Python-list
mailing list