Closed mfinzi closed 7 months ago
Het @mfinzi! Thanks for opening an issue. :)
This is a massive coincidence, but we discussed exactly this problem here this morning! I think you've very correctly diagnosed the issue. In the PR, we're discussed a possible fix, which might be very simple. Please bear with us! With a bit of luck, this should be fixed shortly.
This should be fixed with #108, which will be included in the next release! :)
First off, thanks for the amazing library. 🙌
I had some issues come up when trying to dispatch on parametric types.
In the docs it is specified that the parametric types are covariant:
However, even though
issubclass
seems to respect this property, dispatch does match on these covariant types as I would expect.I added a minimal example to reproduce the behavior below:
whereas
issubclass(test_obj, A[B])
returns trueIs this expected? If so, what is the appropriate way of handling this?