Support types with custom __instancecheck__
method
#248
Labels
enhancement
New feature or request
8000
__instancecheck__
method
#248
This code does not work:
But, it should! For example,
phantom-types
use this method: https://github.com/antonagestam/phantom-types/blob/main/phantom/base.py#L28-L43If we want to support them - we would need this feature.
Solution
I suggest that we need to add types with
__instancecheck__
defined to both._instances
and._protocols
.This way both of these cases would work:
The text was updated successfully, but these errors were encountered: