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

gh-121645: Add PyBytes_Join() function #121646

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jul 12, 2024

@vstinner
Copy link
Member Author

Doc/c-api/bytes.rst Outdated Show resolved Hide resolved
Doc/c-api/bytes.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.14.rst Outdated Show resolved Hide resolved
Lib/test/test_capi/test_bytes.py Show resolved Hide resolved
Objects/bytesobject.c Outdated Show resolved Hide resolved
Doc/whatsnew/3.14.rst Outdated Show resolved Hide resolved
@vstinner
Copy link
Member Author

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

Doc/c-api/bytes.rst Outdated Show resolved Hide resolved
Lib/test/test_capi/test_bytes.py Outdated Show resolved Hide resolved
Include/cpython/bytesobject.h Outdated Show resolved Hide resolved
Modules/_io/bufferedio.c Show resolved Hide resolved
Lib/test/test_capi/test_bytes.py Outdated Show resolved Hide resolved
Objects/bytesobject.c Outdated Show resolved Hide resolved
@vstinner
Copy link
Member Author

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

NULL which is treated as an empty string.

Objects/bytesobject.c Outdated Show resolved Hide resolved
Doc/c-api/bytes.rst Outdated Show resolved Hide resolved
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

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.

Lib/test/test_capi/test_bytes.py Show resolved Hide resolved
Doc/whatsnew/3.14.rst Outdated Show resolved Hide resolved
Doc/c-api/bytes.rst Outdated Show resolved Hide resolved
@vstinner
Copy link
Member Author

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

@cdce8p
Copy link
Contributor

cdce8p commented Jul 25, 2024

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

@vstinner
Copy link
Member Author

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

Done.

@vstinner
Copy link
Member Author

I created capi-workgroup/decisions#36

* Replace _PyBytes_Join() with PyBytes_Join().
* Keep _PyBytes_Join() as an alias to PyBytes_Join().
@vstinner
Copy link
Member Author

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
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
Member Author

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
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.

Copy link
Member

@encukou encukou left a comment

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:main Aug 30, 2024
37 checks passed
@vstinner vstinner deleted the bytes_join branch August 30, 2024 12:57
@vstinner
Copy link
Member Author

Merged, thanks for reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants