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

Skip to content

Commit ebea998

Browse files
committed
Uniformize argument names of "call" functions
* Callable object: callable, o, callable_object => func * Object for method calls: o => obj * Method name: name or nameid => method Cleanup also the C code: * Don't initialize variables to NULL if they are not used before their first assignement * Add braces for readability
1 parent 356ae17 commit ebea998

4 files changed

Lines changed: 93 additions & 90 deletions

File tree

Include/abstract.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
257257

258258
/* Declared elsewhere
259259
260-
PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
260+
PyAPI_FUNC(int) PyCallable_Check(PyObject *obj);
261261
262-
Determine if the object, o, is callable. Return 1 if the
262+
Determine if the object, obj, is callable. Return 1 if the
263263
object is callable and 0 otherwise.
264264
265265
This function always succeeds.
266266
*/
267267

268-
PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object,
268+
PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *func,
269269
PyObject *args, PyObject *kwargs);
270270

271271
#ifndef Py_LIMITED_API
@@ -344,7 +344,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
344344
_PyObject_FastCall((func), &(arg), 1)
345345

346346
PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func,
347-
PyObject *obj, PyObject *args,
347+
PyObject *arg0, PyObject *args,
348348
PyObject *kwargs);
349349

350350
PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func,
@@ -353,27 +353,27 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
353353
#endif /* Py_LIMITED_API */
354354

355355
/*
356-
Call a callable Python object, callable_object, with
356+
Call a callable Python object, func, with
357357
arguments and keywords arguments. The 'args' argument can not be
358358
NULL.
359359
*/
360360

361-
PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object,
361+
PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *func,
362362
PyObject *args);
363363

364364
/*
365-
Call a callable Python object, callable_object, with
365+
Call a callable Python object, func, with
366366
arguments given by the tuple, args. If no arguments are
367367
needed, then args may be NULL. Returns the result of the
368368
call on success, or NULL on failure. This is the equivalent
369369
of the Python expression: o(*args).
370370
*/
371371

372-
PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
372+
PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *func,
373373
const char *format, ...);
374374

375375
/*
376-
Call a callable Python object, callable_object, with a
376+
Call a callable Python object, func, with a
377377
variable number of C arguments. The C arguments are described
378378
using a mkvalue-style format string. The format may be NULL,
379379
indicating that no arguments are provided. Returns the
@@ -382,7 +382,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
382382
*/
383383

384384

385-
PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o,
385+
PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj,
386386
const char *method,
387387
const char *format, ...);
388388

@@ -396,7 +396,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
396396
*/
397397

398398
#ifndef Py_LIMITED_API
399-
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o,
399+
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
400400
_Py_Identifier *method,
401401
const char *format, ...);
402402

@@ -406,36 +406,36 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
406406
*/
407407
#endif /* !Py_LIMITED_API */
408408

409-
PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
409+
PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *func,
410410
const char *format,
411411
...);
412-
PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o,
413-
const char *name,
412+
PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *obj,
413+
const char *method,
414414
const char *format,
415415
...);
416416
#ifndef Py_LIMITED_API
417-
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o,
418-
_Py_Identifier *name,
417+
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj,
418+
_Py_Identifier *method,
419419
const char *format,
420420
...);
421421
#endif /* !Py_LIMITED_API */
422422

423-
PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
423+
PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *func,
424424
...);
425425

426426
/*
427-
Call a callable Python object, callable_object, with a
427+
Call a callable Python object, func, with a
428428
variable number of C arguments. The C arguments are provided
429429
as PyObject * values, terminated by a NULL. Returns the
430430
result of the call on success, or NULL on failure. This is
431431
the equivalent of the Python expression: o(*args).
432432
*/
433433

434434

435-
PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
435+
PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *obj,
436436
PyObject *method, ...);
437437
#ifndef Py_LIMITED_API
438-
PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o,
438+
PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *obj,
439439
struct _Py_Identifier *method,
440440
...);
441441
#endif /* !Py_LIMITED_API */

Include/ceval.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
1414
#define PyEval_CallObject(func,arg) \
1515
PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
1616

17-
PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj,
17+
PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *func,
1818
const char *format, ...);
1919
PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
20-
const char *methodname,
20+
const char *method,
2121
const char *format, ...);
2222

2323
#ifndef Py_LIMITED_API

0 commit comments

Comments
 (0)