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/2004-April/044158.html below:

[Python-Dev] More imformative iterator representations

[Python-Dev] More imformative iterator representations [Python-Dev] More imformative iterator representationsPaul Prescod paul at prescod.net
Thu Apr 8 01:01:56 EDT 2004
Raymond Hettinger wrote:
>...
> An alternative to the read-eval-print approach is providing a custom
> __repr__() method for the builtin iterators.  The good news is that this
> approach is very clean. 

And worth doing!

A few questions:

  * will it be easy for end-users to write iterators that can repr 
nicely? Do you anticipate a base class or helper function to help?

  * might it make sense for enumerate to report something like:

<enumerate object <reversed(['h', 'g', 'f', ...])> ...>

If the underlying object's repr is helpful then enumerate at least might 
not discard the information.

  Paul Prescod


More information about the Python-Dev mailing list

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