Lines Matching defs:obj
19 type_error(const char *msg, PyObject *obj)
21 PyErr_Format(PyExc_TypeError, msg, Py_TYPE(obj)->tp_name);
291 PyObject_CheckBuffer(PyObject *obj)
293 PyBufferProcs *tp_as_buffer = Py_TYPE(obj)->tp_as_buffer;
302 PyObject_CheckReadBuffer(PyObject *obj)
304 PyBufferProcs *pb = Py_TYPE(obj)->tp_as_buffer;
310 if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE) == -1) {
319 as_read_buffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
323 if (obj == NULL || buffer == NULL || buffer_len == NULL) {
327 if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) != 0)
337 PyObject_AsCharBuffer(PyObject *obj,
341 return as_read_buffer(obj, (const void **)buffer, buffer_len);
344 int PyObject_AsReadBuffer(PyObject *obj,
348 return as_read_buffer(obj, buffer, buffer_len);
351 int PyObject_AsWriteBuffer(PyObject *obj,
358 if (obj == NULL || buffer == NULL || buffer_len == NULL) {
362 pb = Py_TYPE(obj)->tp_as_buffer;
365 ((*pb->bf_getbuffer)(obj, &view, PyBUF_WRITABLE) != 0)) {
380 PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
382 PyBufferProcs *pb = Py_TYPE(obj)->tp_as_buffer;
387 Py_TYPE(obj)->tp_name);
390 int res = (*pb->bf_getbuffer)(obj, view, flags);
391 assert(_Py_CheckSlotResult(obj, "getbuffer", res >= 0));
716 PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len,
732 view->obj = obj;
733 if (obj)
734 Py_INCREF(obj);
757 PyObject *obj = view->obj;
759 if (obj == NULL)
761 pb = Py_TYPE(obj)->tp_as_buffer;
763 pb->bf_releasebuffer(obj, view);
765 view->obj = NULL;
766 Py_DECREF(obj);
770 PyObject_Format(PyObject *obj, PyObject *format_spec)
785 if (PyUnicode_CheckExact(obj)) {
786 Py_INCREF(obj);
787 return obj;
789 if (PyLong_CheckExact(obj)) {
790 return PyObject_Str(obj);
801 meth = _PyObject_LookupSpecial(obj, &_Py_ID(__format__));
807 Py_TYPE(obj)->tp_name);
1396 PyIndex_Check(PyObject *obj)
1398 return _PyIndex_Check(obj);
2174 PY_ITERSEARCH_COUNT: -1 if error, else # of times obj appears in seq.
2175 PY_ITERSEARCH_INDEX: 0-based index of first occurrence of obj in seq;
2177 Py_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on error.
2180 _PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation)
2186 if (seq == NULL || obj == NULL) {
2209 cmp = PyObject_RichCompareBool(item, obj, Py_EQ);
2837 PyIter_Check(PyObject *obj)
2839 PyTypeObject *tp = Py_TYPE(obj);
2845 PyAIter_Check(PyObject *obj)
2847 PyTypeObject *tp = Py_TYPE(obj);