Skip to content

bpo-39573: Fix bad copy-paste in Py_SET_SIZE. #18496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ the definition of all other Python objects.

.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)

Set the object *o* size of *size*.
Set the object *o* size to *size*.

.. versionadded:: 3.9

Expand Down
6 changes: 3 additions & 3 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
}
#define Py_SET_TYPE(ob, type) _Py_SET_TYPE(_PyObject_CAST(ob), type)

static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t refcnt) {
ob->ob_size = refcnt;
static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
ob->ob_size = size;
}
#define Py_SET_SIZE(ob, refcnt) _Py_SET_SIZE(_PyVarObject_CAST(ob), refcnt)
#define Py_SET_SIZE(ob, size) _Py_SET_SIZE(_PyVarObject_CAST(ob), size)


/*
Expand Down