From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Jack Kamm <jackkamm@gmail.com>
Cc: Bastien <bzg@gnu.org>, org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] (Tiny) Tweak Python session null return value
Date: Mon, 17 Feb 2020 12:52:43 -0500 [thread overview]
Message-ID: <CAJ51ETosGFnpYJibQVVMXes_48LfsV5YSWFaosHGFpUxf3g4=A@mail.gmail.com> (raw)
In-Reply-To: <87a75hfah9.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]
I think None is correct. If you don't specify a return value in Python,
then a function returns None. I would expect that to happen in a Python
block too.
John
-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
On Mon, Feb 17, 2020 at 11:25 AM Jack Kamm <jackkamm@gmail.com> wrote:
> Hi,
>
> Below is a very small patch to Python session blocks, to make them
> return a blank result (empty string) instead of None when there is no
> return value.
>
> Normally I would push this myself, but since we are so close to 9.4, I
> thought it prudent to mail a patch and let the maintainers handle it. It
> would be nice to include in 9.4, but not a big deal if I've missed the
> window.
>
> Now for an explanation of the patch: 9.4 changes Python session blocks
> to fix several bugs and improve robustness overall [0]. However, there
> is a cost to these fixes, which is that the session blocks can only
> return a result when it is a top-level expression on the last line of
> the block. If the last line is not a top-level expression, the block
> would previously print "None". However, after some testing, I think this
> is a little counter-intuitive, and it would be better if it returned a
> blank (empty) result instead of "None".
>
> [0] https://lists.gnu.org/archive/html/emacs-orgmode/2020-01/msg00190.html
>
> Best,
> Jack
>
>
>
[-- Attachment #2: Type: text/html, Size: 2332 bytes --]
next prev parent reply other threads:[~2020-02-17 17:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-17 16:24 [PATCH] (Tiny) Tweak Python session null return value Jack Kamm
2020-02-17 17:42 ` Bastien
2020-02-17 19:07 ` Jack Kamm
2020-02-17 22:53 ` Bastien
2020-02-17 17:52 ` John Kitchin [this message]
2020-02-17 19:05 ` Jack Kamm
2020-02-17 19:45 ` John Kitchin
2020-02-17 20:45 ` Jack Kamm
2020-02-17 22:27 ` John Kitchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ51ETosGFnpYJibQVVMXes_48LfsV5YSWFaosHGFpUxf3g4=A@mail.gmail.com' \
--to=jkitchin@andrew.cmu.edu \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=jackkamm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.