Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python3....
File: abstract.h
#ifndef Py_ABSTRACTOBJECT_H
[0] Fix | Delete
#define Py_ABSTRACTOBJECT_H
[1] Fix | Delete
#ifdef __cplusplus
[2] Fix | Delete
extern "C" {
[3] Fix | Delete
#endif
[4] Fix | Delete
[5] Fix | Delete
#ifdef PY_SSIZE_T_CLEAN
[6] Fix | Delete
#define PyObject_CallFunction _PyObject_CallFunction_SizeT
[7] Fix | Delete
#define PyObject_CallMethod _PyObject_CallMethod_SizeT
[8] Fix | Delete
#ifndef Py_LIMITED_API
[9] Fix | Delete
#define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
[10] Fix | Delete
#endif /* !Py_LIMITED_API */
[11] Fix | Delete
#endif
[12] Fix | Delete
[13] Fix | Delete
/* Abstract Object Interface (many thanks to Jim Fulton) */
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
PROPOSAL: A Generic Python Object Interface for Python C Modules
[17] Fix | Delete
[18] Fix | Delete
Problem
[19] Fix | Delete
[20] Fix | Delete
Python modules written in C that must access Python objects must do
[21] Fix | Delete
so through routines whose interfaces are described by a set of
[22] Fix | Delete
include files. Unfortunately, these routines vary according to the
[23] Fix | Delete
object accessed. To use these routines, the C programmer must check
[24] Fix | Delete
the type of the object being used and must call a routine based on
[25] Fix | Delete
the object type. For example, to access an element of a sequence,
[26] Fix | Delete
the programmer must determine whether the sequence is a list or a
[27] Fix | Delete
tuple:
[28] Fix | Delete
[29] Fix | Delete
if(is_tupleobject(o))
[30] Fix | Delete
e=gettupleitem(o,i)
[31] Fix | Delete
else if(is_listitem(o))
[32] Fix | Delete
e=getlistitem(o,i)
[33] Fix | Delete
[34] Fix | Delete
If the programmer wants to get an item from another type of object
[35] Fix | Delete
that provides sequence behavior, there is no clear way to do it
[36] Fix | Delete
correctly.
[37] Fix | Delete
[38] Fix | Delete
The persistent programmer may peruse object.h and find that the
[39] Fix | Delete
_typeobject structure provides a means of invoking up to (currently
[40] Fix | Delete
about) 41 special operators. So, for example, a routine can get an
[41] Fix | Delete
item from any object that provides sequence behavior. However, to
[42] Fix | Delete
use this mechanism, the programmer must make their code dependent on
[43] Fix | Delete
the current Python implementation.
[44] Fix | Delete
[45] Fix | Delete
Also, certain semantics, especially memory management semantics, may
[46] Fix | Delete
differ by the type of object being used. Unfortunately, these
[47] Fix | Delete
semantics are not clearly described in the current include files.
[48] Fix | Delete
An abstract interface providing more consistent semantics is needed.
[49] Fix | Delete
[50] Fix | Delete
Proposal
[51] Fix | Delete
[52] Fix | Delete
I propose the creation of a standard interface (with an associated
[53] Fix | Delete
library of routines and/or macros) for generically obtaining the
[54] Fix | Delete
services of Python objects. This proposal can be viewed as one
[55] Fix | Delete
components of a Python C interface consisting of several components.
[56] Fix | Delete
[57] Fix | Delete
From the viewpoint of C access to Python services, we have (as
[58] Fix | Delete
suggested by Guido in off-line discussions):
[59] Fix | Delete
[60] Fix | Delete
- "Very high level layer": two or three functions that let you exec or
[61] Fix | Delete
eval arbitrary Python code given as a string in a module whose name is
[62] Fix | Delete
given, passing C values in and getting C values out using
[63] Fix | Delete
mkvalue/getargs style format strings. This does not require the user
[64] Fix | Delete
to declare any variables of type "PyObject *". This should be enough
[65] Fix | Delete
to write a simple application that gets Python code from the user,
[66] Fix | Delete
execs it, and returns the output or errors. (Error handling must also
[67] Fix | Delete
be part of this API.)
[68] Fix | Delete
[69] Fix | Delete
- "Abstract objects layer": which is the subject of this proposal.
[70] Fix | Delete
It has many functions operating on objects, and lest you do many
[71] Fix | Delete
things from C that you can also write in Python, without going
[72] Fix | Delete
through the Python parser.
[73] Fix | Delete
[74] Fix | Delete
- "Concrete objects layer": This is the public type-dependent
[75] Fix | Delete
interface provided by the standard built-in types, such as floats,
[76] Fix | Delete
strings, and lists. This interface exists and is currently
[77] Fix | Delete
documented by the collection of include files provided with the
[78] Fix | Delete
Python distributions.
[79] Fix | Delete
[80] Fix | Delete
From the point of view of Python accessing services provided by C
[81] Fix | Delete
modules:
[82] Fix | Delete
[83] Fix | Delete
- "Python module interface": this interface consist of the basic
[84] Fix | Delete
routines used to define modules and their members. Most of the
[85] Fix | Delete
current extensions-writing guide deals with this interface.
[86] Fix | Delete
[87] Fix | Delete
- "Built-in object interface": this is the interface that a new
[88] Fix | Delete
built-in type must provide and the mechanisms and rules that a
[89] Fix | Delete
developer of a new built-in type must use and follow.
[90] Fix | Delete
[91] Fix | Delete
This proposal is a "first-cut" that is intended to spur
[92] Fix | Delete
discussion. See especially the lists of notes.
[93] Fix | Delete
[94] Fix | Delete
The Python C object interface will provide four protocols: object,
[95] Fix | Delete
numeric, sequence, and mapping. Each protocol consists of a
[96] Fix | Delete
collection of related operations. If an operation that is not
[97] Fix | Delete
provided by a particular type is invoked, then a standard exception,
[98] Fix | Delete
NotImplementedError is raised with an operation name as an argument.
[99] Fix | Delete
In addition, for convenience this interface defines a set of
[100] Fix | Delete
constructors for building objects of built-in types. This is needed
[101] Fix | Delete
so new objects can be returned from C functions that otherwise treat
[102] Fix | Delete
objects generically.
[103] Fix | Delete
[104] Fix | Delete
Memory Management
[105] Fix | Delete
[106] Fix | Delete
For all of the functions described in this proposal, if a function
[107] Fix | Delete
retains a reference to a Python object passed as an argument, then the
[108] Fix | Delete
function will increase the reference count of the object. It is
[109] Fix | Delete
unnecessary for the caller to increase the reference count of an
[110] Fix | Delete
argument in anticipation of the object's retention.
[111] Fix | Delete
[112] Fix | Delete
All Python objects returned from functions should be treated as new
[113] Fix | Delete
objects. Functions that return objects assume that the caller will
[114] Fix | Delete
retain a reference and the reference count of the object has already
[115] Fix | Delete
been incremented to account for this fact. A caller that does not
[116] Fix | Delete
retain a reference to an object that is returned from a function
[117] Fix | Delete
must decrement the reference count of the object (using
[118] Fix | Delete
DECREF(object)) to prevent memory leaks.
[119] Fix | Delete
[120] Fix | Delete
Note that the behavior mentioned here is different from the current
[121] Fix | Delete
behavior for some objects (e.g. lists and tuples) when certain
[122] Fix | Delete
type-specific routines are called directly (e.g. setlistitem). The
[123] Fix | Delete
proposed abstraction layer will provide a consistent memory
[124] Fix | Delete
management interface, correcting for inconsistent behavior for some
[125] Fix | Delete
built-in types.
[126] Fix | Delete
[127] Fix | Delete
Protocols
[128] Fix | Delete
[129] Fix | Delete
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
[130] Fix | Delete
[131] Fix | Delete
/* Object Protocol: */
[132] Fix | Delete
[133] Fix | Delete
/* Implemented elsewhere:
[134] Fix | Delete
[135] Fix | Delete
int PyObject_Print(PyObject *o, FILE *fp, int flags);
[136] Fix | Delete
[137] Fix | Delete
Print an object, o, on file, fp. Returns -1 on
[138] Fix | Delete
error. The flags argument is used to enable certain printing
[139] Fix | Delete
options. The only option currently supported is Py_Print_RAW.
[140] Fix | Delete
[141] Fix | Delete
(What should be said about Py_Print_RAW?)
[142] Fix | Delete
[143] Fix | Delete
*/
[144] Fix | Delete
[145] Fix | Delete
/* Implemented elsewhere:
[146] Fix | Delete
[147] Fix | Delete
int PyObject_HasAttrString(PyObject *o, const char *attr_name);
[148] Fix | Delete
[149] Fix | Delete
Returns 1 if o has the attribute attr_name, and 0 otherwise.
[150] Fix | Delete
This is equivalent to the Python expression:
[151] Fix | Delete
hasattr(o,attr_name).
[152] Fix | Delete
[153] Fix | Delete
This function always succeeds.
[154] Fix | Delete
[155] Fix | Delete
*/
[156] Fix | Delete
[157] Fix | Delete
/* Implemented elsewhere:
[158] Fix | Delete
[159] Fix | Delete
PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
[160] Fix | Delete
[161] Fix | Delete
Retrieve an attributed named attr_name form object o.
[162] Fix | Delete
Returns the attribute value on success, or NULL on failure.
[163] Fix | Delete
This is the equivalent of the Python expression: o.attr_name.
[164] Fix | Delete
[165] Fix | Delete
*/
[166] Fix | Delete
[167] Fix | Delete
/* Implemented elsewhere:
[168] Fix | Delete
[169] Fix | Delete
int PyObject_HasAttr(PyObject *o, PyObject *attr_name);
[170] Fix | Delete
[171] Fix | Delete
Returns 1 if o has the attribute attr_name, and 0 otherwise.
[172] Fix | Delete
This is equivalent to the Python expression:
[173] Fix | Delete
hasattr(o,attr_name).
[174] Fix | Delete
[175] Fix | Delete
This function always succeeds.
[176] Fix | Delete
[177] Fix | Delete
*/
[178] Fix | Delete
[179] Fix | Delete
/* Implemented elsewhere:
[180] Fix | Delete
[181] Fix | Delete
PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name);
[182] Fix | Delete
[183] Fix | Delete
Retrieve an attributed named attr_name form object o.
[184] Fix | Delete
Returns the attribute value on success, or NULL on failure.
[185] Fix | Delete
This is the equivalent of the Python expression: o.attr_name.
[186] Fix | Delete
[187] Fix | Delete
*/
[188] Fix | Delete
[189] Fix | Delete
[190] Fix | Delete
/* Implemented elsewhere:
[191] Fix | Delete
[192] Fix | Delete
int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
[193] Fix | Delete
[194] Fix | Delete
Set the value of the attribute named attr_name, for object o,
[195] Fix | Delete
to the value v. Raise an exception and return -1 on failure; return 0 on
[196] Fix | Delete
success. This is the equivalent of the Python statement o.attr_name=v.
[197] Fix | Delete
[198] Fix | Delete
*/
[199] Fix | Delete
[200] Fix | Delete
/* Implemented elsewhere:
[201] Fix | Delete
[202] Fix | Delete
int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v);
[203] Fix | Delete
[204] Fix | Delete
Set the value of the attribute named attr_name, for object o,
[205] Fix | Delete
to the value v. Raise an exception and return -1 on failure; return 0 on
[206] Fix | Delete
success. This is the equivalent of the Python statement o.attr_name=v.
[207] Fix | Delete
[208] Fix | Delete
*/
[209] Fix | Delete
[210] Fix | Delete
/* implemented as a macro:
[211] Fix | Delete
[212] Fix | Delete
int PyObject_DelAttrString(PyObject *o, const char *attr_name);
[213] Fix | Delete
[214] Fix | Delete
Delete attribute named attr_name, for object o. Returns
[215] Fix | Delete
-1 on failure. This is the equivalent of the Python
[216] Fix | Delete
statement: del o.attr_name.
[217] Fix | Delete
[218] Fix | Delete
*/
[219] Fix | Delete
#define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A),NULL)
[220] Fix | Delete
[221] Fix | Delete
/* implemented as a macro:
[222] Fix | Delete
[223] Fix | Delete
int PyObject_DelAttr(PyObject *o, PyObject *attr_name);
[224] Fix | Delete
[225] Fix | Delete
Delete attribute named attr_name, for object o. Returns -1
[226] Fix | Delete
on failure. This is the equivalent of the Python
[227] Fix | Delete
statement: del o.attr_name.
[228] Fix | Delete
[229] Fix | Delete
*/
[230] Fix | Delete
#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL)
[231] Fix | Delete
[232] Fix | Delete
/* Implemented elsewhere:
[233] Fix | Delete
[234] Fix | Delete
PyObject *PyObject_Repr(PyObject *o);
[235] Fix | Delete
[236] Fix | Delete
Compute the string representation of object, o. Returns the
[237] Fix | Delete
string representation on success, NULL on failure. This is
[238] Fix | Delete
the equivalent of the Python expression: repr(o).
[239] Fix | Delete
[240] Fix | Delete
Called by the repr() built-in function.
[241] Fix | Delete
[242] Fix | Delete
*/
[243] Fix | Delete
[244] Fix | Delete
/* Implemented elsewhere:
[245] Fix | Delete
[246] Fix | Delete
PyObject *PyObject_Str(PyObject *o);
[247] Fix | Delete
[248] Fix | Delete
Compute the string representation of object, o. Returns the
[249] Fix | Delete
string representation on success, NULL on failure. This is
[250] Fix | Delete
the equivalent of the Python expression: str(o).)
[251] Fix | Delete
[252] Fix | Delete
Called by the str() and print() built-in functions.
[253] Fix | Delete
[254] Fix | Delete
*/
[255] Fix | Delete
[256] Fix | Delete
/* Declared elsewhere
[257] Fix | Delete
[258] Fix | Delete
PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
[259] Fix | Delete
[260] Fix | Delete
Determine if the object, o, is callable. Return 1 if the
[261] Fix | Delete
object is callable and 0 otherwise.
[262] Fix | Delete
[263] Fix | Delete
This function always succeeds.
[264] Fix | Delete
*/
[265] Fix | Delete
[266] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object,
[267] Fix | Delete
PyObject *args, PyObject *kwargs);
[268] Fix | Delete
[269] Fix | Delete
/*
[270] Fix | Delete
Call a callable Python object, callable_object, with
[271] Fix | Delete
arguments and keywords arguments. The 'args' argument can not be
[272] Fix | Delete
NULL.
[273] Fix | Delete
*/
[274] Fix | Delete
[275] Fix | Delete
#ifndef Py_LIMITED_API
[276] Fix | Delete
PyAPI_FUNC(PyObject*) _PyStack_AsTuple(
[277] Fix | Delete
PyObject **stack,
[278] Fix | Delete
Py_ssize_t nargs);
[279] Fix | Delete
[280] Fix | Delete
/* Convert keyword arguments from the (stack, kwnames) format to a Python
[281] Fix | Delete
dictionary.
[282] Fix | Delete
[283] Fix | Delete
kwnames must only contains str strings, no subclass, and all keys must
[284] Fix | Delete
be unique. kwnames is not checked, usually these checks are done before or later
[285] Fix | Delete
calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an
[286] Fix | Delete
error if a key is not a string. */
[287] Fix | Delete
PyAPI_FUNC(PyObject *) _PyStack_AsDict(
[288] Fix | Delete
PyObject **values,
[289] Fix | Delete
PyObject *kwnames);
[290] Fix | Delete
[291] Fix | Delete
/* Convert (args, nargs, kwargs: dict) into (stack, nargs, kwnames: tuple).
[292] Fix | Delete
[293] Fix | Delete
Return 0 on success, raise an exception and return -1 on error.
[294] Fix | Delete
[295] Fix | Delete
Write the new stack into *p_stack. If *p_stack is differen than args, it
[296] Fix | Delete
must be released by PyMem_Free().
[297] Fix | Delete
[298] Fix | Delete
The stack uses borrowed references.
[299] Fix | Delete
[300] Fix | Delete
The type of keyword keys is not checked, these checks should be done
[301] Fix | Delete
later (ex: _PyArg_ParseStackAndKeywords). */
[302] Fix | Delete
PyAPI_FUNC(int) _PyStack_UnpackDict(
[303] Fix | Delete
PyObject **args,
[304] Fix | Delete
Py_ssize_t nargs,
[305] Fix | Delete
PyObject *kwargs,
[306] Fix | Delete
PyObject ***p_stack,
[307] Fix | Delete
PyObject **p_kwnames);
[308] Fix | Delete
[309] Fix | Delete
/* Call the callable object func with the "fast call" calling convention:
[310] Fix | Delete
args is a C array for positional arguments (nargs is the number of
[311] Fix | Delete
positional arguments), kwargs is a dictionary for keyword arguments.
[312] Fix | Delete
[313] Fix | Delete
If nargs is equal to zero, args can be NULL. kwargs can be NULL.
[314] Fix | Delete
nargs must be greater or equal to zero.
[315] Fix | Delete
[316] Fix | Delete
Return the result on success. Raise an exception on return NULL on
[317] Fix | Delete
error. */
[318] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_FastCallDict(PyObject *func,
[319] Fix | Delete
PyObject **args, Py_ssize_t nargs,
[320] Fix | Delete
PyObject *kwargs);
[321] Fix | Delete
[322] Fix | Delete
/* Call the callable object func with the "fast call" calling convention:
[323] Fix | Delete
args is a C array for positional arguments followed by values of
[324] Fix | Delete
keyword arguments. Keys of keyword arguments are stored as a tuple
[325] Fix | Delete
of strings in kwnames. nargs is the number of positional parameters at
[326] Fix | Delete
the beginning of stack. The size of kwnames gives the number of keyword
[327] Fix | Delete
values in the stack after positional arguments.
[328] Fix | Delete
[329] Fix | Delete
kwnames must only contains str strings, no subclass, and all keys must
[330] Fix | Delete
be unique.
[331] Fix | Delete
[332] Fix | Delete
If nargs is equal to zero and there is no keyword argument (kwnames is
[333] Fix | Delete
NULL or its size is zero), args can be NULL.
[334] Fix | Delete
[335] Fix | Delete
Return the result on success. Raise an exception and return NULL on
[336] Fix | Delete
error. */
[337] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords
[338] Fix | Delete
(PyObject *func,
[339] Fix | Delete
PyObject **args,
[340] Fix | Delete
Py_ssize_t nargs,
[341] Fix | Delete
PyObject *kwnames);
[342] Fix | Delete
[343] Fix | Delete
#define _PyObject_FastCall(func, args, nargs) \
[344] Fix | Delete
_PyObject_FastCallDict((func), (args), (nargs), NULL)
[345] Fix | Delete
[346] Fix | Delete
#define _PyObject_CallNoArg(func) \
[347] Fix | Delete
_PyObject_FastCall((func), NULL, 0)
[348] Fix | Delete
[349] Fix | Delete
#define _PyObject_CallArg1(func, arg) \
[350] Fix | Delete
_PyObject_FastCall((func), &(arg), 1)
[351] Fix | Delete
[352] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func,
[353] Fix | Delete
PyObject *obj, PyObject *args,
[354] Fix | Delete
PyObject *kwargs);
[355] Fix | Delete
[356] Fix | Delete
PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func,
[357] Fix | Delete
PyObject *result,
[358] Fix | Delete
const char *where);
[359] Fix | Delete
#endif /* Py_LIMITED_API */
[360] Fix | Delete
[361] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object,
[362] Fix | Delete
PyObject *args);
[363] Fix | Delete
[364] Fix | Delete
/*
[365] Fix | Delete
Call a callable Python object, callable_object, with
[366] Fix | Delete
arguments given by the tuple, args. If no arguments are
[367] Fix | Delete
needed, then args may be NULL. Returns the result of the
[368] Fix | Delete
call on success, or NULL on failure. This is the equivalent
[369] Fix | Delete
of the Python expression: o(*args).
[370] Fix | Delete
*/
[371] Fix | Delete
[372] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
[373] Fix | Delete
const char *format, ...);
[374] Fix | Delete
[375] Fix | Delete
/*
[376] Fix | Delete
Call a callable Python object, callable_object, with a
[377] Fix | Delete
variable number of C arguments. The C arguments are described
[378] Fix | Delete
using a mkvalue-style format string. The format may be NULL,
[379] Fix | Delete
indicating that no arguments are provided. Returns the
[380] Fix | Delete
result of the call on success, or NULL on failure. This is
[381] Fix | Delete
the equivalent of the Python expression: o(*args).
[382] Fix | Delete
*/
[383] Fix | Delete
[384] Fix | Delete
[385] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o,
[386] Fix | Delete
const char *method,
[387] Fix | Delete
const char *format, ...);
[388] Fix | Delete
[389] Fix | Delete
/*
[390] Fix | Delete
Call the method named m of object o with a variable number of
[391] Fix | Delete
C arguments. The C arguments are described by a mkvalue
[392] Fix | Delete
format string. The format may be NULL, indicating that no
[393] Fix | Delete
arguments are provided. Returns the result of the call on
[394] Fix | Delete
success, or NULL on failure. This is the equivalent of the
[395] Fix | Delete
Python expression: o.method(args).
[396] Fix | Delete
*/
[397] Fix | Delete
[398] Fix | Delete
#ifndef Py_LIMITED_API
[399] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o,
[400] Fix | Delete
_Py_Identifier *method,
[401] Fix | Delete
const char *format, ...);
[402] Fix | Delete
[403] Fix | Delete
/*
[404] Fix | Delete
Like PyObject_CallMethod, but expect a _Py_Identifier* as the
[405] Fix | Delete
method name.
[406] Fix | Delete
*/
[407] Fix | Delete
#endif /* !Py_LIMITED_API */
[408] Fix | Delete
[409] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
[410] Fix | Delete
const char *format,
[411] Fix | Delete
...);
[412] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o,
[413] Fix | Delete
const char *name,
[414] Fix | Delete
const char *format,
[415] Fix | Delete
...);
[416] Fix | Delete
#ifndef Py_LIMITED_API
[417] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o,
[418] Fix | Delete
_Py_Identifier *name,
[419] Fix | Delete
const char *format,
[420] Fix | Delete
...);
[421] Fix | Delete
#endif /* !Py_LIMITED_API */
[422] Fix | Delete
[423] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
[424] Fix | Delete
...);
[425] Fix | Delete
[426] Fix | Delete
/*
[427] Fix | Delete
Call a callable Python object, callable_object, with a
[428] Fix | Delete
variable number of C arguments. The C arguments are provided
[429] Fix | Delete
as PyObject * values, terminated by a NULL. Returns the
[430] Fix | Delete
result of the call on success, or NULL on failure. This is
[431] Fix | Delete
the equivalent of the Python expression: o(*args).
[432] Fix | Delete
*/
[433] Fix | Delete
[434] Fix | Delete
[435] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
[436] Fix | Delete
PyObject *method, ...);
[437] Fix | Delete
#ifndef Py_LIMITED_API
[438] Fix | Delete
PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o,
[439] Fix | Delete
struct _Py_Identifier *method,
[440] Fix | Delete
...);
[441] Fix | Delete
#endif /* !Py_LIMITED_API */
[442] Fix | Delete
[443] Fix | Delete
/*
[444] Fix | Delete
Call the method named m of object o with a variable number of
[445] Fix | Delete
C arguments. The C arguments are provided as PyObject *
[446] Fix | Delete
values, terminated by NULL. Returns the result of the call
[447] Fix | Delete
on success, or NULL on failure. This is the equivalent of
[448] Fix | Delete
the Python expression: o.method(args).
[449] Fix | Delete
*/
[450] Fix | Delete
[451] Fix | Delete
[452] Fix | Delete
/* Implemented elsewhere:
[453] Fix | Delete
[454] Fix | Delete
long PyObject_Hash(PyObject *o);
[455] Fix | Delete
[456] Fix | Delete
Compute and return the hash, hash_value, of an object, o. On
[457] Fix | Delete
failure, return -1. This is the equivalent of the Python
[458] Fix | Delete
expression: hash(o).
[459] Fix | Delete
*/
[460] Fix | Delete
[461] Fix | Delete
[462] Fix | Delete
/* Implemented elsewhere:
[463] Fix | Delete
[464] Fix | Delete
int PyObject_IsTrue(PyObject *o);
[465] Fix | Delete
[466] Fix | Delete
Returns 1 if the object, o, is considered to be true, 0 if o is
[467] Fix | Delete
considered to be false and -1 on failure. This is equivalent to the
[468] Fix | Delete
Python expression: not not o
[469] Fix | Delete
*/
[470] Fix | Delete
[471] Fix | Delete
/* Implemented elsewhere:
[472] Fix | Delete
[473] Fix | Delete
int PyObject_Not(PyObject *o);
[474] Fix | Delete
[475] Fix | Delete
Returns 0 if the object, o, is considered to be true, 1 if o is
[476] Fix | Delete
considered to be false and -1 on failure. This is equivalent to the
[477] Fix | Delete
Python expression: not o
[478] Fix | Delete
*/
[479] Fix | Delete
[480] Fix | Delete
PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o);
[481] Fix | Delete
[482] Fix | Delete
/*
[483] Fix | Delete
On success, returns a type object corresponding to the object
[484] Fix | Delete
type of object o. On failure, returns NULL. This is
[485] Fix | Delete
equivalent to the Python expression: type(o).
[486] Fix | Delete
*/
[487] Fix | Delete
[488] Fix | Delete
PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o);
[489] Fix | Delete
[490] Fix | Delete
/*
[491] Fix | Delete
Return the size of object o. If the object, o, provides
[492] Fix | Delete
both sequence and mapping protocols, the sequence size is
[493] Fix | Delete
returned. On error, -1 is returned. This is the equivalent
[494] Fix | Delete
to the Python expression: len(o).
[495] Fix | Delete
*/
[496] Fix | Delete
[497] Fix | Delete
/* For DLL compatibility */
[498] Fix | Delete
#undef PyObject_Length
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function