We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44242f0 commit 4a7ad17Copy full SHA for 4a7ad17
py/set.go
@@ -110,3 +110,31 @@ var _ I__bool__ = (*Set)(nil)
110
var_I__iter__= (*Set)(nil)
111
112
// var _ richComparison = (*Set)(nil)
113
+
114
+func (a*Set) M__eq__(otherObject) Object{
115
+b, ok:=other.(*Set)
116
+if!ok{
117
+returnNotImplemented
118
+ }
119
+iflen(a.items) !=len(b.items){
120
+returnFalse
121
122
+// FIXME nasty O(n**2) algorithm, waiting for proper hashing!
123
+fori:=rangea.items{
124
+forj:=rangeb.items{
125
+ifEq(i, j) ==True{
126
+goto found
127
128
129
130
+ found:
131
132
+returnTrue
133
+}
134
135
+func (a*Set) M__ne__(otherObject) Object{
136
+ifa.M__eq__(other) ==True{
137
138
139
140
0 commit comments