diff options
author | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-10-11 20:07:51 +0200 |
---|---|---|
committer | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-10-11 20:07:51 +0200 |
commit | ac93ca810e2fe04a5dc56a415e8d9a836ce151f9 (patch) | |
tree | 8bcf72cafb81b858601e5f6c55c092c1096b3a1d /modules/language/python/set.scm | |
parent | ad7e9183675e07d8e0698f7c064858a6052ebc7d (diff) |
equal magics
Diffstat (limited to 'modules/language/python/set.scm')
-rw-r--r-- | modules/language/python/set.scm | 9 |
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) |