summaryrefslogtreecommitdiff
path: root/modules/language/python/string.scm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/language/python/string.scm')
-rw-r--r--modules/language/python/string.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/language/python/string.scm b/modules/language/python/string.scm
index 6c31f1e..829e3a2 100644
--- a/modules/language/python/string.scm
+++ b/modules/language/python/string.scm
@@ -293,7 +293,7 @@
(()
(string-trim s))
((x . _)
- (let ((l (map (lambda (x) (if (string? x) (string-ref x 0) x)) x)))
+ (let ((l (map (lambda (x) (if (string? x) (string-ref x 0) x)) l)))
(string-trim s (lambda (ch) (member ch l)))))))
(define-py (py-rstrip rstrip s . l)
@@ -535,16 +535,20 @@
(define-python-class string (<py-string>)
(define __init__
(case-lambda
- ((self s)
+ ((self s)
(cond
((is-a? s <py-string>)
- (slot-ref s 'src))
+ (slot-ref s 'str))
((is-a? s <string>)
s)
(else
- (__init__ self ((@ (guile) format) #f "~a" s)))))))
+ (aif it (ref s '__str__)
+ (it)
+ (__init__ self ((@ (guile) format) #f "~a" s))))))))
- (define __new__ (lambda x (apply __init__ x)))
+ (define __new__
+ (lambda x
+ (apply __init__ x)))
(define __repr__
(lambda (self)