<div dir="ltr">(offlist)<div><br></div><div>To clarify, by "where_i_am" you mean something like the name of the argument where it was found?</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 8, 2018 at 4:49 PM Marten van Kerkwijk <<a href="mailto:m.h.vankerkwijk@gmail.com">m.h.vankerkwijk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>and in particular how the implementation finds out where its own instances are located.</div></div></div></div></blockquote><div><br></div><div>I think we've discussed this before, but I don't think this is feasible to solve in general given the diversity of wrapped APIs. If you want to find the arguments in which a class' own instances appear, you will need to do that in your overloaded function.</div><div><br></div><div>That said, if merely pulling out the flat list of arguments that are checked for and/or implement __array_function__ would be enough, we can probably figure out a way to expose that information.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>In the end, somewhere inside the "dance", you are checking for `__array_function` - it would seem to me that at that point you know exactly where you are, and it would not be difficult to something like<br></div><div>```<br>types[new_type] += [where_i_am]<br></div></div>```<br></div><div class="gmail_extra">(where here I assume types is a defaultdict(list))  - has the set of types in keys and locations as values.<br><br></div><div class="gmail_extra">But easier to discuss whether this is easy with some sample code to look at!<br><br></div></div><div dir="ltr"><div class="gmail_extra">-- Marten <br></div><div class="gmail_extra"><br></div></div>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@python.org" target="_blank">NumPy-Discussion@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/numpy-discussion</a><br>
</blockquote></div>