@@ -78,7 +78,7 @@ function::function(
78
78
if (num_keywords != 0 )
79
79
{
80
80
for (unsigned j = 0 ; j < keyword_offset; ++j)
81
- PyTuple_SET_ITEM (m_arg_names.ptr (), j, incref (Py_None));
81
+ PyTuple_SetItem (m_arg_names.ptr (), j, incref (Py_None));
82
82
}
83
83
84
84
for (unsigned i = 0 ; i < num_keywords; ++i)
@@ -96,7 +96,7 @@ function::function(
96
96
kv = make_tuple (p->name );
97
97
}
98
98
99
- PyTuple_SET_ITEM (
99
+ PyTuple_SetItem (
100
100
m_arg_names.ptr ()
101
101
, i + keyword_offset
102
102
, incref (kv.ptr ())
@@ -122,7 +122,7 @@ function::~function()
122
122
123
123
PyObject* function::call (PyObject* args, PyObject* keywords) const
124
124
{
125
- std::size_t n_unnamed_actual = PyTuple_GET_SIZE (args);
125
+ std::size_t n_unnamed_actual = PyTuple_Size (args);
126
126
std::size_t n_keyword_actual = keywords ? PyDict_Size (keywords) : 0 ;
127
127
std::size_t n_actual = n_unnamed_actual + n_keyword_actual;
128
128
@@ -167,28 +167,28 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
167
167
168
168
// Fill in the positional arguments
169
169
for (std::size_t i = 0 ; i < n_unnamed_actual; ++i)
170
- PyTuple_SET_ITEM (inner_args.get (), i, incref (PyTuple_GET_ITEM (args, i)));
170
+ PyTuple_SetItem (inner_args.get (), i, incref (PyTuple_GetItem (args, i)));
171
171
172
172
// Grab remaining arguments by name from the keyword dictionary
173
173
std::size_t n_actual_processed = n_unnamed_actual;
174
174
175
175
for (std::size_t arg_pos = n_unnamed_actual; arg_pos < max_arity ; ++arg_pos)
176
176
{
177
177
// Get the keyword[, value pair] corresponding
178
- PyObject* kv = PyTuple_GET_ITEM (f->m_arg_names .ptr (), arg_pos);
178
+ PyObject* kv = PyTuple_GetItem (f->m_arg_names .ptr (), arg_pos);
179
179
180
180
// If there were any keyword arguments,
181
181
// look up the one we need for this
182
182
// argument position
183
183
PyObject* value = n_keyword_actual
184
- ? PyDict_GetItem (keywords, PyTuple_GET_ITEM (kv, 0 ))
184
+ ? PyDict_GetItem (keywords, PyTuple_GetItem (kv, 0 ))
185
185
: 0 ;
186
186
187
187
if (!value)
188
188
{
189
189
// Not found; check if there's a default value
190
- if (PyTuple_GET_SIZE (kv) > 1 )
191
- value = PyTuple_GET_ITEM (kv, 1 );
190
+ if (PyTuple_Size (kv) > 1 )
191
+ value = PyTuple_GetItem (kv, 1 );
192
192
193
193
if (!value)
194
194
{
@@ -203,7 +203,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
203
203
++n_actual_processed;
204
204
}
205
205
206
- PyTuple_SET_ITEM (inner_args.get (), arg_pos, incref (value));
206
+ PyTuple_SetItem (inner_args.get (), arg_pos, incref (value));
207
207
}
208
208
209
209
if (inner_args.get ())
0 commit comments