Skip to content
Discussion options

You must be logged in to vote

Here's a signature for the implementation that's compatible with your overloads.

    def parse_args(
        self, args: Sequence[str] | None = None, namespace: _N = None
    ) -> argparse.Namespace | _N:
        return super().parse_args(args, namespace)

Does annotations on the implementation function (I mean function without overload) can influence the typing result?

The overload signatures are used for evaluating calls to the function, and the implementation signature is used for type checking the implementation itself. If the implementation signature is not a "superset" of all of the overload signatures, then there's something wrong with one of the two.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@ostr00000
Comment options

@erictraut
Comment options

Answer selected by ostr00000
@ostr00000
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants