A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-November/018626.html below:

PEP 276 Simple Iterator for ints

[Python-Dev] Re: PEP 276 Simple Iterator for intsSkip Montanaro skip@pobox.com (Skip Montanaro)
Thu, 15 Nov 2001 11:08:19 +0100
    >> Below is the first draft of PEP 276 "Simple Iterator for ints".
    >> (Available at http://python.sourceforge.net/peps/pep-0276.html)
    >> 
    >> Feel free to comment (positive, negative, bipolar, or in between ;-).

I liked "for i in 10:" at first, however, the more I see of the Haskell
iterator syntax, the more I like it.  Given that

    * it should cause no backward compatibility issues (you can't put "..."
      in a list now, can you?  NumPy?)

    * it completely replaces range and xrange, not just one use of it

    * it can be made to work for floats, strings and possibly other builtin
      data types as well as ints

    * you can optimize it well

I would tend to view the int-as-iterator as a wart (a neat sort of wart, but
a wart nonetheless), while the Haskell syntax is elegant and seems to fit in
well with existing Python usage.

-1

-- 
Skip Montanaro (skip@pobox.com - http://www.mojam.com/)
It's only a 25% solution to our problems.  Of course, we only want to solve
25% of our problems, so it becomes a 100% solution.



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