You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions like as_subindex, and in the future things from #14 will have different logic for every combination of two argument types. It might be helpful to organize the code using multipledispatch.
The actual dispatching isn't necessary. It would just help with organization. So maybe in fact we can just roll our own simple variant, since we don't really need to handle subclasses or collisions.
The text was updated successfully, but these errors were encountered:
Looking into it, I'm not sure if multipledispatch supports commutative matching. It may be simpler to simply roll our own thing, especially since I don't really care about extensibility from third-party libraries. NumPy doesn't have any way to define custom index types, so I don't see any reason why ndindex should support it either. Maybe if someone comes up with a use-case we can consider it, but I can't think of any right now.
Actually there are a lot of cases where you want a default implementation that falls back to the Tuple implementation, for example. So perhaps the subclass logic in multipledispatch would be useful. We should figure out if it can do commutative dispatching, though.
Functions like as_subindex, and in the future things from #14 will have different logic for every combination of two argument types. It might be helpful to organize the code using multipledispatch.
The actual dispatching isn't necessary. It would just help with organization. So maybe in fact we can just roll our own simple variant, since we don't really need to handle subclasses or collisions.
The text was updated successfully, but these errors were encountered: