-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
Pyright can't infer the type of fileinput.input() iterator, it infers to Unknown. Present since 1.2.247.
To Reproduce
Check provided code below.
Expected behavior
AnyStr@input type inferred? It was the behaviour before 1.1.247.
Screenshots or Code
import fileinput
for line in fileinput.input(): # line is Unknown
passTooltip on function in VS Code shows the correct type. 😅

VS Code extension or command-line
I usually run it as part of Pylance but just for the sake of this issue have installed Pyright as a separate extension and confirmed the same (still present in 1.1.248 which is newer than the latest Pylance release).
Additional context
It doesn't seem like something caused by updated typeshed stubs because the last time this module was touched in typeshed was a month ago, many Pyright versions ago.