This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: typo in Object/abstract.c : ternary_op
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: douady, rhettinger
Priority: normal Keywords:

Created on 2002-11-24 22:35 by douady, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg13454 - (view) Author: Cesar Douady (douady) Date: 2002-11-24 22:35
in file Object/abstract.c, in function ternary_op, in
the second test which computes slotw :
    	if (w->ob_type != v->ob_type &&
    	    mv != NULL && NEW_STYLE_NUMBER(w)) {
    	    ^^^
the test for mv is obviously a typo and should be
replaced by mw :
    	if (w->ob_type != v->ob_type &&
    	    mw != NULL && NEW_STYLE_NUMBER(w)) {
    	    ^^^
This gives an inconsistent behavior of the ** operator
which refuses to use the __rpow__ method when the first
operand does not have a number methods.

msg13455 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2002-12-07 10:16
Logged In: YES 
user_id=80475

Added testcase and fixed code:
  abstract.c 2.110 and 2.93.6.9
  test_pow.py 1.16 and 1.13.14.1

Marking as fixed and closing bug.
History
Date User Action Args
2022-04-10 16:05:56adminsetgithub: 37529
2002-11-24 22:35:23douadycreate