From f4207042e45726aef75a41ee34c6ad9d2f9c4f6d Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Wed, 26 Feb 2025 12:08:09 -0800 Subject: [PATCH] Revise pycore_stackref.h comments. Remove comment about "strict stack discipline". Clarify that a stolen reference is invalid afterwards. --- Include/internal/pycore_stackref.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/internal/pycore_stackref.h b/Include/internal/pycore_stackref.h index 92b10d21100a25..e961b17960a380 100644 --- a/Include/internal/pycore_stackref.h +++ b/Include/internal/pycore_stackref.h @@ -32,13 +32,13 @@ extern "C" { unboxed integers harder in the future. Steal means that ownership is transferred to something else. The total - number of references to the object stays the same. + number of references to the object stays the same. The old reference is no + longer valid. New creates a new reference from the old reference. The old reference is still valid. - With these 3 API, a strict stack discipline must be maintained. All - _PyStackRef must be operated on by the new reference operations: + All _PyStackRef must be operated on by the new reference operations: 1. DUP 2. CLOSE