Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnyPath is not a subclass of AnyPath #246

Closed
chbehrens opened this issue Aug 15, 2022 · 1 comment · Fixed by #251
Closed

AnyPath is not a subclass of AnyPath #246

chbehrens opened this issue Aug 15, 2022 · 1 comment · Fixed by #251

Comments

@chbehrens
Copy link
Contributor

It would be helpful if issubclass(AnyPath, AnyPath) returns True as usually expected if a class is checked against itself. Do you see any possibility to modify it in such a way or is there a good reason why this shouldn't be the case? Unfortunately, I'm not familiar enough with ABCs to directly suggest a solution.

I came across a use case where I want to make sure, that the type of a field is a subclass of a list of classes. Originally, I used pathlib.Path there and checked against (str, numbers.Number, Path) but as cloud paths should become an option, I'd like to replace pathlib.Path with cloudlib.AnyPath.

@pjbull
Copy link
Member

pjbull commented Aug 18, 2022

Closed by #251

@pjbull pjbull closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants