8 Jul
2005
8 Jul
'05
5:58 p.m.
"Walter Dörwald"
x = blist() x(1) with blist(x) as x: x(2) with blist(x) as x: x(3) x(4) x(5)
This would create the list: [1, [2, [3], 4], 5]
With the current version of PEP 343, we would either have to use different variable names on each level
To me, different names on each level -- x0, x1, x2, ... would be clearer and preferable, so I would know right off which level something was being put at. This is no different from using differnt iteration variables -- i,j,k; or i1, i2, i3; etc -- with nested loops. In both cases, you can delete the unneeded var if you really care and will not be using them again for another nested construct. Terry J. Reedy