Searched refs:length_hint (Results 1 – 11 of 11) sorted by relevance
/external/python/cpython3/Lib/test/ |
D | test_iterlen.py | 47 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 …]
|
D | test_operator.py | 489 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))
|
D | test_enumerate.py | 175 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)
|
D | test_itertools.py | 2045 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)
|
D | test_struct.py | 702 lh = operator.length_hint
|
/external/python/cpython3/Lib/ |
D | operator.py | 185 def length_hint(obj, default=0): function
|
/external/python/cpython3/Doc/library/ |
D | operator.rst | 241 .. function:: length_hint(obj, default=0)
|
/external/python/cpython3/Doc/c-api/ |
D | object.rst | 491 equivalent to the Python expression ``operator.length_hint(o, default)``.
|
/external/python/cpython3/Doc/whatsnew/ |
D | 3.4.rst | 1160 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/ |
D | datamodel.rst | 2174 Called to implement :func:`operator.length_hint`. Should return an estimated
|
/external/python/cpython3/Misc/ |
D | HISTORY | 4679 - Issue #16148: Implement PEP 424, adding operator.length_hint and
|