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

Class C

numpy/core/tests/test_multiarray.py:1083–1087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081 def test_false_len_sequence(self):
1082 # gh-7264, segfault for this example
1083 class C:
1084 def __getitem__(self, i):
1085 raise IndexError
1086 def __len__(self):
1087 return 42
1088
1089 a = np.array(C()) # segfault?
1090 assert_equal(len(a), 0)

Callers 3

Calls

no outgoing calls

Tested by 3