Perhaps it would be better to provide two customization variables, e.g., ;; -*- emacs-lisp -*- (defcustom org-babel-python-hline-to "None" "Replace hlines in incoming tables with this when translating to python.")
(defcustom org-babel-python-None-to "'hline" "Replace 'None' in python tables with this before returning.") That way users may exercise control over this translation process. I know with R tables it is often desirable to replace missing values with "" or 0. Cheers, Lennart Fricke <pge08...@studserv.uni-leipzig.de> writes: > This patch makes None being treated as hline again. > > Best regards > Lennart Fricke > > diff --git a/lisp/ob-python.el b/lisp/ob-python.el > index 71adf73..a1f834f 100644 > --- a/lisp/ob-python.el > +++ b/lisp/ob-python.el > @@ -123,7 +123,11 @@ specifying a variable of the same value." > "Convert RESULTS into an appropriate elisp value. > If the results look like a list or tuple, then convert them into an > Emacs-lisp table, otherwise return the results as a string." > - (org-babel-script-escape results)) > + ((lambda (res) > + (if (listp res) > + (mapcar (lambda (el) (if (equal el 'None) 'hline el)) res) > + res)) > + (org-babel-script-escape results))) > > (defvar org-babel-python-buffers '((:default . nil))) > -- Eric Schulte http://cs.unm.edu/~eschulte