Lines Matching defs:PyObject
23 static PyObject *
24 _testcppext_add(PyObject *Py_UNUSED(module), PyObject *args)
35 // Class to test operator casting an object to PyObject*
39 StrongRef(PyObject *obj) : m_obj(obj) {
47 // Cast to PyObject*: get a borrowed reference
48 inline operator PyObject*() const { return this->m_obj; }
51 PyObject *m_obj; // Strong reference
55 static PyObject *
56 test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
58 PyObject *obj = Py_BuildValue("(ii)", 1, 2);
66 // "const PyObject*". Check that using it does not emit C++ compiler
68 const PyObject *const_obj = obj;
75 PyObject *one = PyTuple_GET_ITEM(const_obj, 0);
78 // gh-92898: StrongRef doesn't inherit from PyObject but has an operator to
79 // cast to PyObject*.
86 // gh-93442: Pass 0 as NULL for PyObject*
90 // Test nullptr passed as PyObject*
100 static PyObject *
101 test_unicode(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
103 PyObject *str = PyUnicode_FromString("abc");
132 class VirtualPyObject : public PyObject {
142 static void dealloc(PyObject* o) {
170 PyObject *type = PyType_FromSpec(&VirtualPyObject_Spec);
180 static PyObject *
181 test_virtual_object(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
208 _testcppext_exec(PyObject *module)
214 PyObject *result;