Skip to content

Commit df663ca

Browse files
author
aleksandr.tseluyko
committed
gh-145860: Document steal semantics in header declarations
Add comments to _PyInterpolation_Build and _PyTemplate_Build declarations in pycore_interpolation.h and pycore_template.h.
1 parent 8cc4cc6 commit df663ca

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Include/internal/pycore_interpolation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern PyTypeObject _PyInterpolation_Type;
1313

1414
#define _PyInterpolation_CheckExact(op) Py_IS_TYPE((op), &_PyInterpolation_Type)
1515

16+
// Steals references to value, str, and format_spec (even on failure).
1617
PyAPI_FUNC(PyObject *) _PyInterpolation_Build(PyObject *value, PyObject *str,
1718
int conversion, PyObject *format_spec);
1819

Include/internal/pycore_template.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern PyTypeObject _PyTemplateIter_Type;
1717

1818
extern PyObject *_PyTemplate_Concat(PyObject *self, PyObject *other);
1919

20+
// Steals references to strings and interpolations (even on failure).
2021
PyAPI_FUNC(PyObject *) _PyTemplate_Build(PyObject *strings, PyObject *interpolations);
2122

2223
#ifdef __cplusplus

0 commit comments

Comments
 (0)