Skip to content

ReturnType violation for protocol's method with docstring #7467

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

You must be logged in to vote

This is by design. You must include a ... to indicate to pyright that the implementation is a placeholder and not an actual implementation that returns an implicit None.

This is an area that is under-specified in the typing spec, but I think that pyright's current design here is defensible, and I will be pushing for it to become the officially-documented behavior in protocols. In any case, I don't plan to change its behavior until we have this discussion in the typing forums and reach consensus about a specified behavior.

Replies: 2 comments 1 reply

Comment options

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

Answer selected by EnderASz
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