The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative value, then the defaultvalue is returned. If one of the calls fails, this function returns -1.
See Implementation
The length hint function returns a non-negative value from o.__len__() or o.__length_hint__(). If those methods aren't found or return a negative value, then the defaultvalue is returned. If one of the calls fails, this function returns -1.