File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,15 +85,35 @@ def __div__(self, other):
8585 def __xor__ (self , other ):
8686 print ("__xor__ called" )
8787
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+
8896cud1 = Cud ()
8997cud2 = Cud ()
98+
9099str (cud1 )
91100cud1 < cud2
92101cud1 <= cud2
93102cud1 == cud2
94103cud1 >= cud2
95104cud1 > cud2
96105cud1 + 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
97117
98118# TODO: the following operations are not supported on every ports
99119#
@@ -103,48 +123,21 @@ def __xor__(self, other):
103123# binary and is not supported
104124# cud1 & cud2
105125#
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- #
112126# binary lshift is not supported
113127# cud1<<1
114128#
115129# modulus is not supported
116130# cud1 % 2
117131#
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- #
127132# binary or is not supported
128133# cud1 | cud2
129134#
130- # pos is not supported on the qemu arm port
131- # +cud1
132- #
133135# pow is not supported
134136# cud1**2
135137#
136138# rshift is not suported
137139# cud1>>1
138140#
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- #
148141# xor is not supported
149142# cud1^cud2
150143#
You can’t perform that action at this time.
0 commit comments