Skip to content

Pylance and @overload of functions #5387

Answered by erictraut
ClementPinard asked this question in Q&A
Discussion options

You must be logged in to vote

I though you were expected to replace all default values with ...

You may include default argument values in an overload signature if you'd like the value to be displayed in hover text and signature help. Default arguments are often replaced by ... in type stubs, but that's a convention more than a requirement. Type checkers and other static analysis tools will handle it fine if you include the actual value. Typeshed stubs are increasingly including the default argument value to improve language server support.

it seems pyright is ignoring my .pyi file

Stub files are stand-ins for a source file within a library. Stubs are typically written because the source file is untyped or because…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ClementPinard
Comment options

Answer selected by ClementPinard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants