We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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__(other Object) Object {
115
+ b, ok := other.(*Set)
116
+ if !ok {
117
+ return NotImplemented
118
+ }
119
+ if len(a.items) != len(b.items) {
120
+ return False
121
122
+ // FIXME nasty O(n**2) algorithm, waiting for proper hashing!
123
+ for i := range a.items {
124
+ for j := range b.items {
125
+ if Eq(i, j) == True {
126
+ goto found
127
128
129
130
+ found:
131
132
+ return True
133
+}
134
135
+func (a *Set) M__ne__(other Object) Object {
136
+ if a.M__eq__(other) == True {
137
138
139
140
0 commit comments