From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id QEcFBTfuFWentQAAqHPOHw:P1 (envelope-from ) for ; Mon, 21 Oct 2024 06:01:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id QEcFBTfuFWentQAAqHPOHw (envelope-from ) for ; Mon, 21 Oct 2024 08:01:27 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Al8Sux6O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729490487; a=rsa-sha256; cv=none; b=WJFnL609CWFXGsS2kl235A3ka68lcXuUPgd+qi26Fr21QaziP8w5y9srbNfE2EeGSmvJ5h orcX99+8qCHeG3InhsMOhbBdPxLE2hKdtMDwBYNKXsFU8ll4i7xhwmLHQYctY3xqzMaXDg 3IibJ4lfCHL0O5N7MWs8hld+KaDblWWSRicnsU9AbNbvOFJXdjgtiyJxp6YuTA4Fak4e0g 47a7K9YjqcXzzyLYVwZkRNTTOjLGAQYIBWIGTOEeXU4ycE77uozk4J/zdtVIotLkU/3th8 ZhPl4KH6ucSg6io5h1VpHCYWyGIH4Y/WR6blkS/7t5R5Dmy6SJsmh+Ts8lRipg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Al8Sux6O; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729490487; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Uhul5SkugqeH3+ywD8V5MAuHzT9/pw9VMV7pDge7vMA=; b=aNAbxAIMznkU+3+oQrKa8RbCc34/WWAIqMuETGSz5ZFDDtdb4KteOAlzs4rf0KwZbl0Vnk OYFMciAogTA0Gh8qJiyAkFt/4fWCuhrfayjsCpOxLE4lakSLgRL2okBmTakj6hsZLdpwl4 Imtf9z4e7Xsk7Gr3UIIvddKt8elr3aOWhEQr84NI+i6rndGel13g7qZ964dIumDuIs50Gd rkN4zCqFoVO9ZCpP/pnvmEl2od3H7XgzxUEkVdz52vvuy7O13ofyoNvXKvDQBrEkpTuoFk gFhhafSxRCGg/F3mbMITSya/92lSHPAtpC7h9NyK1087jum8vAReV30fFi1JzQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AA27270D53 for ; Mon, 21 Oct 2024 08:01:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t2lT4-0002tM-6C; Mon, 21 Oct 2024 02:00:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t2lT3-0002t4-7H for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 02:00:37 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t2lT1-0005cC-Nf for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 02:00:36 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-718e9c8bd83so3480775b3a.1 for ; Sun, 20 Oct 2024 23:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729490434; x=1730095234; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Uhul5SkugqeH3+ywD8V5MAuHzT9/pw9VMV7pDge7vMA=; b=Al8Sux6OOhqoxGWI4OGAPlrwJLkspl8OQ4TZQIZV2Uqk/HQ5wRwgvgOoH9G8oocQms iiIUQmgrOdpkVTPsJtJwM0IgdGtpRR+5NWfQsh67xzOHctw9lFwVESuRXht8SepVJfRb 0BcZgHEp4gukN9T4q7YiN76ubQ7CmcgL60e1/2uZG5hb16ps0wRxavH9mGohss0y5soB 83oVck54y5Jkp6GT20q3szzksNY6XSDYkIYZwGiZCxOuecb0qopVswSFDQWL7zyT65gu 4EtDsR1dKrHCs3+TcBdf6FX9OUE6dH1wzIJkKoaNopDiLep0WTDy9Md+3a9JzyU/KqOG jarQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729490434; x=1730095234; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uhul5SkugqeH3+ywD8V5MAuHzT9/pw9VMV7pDge7vMA=; b=v8UzByFYqktAijMQ5H8BAJ78x+tZYYcnZaYLv0yaaq+QhWVpVsGon+lZKTEsSgFBdI qnWXQnwA6Y4X6z9uiRUOHJrRBEdxBDhFaDy03IJb2zD7+gVbhw7d5irQ+sZ6pBItDNF2 Wee4xlLkdeviyQUhz1dacILCLsphlxsxtP/q+vV4e2c27V6GFiQYAy9CC646OwGyQs4N u/MdzgZnAFn4gUH2epqcvPh7rHP4KR8PqMlrVPPsuvQi/5iqJTaMRjgp+MicUiPQpBD4 DeJ2fpRXmh/cnWN03J6CnKPTTIaiZrBP5Q2Wb32UuwTwMgL7s9Br1w5dJHV2FyrEs8nM tmPA== X-Forwarded-Encrypted: i=1; AJvYcCVHSEjCCE8AmxYauabamxG67qMVZ1GEyo8cGpnhOB01kKVrx3vRYXs/k9gE0bMflwO7bqlz31Xc2k3fen/Q@gnu.org X-Gm-Message-State: AOJu0YwnFL/ORgQ8+xVe9T1cL420auPEa6QDrh9o2HWJZiP9dcd7UQzx iJ1v0cU+Sa5DcbslxJ4LAhA3b22VqG7ZyyDHM8TNldA2vp9y3BAz X-Google-Smtp-Source: AGHT+IHUe6IYtK83m02ueJARd38md7nKEMph06HQ0KP/AFqzw7waXQi9kl+7vQ9hrWtFAwMO+uQK9w== X-Received: by 2002:a05:6a00:2d18:b0:71e:71ba:9056 with SMTP id d2e1a72fcca58-71ea425995dmr14228483b3a.10.1729490434003; Sun, 20 Oct 2024 23:00:34 -0700 (PDT) Received: from localhost ([198.27.183.102]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec132fef0sm2070891b3a.63.2024.10.20.23.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Oct 2024 23:00:33 -0700 (PDT) From: Jack Kamm To: Ihor Radchenko Cc: "Dr. Arne Babenhauserheide" , Rudolf =?utf-8?Q?Adamko?= =?utf-8?Q?vi=C4=8D?= , emacs-orgmode@gnu.org Subject: Re: Org Babel says 1 + 1 in Python is None In-Reply-To: <8734krru39.fsf@localhost> References: <87y143x4q0.fsf@web.de> <87plo4z0vi.fsf@localhost> <87bjzf45g5.fsf@gmail.com> <8734krru39.fsf@localhost> Date: Sun, 20 Oct 2024 23:00:32 -0700 Message-ID: <874j563shr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=jackkamm@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.60 X-Spam-Score: -5.60 X-Migadu-Queue-Id: AA27270D53 X-Migadu-Scanner: mx10.migadu.com X-TUID: p5TUAcY6iMqz Ihor Radchenko writes: > I'm afraid that trying to replicate Python REPL behavior for > non-interactive src blocks will be beyond what we can reasonably do in > Org: we would somehow need to detect the last statement in the src > blocks, which may or may not span a single line; and multiline statements > will need to use some kind of Python parser. All this sounds way too > fragile to be practical. Well, ob-python sessions implement this sort of parser in `org-babel-python-format-session-value', which AFAIK is robust. I think it would be feasible to switch non-session blocks to use this parser, which IMO is nicer behavior -- the "return" statements always felt weird to me. But a major reason not to do it is to avoid breaking compatibility. Lots of old ob-python nonsession blocks with "return" statements out there. But perhaps we could implement an option to switch nonsession value to the session value behavior (omitting "return"). The default behavior should remain unchanged (requiring "return"), but in the long term we could consider changing the default if there is consensus for it. (I likely don't have bandwidth to implement such an option in the near term, but would be supportive if anyone wants to have a go at it).