[plugin] dirstate experiments

Jamie Wilkinson jaq at spacepants.org
Fri Jun 16 06:32:10 BST 2006


This one time, at band camp, Andrew Bennetts wrote:
>On Fri, Jun 16, 2006 at 02:49:30AM +1000, Robert Collins wrote:
>[...]
>> 
>> just randomly, you might try:
>> 
>>  x, y, z = (x1, x2), (y1, y2, y3), (z1, z2, z3) = list[1:9]
>> 
>> No idea if it will play...
>
>No luck here.  Python sees an attempt to unpack a sequence of eight items into a
>sequence of three items, so it throws a ValueError.
>
>The closest you could do to what you wrote would be:
>
>    x1, x2, y1, y2, y3, z1, z2, z3 = list[1:9]
>    x, y, z = (x1, x2), (y1, y2, y3), (z1, z2, z3)

How about

 x, y, z = tuple(list[1:3]), tuple(list[3:6]), tuple(list[6:9])

?




More information about the bazaar mailing list