MCPcopy Index your code
hub / github.com/RustPython/RustPython / _AnyComparer

Class _AnyComparer

Lib/unittest/mock.py:1120–1133  ·  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

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