Tuple assignment and generators?

Just just at xs4all.nl
Thu May 4 13:08:44 EDT 2006


In article <0KydnWcEJaVCtcfZnZ2dnUVZ_tmdnZ2d at comcast.com>,
 Larry Bates <larry.bates at websafe.com> wrote:

> While I have never needed anything like this in my 5 years of Python
> programming, here is a way:
> 
> a,b,c = 3*[0]
> q,r,s,t,u,v = 6*[0]

This is (IMO) fairly idiomatic:

   a = b = c = 0
   q = r = s = t = u = v = 0

Just



More information about the Python-list mailing list