<html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> </head> <body style="font-family:Helvetica;color:#000000;font-size:13px;"> <div id="CanaryDropbox"> </div> <blockquote id="CanaryBlockquote"> <div> <div>On Saturday, Nov 10, 2018 at 6:59 PM, Marten van Kerkwijk <<a href="mailto:m.h.vankerkwijk@gmail.com">m.h.vankerkwijk@gmail.com</a>> wrote:<br></div> <div><div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote"><div dir="auto">More broadly, it is only necessary to reject an argument type at the __array_function__ level if it defines __array_function__ itself, because that’s the only case where it would make a difference to return NotImplemented rather than trying (and failing) to call the overriden function implementation.</div></div></div></blockquote><div><br></div><div>Yes, this makes sense -- these are the only types that could possibly change the outcome if the class now called fails to produce a result. Indeed, that reasoning makes it logical that `ndarray` itself is not present even though it defines `__array_ufunc__` - we know it cannot handle anything with a `__array_ufunc__` implementation.</div><div><br></div><div>Hameer, is Stephan's argument convincing to you too? If so, I'll close the PR.</div></div></div></div></div></blockquote><br><div id="CanaryBody"><div>I agree with Stephan here, other than the fact that ndarray should be in the list of types. I can think of many cases in PyData/Sparse where I dont want to allow mixed inputs, but maybe that’s a tangential discussion.</div><div><br></div></div><div id="CanarySig"><div>Best Regards,<div>Hameer Abbasi</div></div></div><blockquote><div><div><div dir="ltr"><div class="gmail_quote"><div><br></div><div>-- Marten</div></div></div> _______________________________________________ <br>NumPy-Discussion mailing list <br>NumPy-Discussion@python.org <br>https://mail.python.org/mailman/listinfo/numpy-discussion <br></div> </div> </blockquote> <img id="25D9D726E9B0FA9EB308A9CD199AC725" width="1px" src="http://pixels.canarymail.io:8100/track/977C99C0645380AF45E168B4CDA443F5_25D9D726E9B0FA9EB308A9CD199AC725.png" height="1px"></body></html>