[Python-Dev] PEP 0424: A method for exposing a length hint (original) (raw)
Alex Gaynor alex.gaynor at gmail.com
Tue Jul 17 05:03:08 CEST 2012
- Previous message: [Python-Dev] PEP 0424: A method for exposing a length hint
- Next message: [Python-Dev] PEP 0424: A method for exposing a length hint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've updated the PEP to reflect the discussion. There are two major changes:
- NotImplemented may be used by length_hint to indicate that there is no finite length hint available.
- callers of operator.length_hint() must provide their own default value, this is also required by the current C _PyObject_LengthHint implementation.
There are no provisions for infinite iterators, that is not within the scope of this proposal.
Alex
- Previous message: [Python-Dev] PEP 0424: A method for exposing a length hint
- Next message: [Python-Dev] PEP 0424: A method for exposing a length hint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]