From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Kamm Subject: Re: [PATCH] (Tiny) Tweak Python session null return value Date: Mon, 17 Feb 2020 11:05:44 -0800 Message-ID: <877e0lf307.fsf@gmail.com> References: <87a75hfah9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51691) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3ljK-0007Zn-MV for emacs-orgmode@gnu.org; Mon, 17 Feb 2020 14:06:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3ljJ-0004w6-MF for emacs-orgmode@gnu.org; Mon, 17 Feb 2020 14:06:54 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin Cc: Bastien , org-mode-email Hi John, John Kitchin writes: > 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. Hmm, OK, thanks for your intuition, it's useful feedback. Working this out loud, I was considering the following sort of block: #+begin_src python :session :results value if some_condition: True else: False #+end_src #+RESULTS: : None Ideally, it would return True/False, but the current implementation cannot grab that result unfortunately. (In its defense, it at least doesn't crash like it did before). I was thinking not printing anything at all under "#+RESULTS" would be less surprising than printing "None". But both are admittedly surprising at first. I agree your preference of returning "None" is the more technically consistent behavior though. I don't want to rush a decision now, I think I need to gather more user feedback after the 9.4 release. I'll ask Bastien to revert that commit and put this off to 9.5, rather than writing an updated NEWS entry like he asked. Either way, we'll need to update Worg to clearly document what's going on here.