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
Currently sys.stdin et al. are typed as TextIO, not TextIOWrapper. This would need to be changed as well, although I am not sure that this does not cause complications. But adding TextIOWrapper.reconfigure() would be welcome in any case.
Activity
srittau commentedon Jun 11, 2019
Currently
sys.stdinet al. are typed asTextIO, notTextIOWrapper. This would need to be changed as well, although I am not sure that this does not cause complications. But addingTextIOWrapper.reconfigure()would be welcome in any case.serhiy-storchaka commentedon May 14, 2020
For the following code
I get the error:
MyPy understand that
sys.stdoutis aTextIOWrapperinstance.serhiy-storchaka commentedon May 14, 2020
What is worse -- I cannot silence the error by adding
# type: ignore, because on Python 3.6 I geterror: unused 'type: ignore' comment.grantwwu commentedon May 14, 2020
I haven't touched MyPy in many months but your platform check might be too complex for https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks to understand. Try splitting it into two
ifs?srittau commentedon May 14, 2020
FWIW, I just checked the following with mypy 0.770 using
--warn-unused-ignoresunder both Python 3.6.9 and 3.7.4 and it works or me:That said, we'll gladly accept a PR that adds
TextIOWrapper.reconfigure():)serhiy-storchaka commentedon May 18, 2020
It is the same if split on two
ifs.fix(out.py): `TextIOWrapper.reconfigure` typing
fix(out.py): `TextIOWrapper.reconfigure` typing
fix(out.py): `TextIOWrapper.reconfigure` typing
fix(out.py): `TextIOWrapper.reconfigure` typing