Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92024d1

Browse files
committed
Clarify the description of the creation of an owned reference from an API
function. This closes SF bug #486657.
1 parent 99181ac commit 92024d1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Doc/ext/extending.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,11 +1291,11 @@ \subsection{Ownership Rules
12911291
Most functions that return a reference to an object pass on ownership
12921292
with the reference. In particular, all functions whose function it is
12931293
to create a new object, such as \cfunction{PyInt_FromLong()} and
1294-
\cfunction{Py_BuildValue()}, pass ownership to the receiver. Even if in
1295-
fact, in some cases, you don't receive a reference to a brand new
1296-
object, you still receive ownership of the reference. For instance,
1297-
\cfunction{PyInt_FromLong()} maintains a cache of popular values and can
1298-
return a reference to a cached item.
1294+
\cfunction{Py_BuildValue()}, pass ownership to the receiver. Even if
1295+
the object is not actually new, you still receive ownership of a new
1296+
reference to that object. For instance, \cfunction{PyInt_FromLong()}
1297+
maintains a cache of popular values and can return a reference to a
1298+
cached item.
12991299

13001300
Many functions that extract objects from other objects also transfer
13011301
ownership with the reference, for instance

0 commit comments

Comments
 (0)