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

bpo-44392: Add Py_GenericAlias to C API docs #26724

Merged
merged 10 commits into from Jun 16, 2021

Conversation

Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jun 14, 2021

https://bugs.python.org/issue44392

@Fidget-Spinner Fidget-Spinner requested a review from a team as a code owner Jun 14, 2021
@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 14, 2021

BTW, I also noticed the stable ABI manifest exposes the wrong return type for Py_GenericAliasType. It exposes it as a function when it's a var/type/struct. So I fixed that in the PR too otherwise the docs weren't compiling. But that means the exported symbol for Windows is also modified.

Doc/c-api/typehints.rst Outdated Show resolved Hide resolved
@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 15, 2021

BTW, I also noticed the stable ABI manifest exposes the wrong return type for Py_GenericAliasType. It exposes it as a function when it's a var/type/struct. So I fixed that in the PR too otherwise the docs weren't compiling. But that means the exported symbol for Windows is also modified.

@encukou, is this alright with you and can I backport this? I was wondering if such a change to the stable ABI (for a bugfix) is okay.

@encukou
Copy link
Member

encukou commented Jun 15, 2021

Yes, fine with me, as long as it's backported to 3.10. This is a documentation change, except the function is not marked as DATA for the MSVC export. I'm not sure of the exact ABI impact of that, but it was clearly wrong before and we fixed things like this for 3.10.

cc @pablogsal: another ABI-related change for 3.10.

@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 15, 2021

Yes, fine with me, as long as it's backported to 3.10. This is a documentation change, except the function is not marked as DATA for the MSVC export. I'm not sure of the exact ABI impact of that, but it was clearly wrong before and we fixed things like this for 3.10.

cc @pablogsal: another ABI-related change for 3.10.

Great, thanks for your advice. I created a separate PR GH-26739 to fix the stable ABI errors and make backporting this docfix PR easier (it needs to land in 3.9 too). That will need to be merged first before this PR.

@pablogsal
Copy link
Member

pablogsal commented Jun 15, 2021

cc @pablogsal: another ABI-related change for 3.10.

As we are before beta 4, this is still ok to me, but please, backport this before Thursday so it goes into beta 3.

Copy link
Member

@gvanrossum gvanrossum left a comment

Thanks! Here are some suggestions. What do you think? Otherwise this looks good!

Doc/c-api/typehints.rst Outdated Show resolved Hide resolved
Doc/c-api/typehints.rst Outdated Show resolved Hide resolved
Doc/c-api/typehints.rst Outdated Show resolved Hide resolved
Doc/c-api/typehints.rst Outdated Show resolved Hide resolved
Doc/c-api/typehints.rst Show resolved Hide resolved
Fidget-Spinner and others added 3 commits Jun 16, 2021
Co-Authored-By: Guido van Rossum <[email protected]>
Co-Authored-By: Guido van Rossum <[email protected]>
@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 16, 2021

Thanks! Here are some suggestions. What do you think? Otherwise this looks good!

Thanks for the review and suggestions. I think they make sense so they're added.

@gvanrossum gvanrossum merged commit 6773c3e into python:main Jun 16, 2021
12 of 13 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jun 16, 2021

Thanks @Fidget-Spinner for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒🤖 I'm not a witch! I'm not a witch!

@bedevere-bot
Copy link

bedevere-bot commented Jun 16, 2021

GH-26756 is a backport of this pull request to the 3.10 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 16, 2021
Also fix stable ABI type definitions
(cherry picked from commit 6773c3e)

Co-authored-by: Ken Jin <[email protected]>
@gvanrossum
Copy link
Member

gvanrossum commented Jun 16, 2021

I don't know why the Address Sanitizer test is failing but I don't think it was your code, so I've merged regardless. Now on to the backport(s).

@Fidget-Spinner
Copy link
Member Author

Fidget-Spinner commented Jun 16, 2021

I don't know why the Address Sanitizer test is failing but I don't think it was your code, so I've merged regardless. Now on to the backport(s).

Yeah I noticed it passed at first, then failed after I added a blurb entry, which probably means it was something else.

This doesn't affect much, but I initially split off the C API changes into GH-26739 which was supposed to be merged first (along with a separate news entry). However, since you already merged this PR, we don't need that anymore.

Thanks for the merge, and I'll work on the docs only backport to 3.9 :). This needs some manual work.

@Fidget-Spinner Fidget-Spinner deleted the genericalias_stableabi branch Jun 16, 2021
miss-islington added a commit that referenced this pull request Jun 16, 2021
Also fix stable ABI type definitions
(cherry picked from commit 6773c3e)

Co-authored-by: Ken Jin <[email protected]>
Fidget-Spinner added a commit to Fidget-Spinner/cpython that referenced this pull request Jun 16, 2021
miss-islington pushed a commit that referenced this pull request Jun 16, 2021
jdevries3133 pushed a commit to jdevries3133/cpython that referenced this pull request Jun 19, 2021
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.

None yet

8 participants