Home
last modified time | relevance | path

Searched refs:tp_new (Results 1 – 25 of 54) sorted by relevance

123

/external/python/cpython3/Doc/extending/
Dnewtypes_tutorial.rst95 .tp_new = PyType_GenericNew,
164 To enable object creation, we have to provide a :c:member:`~PyTypeObject.tp_new`
169 .tp_new = PyType_GenericNew,
272 *NULL* (which might happen here if ``tp_new`` failed midway). It then
286 strings, so we provide a ``tp_new`` implementation::
309 and install it in the :c:member:`~PyTypeObject.tp_new` member::
311 .tp_new = Custom_new,
313 The ``tp_new`` handler is responsible for creating (as opposed to initializing)
315 It is not required to define a ``tp_new`` member, and indeed many extension
317 version of the ``Custom`` type above. In this case, we use the ``tp_new``
[all …]
/external/python/cpython2/Doc/includes/
Dnoddy.c44 noddy_NoddyType.tp_new = PyType_GenericNew; in initnoddy()
Dtypestruct.h67 newfunc tp_new; member
/external/python/cpython2/Modules/_sqlite/
Dprepare_protocol.c81 pysqlite_PrepareProtocolType.tp_new = PyType_GenericNew; in pysqlite_prepare_protocol_setup_types()
Dcache.c365 pysqlite_NodeType.tp_new = PyType_GenericNew; in pysqlite_cache_setup_types()
366 pysqlite_CacheType.tp_new = PyType_GenericNew; in pysqlite_cache_setup_types()
Drow.c280 pysqlite_RowType.tp_new = pysqlite_row_new; in pysqlite_row_setup_types()
Dstatement.c546 pysqlite_StatementType.tp_new = PyType_GenericNew; in pysqlite_statement_setup_types()
/external/python/cpython3/Modules/_sqlite/
Dprepare_protocol.c80 pysqlite_PrepareProtocolType.tp_new = PyType_GenericNew; in pysqlite_prepare_protocol_setup_types()
Dcache.c346 pysqlite_NodeType.tp_new = PyType_GenericNew; in pysqlite_cache_setup_types()
347 pysqlite_CacheType.tp_new = PyType_GenericNew; in pysqlite_cache_setup_types()
Drow.c277 pysqlite_RowType.tp_new = pysqlite_row_new; in pysqlite_row_setup_types()
Dstatement.c496 pysqlite_StatementType.tp_new = PyType_GenericNew; in pysqlite_statement_setup_types()
/external/python/cpython3/Doc/includes/
Dcustom.c15 .tp_new = PyType_GenericNew,
Dtypestruct.h65 newfunc tp_new; member
Dcustom2.c104 .tp_new = Custom_new,
Dcustom3.c154 .tp_new = Custom_new,
Dcustom4.c166 .tp_new = Custom_new,
/external/python/cpython2/Objects/
Dtypeobject.c742 if (type->tp_new == NULL) { in type_call()
749 obj = type->tp_new(type, args, kwds); in type_call()
2161 if (winner->tp_new != type_new) /* Pass it to the winner */ in type_new()
2162 return winner->tp_new(winner, args, kwds); in type_new()
2984 type->tp_new != object_new) in object_init()
2991 type->tp_new == object_new) in object_init()
3006 if (type->tp_new != object_new && in object_new()
3013 else if (type->tp_new != object_new || in object_new()
3325 if (PyType_Check(cls) && ((PyTypeObject *)cls)->tp_new == NULL) { in reduce_2()
3868 if (type->tp_new == NULL)
[all …]
/external/python/cpython3/Objects/
Dtypeobject.c915 if (type->tp_new == NULL) { in type_call()
929 obj = type->tp_new(type, args, kwds); in type_call()
2427 if (winner->tp_new != type_new) /* Pass it to the winner */ in type_new()
2428 return winner->tp_new(winner, args, kwds); in type_new()
3661 if (type->tp_new == object_new) { in object_init()
3675 if (type->tp_new != object_new) { in object_new()
4398 if (Py_TYPE(obj)->tp_new == NULL) { in reduce_newobj()
4888 if (type->tp_new == NULL) in inherit_special()
4889 type->tp_new = base->tp_new; in inherit_special()
5900 while (staticbase && (staticbase->tp_new == slot_tp_new)) in tp_new_wrapper()
[all …]
Dtypeslots.inc66 offsetof(PyHeapTypeObject, ht_type.tp_new),
/external/python/cpython2/Modules/
Dxxmodule.c348 Null_Type.tp_new = PyType_GenericNew; in initxx()
/external/python/cpython3/Python/
Dcontext.c671 .tp_new = context_tp_new,
1007 .tp_new = contextvar_tp_new,
1141 .tp_new = token_tp_new,
/external/python/cpython2/Python/
Dsysmodule.c1498 VersionInfoType.tp_new = NULL; in _PySys_Init()
1506 FlagsType.tp_new = NULL; in _PySys_Init()
1515 WindowsVersionType.tp_new = NULL; in _PySys_Init()
/external/python/cpython2/Doc/extending/
Dnewtypes.rst180 To enable object creation, we have to provide a :c:member:`~PyTypeObject.tp_new` implementation.
183 :c:member:`~PyTypeObject.tp_new` slot, but we can't, for portability sake, On some platforms or
185 defined in another C module, so, instead, we'll assign the :c:member:`~PyTypeObject.tp_new` slot
189 noddy_NoddyType.tp_new = PyType_GenericNew;
322 and install it in the :c:member:`~PyTypeObject.tp_new` member::
324 Noddy_new, /* tp_new */
349 If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one that calls a base type's
350 :c:member:`~PyTypeObject.tp_new` or :meth:`__new__`), you must *not* try to determine what method
352 what type you are going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or via
353 ``type->tp_base->tp_new``. If you do not do this, Python subclasses of your
[all …]
/external/python/cpython3/Doc/c-api/
Dtype.rst88 Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type object. Create a
/external/python/cpython2/Doc/c-api/
Dtypeobj.rst515 …mber:`~PyTypeObject.tp_init`, :c:member:`~PyTypeObject.tp_alloc`, :c:member:`~PyTypeObject.tp_new`,
953 created normally by calling its type, after the type's :c:member:`~PyTypeObject.tp_new` function
954 … has returned an instance of the type. If the :c:member:`~PyTypeObject.tp_new` function returns an
956 …:c:member:`~PyTypeObject.tp_init` function is called; if :c:member:`~PyTypeObject.tp_new` returns …
960 :c:member:`~PyTypeObject.tp_new` was always called, if not *NULL*.)
984 allocate additional memory; that should be done by :c:member:`~PyTypeObject.tp_new`.
992 .. c:member:: newfunc PyTypeObject.tp_new
1002 PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
1006 type. Note that subtype doesn't have to equal the type whose :c:member:`~PyTypeObject.tp_new`
1010 The :c:member:`~PyTypeObject.tp_new` function should call ``subtype->tp_alloc(subtype, nitems)``
[all …]

123