]> granicus.if.org Git - python/commit
It's a fact: for binary operators, *under certain circumstances*,
authorGuido van Rossum <guido@python.org>
Fri, 28 Sep 2001 23:49:48 +0000 (23:49 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 28 Sep 2001 23:49:48 +0000 (23:49 +0000)
commit4bb1e36eec19b30f2e582fceffa250e1598262e1
tree0ba999260cfc7eaa6f9ce6a7e9f251d79edcf1e7
parent9bea3abf0d7c658a95a92a295c82d5bf0b583f08
It's a fact: for binary operators, *under certain circumstances*,
__rop__ now takes precendence over __op__.  Those circumstances are:

  - Both arguments are new-style classes
  - Both arguments are new-style numbers
  - Their implementation slots for tp_op differ
  - Their types differ
  - The right argument's type is a subtype of the left argument's type

Also did this for the ternary operator (pow) -- only the binary case
is dealt with properly though, since __rpow__ is not supported anyway.
Lib/test/test_descr.py
Objects/abstract.c