<html><body><br><blockquote class="hm_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>Don’t you mean <a href="https://docs.python.org/3/library/enum.html#intflag">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="hm_quoted_text" style="padding-left:8px;margin:0;border-left:1px solid rgb(185,185,185);color:rgb(100,100,100)"><div></div>
</blockquote>
</body></html>