Python/C API Reference Manual
Previous:
7.5.1 File Objects
Up:
7.5 Other Objects
Next:
7.5.3 Module Objects
7.5.2 Instance Objects
There are very few functions specific to instance objects.
PyTypeObject
PyInstance_Type
Type object for class instances.
int
PyInstance_Check
(
PyObject *obj
)
Returns true if
obj
is an instance.
PyObject*
PyInstance_New
(
PyObject *class, PyObject *arg, PyObject *kw
)
Return value:
New reference.
Create a new instance of a specific class. The parameters
arg
and
kw
are used as the positional and keyword parameters to the object's constructor.
PyObject*
PyInstance_NewRaw
(
PyObject *class, PyObject *dict
)
Return value:
New reference.
Create a new instance of a specific class without calling it's constructor.
class
is the class of new object. The
dict
parameter will be used as the object's
__dict__
; if
NULL
, a new dictionary will be created for the instance.
Python/C API Reference Manual
Previous:
7.5.1 File Objects
Up:
7.5 Other Objects
Next:
7.5.3 Module Objects
Release 2.1.3, documentation updated on April 8, 2002.
See
About this document...
for information on suggesting changes.