Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commented Dec 31, 2024

Non-tuple sequences are deprecated as argument for the "(items)" format unit in PyArg_ParseTuple() and other argument parsing functions if items contains format units which store borrowed buffer or reference (e.g. "s" and "O").

str and bytearray are no longer accepted as valid sequences.


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

…seTuple() Non-tuple sequences are deprecated as argument for the "(items)" format unit in PyArg_ParseTuple() and other argument parsing functions if items contains format units which store borrowed buffer or reference (e.g. "s" and "O"). str and bytearray are no longer accepted as valid sequences.
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

While I understand that "borrowed buffer or reference" reads as "borrowed buffer or borrowed reference", I would advise repeating "borrowed reference" as well.

I haven't looked at te implementation though.

Co-authored-by: Bénédikt Tran <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
@erlend-aasland
Copy link
Contributor

While I understand that "borrowed buffer or reference" reads as "borrowed buffer or borrowed reference", I would advise repeating "borrowed reference" as well.

In this case, I think we should consider being explicit, rather than worrying about the repeated word.

@serhiy-storchaka
Copy link
MemberAuthor

This didn't cause much controversy when posted on Discourse, so I just merge it. There will be time to tweak or revert it.

@serhiy-storchakaserhiy-storchaka merged commit 0e4cf9c into python:mainApr 8, 2025
42 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@serhiy-storchaka@erlend-aasland@picnixz@StanFromIreland