emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Possible bug: (mis)handling tuples for :return value in Python [7.4 (release_7.4.153.ga0b8)]
@ 2011-02-24 14:22 Scott May
  2011-02-27 21:30 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Scott May @ 2011-02-24 14:22 UTC (permalink / raw)
  To: emacs-orgmode

I do not think that =org-babel-read= is correctly handling Python
tuples that are returned from source blocks.

If I execute the following source block:
#+begin_src python :results value
  return (1,2)
#+end_src

I get the following error message:
: Symbol's function definition is void: 1\,

The Python output for this source block is =(1,2)=, which =org-babel-read=
interprets as lisp and tries to eval.

I can work around the problem using either a Python list:
#+begin_src python :results value
  return [1,2]
#+end_src

or by using =:results output=
#+begin_src python :results output :session
  (1,2)
#+end_src

Regards,
Scott


Emacs  : GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.21.6)
 of 2010-09-01 on rhenium, modified by Debian
Package: Org-mode version 7.4 (release_7.4.529.gb23d)



      

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [babel] Possible bug: (mis)handling tuples for :return value in Python [7.4 (release_7.4.153.ga0b8)]
  2011-02-24 14:22 [babel] Possible bug: (mis)handling tuples for :return value in Python [7.4 (release_7.4.153.ga0b8)] Scott May
@ 2011-02-27 21:30 ` Eric Schulte
  2011-02-28 13:22   ` Scott May
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2011-02-27 21:30 UTC (permalink / raw)
  To: Scott May; +Cc: emacs-orgmode

Scott May <bscottmay@yahoo.com> writes:

> I do not think that =org-babel-read= is correctly handling Python
> tuples that are returned from source blocks.
>
> If I execute the following source block:
> #+begin_src python :results value
>   return (1,2)
> #+end_src
>
> I get the following error message:
> : Symbol's function definition is void: 1\,
>
> The Python output for this source block is =(1,2)=, which =org-babel-read=
> interprets as lisp and tries to eval.
>
> I can work around the problem using either a Python list:
> #+begin_src python :results value
>   return [1,2]
> #+end_src
>
> or by using =:results output=
> #+begin_src python :results output :session
>   (1,2)
> #+end_src
>
> Regards,
> Scott
>

Hi Scott,

This issue has come up a couple of times recently.  I just pushed up a
fix.  Please let me know if you run into any further issues.

Thanks -- Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [babel] Possible bug: (mis)handling tuples for :return value in Python [7.4 (release_7.4.153.ga0b8)]
  2011-02-27 21:30 ` Eric Schulte
@ 2011-02-28 13:22   ` Scott May
  0 siblings, 0 replies; 3+ messages in thread
From: Scott May @ 2011-02-28 13:22 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

> 
> Hi  Scott,
> 
> This issue has come up a couple of times recently.  I just  pushed up a
> fix.  Please let me know if you run into any further  issues.
> 
> Thanks -- Eric
> 

Eric,

It works now. Thanks! 

Cheers,
Scott



      

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-28 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-24 14:22 [babel] Possible bug: (mis)handling tuples for :return value in Python [7.4 (release_7.4.153.ga0b8)] Scott May
2011-02-27 21:30 ` Eric Schulte
2011-02-28 13:22   ` Scott May

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).