-
-
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
add encodings.ascii and encodings.latin_1 #13113
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
class StreamWriter(Codec, codecs.StreamWriter): ... | ||
class StreamReader(Codec, codecs.StreamReader): ... | ||
|
||
# Note: encode being a decode function and decode being an encode function is accurate to runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, is that a bug in the runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. StreamConverter
only exists on ascii and latin_1 encodings. Both do this, and there's nothing in the stdlib that makes use of them, so I don't know how they're intended to be used. I wondered the same thing, but I can't rule out that this is intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They've also been this way for almost 25 years now.
It's possible that no one has ever used these classes for anything.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Not identical, but nearly so. Only the base functions from
codecs
are different.