Add support for showing all overload
signatures
#665
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.