I'm stifling it, but, FWIW, I've been trying to sell "indexing" for most of my adult life <wink -- but yes, in my experience too range(len(seq)) is extraordinarly hard to get across to newbies at first; and I *expect* [:len(seq)] to be at least as hard>. > -----Original Message----- > From: nowonder@stud.ntnu.no [mailto:nowonder@stud.ntnu.no]On Behalf Of > Peter Schneider-Kamp > Sent: Friday, August 18, 2000 4:06 AM > To: Tim Peters > Cc: python-dev@python.org > Subject: Re: indexing, indices(), irange(), list.items() (was RE: > [Python-Dev] Lockstep iteration - eureka!) > > > Tim Peters wrote: > > > > Note that Guido rejected all the loop-gimmick proposals ("indexing", > > indices(), irange(), and list.items()) on Thursday, so let's stifle this > > debate until after 2.0 (or, even better, until after I'm dead <wink>). > > That's sad. :-/ > > One of the reasons I implemented .items() is that I wanted > to increase the probability that at least *something* is > available instead of: > > for i in range(len(list): > e = list[i] > ... > > or > > for i, e in zip(range(len(list)), list): > ... > > I'm going to teach Python to a lot of newbies (ca. 30) in > October. From my experience (I already tried my luck on two > individuals from that group) 'range(len(list))' is one > of the harder concepts to get across. Even indices(list) > would help here. > > Peter > -- > Peter Schneider-Kamp ++47-7388-7331 > Herman Krags veg 51-11 mailto:peter@schneider-kamp.de > N-7050 Trondheim http://schneider-kamp.de
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4