@@ -265,14 +265,16 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
265265 This function always succeeds.
266266 */
267267
268- PyAPI_FUNC ( PyObject * ) PyObject_Call ( PyObject * callable_object ,
269- PyObject * args , PyObject * kwargs );
268+ /* Call a callable Python object 'callable' with arguments given by the
269+ tuple 'args' and keywords arguments given by the dictionary ' kwargs'.
270270
271- /*
272- Call a callable Python object, callable_object, with
273- arguments and keywords arguments. The 'args' argument can not be
274- NULL.
275- */
271+ 'args' must not be *NULL*, use an empty tuple if no arguments are
272+ needed. If no named arguments are needed, 'kwargs' can be NULL.
273+
274+ This is the equivalent of the Python expression:
275+ callable(*args, **kwargs). */
276+ PyAPI_FUNC (PyObject * ) PyObject_Call (PyObject * callable ,
277+ PyObject * args , PyObject * kwargs );
276278
277279#ifndef Py_LIMITED_API
278280 PyAPI_FUNC (PyObject * ) _PyStack_AsTuple (
@@ -306,7 +308,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
306308 PyObject * * kwnames ,
307309 PyObject * func );
308310
309- /* Call the callable object func with the "fast call" calling convention:
311+ /* Call the callable object 'callable' with the "fast call" calling convention:
310312 args is a C array for positional arguments (nargs is the number of
311313 positional arguments), kwargs is a dictionary for keyword arguments.
312314
@@ -315,11 +317,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
315317
316318 Return the result on success. Raise an exception on return NULL on
317319 error. */
318- PyAPI_FUNC (PyObject * ) _PyObject_FastCallDict (PyObject * func ,
320+ PyAPI_FUNC (PyObject * ) _PyObject_FastCallDict (PyObject * callable ,
319321 PyObject * * args , Py_ssize_t nargs ,
320322 PyObject * kwargs );
321323
322- /* Call the callable object func with the "fast call" calling convention:
324+ /* Call the callable object 'callable' with the "fast call" calling convention:
323325 args is a C array for positional arguments followed by values of
324326 keyword arguments. Keys of keyword arguments are stored as a tuple
325327 of strings in kwnames. nargs is the number of positional parameters at
@@ -335,7 +337,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
335337 Return the result on success. Raise an exception and return NULL on
336338 error. */
337339 PyAPI_FUNC (PyObject * ) _PyObject_FastCallKeywords
338- (PyObject * func ,
340+ (PyObject * callable ,
339341 PyObject * * args ,
340342 Py_ssize_t nargs ,
341343 PyObject * kwnames );
@@ -346,55 +348,54 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
346348#define _PyObject_CallNoArg (func ) \
347349 _PyObject_FastCallDict((func), NULL, 0, NULL)
348350
349- PyAPI_FUNC (PyObject * ) _PyObject_Call_Prepend (PyObject * func ,
351+ PyAPI_FUNC (PyObject * ) _PyObject_Call_Prepend (PyObject * callable ,
350352 PyObject * obj , PyObject * args ,
351353 PyObject * kwargs );
352354
353- PyAPI_FUNC (PyObject * ) _Py_CheckFunctionResult (PyObject * func ,
355+ PyAPI_FUNC (PyObject * ) _Py_CheckFunctionResult (PyObject * callable ,
354356 PyObject * result ,
355357 const char * where );
356358#endif /* Py_LIMITED_API */
357359
358- PyAPI_FUNC (PyObject * ) PyObject_CallObject (PyObject * callable_object ,
360+ /* Call a callable Python object 'callable', with arguments given by the
361+ tuple 'args'. If no arguments are needed, then 'args' can be *NULL*.
362+
363+ Returns the result of the call on success, or *NULL* on failure.
364+
365+ This is the equivalent of the Python expression:
366+ callable(*args) */
367+ PyAPI_FUNC (PyObject * ) PyObject_CallObject (PyObject * callable ,
359368 PyObject * args );
360369
361- /*
362- Call a callable Python object, callable_object, with
363- arguments given by the tuple, args. If no arguments are
364- needed, then args may be NULL. Returns the result of the
365- call on success, or NULL on failure. This is the equivalent
366- of the Python expression: o(*args).
367- */
370+ /* Call a callable Python object, callable, with a variable number of C
371+ arguments. The C arguments are described using a mkvalue-style format
372+ string.
368373
369- PyAPI_FUNC (PyObject * ) PyObject_CallFunction (PyObject * callable_object ,
374+ The format may be NULL, indicating that no arguments are provided.
375+
376+ Returns the result of the call on success, or NULL on failure.
377+
378+ This is the equivalent of the Python expression:
379+ callable(arg1, arg2, ...) */
380+ PyAPI_FUNC (PyObject * ) PyObject_CallFunction (PyObject * callable ,
370381 const char * format , ...);
371382
372- /*
373- Call a callable Python object, callable_object, with a
374- variable number of C arguments. The C arguments are described
375- using a mkvalue-style format string. The format may be NULL,
376- indicating that no arguments are provided. Returns the
377- result of the call on success, or NULL on failure. This is
378- the equivalent of the Python expression: o(*args).
379- */
383+ /* Call the method named 'name' of object 'obj' with a variable number of
384+ C arguments. The C arguments are described by a mkvalue format string.
380385
386+ The format can be NULL, indicating that no arguments are provided.
381387
382- PyAPI_FUNC (PyObject * ) PyObject_CallMethod (PyObject * o ,
383- const char * method ,
384- const char * format , ...);
388+ Returns the result of the call on success, or NULL on failure.
385389
386- /*
387- Call the method named m of object o with a variable number of
388- C arguments. The C arguments are described by a mkvalue
389- format string. The format may be NULL, indicating that no
390- arguments are provided. Returns the result of the call on
391- success, or NULL on failure. This is the equivalent of the
392- Python expression: o.method(args).
393- */
390+ This is the equivalent of the Python expression:
391+ obj.name(arg1, arg2, ...) */
392+ PyAPI_FUNC (PyObject * ) PyObject_CallMethod (PyObject * obj ,
393+ const char * name ,
394+ const char * format , ...);
394395
395396#ifndef Py_LIMITED_API
396- PyAPI_FUNC (PyObject * ) _PyObject_CallMethodId (PyObject * o ,
397- _Py_Identifier * method ,
397+ PyAPI_FUNC (PyObject * ) _PyObject_CallMethodId (PyObject * obj ,
398+ _Py_Identifier * name ,
398399 const char * format , ...);
399400
400401 /*
@@ -406,44 +407,45 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
406407 PyAPI_FUNC (PyObject * ) _PyObject_CallFunction_SizeT (PyObject * callable ,
407408 const char * format ,
408409 ...);
409- PyAPI_FUNC (PyObject * ) _PyObject_CallMethod_SizeT (PyObject * o ,
410+ PyAPI_FUNC (PyObject * ) _PyObject_CallMethod_SizeT (PyObject * obj ,
410411 const char * name ,
411412 const char * format ,
412413 ...);
413414#ifndef Py_LIMITED_API
414- PyAPI_FUNC (PyObject * ) _PyObject_CallMethodId_SizeT (PyObject * o ,
415- _Py_Identifier * name ,
416- const char * format ,
417- ...);
415+ PyAPI_FUNC (PyObject * ) _PyObject_CallMethodId_SizeT (PyObject * obj ,
416+ _Py_Identifier * name ,
417+ const char * format ,
418+ ...);
418419#endif /* !Py_LIMITED_API */
419420
421+ /* Call a callable Python object 'callable' with a variable number of C
422+ arguments. The C arguments are provided as PyObject* values, terminated
423+ by a NULL.
424+
425+ Returns the result of the call on success, or NULL on failure.
426+
427+ This is the equivalent of the Python expression:
428+ callable(arg1, arg2, ...) */
420429 PyAPI_FUNC (PyObject * ) PyObject_CallFunctionObjArgs (PyObject * callable ,
421430 ...);
422431
423432 /*
424- Call a callable Python object, callable_object, with a
425- variable number of C arguments. The C arguments are provided
426- as PyObject * values, terminated by a NULL. Returns the
427- result of the call on success, or NULL on failure. This is
428- the equivalent of the Python expression: o(* args).
433+ Call the method named 'name' of object 'obj' with a variable number of
434+ C arguments. The C arguments are provided as PyObject *
435+ values, terminated by NULL. Returns the result of the call
436+ on success, or NULL on failure. This is the equivalent of
437+ the Python expression: obj.name( args).
429438 */
430439
431-
432- PyAPI_FUNC ( PyObject * ) PyObject_CallMethodObjArgs ( PyObject * o ,
433- PyObject * method , ...);
440+ PyAPI_FUNC ( PyObject * ) PyObject_CallMethodObjArgs ( PyObject * obj ,
441+ PyObject * name ,
442+ ...);
434443#ifndef Py_LIMITED_API
435- PyAPI_FUNC (PyObject * ) _PyObject_CallMethodIdObjArgs (PyObject * o ,
436- struct _Py_Identifier * method ,
444+ PyAPI_FUNC (PyObject * ) _PyObject_CallMethodIdObjArgs (PyObject * obj ,
445+ struct _Py_Identifier * name ,
437446 ...);
438447#endif /* !Py_LIMITED_API */
439448
440- /*
441- Call the method named m of object o with a variable number of
442- C arguments. The C arguments are provided as PyObject *
443- values, terminated by NULL. Returns the result of the call
444- on success, or NULL on failure. This is the equivalent of
445- the Python expression: o.method(args).
446- */
447449
448450
449451 /* Implemented elsewhere:
0 commit comments