Wed, 07 Sep 2016 09:22:24 -0700, Nathaniel Smith kirjoitti: [clip] > I wonder if there is any way we can avoid the flag, and just make this > happen automatically when appropriate? nditer has too many "unbreak-me" > flags already. > > Are there any cases where we *don't* want the copy-if-overlap behavior? > Traditionally overlap has triggered undefined behavior, so there's no > backcompat issue, right?
I didn't put it on by default, because of backward compatibility and side effects that break things. On side effects: there are some bugs in ufunc code that need fixing if the flag is turned on (wheremask code breaks, and ufuncs write to wrong output arrays). Moreover, copying write operands with updateifcopy marks the original arrays as read-only, until the copied array is decrefed. There may also be other side effects that are not so obvious. The PR is not mergeable if the flag would be on by default --- that requires inspecting all the uses of the iterator in the numpy codebase and making sure there's no weird stuff done. I'm not sure how much 3rd party code is using the iterator, but I'm a bit worried also that copies break assumptions also there. It might be possible to turn it on by default for operands with COPY or UPDATEIFCOPY flags --- but I'm not sure if that's helpful (now you'd need to set the flags to all input operands). -- Pauli Virtanen _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion