RE: Python-Dev digest, Vol 1 #1124 - 13 msgs
Jan. 29, 2001
7:38 p.m.
Greg Wilson writes:
This would allow multi-dimensional structures (e.g. NumPy arrays) to do things like: for (i, j, k) in array: and: for ((i, j, k), v) in array: # three indices and value
Charles Waldman asks: And what if I had, for example, a 3-dimensional array where the values are 3-tuples? Would "for (i,j,k) in array" refer to the indices or the values?
Greg Wilson writes: That would be up to the module's implementer --- my idea was to have the 'for' loop provide more information to the object being iterated over, so that it could "do the right thing" (just as objects do right now with "x[i]"). Greg
9150
Age (days ago)
9150
Last active (days ago)
0 comments
1 participants
participants (1)
-
Greg Wilson