File tree Expand file tree Collapse file tree 1 file changed +20
-27
lines changed Expand file tree Collapse file tree 1 file changed +20
-27
lines changed Original file line number Diff line number Diff line change @@ -85,15 +85,35 @@ def __div__(self, other):
85
85
def __xor__ (self , other ):
86
86
print ("__xor__ called" )
87
87
88
+ def __iadd__ (self , other ):
89
+ print ("__iadd__ called" )
90
+ return self
91
+
92
+ def __isub__ (self , other ):
93
+ print ("__isub__ called" )
94
+ return self
95
+
88
96
cud1 = Cud ()
89
97
cud2 = Cud ()
98
+
90
99
str (cud1 )
91
100
cud1 < cud2
92
101
cud1 <= cud2
93
102
cud1 == cud2
94
103
cud1 >= cud2
95
104
cud1 > cud2
96
105
cud1 + cud2
106
+ cud1 - cud2
107
+
108
+ # the following require MICROPY_PY_ALL_SPECIAL_METHODS
109
+ + cud1
110
+ - cud1
111
+ ~ cud1
112
+ cud1 * cud2
113
+ cud1 / cud2
114
+ cud2 // cud1
115
+ cud1 += cud2
116
+ cud1 -= cud2
97
117
98
118
# TODO: the following operations are not supported on every ports
99
119
#
@@ -103,48 +123,21 @@ def __xor__(self, other):
103
123
# binary and is not supported
104
124
# cud1 & cud2
105
125
#
106
- # floor div is not supported on the qemu arm port
107
- # cud2 // cud1
108
- #
109
- # inv is not supported on the qemu arm port
110
- # ~cud1
111
- #
112
126
# binary lshift is not supported
113
127
# cud1<<1
114
128
#
115
129
# modulus is not supported
116
130
# cud1 % 2
117
131
#
118
- # mult is not supported on the qemu arm port
119
- # cud1 * cud2
120
- #
121
- # mult is not supported on the qemu arm port
122
- # cud1 * 2
123
- #
124
- # inv is not supported on the qemu arm port
125
- # -cud1
126
- #
127
132
# binary or is not supported
128
133
# cud1 | cud2
129
134
#
130
- # pos is not supported on the qemu arm port
131
- # +cud1
132
- #
133
135
# pow is not supported
134
136
# cud1**2
135
137
#
136
138
# rshift is not suported
137
139
# cud1>>1
138
140
#
139
- # sub is not supported on the qemu arm port
140
- # cud1 - cud2
141
- #
142
- # div is not supported on the qemu arm port
143
- # cud1 / cud2
144
- #
145
- # div is not supported on the qemu arm port
146
- # cud1 / 2
147
- #
148
141
# xor is not supported
149
142
# cud1^cud2
150
143
#
You can’t perform that action at this time.
0 commit comments