[issue36379] nb_inplace_pow is always called with an invalid argument

2021-01-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: I'm pretty sure this is fixed for 3.8+. whether or not it should be considered a bugfix and backported to 3.7.x is probably too late at this point in release lifecycles anyways. thanks for raising this and the fixing PR! -- nosy: +gregory.p.smith

[issue36379] nb_inplace_pow is always called with an invalid argument

2020-08-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: Zackery, should this be closed? Or is there something missing from the patch? -- ___ Python tracker ___ _

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-05-31 Thread miss-islington
miss-islington added the comment: New changeset c7f803b08ed5211701c75f98ba9ada85d45ac155 by Miss Islington (bot) (Zackery Spytz) in branch 'master': bpo-36379: __ipow__ must be a ternaryfunc, not a binaryfunc (GH-13546) https://github.com/python/cpython/commit/c7f803b08ed5211701c75f98ba9ada85

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-05-24 Thread Zackery Spytz
Zackery Spytz added the comment: I've created a PR for this issue (with tests). -- nosy: +ZackerySpytz ___ Python tracker ___ ___ P

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-05-24 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +13458 stage: needs patch -> patch review ___ Python tracker ___ ___ Py

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-04-02 Thread Josh Rosenberg
Josh Rosenberg added the comment: skrah: Is there any reason your patch, as written, wouldn't work? If you need a test case to verify, gmpy2's xmpz type supports in place pow (but requires the modulus to be None, since there is no normal way to pass it anyway), so you can just test: >>>

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
Change by Stefan Krah : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: Ok, got it. I think __ipow__ should be a ternaryfunc, like so: diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 403f3caaee..914d076b5c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -7032,7 +7032,7 @@ static slotdef slotdefs[] = {

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Zuzu_Typ
Zuzu_Typ added the comment: This isn't about the CPython Interpreter, it's about the C-API, the APIT for writing c-extensions for Python. I know it works in CPython. -- ___ Python tracker _

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Stefan Krah
Stefan Krah added the comment: Like Josh I don't quite understand the problem description. This for example works: >>> class C(int): ... def __ipow__(self, other, mod=None): ... return pow(self, other, mod) ... >>> >>> x = C(10) >>> x 10 >>> x **= 3 >>> x 1000 -- nosy: +

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Zuzu_Typ
Zuzu_Typ added the comment: Even though __ipow__ might be documented to take a third argument, if you build an inplace_pow function using the C-API, you can only pass one argument to it. You can see that in the attached screenshot. The example class shown in the screenshot can be found here:

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: object.__ipow__ is documented to take an optional third argument (though there is no way to pass it aside from explicitly calling __ipow__ directly since there is no syntax support for three-arg pow, in place or otherwise), so it's not some incompatibility w

[issue36379] nb_inplace_pow is always called with an invalid argument

2019-03-20 Thread Zuzu_Typ
New submission from Zuzu_Typ : Using the C-API, the inplace_pow numbermethod is always called with the third argument pointing to an invalid address. The reason is likely that self.__ipow__ only takes one argument, resulting in a binaryfunc (self, arg), though inplace_pow is a ternaryfunc. Wh