From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id YGVMOakRF2fSRgEA62LTzQ:P1 (envelope-from ) for ; Tue, 22 Oct 2024 02:44:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YGVMOakRF2fSRgEA62LTzQ (envelope-from ) for ; Tue, 22 Oct 2024 04:44:58 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BLBnXx1b; 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=1729565097; a=rsa-sha256; cv=none; b=M7Tv6tEJCjedSkO7hreBrKq1oFmB8sC00e/t3Lc2GHzhXGfdsIulKM3GZdTJzdDZviul3J uXi7qGh7b2uCC9gAKp9q/BEPc5FJFpS0LG7w++0rxGbyUByafT/iDjFCMCudKCUFYix7zz lKMr+QcfBAH4ctaBDjLsGNZMmLrSWzxo+UYVyx+9+ETVx/S86K57FKPJWADVuaSNGQghQz CM1NkdtiXav6/6lS6NjDFB6CNjrmrd8rAQ0phF8iwDT/DkPzlll81XZBRDtvA1Oo9RKlTn MXONdyxtdxGa6zfRX1evt+BLod3DMfEXebEXdPY6PNZDUjp3Ifeqc2F2o9b2/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BLBnXx1b; 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=1729565097; 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=N8Ez6vvtBK/NK17d/BtMAdGs9sRlrRBud3ctZmQLXpk=; b=l4fFYP/LhOgmKpPKUoyTs4FHjJJs+Bn+zoaFVrU+9cmcNiXmoRSe4lm7ejb0eXUSu4227F 4YTjpRTRlzTCaUmYOaPhoUyjABJHt9a+FEjHpgkBxxl80MvCgr55c9ArNaP0DMaiZzJGe9 WMpZ1KmVH1oNvL6b4d5Kxkliz7RtvQdFuK6P5jJE35DfBJsMf6Gn6ivPfHoRfiBsSYJ+sm yltNFbhWxI+sVoD3ftgxKwZp74REfvN8UmPosMtzSvR2QWjfSNiE4xmGmgxxq0qbBuiEmI lkeH7fN1EAm+RrMgBNnojXkwRsGhSRikxyTfqAYvccsE2yVe/tdduC0Qhh9aXw== 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 7E4ED1EC99 for ; Tue, 22 Oct 2024 04:44:57 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t34sG-0006SR-3Q; Mon, 21 Oct 2024 22:43:56 -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 1t34sE-0006S4-Ic for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 22:43:54 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t34sD-0004Id-4t for emacs-orgmode@gnu.org; Mon, 21 Oct 2024 22:43:54 -0400 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-7ea7d509e61so2192128a12.1 for ; Mon, 21 Oct 2024 19:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729565031; x=1730169831; 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=N8Ez6vvtBK/NK17d/BtMAdGs9sRlrRBud3ctZmQLXpk=; b=BLBnXx1b06dCU+Ai+YRfibBnpzuPNrOXt+rckvwczpWPJsz+hA88aWJlsubkwYC6Dx ahMsz/c//5GB/dUhoSEFpypiUajPmxNaWjlZZ5gi3VWCqLZQ2eOgcO7m0xfrtiFg01UM R0JOsQR3FizDvjCVOdtetj9Vj/r3Q+G2GET/cLJwBQcQzDpZZQZTpjC1G8h8WlXo+c7Z qRMskFBhU8pqoiLuAtxdI8ysjRPudTcQ2jezqD6zk5R4SNLfTciLnTFxYSwo1V4AmKdZ gejg9uBUGOjBZc5MXIhdjqtQpFxQa/ojV/OuuI+wX/dDbNFqAAAQgq5M4wn1Nc+kvScc Ct3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729565031; x=1730169831; 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=N8Ez6vvtBK/NK17d/BtMAdGs9sRlrRBud3ctZmQLXpk=; b=ROVbQEspNpjWpyk6XTpB+xNqyF1oPNPe/hfJJSivIP6qikaGx152V4Upy/Rp/WFceM aVn7KOrIqX64dSKjTwFZojWGdS3aVlOk83kpYMt/4Xe5AQrpfuVWd1XtopTO/91xp4Qw 2TQWA/5eKbMUfIcFhKARBDmqVXQ5Qb+V7DNxuXR64grurikyYgoGuYnyeMpib05cOlHy /JCQDLN9OLPmz8f9oKghmU6aaN8RxamtI1dtDYb/d5FLMMOs5m+qpJD0pPuSGFqPWl5g 5YUTayUzH/zdWRXvH//4aYRlaGMXtytAdpRF+2K8okxiJrEUFw+/7St2XAtvcUMH/5YV mPoA== X-Forwarded-Encrypted: i=1; AJvYcCWjWjGXhD81vZxXwLiM6bqKQLIW7dh7SSIAKCAlZe6/zbT+BmDGxyVhxcmw7c1UQTp9nOH+9Ko/fpvJ0u6O@gnu.org X-Gm-Message-State: AOJu0YwVcxdbpDuhdJt3qpiwaw4Q4HnopNnC5W3glo9iXse7AN9PdjgW Od8zaGvkG3/clHgeh4NFTJ/q51ZH2r84zbXNvqEyRZUdj5y0cIEb X-Google-Smtp-Source: AGHT+IEu54HMNCAJe2LlzcI9v+DOMOcw9fEai1vGBdahLzDm/Z68eOrdYjboqtG/4WNh9Zc9ssT9FA== X-Received: by 2002:a05:6a21:2fc7:b0:1d9:d04:586d with SMTP id adf61e73a8af0-1d96b83f27emr2501108637.38.1729565031200; Mon, 21 Oct 2024 19:43:51 -0700 (PDT) Received: from localhost ([198.27.183.102]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13d7544sm3755813b3a.140.2024.10.21.19.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 19:43:50 -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: <877ca19vvv.fsf@localhost> References: <87y143x4q0.fsf@web.de> <87plo4z0vi.fsf@localhost> <87bjzf45g5.fsf@gmail.com> <8734krru39.fsf@localhost> <874j563shr.fsf@gmail.com> <877ca19vvv.fsf@localhost> Date: Mon, 21 Oct 2024 19:43:49 -0700 Message-ID: <871q08502i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52e.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.55 X-Spam-Score: -1.55 X-Migadu-Queue-Id: 7E4ED1EC99 X-Migadu-Scanner: mx12.migadu.com X-TUID: yymtdV0Mwjw+ Ihor Radchenko writes: >> 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. > > May we detect if there is a return statement? That's a nice idea, I like it. Probably there should be a customization `org-babel-python-nonsession-return-style', which could take on the values 'require-return (old behavior), 'last-statement (session style), or 'auto (detect if there is return statement). While technically a breaking change, I think 'auto would be a reasonable default, since it would only change the behavior on the unusual edge case where the user deliberately returned "None" by omitting a return statement.