summaryrefslogtreecommitdiff
path: root/modules/language/python/format2.scm
diff options
context:
space:
mode:
Diffstat (limited to 'modules/language/python/format2.scm')
-rw-r--r--modules/language/python/format2.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/language/python/format2.scm b/modules/language/python/format2.scm
index 70ee212..4a9af31 100644
--- a/modules/language/python/format2.scm
+++ b/modules/language/python/format2.scm
@@ -63,7 +63,14 @@
(if (and (number? x) (integer? x))
(list->string (list (integer->char x)))
x)))
- ("s" (lambda (x) (scm-format #f "~a" x)))
+
+ ("s" (lambda (x)
+ (if (is-a? x <p>)
+ (aif it (ref x '__str__)
+ (scm-format #f "~a" (it))
+ (scm-format #f "~a" x))
+ (scm-format #f "~a" x))))
+
("a" (lambda (x) (scm-format #f "~a" x)))
("r" (lambda (x) (scm-format #f "~a" x)))
("%"