Say that I evaluate the following Python code:
import inspect
import scipy.ndimage.filters
list (inspect.getargspec (scipy.ndimage.filters.gaussian_filter1d))
# => [['input', 'sigma', 'axis', 'order', 'output', 'mode', 'cval'],
# None, None, (-1, 0, None, 'reflect', 0.0)]
I'd like to transform the output string, which is simply Python's
print output, to an Elisp data structure. So I need a function foo
that does this:
(foo "[['input', 'sigma', 'axis', 'order', 'output', 'mode', 'cval'], None, None, (-1, 0, None, 'reflect', 0.0)]")
;; =>
;; (("input"
;; "sigma"
;; "axis"
;; "order"
;; "output"
;; "mode"
;; "cval")
;; nil
;; nil
;; (-1 0 nil "reflect" 0.0))
While it's not hard to write a version of foo
that works for this
specific instance, I wonder if there's a library that does this in a
generic way, i.e. it is able to handle any complex Python structure.