diff options
author | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-10-02 23:20:56 +0200 |
---|---|---|
committer | Stefan Israelsson Tampe <stefan.itampe@gmail.com> | 2017-10-02 23:20:56 +0200 |
commit | 3533d6037dd7d83a1f9ee250138d0ebf1bccc062 (patch) | |
tree | 29cd01ca96012b652b23916bf6321ee4e24bc454 /modules/language/python/dir.scm | |
parent | ac7d9a507124df0e67b7d234d4e3ee519f968947 (diff) |
complex numbers
Diffstat (limited to 'modules/language/python/dir.scm')
-rw-r--r-- | modules/language/python/dir.scm | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/language/python/dir.scm b/modules/language/python/dir.scm index a1c77c9..1189673 100644 --- a/modules/language/python/dir.scm +++ b/modules/language/python/dir.scm @@ -127,14 +127,22 @@ (pylist-sort! l) l) l1))) + +(define-method (dir (o <py-complex>)) + (let ((l1 (pycomplex-listing))) + (if (is-a? o <p>) + (let* ((l2 (next-method)) + (l (+ l1 l2))) + (pylist-sort! l) + l) + l1))) (define-method (dir (o <hashtable> )) (pyhash-listing)) (define-method (dir (o <string> )) (pystring-listing)) -(define-method (dir (o <complex> )) - (if (integer? o) - (pyint-listing) - (pyfloat-listing))) +(define-method (dir (o <complex> )) (pycomplex-listing)) +(define-method (dir (o <real> )) (pyfloat-listing)) +(define-method (dir (o <integer> )) (pyint-listing)) (define-method (dir) (let ((l '())) |