Uh oh!
There was an error while loading. Please reload this page.
bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async - #13464
Conversation
encukou
commented
May 22, 2019
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. |
jdemeyer
commented
May 22, 2019
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 |
encukou
commented
May 22, 2019
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. |
methane
commented
May 22, 2019
I don't have strong opinion here. If we keep lying comment in many type definitions, |
jdemeyer
commented
May 28, 2019
Let's look at these 4 points individually:
|
jdemeyer
commented
May 28, 2019
CC @benjaminp because you merged #9093. |
markshannon
commented
May 28, 2019
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. |
jdemeyer
commented
May 28, 2019
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. |
asvetlov
commented
May 28, 2019
@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. |
benjaminp
commented
May 28, 2019
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. |
jdemeyer
commented
May 28, 2019
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 |
jdemeyer
commented
May 28, 2019
I disagree because of the reasons that @encukou mentioned. |
benjaminp
commented
May 29, 2019
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
tiran
commented
May 29, 2019
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. |
jdemeyer
commented
May 29, 2019
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). |
jdemeyer
commented
May 30, 2019
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_printbytp_vectorcall_offsetin 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_asyncin 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