MCPcopy Index your code
hub / github.com/python/cpython / _AnyComparer

Class _AnyComparer

Lib/unittest/mock.py:1121–1134  ·  view source on GitHub ↗

A list which checks if it contains a call which may have an argument of ANY, flipping the components of item and self from their traditional locations so that ANY is guaranteed to be on the left.

Source from the content-addressed store, hash-verified

1119
1120
1121class _AnyComparer(list):
1122 """A list which checks if it contains a call which may have an
1123 argument of ANY, flipping the components of item and self from
1124 their traditional locations so that ANY is guaranteed to be on
1125 the left."""
1126 def __contains__(self, item):
1127 for _call in self:
1128 assert len(item) == len(_call)
1129 if all([
1130 expected == actual
1131 for expected, actual in zip(item, _call)
1132 ]):
1133 return True
1134 return False
1135
1136
1137def _try_iter(obj):

Callers 2

assert_any_callMethod · 0.85
assert_any_awaitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…