Lines Matching defs:data
1123 const void *data = PyUnicode_DATA(tag);
1125 if (len >= 3 && PyUnicode_READ(kind, data, 0) == '{' && (
1126 PyUnicode_READ(kind, data, 1) == '}' || (
1127 PyUnicode_READ(kind, data, 1) == '*' &&
1128 PyUnicode_READ(kind, data, 2) == '}'))) {
1133 Py_UCS4 ch = PyUnicode_READ(kind, data, i);
2323 PyObject *data; /* data collector (string or list), or NULL */
2362 t->data = NULL;
2454 Py_VISIT(self->data);
2473 Py_CLEAR(self->data);
2547 treebuilder_extend_element_text_or_tail(PyObject *element, PyObject **data,
2554 *dest = JOIN_SET(*data, PyList_CheckExact(*data));
2555 *data = NULL;
2560 if (PyList_SetSlice(dest_obj, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, *data) < 0) {
2563 Py_CLEAR(*data);
2575 joined = list_join(*data);
2595 Py_CLEAR(*data);
2603 if (!self->data) {
2611 element, &self->data,
2618 element, &self->data,
2736 treebuilder_handle_data(TreeBuilderObject* self, PyObject* data)
2738 if (!self->data) {
2740 /* ignore calls to data before the first call to start */
2744 Py_INCREF(data); self->data = data;
2747 if (PyBytes_CheckExact(self->data) && Py_REFCNT(self->data) == 1 &&
2748 PyBytes_CheckExact(data) && PyBytes_GET_SIZE(data) == 1) {
2750 /* expat often generates single character data sections; handle
2752 Py_ssize_t size = PyBytes_GET_SIZE(self->data);
2753 if (_PyBytes_Resize(&self->data, size + 1) < 0)
2755 PyBytes_AS_STRING(self->data)[size] = PyBytes_AS_STRING(data)[0];
2756 } else if (PyList_CheckExact(self->data)) {
2757 if (PyList_Append(self->data, data) < 0)
2763 PyList_SET_ITEM(list, 0, self->data);
2764 Py_INCREF(data); PyList_SET_ITEM(list, 1, data);
2765 self->data = list;
2924 _elementtree.TreeBuilder.data
2926 data: object
2932 _elementtree_TreeBuilder_data(TreeBuilderObject *self, PyObject *data)
2935 return treebuilder_handle_data(self, data);
3316 PyObject* data;
3322 data = PyUnicode_DecodeUTF8(data_in, data_len, "strict");
3323 if (!data)
3328 res = treebuilder_handle_data((TreeBuilderObject*) self->target, data);
3330 res = PyObject_CallOneArg(self->handle_data, data);
3334 Py_DECREF(data);
3548 PyObject* data;
3563 data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
3564 if (!data)
3566 res = treebuilder_handle_pi(target, pi_target, data);
3568 Py_DECREF(data);
3575 data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
3576 if (!data)
3580 stack[1] = data;
3583 Py_DECREF(data);
3684 self->handle_data = PyObject_GetAttrString(target, "data");
3818 expat_parse(XMLParserObject* self, const char* data, int data_len, int final)
3823 ok = EXPAT(Parse)(self->parser, data, data_len, final);
3850 /* end feeding data to parser */
3877 data: object
3883 _elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data)
3886 /* feed data to parser */
3891 if (PyUnicode_Check(data)) {
3893 const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len);
3907 if (PyObject_GetBuffer(data, &view, PyBUF_SIMPLE) < 0)
4188 "A string identifying what kind of data this element represents"},