From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 79BNOI4KBmpMejoAWB0awg (envelope-from ) for ; Thu, 14 May 2026 13:46:54 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=HoGLEG1E; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D91C81E067; Thu, 14 May 2026 13:46:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 23CAE1E067 for ; Thu, 14 May 2026 13:46:53 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C99054BB8F63 for ; Thu, 14 May 2026 17:46:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C99054BB8F63 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=HoGLEG1E Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 2ACFB4B92080 for ; Thu, 14 May 2026 17:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2ACFB4B92080 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2ACFB4B92080 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778780775; cv=none; b=Gd+ne+llKAdHkOBDpFTS264bZOQFdX5yCLyHBOycCklPQTUmJmA0MTgG5BCpdpy3/LQobeen8HBtYqX5PHPjYeJhjWX7njIDuIb0N26OaqL8m7LvTTmVtZBjZ/mNwrEHQTkKItvjLRN0rON9dCwmgvjS7O/HGYMNX92UHRQ4F5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778780775; c=relaxed/simple; bh=kjjVmVO5vqrLHyvHC0uJwwjNqD2dVmiU3TSGTCER/Cw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mnQbsLLDkflF6biUBJAKLY86ul5VrgGs7zeUoAbyvWQemhVeX0lhH0ORwHhCn6UOhrCTIUQLH0a0y1PULFMh/2WBNwl9QUMDjakksJzfM2YhOLgY92FwjUNOzFuvLx+w6T9edb7WZin+3Srl1X/fHT6T7koIPtRIboOfQk2xlP8= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=HoGLEG1E reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2ACFB4B92080 Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id NZiTw4BcMnwj2Na8Uwiw17; Thu, 14 May 2026 17:46:14 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Na8Twtik7tuVJNa8TwMJpV; Thu, 14 May 2026 17:46:13 +0000 X-Authority-Analysis: v=2.4 cv=BNWzrEQG c=1 sm=1 tr=0 ts=6a060a65 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=NGcC8JguVDcA:10 a=ItBw4LHWJt0A:10 a=FN29zFJxScpU5LZLdM4A:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xKpi/vT+5IV1+2ucY2dI0X/RmHJgHS/mimi6CfuLU7k=; b=HoGLEG1EjAXKw3d5UVukfZ7B6l 9yeSEchhF70qtz37b6TRv0pQW9leSsd3aUPl7NbcDbR3q5uopySmprCPWenEfUKXnCaoOUJA5SEui RuJZ45YbDsw9efRgBAhkpLTmy; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:54206 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wNa8S-00000000Qu8-3S61; Thu, 14 May 2026 11:46:12 -0600 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 1/2] [gdb/python] Introduce py_none/py_true/py_false functions In-Reply-To: <20260513163005.3997485-2-tdevries@suse.de> (Tom de Vries's message of "Wed, 13 May 2026 18:30:04 +0200") References: <20260513163005.3997485-1-tdevries@suse.de> <20260513163005.3997485-2-tdevries@suse.de> X-Attribution: Tom Date: Thu, 14 May 2026 11:46:06 -0600 Message-ID: <87qzndkhpd.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wNa8S-00000000Qu8-3S61 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:54206 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCm4asY0HIWELY0FN5oLi9hMtbC8e9K/RXL4jU4mcPuc9I7DXkLGBHHEZOS2Z4/yBjXglw7ywtvZjI+e9ngHmHX0kXct7GbVsprQNtyu9FHeJEaoUzD7 stmT2XC104y4yCSWOh4CO6tLkQiXwsqZxI3vX0/Mut5sZyem9kG5mV8P0Udrl3OwntDxdGZlma95s1QbDtlgY8wWw552mcu66ro= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Tom" == Tom de Vries writes: Tom> +/* The following three functions are refcount-safe wrappers around Tom> + Py_RETURN_{NONE,TRUE,FALSE}. Starting with python 3.12, None, True and Tom> + False are immortal, and increasing and decreasing refcount for such object Tom> + is a no-op, but while supporting older versions we ignore that aspect Tom> + here. */ This comment is mildly incorrect in that using gdbpy_ref<> inherently implies a decref. Immortality of Python objects isn't really a concern at the API level. It's an implementation detail of the Python interpreter. The rest of the patch seems ok to me. I'm not a huge fan of immediately-evaluated lambdas but OTOH it's probably harmless here. + return gdbpy_ref<> ([] { Py_RETURN_FALSE; } ()); +} #endif /* GDB_PYTHON_PYTHON_INTERNAL_H */ Newline between the closing brace and the #endif please. thanks, Tom