diff options
author | Damien George <damien@micropython.org> | 2023-05-12 23:16:37 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-05-19 13:44:00 +1000 |
commit | ea7031faff9efe6803d8a8f67ad2e3b4a6d390e3 (patch) | |
tree | 71faadf644033b57a5e1339102148719ae20a155 /tests/basics/class_reverse_op.py | |
parent | 4b57330465b98df30ef8a10e19a0e197b5797550 (diff) |
py/runtime: If inplace binop fails then try corresponding normal binop.
The code that handles inplace-operator to normal-binary-operator fallback
is moved in this commit from py/objtype.c to py/runtime.c, making it apply
to all types, not just user classes.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/class_reverse_op.py')
-rw-r--r-- | tests/basics/class_reverse_op.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basics/class_reverse_op.py b/tests/basics/class_reverse_op.py index 11aba6aad..915b3a9ef 100644 --- a/tests/basics/class_reverse_op.py +++ b/tests/basics/class_reverse_op.py @@ -46,3 +46,8 @@ print("a" | B("b")) print("a" + B("b")) print("a" * B("b")) print("a" / B("b")) + +x = "a"; x |= B("b"); print(x) +x = "a"; x += B("b"); print(x) +x = "a"; x *= B("b"); print(x) +x = "a"; x /= B("b"); print(x) |