-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feature: support type stubs? #77
Labels
feature
New feature or request
Comments
It's already supported! But maybe I forgot to support the case where the name passed to |
Excellent! Sorry I missed that 😂 |
Found one more case where stubs are being missed:
The top level |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As mentioned in #75 (comment), one benefit of static API analysis is the ability to pick up stuff like
@typing.overload
-decorated functions, and other stuff that doesn't make it into a runtime representation.This got me thinking: would it be within scope to support type stub /
.pyi
files?as an example, consider this terrible, awful, very bad module:
Yes, this is a silly thing to do, but there are some cases where meta-programming is particularly powerful in python, so it's not out of the realm of "reasonable" possibilities to inject names into a namespace dynamically. If I'm ever tempted to do something like that, I'd always provide a type stub:
currently, griffe would find nothing:
... but perhaps it could also look for type stubs to find that info? Whether a type stub should simply override an actual
py
module, or whether there should be some attempt to merge is another question. (I'd tend to simply override if present, as type checkers seem to do)The text was updated successfully, but these errors were encountered: