Skip to content

Re-phrase docs of set_content behavior for str payloads #2

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

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Re-phrase docs of set_content behavior for str payloads #2

merged 1 commit into from
Jul 24, 2024

Conversation

rapidcow
Copy link

@rapidcow rapidcow commented Jul 18, 2024

Patch for gh-121543


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

The previous patch only illustrates this behavior with a
very specific edge case, which IMO did not do a good job
elucidating the present ambiguous documentation, if not
worsening it by obscuring the true intention behind EOL
canonicalization for messages of text/* types.

This instead should address the more general case, abeit less
concrete, which seems like a fair compromise, considering
users who care about accurate representation of line endings
will likely carefully study the documentation and be assured
that this is an expected deviation from the legacy API, while
those who do not are not befuddled by a footnote that seems
to warn of something out of the blue.  I do not know if this
is true to the original author's intention, but it is my
personal understanding of this implementation at least. :/

The case of bytes is also addressed briefly in a subsequent
bullet point to assure the user that it is to be expected that
all bytes are preserved as any arbitrary binary file ought to
be.  I wish I could state this more explicitly, but that seems
rather hard without presumably restructuring this particular
page, so I will leave it to the original author... :)

Signed-off-by: Yizheng Meng <dev@rapidcow.org>
@ZeroIntensity ZeroIntensity merged commit 25046ae into ZeroIntensity:patch-1 Jul 24, 2024
1 check passed
@rapidcow rapidcow deleted the patch-1 branch July 29, 2024 12:09
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