[Python-Dev] More imformative iterator representations (original) (raw)
Paul Prescod paul at prescod.net
Thu Apr 8 01:01:56 EDT 2004
- Previous message: [Python-Dev] More imformative iterator representations
- Next message: [Python-Dev] More imformative iterator representations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] More imformative iterator representations
- Next message: [Python-Dev] More imformative iterator representations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]