summaryrefslogtreecommitdiff
path: root/modules/language/python/set.scm
diff options
context:
space:
mode:
authorStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-04-15 22:29:50 +0200
committerStefan Israelsson Tampe <stefan.itampe@gmail.com>2018-04-15 22:29:50 +0200
commit77e4e51a919c50e2847527aaffe67e8e19b970ae (patch)
tree61a261e5b053da07493610b947fd8b51e1a8c2f4 /modules/language/python/set.scm
parent7c0c098b89dc33ad1018b6542def4e2d34ddd2a8 (diff)
progressively imporoving the conformance with python3
Diffstat (limited to 'modules/language/python/set.scm')
-rw-r--r--modules/language/python/set.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/language/python/set.scm b/modules/language/python/set.scm
index 5582d36..2f3b7cc 100644
--- a/modules/language/python/set.scm
+++ b/modules/language/python/set.scm
@@ -224,6 +224,22 @@
(t (slot-ref d 't)))
(not (eq? miss (py-hash-ref t x miss))))))
+ (define __and__
+ (lambda (self op)
+ (intersection self op)))
+
+ (define __or__
+ (lambda (self op)
+ (union self op)))
+
+ (define __sub__
+ (lambda (self op)
+ (difference self op)))
+
+ (define __xor__
+ (lambda (self op)
+ (symmetric_difference self op)))
+
(define __eq__
(lambda (self x)
(and