10000 Document the lifetime of `PyUnicode_AsUTF8String` (#92325) · python/cpython@740da8d · GitHub
[go: up one dir, main page]

Skip to content

Commit 740da8d

Browse files
authored
Document the lifetime of PyUnicode_AsUTF8String (#92325)
The current wording implied this, but didn't state it explicitly.
1 parent ebaf094 commit 740da8d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/c-api/unicode.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,8 @@ These are the UTF-8 codec APIs:
10751075
10761076
This caches the UTF-8 representation of the string in the Unicode object, and
10771077
subsequent calls will return a pointer to the same buffer. The caller is not
1078-
responsible for deallocating the buffer.
1078+
responsible for deallocating the buffer. The buffer is deallocated and
1079+
pointers to it become invalid when the Unicode object is garbage collected.
10791080
10801081
.. versionadded:: 3.3
10811082

0 commit comments

Comments
 (0)
0