-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Add support for showing all overload
signatures
#665
base: main
Are you sure you want to change the base?
Conversation
Ok, never mind... this still does not work with stub files when the stub file only contains the Edit: I'll just make a note for myself that I need to look at Edit2: The |
(Happy to look at this once you mark it as ready) |
Thanks! Unfortunately, I'll have to come back to this a bit later... the current implementation works as long as both the "base" method and its overloads are all declared in the stub file. But that is not the recommended way of doing things (e.g. The issue is that once the overloads are in the stub file without the base method, they don't seem to be accessible through the built-in |
This PR should solve #442 by displaying each
overload
type signature as a separate indented block after the "main" method signature.So far, this works fine on my own project (which uses
PyO3
, so I am also testing it with overloads in stub files). But I am relatively new topdoc
, so I am not sure what level of testing is expected for this to be merged. Would it be sufficient to add an overloaded method totests/testdata/misc_py311.py
to see how it renders, or is there something more detailed that needs to be done?Edit: I see that it is required to have 100% test coverage on the latest Python version. However, this feature is only available from Python 3.11 onward. So I've added a little compatibility shim which just returns an empty value on older Python versions (not ideal, but probably the best option). But this shim is not triggered on the newer Python versions, hence there is no way to get 100% coverage, even if I fix the other uncovered lines.