Armin Rigo wrote: > This said, do we vote for __length_hint__ or __length_cue__? :-) 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 __getitem_hint__ or __getitem_cue__? 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 +--------------------------------------+
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