summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/class_reverse_op.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-09-10 17:05:20 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-09-10 17:05:57 +0300
commiteb84a830df62813f5af7f0144fc77444bf18f3a8 (patch)
treec75036150f3584486bc2064572faa2fe2750ae8c /tests/basics/class_reverse_op.py
parentde981040b392685b0d7f2381a63526b71e633b9c (diff)
downloadmicropython-eb84a830df62813f5af7f0144fc77444bf18f3a8.tar.gz
micropython-eb84a830df62813f5af7f0144fc77444bf18f3a8.zip
py/runtime: Implement dispatch for "reverse op" special methods.
If, for class X, X.__add__(Y) doesn't exist (or returns NotImplemented), try Y.__radd__(X) instead. This patch could be simpler, but requires undoing operand swap and operation switch to get non-confusing error message in case __radd__ doesn't exist.
Diffstat (limited to 'tests/basics/class_reverse_op.py')
0 files changed, 0 insertions, 0 deletions