PyDocs

Nav

Python Runtime Services

object.__length_hint__

builtins

method of object · Added in 3.4
  • object.__length_hint__(self)
Called to implement operator.length_hint(). Should return an estimated length for the object (which may be greater or less than the actual length). The length must be an integer >= 0. The return value may also be NotImplemented, which is treated the same as if the __length_hint__ method didn’t exist at all. This method is purely an optimization and is never required for correctness.
0 Examples
No examples for builtins/object.__length_hint__.
See Also
No see-alsos for builtins/object.__length_hint__
0 Notes
No notes for object.__length_hint__