You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If numpy is built with NPY_RELAXED_STRIDES_DEBUG == 1, then fromiter uses the invalid strides.
importnumpyasnpNPY_RELAXED_STRIDES_DEBUG=np.ones(1, np.uint8).strides[0] !=1assertNPY_RELAXED_STRIDES_DEBUGclassMyIter:
def__length_hint__(self):
# only required to be an estimate, this is legalreturn1def__iter__(self):
returniter([1, 2, 3])
x=np.fromiter(MyIter(), int)
# segfault