aboutsummaryrefslogtreecommitdiff
path: root/tests/float/complex_special_mehods.py
blob: 6789013fa6e0dc8a369fcb7d10988a6eefee1ce2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# test complex interacting with special methods


class A:
    def __add__(self, x):
        print("__add__")
        return 1

    def __radd__(self, x):
        print("__radd__")
        return 2


print(A() + 1j)
print(1j + A())