Skip to content

fix(typing): User may not have provided a return annotation for an overload #523

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bzoracler
Copy link

If the source code doesn't provide a return type annotation on one or more overloads, then 1-indexed value of the inner tuple, representing the annotation, can be None.

This is a consequence of the following:

grouped["overloads"].append(
(child_data["args"], child_data["return_annotation"])
)

"return_annotation": _astroid_utils.get_return_annotation(node),

def get_return_annotation(node: astroid.nodes.FunctionDef) -> str | None:

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 this pull request may close these issues.

1 participant