[Python-Dev] More imformative iterator representations (original) (raw)

Paul 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:

<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