Home
last modified time | relevance | path

Searched refs:length_hint (Results 1 – 16 of 16) 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.py496 self.assertEqual(operator.length_hint([], 2), 0)
497 self.assertEqual(operator.length_hint(iter([1, 2, 3])), 3)
499 self.assertEqual(operator.length_hint(X(2)), 2)
500 self.assertEqual(operator.length_hint(X(NotImplemented), 4), 4)
501 self.assertEqual(operator.length_hint(X(TypeError), 12), 12)
503 operator.length_hint(X("abc"))
505 operator.length_hint(X(-2))
507 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.py732 lh = operator.length_hint
/external/openscreen/third_party/abseil/src/absl/strings/
Dcord.cc374 static CordRep* NewFlat(size_t length_hint) { in NewFlat() argument
375 if (length_hint <= kMinFlatLength) { in NewFlat()
376 length_hint = kMinFlatLength; in NewFlat()
377 } else if (length_hint > kMaxFlatLength) { in NewFlat()
378 length_hint = kMaxFlatLength; in NewFlat()
382 const size_t size = RoundUpForTag(length_hint + kFlatOverhead); in NewFlat()
/external/webrtc/third_party/abseil-cpp/absl/strings/
Dcord.cc457 static CordRep* NewFlat(size_t length_hint) { in NewFlat() argument
458 if (length_hint <= kMinFlatLength) { in NewFlat()
459 length_hint = kMinFlatLength; in NewFlat()
460 } else if (length_hint > kMaxFlatLength) { in NewFlat()
461 length_hint = kMaxFlatLength; in NewFlat()
465 const size_t size = RoundUpForTag(length_hint + kFlatOverhead); in NewFlat()
/external/libtextclassifier/abseil-cpp/absl/strings/
Dcord.cc378 static CordRep* NewFlat(size_t length_hint) { in NewFlat() argument
379 if (length_hint <= kMinFlatLength) { in NewFlat()
380 length_hint = kMinFlatLength; in NewFlat()
381 } else if (length_hint > kMaxFlatLength) { in NewFlat()
382 length_hint = kMaxFlatLength; in NewFlat()
386 const size_t size = RoundUpForTag(length_hint + kFlatOverhead); in NewFlat()
/external/rust/crates/grpcio-sys/grpc/third_party/abseil-cpp/absl/strings/
Dcord.cc378 static CordRep* NewFlat(size_t length_hint) { in NewFlat() argument
379 if (length_hint <= kMinFlatLength) { in NewFlat()
380 length_hint = kMinFlatLength; in NewFlat()
381 } else if (length_hint > kMaxFlatLength) { in NewFlat()
382 length_hint = kMaxFlatLength; in NewFlat()
386 const size_t size = RoundUpForTag(length_hint + kFlatOverhead); in NewFlat()
/external/abseil-cpp/absl/strings/
Dcord.cc457 static CordRep* NewFlat(size_t length_hint) { in NewFlat() argument
458 if (length_hint <= kMinFlatLength) { in NewFlat()
459 length_hint = kMinFlatLength; in NewFlat()
460 } else if (length_hint > kMaxFlatLength) { in NewFlat()
461 length_hint = kMaxFlatLength; in NewFlat()
465 const size_t size = RoundUpForTag(length_hint + kFlatOverhead); in NewFlat()
/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.rst319 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.rst2230 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