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/008940.html below:

[Python-Dev] Lukewarm about range literals

[Python-Dev] Lukewarm about range literals [Python-Dev] Lukewarm about range literalsGreg Ewing greg@cosc.canterbury.ac.nz
Wed, 30 Aug 2000 14:11:41 +1200 (NZST)
> I doubt there would be much
> problem adding ".." as a token either.

If we're going to use any sort of ellipsis syntax here, I
think it would be highly preferable to use the ellipsis
token we've already got. I can't see any justification for
having two different ellipsis-like tokens in the language,
when there would be no ambiguity in using one for both
purposes.

> What we really want I think is something that evokes the following in the
> mind of the reader
> 
>     for i from START to END incrementing by STEP:

Am I right in thinking that the main motivation here is
to clean up the "for i in range(len(a))" idiom? If so,
what's wrong with a built-in:

  def indices(a):
    return range(len(a))

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+



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