-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async #13464
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
Conversation
As you can see from all those If there's a type you're already changing, prefer C99 designated initializers (see asyncio.Future for an aptly named example). Those avoid unused and wrong field names. |
It's not clear to me whether that's intentional or just an oversight. At least,
But then I guess I have to rewrite the type structure completely (I don't think it's sane to combine old-style and C99-style initializers in the same type structure), which is actually worse in terms of backportability and |
It was, in 2009, for Python 3.0. That was a different time.
I'm not comfortable merging it.
Yes. That's why it's better done one type at a time. |
I don't have strong opinion here. If we keep lying comment in many type definitions, |
Let's look at these 4 points individually:
|
CC @benjaminp because you merged #9093. |
The problem with this PR is not the changes it makes, but that no one will fee comfortable merging it becauseit covers too much of the code base at once. |
I don't understand why that's a problem for such a trivial PR like this one. I agree, as a general rule, one shouldn't put too many unrelated changes in one PR. But in the case, the changes are so trivial that I don't see the problem in having them all together.
I don't see why somebody should "take responsibility for" this PR. Maybe I just misunderstand what you mean here. This PR literally only changes comments, so it's extremely improbable that it will break anything. |
@jdemeyer please keep calm. Please split the PR into 109 ones for one module at once.
Sorry, it takes much more work. Maybe some related modules can be addressed by single PR. We can open "easy issue" on https://bugs.python.org to track the change. People will help, sure. |
I also don't see what's objectionable about a large, automated comment-only change. We should review whatever the process was for making it and call it a day. Making 109 one-file PRs doesn't seems like a good use of anyone's time. |
It's not completely automated. Of course, I started with automatic replacements but then I made some minor adjustments (mostly whitespace and fixing a few comments which mentioned |
I disagree because of the reasons that @encukou mentioned. |
Yes, for large changes it's best practice to document how they were made in the commit message. I still think this is fine. The current comments are wrong for those slots. So, even if there are a few things in here that aren't completely correct, it's a strict improvement. |
Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
I'm -0 on the change set. It's a lot of noise, but I won't object if the majority wants to move on with it. |
OK, I changed the commits. The first commit replaces everywhere:
The second commit adds some manual fixes, partially reverting the first one where not applicable (for example in docs, which I plan to fix in #13450). |
I suggest that this is merged either in 3.8 (i.e. very soon now) or not at all. If we merge this in 3.9 but not in 3.8, it's going to be worse for backportability, which is arguably more important in the beta phase than the release phase. |
…async (pythonGH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
Replace
tp_print
bytp_vectorcall_offset
in comments when defining type structures, in all cases where the value is 0. While we're at it, also replacetp_reserved
->tp_as_async
(this was never done systematically) andtp_compare
->tp_as_async
in a few left-over places.This PR is independent from the rest of the PEP 590 implementation.
CC @encukou @markshannon
https://bugs.python.org/issue36974