Skip to content
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

Merged
merged 6 commits into from
Nov 27, 2024

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Nov 25, 2024

Not identical, but nearly so. Only the base functions from codecs are different.

This comment has been minimized.

@tungol tungol marked this pull request as draft November 26, 2024 19:09
@tungol tungol marked this pull request as ready for review November 26, 2024 19:51

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.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 4ce28d2 into python:main Nov 27, 2024
63 checks passed
@tungol tungol deleted the encodings_ascii branch November 27, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants