Skip to content

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Jul 10, 2025

I do not think there is a need for an example as @doerwalter suggested, but I do not mind adding one.


📚 Documentation preview 📚: https://cpython-previews--136497.org.readthedocs.build/

Copy link
Member

@malemburg malemburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether we should do this. The codecs machinery is not tied to str<->bytes only.

While it's true that the current implementation of those two functions will only work with iterators of certain types, this is an (unwanted) side-effect of their use of "" and b"" in the implementation. More correct would be to use input[:0] to finalize the encoder.

Perhaps it's better to write e.g. "For most encodings, iterator must yield :class:str objects."

@malemburg
Copy link
Member

Ok, I had another look at what Walter had implemented for the incremental encoders/decoders and he does indeed assume that only str<->bytes encoding can be used.

@malemburg malemburg merged commit 4b41b20 into python:main Jul 10, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jul 10, 2025
@malemburg
Copy link
Member

Thanks, @StanFromIreland

@malemburg malemburg added 3.13 bugs and security fixes 3.14 bugs and security fixes needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes and removed 3.13 bugs and security fixes 3.14 bugs and security fixes labels Jul 10, 2025
@miss-islington-app
Copy link

Thanks @StanFromIreland for the PR, and @malemburg for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @StanFromIreland for the PR, and @malemburg for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 10, 2025
)

Closes pythonGH-82663
(cherry picked from commit 4b41b20)

Co-authored-by: Stan Ulbrych <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 10, 2025
)

Closes pythonGH-82663
(cherry picked from commit 4b41b20)

Co-authored-by: Stan Ulbrych <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jul 10, 2025

GH-136512 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 10, 2025
@bedevere-app
Copy link

bedevere-app bot commented Jul 10, 2025

GH-136513 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jul 10, 2025
@StanFromIreland StanFromIreland deleted the gh-82663 branch July 10, 2025 15:40
malemburg pushed a commit that referenced this pull request Jul 10, 2025
…136512)

gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497)

Closes GH-82663
(cherry picked from commit 4b41b20)

Co-authored-by: Stan Ulbrych <[email protected]>
malemburg pushed a commit that referenced this pull request Jul 10, 2025
…136513)

gh-82663: Clarify `codecs.iterdecode/encode` docs (GH-136497)

Closes GH-82663
(cherry picked from commit 4b41b20)

Co-authored-by: Stan Ulbrych <[email protected]>
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
picnixz pushed a commit to picnixz/cpython that referenced this pull request Jul 13, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
…nGH-136497) (python#136513)

pythongh-82663: Clarify `codecs.iterdecode/encode` docs (pythonGH-136497)

Closes pythonGH-82663
(cherry picked from commit 4b41b20)

Co-authored-by: Stan Ulbrych <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants