You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy reports an Incompatible types in assignment error when the variable name defined is same across "with" blocks and any of the "with" block contain an inner method. I hope this is on the lines of #15605 and a possible variant of #12246.
main.py:4: error: Incompatible types in assignment (expression has type "BufferedReader", variable has type "TextIOWrapper") [assignment]
Found 1 error in 1 file (checked 1 source file)
Bug Report
mypy reports an
Incompatible types in assignment
error when the variable name defined is same across "with" blocks and any of the "with" block contain an inner method. I hope this is on the lines of #15605 and a possible variant of #12246.To Reproduce
Please use the below code:
Expected Behavior
Type check passes.
Actual Behavior
I observed the following error:
Your Environment
mypy main.py
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: