We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
str
str | bytes
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3.11.5 (main, Aug 25 2023, 07:43:52) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> open(b'/dev/null') <_io.TextIOWrapper name=b'/dev/null' mode='r' encoding='UTF-8'>
File IO classes can have bytes names, not just str. The name field at construction time and thus name property on IO should thus be str | bytes.
bytes
The text was updated successfully, but these errors were encountered:
typing.pyi: IO.name may be bytes
c9d33d8
Fixes #10737 Worried this may be too disruptive, but let's see what mypy-primer says.
Make IO.name() generic
IO.name()
3caec47
Cf. python#10737
Successfully merging a pull request may close this issue.
File IO classes can have
bytes
names, not juststr
. The name field at construction time and thus name property on IO should thus bestr | bytes
.The text was updated successfully, but these errors were encountered: