[Python-Dev] Proposed iterator representations (original) (raw)
Brett C. bac at OCF.Berkeley.EDU
Fri Apr 9 02🔞28 EDT 2004
- Previous message: [Python-Dev] Proposed iterator representations
- Next message: [Python-Dev] Re: Proposed iterator representations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Raymond Hettinger wrote:
For xrange iterators, there are a few choices:
it = iter(xrange(10, 20, 2)) iter(xrange(10, 20, 2)) or rangeiterator(10, 20, 2) or The first is my favorite. Though odd looking, it can be run through eval() and is completely self-documenting. The second has the virtue of using the actual type name but it cannot be run through eval(). The third is closer to the current format but adds some information.
Third. If I am at the interpreter I want information presented to me in the best way possible. If I need to type it in again I have readline and a command history for that. =)
For dictionaries, lists, tuples, and reversed, there are similar choices but the eval() version can only be supported with a full listing of the parent object: What do you guys think?
As mentioned above, I want the information presented in the most informative way and not worry about the repr output.
-Brett
- Previous message: [Python-Dev] Proposed iterator representations
- Next message: [Python-Dev] Re: Proposed iterator representations
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]