File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,12 +99,7 @@ many other useful protocols.
9999How do I use Py_BuildValue() to create a tuple of arbitrary length?
100100-------------------------------------------------------------------
101101
102- You can't. Use ``t = PyTuple_New(n) `` instead, and fill it with objects using
103- ``PyTuple_SetItem(t, i, o) `` -- note that this "eats" a reference count of
104- ``o ``, so you have to :c:func: `Py_INCREF ` it. Lists have similar functions
105- ``PyList_New(n) `` and ``PyList_SetItem(l, i, o) ``. Note that you *must * set all
106- the tuple items to some value before you pass the tuple to Python code --
107- ``PyTuple_New(n) `` initializes them to NULL, which isn't a valid Python value.
102+ You can't. Use :c:func: `PyTuple_Pack ` instead.
108103
109104
110105How do I call an object's method from C?
You can’t perform that action at this time.
0 commit comments