MCPcopy Create free account
hub / github.com/numpy/numpy / NotConvertible

Class NotConvertible

numpy/core/tests/test_multiarray.py:8750–8752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8748 assert_raises(ValueError, bool, np.array([1, 2]))
8749
8750 class NotConvertible:
8751 def __bool__(self):
8752 raise NotImplementedError
8753
8754 assert_raises(NotImplementedError, bool, np.array(NotConvertible()))
8755 assert_raises(NotImplementedError, bool, np.array([NotConvertible()]))

Callers 2

test_to_bool_scalarMethod · 0.85
test_to_int_scalarMethod · 0.85

Calls

no outgoing calls

Tested by 2

test_to_bool_scalarMethod · 0.68
test_to_int_scalarMethod · 0.68