A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/008096.html below:

[Python-Dev] Lockstep iteration - eureka!

[Python-Dev] Lockstep iteration - eureka!Ken Manheimer klm@digicool.com
Wed, 9 Aug 2000 18:05:57 -0400 (EDT)
On Wed, 9 Aug 2000, Just van Rossum wrote:

> PEP:            1716099-3
> Title:          Index-enhanced sequence iteration
> [...]
>     It adds an optional clause to the 'for' statement:
> 
>         for <index> indexing <element> in <seq>:
>             ...
> [...]
> Disadvantages:
> 
>     It will break that one person's code that uses "indexing"
>     as a variable name.

      It creates a new 'for' variant, increasing challenge for beginners 
      (and the befuddled, like me) of tracking the correct syntax.

I could see that disadvantage being justified by a more significant change
- lockstep iteration would qualify, for me (though it's circumventing this
drawback with zip()).  List comprehensions have that weight, and analogize
elegantly against the existing slice syntax.  I don't think the 'indexing'
benefits are of that order, not enough so to double the number of 'for'
forms, even if there are some performance gains over the (syntactically
equivalent) zip(), so, sorry, but i'm -1.

Ken
klm@digicool.com




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