summaryrefslogtreecommitdiff
path: root/modules/language/python/set.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-11 20:07:51 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2017-10-11 20:07:51 +0200
commitac93ca810e2fe04a5dc56a415e8d9a836ce151f9 (patch)
tree8bcf72cafb81b858601e5f6c55c092c1096b3a1d /modules/language/python/set.scm
parentad7e9183675e07d8e0698f7c064858a6052ebc7d (diff)
equal magics
Diffstat (limited to 'modules/language/python/set.scm')
-rw-r--r--modules/language/python/set.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/language/python/set.scm b/modules/language/python/set.scm
index d69b7c9..ef4abe7 100644
--- a/modules/language/python/set.scm
+++ b/modules/language/python/set.scm
@@ -198,7 +198,14 @@
(let* ((d (slot-ref self 'dict))
(t (slot-ref d 't)))
(not (eq? miss (py-hash-ref t x miss))))))
-
+
+ (define __eq__
+ (lambda (self x)
+ (and
+ (is-a? x <p>)
+ (eq? (ref self '__class__ 1) (ref x '__class__ 2))
+ (equal? (ref self 'd 1) (ref x 'd 2)))))
+
(define __iter__
(make-generator (self)
(lambda (yield self)