Skip to content

gh-121645: Add PyBytes_Join() function - #121646

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:bytes_join
Aug 30, 2024
Merged

gh-121645: Add PyBytes_Join() function#121646
vstinner merged 2 commits into
python:mainfrom
vstinner:bytes_join

Conversation

@vstinner

@vstinnervstinner commented Jul 12, 2024

Copy link
Copy Markdown
Member

@vstinner

Copy link
Copy Markdown
MemberAuthor

Comment threadDoc/c-api/bytes.rst Outdated
Comment threadDoc/c-api/bytes.rst
Comment threadDoc/c-api/bytes.rst Outdated
Comment threadDoc/whatsnew/3.14.rst Outdated
Comment threadLib/test/test_capi/test_bytes.py
Comment threadObjects/bytesobject.c
Comment threadDoc/whatsnew/3.14.rst Outdated
@vstinner

Copy link
Copy Markdown
MemberAuthor

@serhiy-storchaka: Please review the updated PR. I tried to address most of your comments.

Comment threadDoc/c-api/bytes.rst Outdated
Comment threadLib/test/test_capi/test_bytes.py Outdated
Comment threadInclude/cpython/bytesobject.h Outdated
Comment threadModules/_io/bufferedio.c
Comment threadLib/test/test_capi/test_bytes.py Outdated
Comment threadObjects/bytesobject.c Outdated
@vstinner

Copy link
Copy Markdown
MemberAuthor

@serhiy-storchaka: I addressed most of your comments, except of the one one the doc:

NULL which is treated as an empty string.

Comment threadObjects/bytesobject.c Outdated
Comment threadDoc/c-api/bytes.rst Outdated

@serhiy-storchakaserhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but please discuss first the behavior for the NULL separator.

Comment threadLib/test/test_capi/test_bytes.py
Comment threadDoc/whatsnew/3.14.rst Outdated
Comment threadDoc/c-api/bytes.rst Outdated
@vstinner

Copy link
Copy Markdown
MemberAuthor

@encukou: I updated the PR to address your review.

@cdce8p

Copy link
Copy Markdown
Contributor

@vstinner This might need a merge / rebase after #122267.

@vstinner

Copy link
Copy Markdown
MemberAuthor

@vstinner This might need a merge / rebase after #122267.

Done.

@vstinner

Copy link
Copy Markdown
MemberAuthor

I created capi-workgroup/decisions#36

* Replace _PyBytes_Join() with PyBytes_Join().
* Keep _PyBytes_Join() as an alias to PyBytes_Join().
@vstinner

Copy link
Copy Markdown
MemberAuthor

I created capi-workgroup/decisions#36

It was decided to reject NULL separator. I updated my PR to respect the C API Working Group decision.

I also rebased the PR to fix merge conflicts.

@erlend-aasland@encukou@serhiy-storchaka: Would you mind to review the updated PR?

@serhiy-storchaka

Copy link
Copy Markdown
Member

Please do not use rebase so later in the review. So I do not see difference with already reviewed code and need to re-read all from the start.

Last two days I have power only for 2 intervals of 2 hours per day, so new review may take a time.

@vstinner

Copy link
Copy Markdown
MemberAuthor

Please do not use rebase so later in the review.

Do you mean that rebasing on main is bad, or is squashing commits which is bad for review? Sorry, I will avoid squashing commits next time.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Normally, I can find a link "changes since your last review". It is the best scenario.

If you rebased without squashing, I can still manually select recent commits. This is less convenient, and there is no guarantee that you did not modify previous commits.

If you squashed commits, all is lost. I do this only immediately after creating commit or pushing new changes, when there is a little chance that my previous change has been reviewed.

@encukouencukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

I second Serhiy's request to not rebase CPython PRs.

@vstinner
vstinner enabled auto-merge (squash) August 30, 2024 12:32
@vstinner
vstinner merged commit 3d60dfb into python:mainAug 30, 2024
@vstinner
vstinner deleted the bytes_join branch August 30, 2024 12:57
@vstinner

Copy link
Copy Markdown
MemberAuthor

Merged, thanks for reviews.

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.

6 participants

@vstinner@cdce8p@serhiy-storchaka@encukou@picnixz@erlend-aasland