[Python-Dev] _length_cue() (original) (raw)
Andrew Koenig ark at acm.org
Wed Feb 8 17:54:14 CET 2006
- Previous message: [Python-Dev] _length_cue()
- Next message: [Python-Dev] _length_cue()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm worried about the name. There are now exactly two names that behave like a special method without having the double-underscores around it. The first name is 'next', which is kind of fine because it's for iterator classes only and it's documented. But now, consider: the CPython implementation can unexpectedly invoke a method on a user-defined iterator class, even though this method's name is not '*_' and not documented as special! That's new and that's bad._
Might I suggest that at least you consider using "hint" instead of "cue"? I'm pretty sure that "hint" has been in use for some time, and always to mean a value that can't be assumed to be correct but that improves performance if it is.
For example, algorithms that insert values in balanced trees sometimes take hint arguments that suggest where the algorithm should start searching for the insertion point.
- Previous message: [Python-Dev] _length_cue()
- Next message: [Python-Dev] _length_cue()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]