<div dir="ltr">Yes, meant IntFlag :sheep:</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Mar 17, 2018 at 6:02 PM Hameer Abbasi <<a href="mailto:einstein.edison@gmail.com">einstein.edison@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><br><blockquote class="m_-2202286196543125663hm_quoted_text" style="padding-left:8px;margin:0;border-left:1px solid rgb(185,185,185);color:rgb(100,100,100)">
<div>It would be nice if there was an IntEnum [1] that was taken is an input to `np.asarrayish` and `np.isarrayish` to require a combination of the groups of attributes/methods/semantics.</div></blockquote><div><br></div></div><div><div>Don’t you mean <a href="https://docs.python.org/3/library/enum.html#intflag" target="_blank">IntFlag</a>? I like Marten’s idea of “grouping together” related functionality via ABCs and implementing different parts via ABCs (for example, in pydata/sparse we use NDArrayOperatorsMixin for exactly this), but I believe that separate ABCs should be provided for different parts of the interface.</div><div><br></div><div>Then we can either:</div><div><ol style="font-style:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:17px;font-family:"Helvetica Neue";text-decoration:none;color:rgb(0,0,0);background-color:rgba(0,0,0,0)"><li>Check with isinstance for the ABCs, or</li><li>Check with hasattr.</li></ol><div>I like the IntFlag idea most (it seems to be designed for use-cases like these), but a string-based (np.aspyarray(x, functionality=‘arithmetic|reductions')) or list-based (np.aspyarray(x, functionality=[‘arithmetic’, ‘reductions’]) is also fine.</div></div><div><br></div><div>It might help to have some sort of a “dry-run” interface that (given a run of code) figures out which parts you need.</div><blockquote class="m_-2202286196543125663hm_quoted_text" style="padding-left:8px;margin:0;border-left:1px solid rgb(185,185,185);color:rgb(100,100,100)"><div></div>
</blockquote>
</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>