• Guido van Rossum's avatar
    It's a fact: for binary operators, *under certain circumstances*, · f4704655
    Guido van Rossum authored
    __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.
    f4704655
test_descr.py 63.4 KB