Optimisation problem
sismex01 at hebmex.com
sismex01 at hebmex.com
Tue Nov 12 13:43:28 EST 2002
> From: gabor [mailto:gabor at realtime.sk]
> Sent: Tuesday, November 12, 2002 12:44 PM
>
> On Tue, 2002-11-12 at 19:30, sismex01 at hebmex.com wrote:
> > > 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.
>
> ok, so it creates temporary tuples.. i didn't know that...
>
> but the end result would be the same?
>
> bye,
> gabor
In this case which is quite simple, yes, it's the
same result; but others might enlighten us on other
cases where the "obvious" result isn't the one we'd
get.
Any suspects, anyone?
-gustavo
More information about the Python-list
mailing list