[Python-Dev] Lockstep iteration - eureka! (original) (raw)

Barry A. Warsaw bwarsaw@beopen.com
Mon, 14 Aug 2000 15:24:10 -0400 (EDT)


"TP" == Tim Peters <timone@email.msn.com> writes:

TP> But if you add seq.items(), you had better add seq.keys() too,
TP> and seq.values() as a synonym for seq[:].  I guess the
TP> perceived advantage of adding seq.items() is that it supplies
TP> yet another incredibly slow and convoluted way to get at the
TP> for-loop index?  "Ah, that's the ticket!  Let's allocate
TP> gazillabytes of storage and compute all the indexes into a
TP> massive data structure up front, and then we can use the loop
TP> index that's already sitting there for free anyway to index
TP> into that and get back a redundant copy of itself!" <wink>.

Or create a generator. <oops, slap>

-Barry