summaryrefslogtreecommitdiff
path: root/tests/basics/class_reverse_op.py
AgeCommit message (Collapse)Author
2023-05-19py/runtime: If inplace binop fails then try corresponding normal binop.Damien George
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>
2023-05-19py/objstr: Return unsupported binop instead of raising TypeError.Damien George
So that user types can implement reverse operators and have them work with str on the left-hand-side, eg `"a" + UserType()`. Signed-off-by: Damien George <damien@micropython.org>
2019-10-29tests/basics: Use str.format instead of % for formatting messages.Damien George
Only use % formatting when testing % itself, because only str.format is guaranteed to be available on any port.
2017-09-10tests/class_reverse_op: Test for reverse arith ops special methods.Paul Sokolovsky
This test should be run only if support for reverse ops is enabled, so the corresponding feature_check is added to run-tests.