PyDocs

Nav

Functional Programming Modules

length_hint

operator

function · Added in 3.4
  • length_hint(obj, default=0)
Return an estimate of the number of items in obj.

This is useful for presizing containers when building from an iterable.

If the object supports len(), the result will be exact.
Otherwise, it may over- or under-estimate by an arbitrary amount.
The result will be an integer >= 0.
0 Examples
No examples for operator/length_hint.
See Also
No see-alsos for operator/length_hint
0 Notes
No notes for length_hint