Home
last modified time | relevance | path

Searched refs:length_hint (Results 1 – 11 of 11) sorted by relevance

/external/python/cpython3/Lib/test/
Dtest_iterlen.py47 from operator import length_hint
57 self.assertEqual(length_hint(it), i)
59 self.assertEqual(length_hint(it), 0)
61 self.assertEqual(length_hint(it), 0)
70 self.assertEqual(length_hint(it), n)
72 self.assertEqual(length_hint(it), n-1)
75 self.assertEqual(length_hint(it), 0)
155 self.assertEqual(length_hint(it), n - 2)
157 self.assertEqual(length_hint(it), n - 1) # grow with append
159 self.assertEqual(length_hint(it), 0)
[all …]
Dtest_operator.py476 self.assertEqual(operator.length_hint([], 2), 0)
477 self.assertEqual(operator.length_hint(iter([1, 2, 3])), 3)
479 self.assertEqual(operator.length_hint(X(2)), 2)
480 self.assertEqual(operator.length_hint(X(NotImplemented), 4), 4)
481 self.assertEqual(operator.length_hint(X(TypeError), 12), 12)
483 operator.length_hint(X("abc"))
485 operator.length_hint(X(-2))
487 operator.length_hint(X(LookupError))
Dtest_enumerate.py175 self.assertEqual(operator.length_hint(reversed(s)), len(s))
178 self.assertEqual(operator.length_hint(r), 0)
189 self.assertRaises(ZeroDivisionError, operator.length_hint, r)
Dtest_itertools.py1990 self.assertEqual(operator.length_hint(repeat(None, 50)), 50)
1991 self.assertEqual(operator.length_hint(repeat(None, 0)), 0)
1992 self.assertEqual(operator.length_hint(repeat(None), 12), 12)
1995 self.assertEqual(operator.length_hint(repeat(None, -1)), 0)
1996 self.assertEqual(operator.length_hint(repeat(None, -2)), 0)
1997 self.assertEqual(operator.length_hint(repeat(None, times=-1)), 0)
1998 self.assertEqual(operator.length_hint(repeat(None, times=-2)), 0)
Dtest_struct.py676 lh = operator.length_hint
/external/python/cpython3/Lib/
Doperator.py185 def length_hint(obj, default=0): function
/external/python/cpython3/Doc/library/
Doperator.rst241 .. function:: length_hint(obj, default=0)
/external/python/cpython3/Doc/c-api/
Dobject.rst406 equivalent to the Python expression ``operator.length_hint(o, default)``.
/external/python/cpython3/Doc/whatsnew/
D3.4.rst1160 New function :func:`~operator.length_hint` provides an implementation of the
1925 of :func:`operator.length_hint`. (Contributed by Armin Ronacher in
/external/python/cpython3/Doc/reference/
Ddatamodel.rst2143 Called to implement :func:`operator.length_hint`. Should return an estimated
/external/python/cpython3/Misc/
DHISTORY4679 - Issue #16148: Implement PEP 424, adding operator.length_hint and