[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-30 Thread hongweipeng
hongweipeng added the comment: Oh, I see. Thank you. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-29 Thread Ammar Askar
Ammar Askar added the comment: This isn't the ternary form of pow(), the documentation there is referring to the `pow(base, exp, modulus)`. -- nosy: +ammar2 ___ Python tracker

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-29 Thread hongweipeng
hongweipeng added the comment: The document says(https://docs.python.org/3.9/reference/datamodel.html?highlight=__rpow__#object.__rpow__): >Note that ternary pow() will not try calling __rpow__() (the coercion rules >would become too complicated). -- nosy: +hongweipeng

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-28 Thread Alex Shkop
Change by Alex Shkop : -- keywords: +patch pull_requests: +16041 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16459 ___ Python tracker ___

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi
Adi added the comment: Meant to say "... 2 and 3 arguments forms of pow, ..." -- ___ Python tracker ___ ___ Python-bugs-list

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi
Change by Adi : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38302] __rpow__ not reached when __ipow__ returns NotImplemented

2019-09-27 Thread Adi
New submission from Adi : Due to shared code between the 2 and 3 forms of pow, the following code causes a TypeError: class A: def __init__(self, val): self.val = val def __ipow__(self, other): return NotImplemented class B: def __init__(self, val):