[Python-Dev] _length_cue() (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 9 04:27:54 CET 2006
- Previous message: [Python-Dev] _length_cue()
- Next message: [Python-Dev] _length_cue()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Armin Rigo wrote:
This said, do we vote for lengthhint or lengthcue? :-)
I prefer something containing "hint" rather than "cue" because it more explicitly says what we mean.
I feel that length_hint is a bit long, though. We have len, not length, so maybe it should be len_hint or lenhint.
And does anyone objects about getitemhint or getitemcue?
I'm having trouble seeing widespread use cases for this. If an object is capable of computing arbitrary items on demand, seems to me it should be implemented as a lazily-evaluated sequence or mapping rather than an iterator.
The iterator protocol is currently very simple and well-focused on a single task -- producing things one at a time, in sequence. Let's not clutter it up with too much more cruft.
-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiam! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing at canterbury.ac.nz +--------------------------------------+
- Previous message: [Python-Dev] _length_cue()
- Next message: [Python-Dev] _length_cue()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]