Uh oh!
There was an error while loading. Please reload this page.
PEP 590: Correct sign of return value of PyVectorcall_NARGS(). - #1105
PEP 590: Correct sign of return value of PyVectorcall_NARGS().#1105markshannon wants to merge 1 commit into
Conversation
I argue that it should remain |
jdemeyer
commented
Jun 14, 2019
For future reference: I think it's good to put all authors of a PEP in CC when proposing a change to a PEP. |
We all agreed that the size of |
jdemeyer
commented
Jun 17, 2019
As you can see from #1066 (comment), this was intentional. We didn't forget to change the return type. |
jdemeyer
commented
Jun 17, 2019
I don't see why. It's a cast from an unsigned number to a signed number of the same size. This doesn't change the bit pattern of the number, so why there should there be any overhead? To support |
markshannon
commented
Jun 23, 2019
Compare the GCC output for the form with and without the cast: https://www.godbolt.org/z/GG3Pmy
|
jdemeyer
commented
Jun 23, 2019
Comparing unoptimized code is not very relevant. When you compile even with |
jdemeyer
commented
Jun 23, 2019
Maybe you're right. I'm not even arguing about that. I'm just saying that using |
jdemeyer
commented
Jun 23, 2019
By the way: that looks like a very cool site, I didn't know about it. Thanks! |
encukou
commented
Jun 24, 2019
Indeed, FWIW, I grew to like the practical hack: as it's done now, you're likely to get a compiler warning when mixing "arguments with the offset flag" and "just number of arguments" inappropriately. |
jdemeyer
commented
Jun 24, 2019
+1 |
jdemeyer
commented
Jul 4, 2019
Can we get some resolution on this please? There is no point in keeping this PR open if it doesn't look like it will be accepted. |
encukou
commented
Jul 5, 2019
Yes. Please re-open if there's more to discuss. (Or comment, if you can't reopen.) |
The return type of
PyVectorcall_NARGS()is documented atPy_ssize_tbut it makes no sense for this to be a signed value, for two reasons.