MCPcopy Create free account
hub / github.com/bpython/bpython / MockNumPy

Class MockNumPy

bpython/test/test_autocomplete.py:179–187  ·  view source on GitHub ↗

This is a mock numpy object that raises an error when there is an attempt to convert it to a boolean.

Source from the content-addressed store, hash-verified

177
178
179class MockNumPy:
180 """This is a mock numpy object that raises an error when there is an attempt
181 to convert it to a boolean."""
182
183 def __nonzero__(self):
184 raise ValueError(
185 "The truth value of an array with more than one "
186 "element is ambiguous. Use a.any() or a.all()"
187 )
188
189
190class TestDictKeyCompletion(unittest.TestCase):

Calls

no outgoing calls