-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
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
sys.stdout missing encoding attribute in Python 2 #2196
Comments
Hm, at runtime I'm leaning towards using |
Hm, if we changed the declaration of So I'm tempted to say that (in Python 2!) the OP should not assume that But I understand that's a pain. |
👍 |
I feel that IO classes should be broken down into several fairly fine-grained protocols, considering how much variation there is. Most functions receiving a file-like object use only a fairly small subset of methods anyway (often just |
Agreed. When I first designed the I/O hierarchy I resisted creating many small classes because the inheritance would be a nightmare. But with protocols this is actually the way to go, at least for arguments. For return values the existing hierarchy needs to continue to exist, since it matches the concrete types at runtime. |
See also python/typing#564 for a broader discussion about this topic. |
We now plan to soon remove support for Python 2 entirely (#7367), so I'm going to close this as a "wontfix" issue. |
typeshed/stdlib/2/sys.pyi
Line 73 in eef0b1d
typeshed/stdlib/2/typing.pyi
Line 277 in eef0b1d
The text was updated successfully, but these errors were encountered: