Skip to content

Why does the unknown type propagate over after an explicit annotation #9670

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

You must be logged in to vote

A # pyright: ignore comment does not affect type evaluation behavior; it simply suppresses any diagnostics on that line.

The reportUnknown... checks report the use of an Unknown. If Unknown was not retained, you would see no strict-mode diagnostic in this code sequence despite the fact that it represents a typing hole.

x: int = unknown
y: int = x

Replies: 1 comment 3 replies

Comment options

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

@ItsDrike
Comment options

@erictraut
Comment options

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