-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Callable protocols not being parsed correctly #636
Comments
Thank you for reporting! Some comments:
|
These problems should be fixed with #637. |
Hello, thanks for the feedback, According to the documentation implementing protocols by explicitly inheriting from the protocol as the base class is allowed https://typing.readthedocs.io/en/latest/spec/protocol.html#explicitly-declaring-implementation |
Yes, for normal inheritance from a protocol it could be supported. |
Thank you! |
thanks for the fix on #637 it is working now, the only thing that does not work is the help string where the subclass is still not recognized. |
I found the source of the issue. When getting the help string the following check is performed this fails in |
This should be fixed with #645. Also I added a test in which a class inherits from a protocol, resolving the name to its class path. |
🐛 Bug report
Even though bugs related with calling protocol inheritance were resolved in this PR it seem there are still some issues relating to parsing callable protocols.
To reproduce
results in the following error message:
and asking for the help string gives:
Note that in the tests this exact interface,
ImplementsCallableInterface1
is recognized as being a valid instantiation of theCallableInterface
.Expected behavior
The parser should recolonize CallableInterface and be able to instantiate it.
Environment
The text was updated successfully, but these errors were encountered: