-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
As part of our project we are using wurlitzer to redirect some of the outputs into the files.
The problem I am facing is that library lacks type deduction, thus linters are trying to deduce types themselves leading to errors.
Even trying out the doc example (saved as test.py):
from io import StringIO
from wurlitzer import pipes, STDOUT
out = StringIO()
with pipes(stdout=out, stderr=STDOUT):
print("test")
stdout = out.getvalue()
When running
pyright test.py
I got the following error
//:5:19 - error: Argument of type "StringIO" cannot be assigned to parameter "stdout" of type "int"
"StringIO" is incompatible with "int" (reportGeneralTypeIssues)
This is basically a feature request - I can workaround it by silencing linters and type checkers for individual lines in my code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels