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.py489 self.assertEqual(operator.length_hint([], 2), 0)
490 self.assertEqual(operator.length_hint(iter([1, 2, 3])), 3)
492 self.assertEqual(operator.length_hint(X(2)), 2)
493 self.assertEqual(operator.length_hint(X(NotImplemented), 4), 4)
494 self.assertEqual(operator.length_hint(X(TypeError), 12), 12)
496 operator.length_hint(X("abc"))
498 operator.length_hint(X(-2))
500 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.py2045 self.assertEqual(operator.length_hint(repeat(None, 50)), 50)
2046 self.assertEqual(operator.length_hint(repeat(None, 0)), 0)
2047 self.assertEqual(operator.length_hint(repeat(None), 12), 12)
2050 self.assertEqual(operator.length_hint(repeat(None, -1)), 0)
2051 self.assertEqual(operator.length_hint(repeat(None, -2)), 0)
2052 self.assertEqual(operator.length_hint(repeat(None, times=-1)), 0)
2053 self.assertEqual(operator.length_hint(repeat(None, times=-2)), 0)
Dtest_struct.py702 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.rst491 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.rst2174 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