]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document the lifetime of `PyUnicode_AsUTF8String` (#92325)
authorMatt Wozniski <godlygeek@gmail.com>
Fri, 6 May 2022 09:37:08 +0000 (05:37 -0400)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 09:37:08 +0000 (10:37 +0100)
The current wording implied this, but didn't state it explicitly.

Doc/c-api/unicode.rst

index 00faac5b69abdb43a9c16fe12176e2c409299abb..d139112578ca99652e35d0a60b0c00d99fb0eb98 100644 (file)
@@ -1075,7 +1075,8 @@ These are the UTF-8 codec APIs:
 
    This caches the UTF-8 representation of the string in the Unicode object, and
    subsequent calls will return a pointer to the same buffer.  The caller is not
-   responsible for deallocating the buffer.
+   responsible for deallocating the buffer. The buffer is deallocated and
+   pointers to it become invalid when the Unicode object is garbage collected.
 
    .. versionadded:: 3.3