1 /* Generated by Cython 0.29.18 */
3 /* BEGIN: Cython Metadata
8 "CYTHON_CLINE_IN_TRACEBACK",
13 "/usr/include/libxml2/libxml/HTMLtree.h",
14 "/usr/include/libxml2/libxml/chvalid.h",
15 "/usr/include/libxml2/libxml/encoding.h",
16 "/usr/include/libxml2/libxml/globals.h",
17 "/usr/include/libxml2/libxml/hash.h",
18 "/usr/include/libxml2/libxml/tree.h",
19 "/usr/include/libxml2/libxml/uri.h",
20 "/usr/include/libxml2/libxml/valid.h",
21 "/usr/include/libxml2/libxml/xmlIO.h",
22 "/usr/include/libxml2/libxml/xmlmemory.h",
23 "/usr/include/libxml2/libxml/xmlsave.h",
24 "/usr/include/libxml2/libxml/xmlstring.h",
25 "/usr/include/libxml2/libxml/xmlversion.h",
26 "src/lxml/includes/__init__.pxd",
27 "src/lxml/includes/c14n.pxd",
28 "src/lxml/includes/config.pxd",
29 "src/lxml/includes/dtdvalid.pxd",
30 "src/lxml/includes/etree_defs.h",
31 "src/lxml/includes/etreepublic.pxd",
32 "src/lxml/includes/htmlparser.pxd",
33 "src/lxml/includes/lxml-version.h",
34 "src/lxml/includes/relaxng.pxd",
35 "src/lxml/includes/schematron.pxd",
36 "src/lxml/includes/tree.pxd",
37 "src/lxml/includes/uri.pxd",
38 "src/lxml/includes/xinclude.pxd",
39 "src/lxml/includes/xmlerror.pxd",
40 "src/lxml/includes/xmlparser.pxd",
41 "src/lxml/includes/xmlschema.pxd",
42 "src/lxml/includes/xpath.pxd",
43 "src/lxml/includes/xslt.pxd",
44 "src/lxml/objectpath.pxi"
46 "extra_compile_args": [
51 "/usr/include/libxml2",
62 "name": "lxml.objectify",
64 "src/lxml/objectify.pyx"
67 "module_name": "lxml.objectify"
69 END: Cython Metadata */
71 #define PY_SSIZE_T_CLEAN
74 #error Python headers needed to compile C extensions, please install development version of Python.
75 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
76 #error Cython requires Python 2.6+ or Python 3.3+.
78 #define CYTHON_ABI "0_29_18"
79 #define CYTHON_HEX_VERSION 0x001D12F0
80 #define CYTHON_FUTURE_DIVISION 0
83 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
85 #if !defined(WIN32) && !defined(MS_WINDOWS)
97 #define DL_IMPORT(t) t
100 #define DL_EXPORT(t) t
102 #define __PYX_COMMA ,
103 #ifndef HAVE_LONG_LONG
104 #if PY_VERSION_HEX >= 0x02070000
105 #define HAVE_LONG_LONG
109 #define PY_LONG_LONG LONG_LONG
112 #define Py_HUGE_VAL HUGE_VAL
115 #define CYTHON_COMPILING_IN_PYPY 1
116 #define CYTHON_COMPILING_IN_PYSTON 0
117 #define CYTHON_COMPILING_IN_CPYTHON 0
118 #undef CYTHON_USE_TYPE_SLOTS
119 #define CYTHON_USE_TYPE_SLOTS 0
120 #undef CYTHON_USE_PYTYPE_LOOKUP
121 #define CYTHON_USE_PYTYPE_LOOKUP 0
122 #if PY_VERSION_HEX < 0x03050000
123 #undef CYTHON_USE_ASYNC_SLOTS
124 #define CYTHON_USE_ASYNC_SLOTS 0
125 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
126 #define CYTHON_USE_ASYNC_SLOTS 1
128 #undef CYTHON_USE_PYLIST_INTERNALS
129 #define CYTHON_USE_PYLIST_INTERNALS 0
130 #undef CYTHON_USE_UNICODE_INTERNALS
131 #define CYTHON_USE_UNICODE_INTERNALS 0
132 #undef CYTHON_USE_UNICODE_WRITER
133 #define CYTHON_USE_UNICODE_WRITER 0
134 #undef CYTHON_USE_PYLONG_INTERNALS
135 #define CYTHON_USE_PYLONG_INTERNALS 0
136 #undef CYTHON_AVOID_BORROWED_REFS
137 #define CYTHON_AVOID_BORROWED_REFS 1
138 #undef CYTHON_ASSUME_SAFE_MACROS
139 #define CYTHON_ASSUME_SAFE_MACROS 0
140 #undef CYTHON_UNPACK_METHODS
141 #define CYTHON_UNPACK_METHODS 0
142 #undef CYTHON_FAST_THREAD_STATE
143 #define CYTHON_FAST_THREAD_STATE 0
144 #undef CYTHON_FAST_PYCALL
145 #define CYTHON_FAST_PYCALL 0
146 #undef CYTHON_PEP489_MULTI_PHASE_INIT
147 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
148 #undef CYTHON_USE_TP_FINALIZE
149 #define CYTHON_USE_TP_FINALIZE 0
150 #undef CYTHON_USE_DICT_VERSIONS
151 #define CYTHON_USE_DICT_VERSIONS 0
152 #undef CYTHON_USE_EXC_INFO_STACK
153 #define CYTHON_USE_EXC_INFO_STACK 0
154 #elif defined(PYSTON_VERSION)
155 #define CYTHON_COMPILING_IN_PYPY 0
156 #define CYTHON_COMPILING_IN_PYSTON 1
157 #define CYTHON_COMPILING_IN_CPYTHON 0
158 #ifndef CYTHON_USE_TYPE_SLOTS
159 #define CYTHON_USE_TYPE_SLOTS 1
161 #undef CYTHON_USE_PYTYPE_LOOKUP
162 #define CYTHON_USE_PYTYPE_LOOKUP 0
163 #undef CYTHON_USE_ASYNC_SLOTS
164 #define CYTHON_USE_ASYNC_SLOTS 0
165 #undef CYTHON_USE_PYLIST_INTERNALS
166 #define CYTHON_USE_PYLIST_INTERNALS 0
167 #ifndef CYTHON_USE_UNICODE_INTERNALS
168 #define CYTHON_USE_UNICODE_INTERNALS 1
170 #undef CYTHON_USE_UNICODE_WRITER
171 #define CYTHON_USE_UNICODE_WRITER 0
172 #undef CYTHON_USE_PYLONG_INTERNALS
173 #define CYTHON_USE_PYLONG_INTERNALS 0
174 #ifndef CYTHON_AVOID_BORROWED_REFS
175 #define CYTHON_AVOID_BORROWED_REFS 0
177 #ifndef CYTHON_ASSUME_SAFE_MACROS
178 #define CYTHON_ASSUME_SAFE_MACROS 1
180 #ifndef CYTHON_UNPACK_METHODS
181 #define CYTHON_UNPACK_METHODS 1
183 #undef CYTHON_FAST_THREAD_STATE
184 #define CYTHON_FAST_THREAD_STATE 0
185 #undef CYTHON_FAST_PYCALL
186 #define CYTHON_FAST_PYCALL 0
187 #undef CYTHON_PEP489_MULTI_PHASE_INIT
188 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
189 #undef CYTHON_USE_TP_FINALIZE
190 #define CYTHON_USE_TP_FINALIZE 0
191 #undef CYTHON_USE_DICT_VERSIONS
192 #define CYTHON_USE_DICT_VERSIONS 0
193 #undef CYTHON_USE_EXC_INFO_STACK
194 #define CYTHON_USE_EXC_INFO_STACK 0
196 #define CYTHON_COMPILING_IN_PYPY 0
197 #define CYTHON_COMPILING_IN_PYSTON 0
198 #define CYTHON_COMPILING_IN_CPYTHON 1
199 #ifndef CYTHON_USE_TYPE_SLOTS
200 #define CYTHON_USE_TYPE_SLOTS 1
202 #if PY_VERSION_HEX < 0x02070000
203 #undef CYTHON_USE_PYTYPE_LOOKUP
204 #define CYTHON_USE_PYTYPE_LOOKUP 0
205 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
206 #define CYTHON_USE_PYTYPE_LOOKUP 1
208 #if PY_MAJOR_VERSION < 3
209 #undef CYTHON_USE_ASYNC_SLOTS
210 #define CYTHON_USE_ASYNC_SLOTS 0
211 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
212 #define CYTHON_USE_ASYNC_SLOTS 1
214 #if PY_VERSION_HEX < 0x02070000
215 #undef CYTHON_USE_PYLONG_INTERNALS
216 #define CYTHON_USE_PYLONG_INTERNALS 0
217 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
218 #define CYTHON_USE_PYLONG_INTERNALS 1
220 #ifndef CYTHON_USE_PYLIST_INTERNALS
221 #define CYTHON_USE_PYLIST_INTERNALS 1
223 #ifndef CYTHON_USE_UNICODE_INTERNALS
224 #define CYTHON_USE_UNICODE_INTERNALS 1
226 #if PY_VERSION_HEX < 0x030300F0
227 #undef CYTHON_USE_UNICODE_WRITER
228 #define CYTHON_USE_UNICODE_WRITER 0
229 #elif !defined(CYTHON_USE_UNICODE_WRITER)
230 #define CYTHON_USE_UNICODE_WRITER 1
232 #ifndef CYTHON_AVOID_BORROWED_REFS
233 #define CYTHON_AVOID_BORROWED_REFS 0
235 #ifndef CYTHON_ASSUME_SAFE_MACROS
236 #define CYTHON_ASSUME_SAFE_MACROS 1
238 #ifndef CYTHON_UNPACK_METHODS
239 #define CYTHON_UNPACK_METHODS 1
241 #ifndef CYTHON_FAST_THREAD_STATE
242 #define CYTHON_FAST_THREAD_STATE 1
244 #ifndef CYTHON_FAST_PYCALL
245 #define CYTHON_FAST_PYCALL 1
247 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
248 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
250 #ifndef CYTHON_USE_TP_FINALIZE
251 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
253 #ifndef CYTHON_USE_DICT_VERSIONS
254 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
256 #ifndef CYTHON_USE_EXC_INFO_STACK
257 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
260 #if !defined(CYTHON_FAST_PYCCALL)
261 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
263 #if CYTHON_USE_PYLONG_INTERNALS
264 #include "longintrepr.h"
269 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
272 #ifndef __has_attribute
273 #define __has_attribute(x) 0
275 #ifndef __has_cpp_attribute
276 #define __has_cpp_attribute(x) 0
278 #ifndef CYTHON_RESTRICT
279 #if defined(__GNUC__)
280 #define CYTHON_RESTRICT __restrict__
281 #elif defined(_MSC_VER) && _MSC_VER >= 1400
282 #define CYTHON_RESTRICT __restrict
283 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
284 #define CYTHON_RESTRICT restrict
286 #define CYTHON_RESTRICT
289 #ifndef CYTHON_UNUSED
290 # if defined(__GNUC__)
291 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
292 # define CYTHON_UNUSED __attribute__ ((__unused__))
294 # define CYTHON_UNUSED
296 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
297 # define CYTHON_UNUSED __attribute__ ((__unused__))
299 # define CYTHON_UNUSED
302 #ifndef CYTHON_MAYBE_UNUSED_VAR
303 # if defined(__cplusplus)
304 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
306 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
309 #ifndef CYTHON_NCP_UNUSED
310 # if CYTHON_COMPILING_IN_CPYTHON
311 # define CYTHON_NCP_UNUSED
313 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
316 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
318 #ifndef _MSC_STDINT_H_
320 typedef unsigned char uint8_t;
321 typedef unsigned int uint32_t;
323 typedef unsigned __int8 uint8_t;
324 typedef unsigned __int32 uint32_t;
330 #ifndef CYTHON_FALLTHROUGH
331 #if defined(__cplusplus) && __cplusplus >= 201103L
332 #if __has_cpp_attribute(fallthrough)
333 #define CYTHON_FALLTHROUGH [[fallthrough]]
334 #elif __has_cpp_attribute(clang::fallthrough)
335 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
336 #elif __has_cpp_attribute(gnu::fallthrough)
337 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
340 #ifndef CYTHON_FALLTHROUGH
341 #if __has_attribute(fallthrough)
342 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
344 #define CYTHON_FALLTHROUGH
347 #if defined(__clang__ ) && defined(__apple_build_version__)
348 #if __apple_build_version__ < 7000000
349 #undef CYTHON_FALLTHROUGH
350 #define CYTHON_FALLTHROUGH
355 #ifndef CYTHON_INLINE
356 #if defined(__clang__)
357 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
358 #elif defined(__GNUC__)
359 #define CYTHON_INLINE __inline__
360 #elif defined(_MSC_VER)
361 #define CYTHON_INLINE __inline
362 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
363 #define CYTHON_INLINE inline
365 #define CYTHON_INLINE
369 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
370 #define Py_OptimizeFlag 0
372 #define __PYX_BUILD_PY_SSIZE_T "n"
373 #define CYTHON_FORMAT_SSIZE_T "z"
374 #if PY_MAJOR_VERSION < 3
375 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
376 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
377 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
378 #define __Pyx_DefaultClassType PyClass_Type
380 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
381 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
382 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
383 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
385 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
386 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
388 #define __Pyx_DefaultClassType PyType_Type
390 #ifndef Py_TPFLAGS_CHECKTYPES
391 #define Py_TPFLAGS_CHECKTYPES 0
393 #ifndef Py_TPFLAGS_HAVE_INDEX
394 #define Py_TPFLAGS_HAVE_INDEX 0
396 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
397 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
399 #ifndef Py_TPFLAGS_HAVE_FINALIZE
400 #define Py_TPFLAGS_HAVE_FINALIZE 0
402 #ifndef METH_STACKLESS
403 #define METH_STACKLESS 0
405 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
406 #ifndef METH_FASTCALL
407 #define METH_FASTCALL 0x80
409 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
410 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
411 Py_ssize_t nargs, PyObject *kwnames);
413 #define __Pyx_PyCFunctionFast _PyCFunctionFast
414 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
416 #if CYTHON_FAST_PYCCALL
417 #define __Pyx_PyFastCFunction_Check(func)\
418 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
420 #define __Pyx_PyFastCFunction_Check(func) 0
422 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
423 #define PyObject_Malloc(s) PyMem_Malloc(s)
424 #define PyObject_Free(p) PyMem_Free(p)
425 #define PyObject_Realloc(p) PyMem_Realloc(p)
427 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
428 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
429 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
430 #define PyMem_RawFree(p) PyMem_Free(p)
432 #if CYTHON_COMPILING_IN_PYSTON
433 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
434 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
436 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
437 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
439 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
440 #define __Pyx_PyThreadState_Current PyThreadState_GET()
441 #elif PY_VERSION_HEX >= 0x03060000
442 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
443 #elif PY_VERSION_HEX >= 0x03000000
444 #define __Pyx_PyThreadState_Current PyThreadState_GET()
446 #define __Pyx_PyThreadState_Current _PyThreadState_Current
448 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
449 #include "pythread.h"
450 #define Py_tss_NEEDS_INIT 0
451 typedef int Py_tss_t;
452 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
453 *key = PyThread_create_key();
456 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
457 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
458 *key = Py_tss_NEEDS_INIT;
461 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
464 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
465 return *key != Py_tss_NEEDS_INIT;
467 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
468 PyThread_delete_key(*key);
469 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
472 return PyThread_set_key_value(*key, value);
474 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
475 return PyThread_get_key_value(*key);
478 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
479 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
481 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
483 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
484 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
485 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
487 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
488 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
490 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
491 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
493 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
495 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
496 #define CYTHON_PEP393_ENABLED 1
497 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
498 0 : _PyUnicode_Ready((PyObject *)(op)))
499 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
500 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
501 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
502 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
503 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
504 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
505 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
506 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
508 #define CYTHON_PEP393_ENABLED 0
509 #define PyUnicode_1BYTE_KIND 1
510 #define PyUnicode_2BYTE_KIND 2
511 #define PyUnicode_4BYTE_KIND 4
512 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
516 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
517 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
518 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
520 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
522 #if CYTHON_COMPILING_IN_PYPY
523 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
524 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
526 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
527 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
528 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
530 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
531 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
533 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
534 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
536 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
537 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
539 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
540 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
541 #if PY_MAJOR_VERSION >= 3
542 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
544 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
546 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
547 #define PyObject_ASCII(o) PyObject_Repr(o)
549 #if PY_MAJOR_VERSION >= 3
550 #define PyBaseString_Type PyUnicode_Type
551 #define PyStringObject PyUnicodeObject
552 #define PyString_Type PyUnicode_Type
553 #define PyString_Check PyUnicode_Check
554 #define PyString_CheckExact PyUnicode_CheckExact
555 #ifndef PyObject_Unicode
556 #define PyObject_Unicode PyObject_Str
559 #if PY_MAJOR_VERSION >= 3
560 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
561 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
563 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
564 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
566 #ifndef PySet_CheckExact
567 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
569 #if CYTHON_ASSUME_SAFE_MACROS
570 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
572 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
574 #if PY_MAJOR_VERSION >= 3
575 #define PyIntObject PyLongObject
576 #define PyInt_Type PyLong_Type
577 #define PyInt_Check(op) PyLong_Check(op)
578 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
579 #define PyInt_FromString PyLong_FromString
580 #define PyInt_FromUnicode PyLong_FromUnicode
581 #define PyInt_FromLong PyLong_FromLong
582 #define PyInt_FromSize_t PyLong_FromSize_t
583 #define PyInt_FromSsize_t PyLong_FromSsize_t
584 #define PyInt_AsLong PyLong_AsLong
585 #define PyInt_AS_LONG PyLong_AS_LONG
586 #define PyInt_AsSsize_t PyLong_AsSsize_t
587 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
588 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
589 #define PyNumber_Int PyNumber_Long
591 #if PY_MAJOR_VERSION >= 3
592 #define PyBoolObject PyLongObject
594 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
595 #ifndef PyUnicode_InternFromString
596 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
599 #if PY_VERSION_HEX < 0x030200A4
600 typedef long Py_hash_t;
601 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
602 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
604 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
605 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
607 #if PY_MAJOR_VERSION >= 3
608 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
610 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
612 #if CYTHON_USE_ASYNC_SLOTS
613 #if PY_VERSION_HEX >= 0x030500B1
614 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
615 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
617 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
620 #define __Pyx_PyType_AsAsync(obj) NULL
622 #ifndef __Pyx_PyAsyncMethodsStruct
627 } __Pyx_PyAsyncMethodsStruct;
630 #if defined(WIN32) || defined(MS_WINDOWS)
631 #define _USE_MATH_DEFINESg
635 #define __PYX_NAN() ((float) NAN)
637 static CYTHON_INLINE float __PYX_NAN() {
639 memset(&value, 0xFF, sizeof(value));
643 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
644 #define __Pyx_truncl trunc
646 #define __Pyx_truncl truncl
649 #define __PYX_MARK_ERR_POS(f_index, lineno) \
650 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
651 #define __PYX_ERR(f_index, lineno, Ln_error) \
652 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
654 #ifndef __PYX_EXTERN_C
656 #define __PYX_EXTERN_C extern "C"
658 #define __PYX_EXTERN_C extern
662 #define __PYX_HAVE__lxml__objectify
663 #define __PYX_HAVE_API__lxml__objectify
667 #include "lxml-version.h"
668 #include "libxml/xmlversion.h"
669 #include "libxml/xmlstring.h"
670 #include "libxml/encoding.h"
671 #include "libxml/chvalid.h"
672 #include "libxml/hash.h"
673 #include "libxml/tree.h"
674 #include "libxml/uri.h"
675 #include "libxml/HTMLtree.h"
676 #include "libxml/valid.h"
677 #include "libxml/xmlIO.h"
678 #include "libxml/xmlsave.h"
679 #include "libxml/globals.h"
680 #include "libxml/xmlmemory.h"
681 #include "etree_defs.h"
682 #include "etree_api.h"
683 #include "pythread.h"
684 #include "includes/etree_defs.h"
685 #include "lxml_endian.h"
690 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
691 #define CYTHON_WITHOUT_ASSERTIONS
694 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
695 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
697 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
698 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
699 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
700 #define __PYX_DEFAULT_STRING_ENCODING ""
701 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
702 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
703 #define __Pyx_uchar_cast(c) ((unsigned char)c)
704 #define __Pyx_long_cast(x) ((long)x)
705 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
706 (sizeof(type) < sizeof(Py_ssize_t)) ||\
707 (sizeof(type) > sizeof(Py_ssize_t) &&\
708 likely(v < (type)PY_SSIZE_T_MAX ||\
709 v == (type)PY_SSIZE_T_MAX) &&\
710 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
711 v == (type)PY_SSIZE_T_MIN))) ||\
712 (sizeof(type) == sizeof(Py_ssize_t) &&\
713 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
714 v == (type)PY_SSIZE_T_MAX))) )
715 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
716 return (size_t) i < (size_t) limit;
718 #if defined (__cplusplus) && __cplusplus >= 201103L
720 #define __Pyx_sst_abs(value) std::abs(value)
721 #elif SIZEOF_INT >= SIZEOF_SIZE_T
722 #define __Pyx_sst_abs(value) abs(value)
723 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
724 #define __Pyx_sst_abs(value) labs(value)
725 #elif defined (_MSC_VER)
726 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
727 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
728 #define __Pyx_sst_abs(value) llabs(value)
729 #elif defined (__GNUC__)
730 #define __Pyx_sst_abs(value) __builtin_llabs(value)
732 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
734 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
735 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
736 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
737 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
738 #define __Pyx_PyBytes_FromString PyBytes_FromString
739 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
740 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
741 #if PY_MAJOR_VERSION < 3
742 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
743 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
745 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
746 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
748 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
749 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
750 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
751 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
752 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
753 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
754 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
755 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
756 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
757 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
758 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
759 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
760 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
761 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
762 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
763 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
764 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
765 const Py_UNICODE *u_end = u;
767 return (size_t)(u_end - u - 1);
769 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
770 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
771 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
772 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
773 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
774 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
775 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
776 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
777 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
778 #define __Pyx_PySequence_Tuple(obj)\
779 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
780 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
781 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
782 #if CYTHON_ASSUME_SAFE_MACROS
783 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
785 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
787 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
788 #if PY_MAJOR_VERSION >= 3
789 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
791 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
793 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
794 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
795 static int __Pyx_sys_getdefaultencoding_not_ascii;
796 static int __Pyx_init_sys_getdefaultencoding_params(void) {
798 PyObject* default_encoding = NULL;
799 PyObject* ascii_chars_u = NULL;
800 PyObject* ascii_chars_b = NULL;
801 const char* default_encoding_c;
802 sys = PyImport_ImportModule("sys");
804 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
806 if (!default_encoding) goto bad;
807 default_encoding_c = PyBytes_AsString(default_encoding);
808 if (!default_encoding_c) goto bad;
809 if (strcmp(default_encoding_c, "ascii") == 0) {
810 __Pyx_sys_getdefaultencoding_not_ascii = 0;
812 char ascii_chars[128];
814 for (c = 0; c < 128; c++) {
817 __Pyx_sys_getdefaultencoding_not_ascii = 1;
818 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
819 if (!ascii_chars_u) goto bad;
820 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
821 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
824 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
828 Py_DECREF(ascii_chars_u);
829 Py_DECREF(ascii_chars_b);
831 Py_DECREF(default_encoding);
834 Py_XDECREF(default_encoding);
835 Py_XDECREF(ascii_chars_u);
836 Py_XDECREF(ascii_chars_b);
840 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
841 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
843 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
844 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
845 static char* __PYX_DEFAULT_STRING_ENCODING;
846 static int __Pyx_init_sys_getdefaultencoding_params(void) {
848 PyObject* default_encoding = NULL;
849 char* default_encoding_c;
850 sys = PyImport_ImportModule("sys");
852 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
854 if (!default_encoding) goto bad;
855 default_encoding_c = PyBytes_AsString(default_encoding);
856 if (!default_encoding_c) goto bad;
857 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
858 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
859 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
860 Py_DECREF(default_encoding);
863 Py_XDECREF(default_encoding);
870 /* Test for GCC > 2.95 */
871 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
872 #define likely(x) __builtin_expect(!!(x), 1)
873 #define unlikely(x) __builtin_expect(!!(x), 0)
874 #else /* !__GNUC__ or GCC < 2.95 */
875 #define likely(x) (x)
876 #define unlikely(x) (x)
877 #endif /* __GNUC__ */
878 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
880 static PyObject *__pyx_m = NULL;
881 static PyObject *__pyx_d;
882 static PyObject *__pyx_b;
883 static PyObject *__pyx_cython_runtime = NULL;
884 static PyObject *__pyx_empty_tuple;
885 static PyObject *__pyx_empty_bytes;
886 static PyObject *__pyx_empty_unicode;
887 static int __pyx_lineno;
888 static int __pyx_clineno = 0;
889 static const char * __pyx_cfilenm= __FILE__;
890 static const char *__pyx_filename;
893 static const char *__pyx_f[] = {
894 "src/lxml/objectify.pyx",
895 "src/lxml/objectpath.pxi",
896 "src/lxml/includes/etreepublic.pxd",
899 /*--- Type declarations ---*/
900 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement;
901 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement;
902 struct __pyx_obj_4lxml_9objectify_NumberElement;
903 struct __pyx_obj_4lxml_9objectify_IntElement;
904 struct __pyx_obj_4lxml_9objectify_LongElement;
905 struct __pyx_obj_4lxml_9objectify_FloatElement;
906 struct __pyx_obj_4lxml_9objectify_StringElement;
907 struct __pyx_obj_4lxml_9objectify_NoneElement;
908 struct __pyx_obj_4lxml_9objectify_BoolElement;
909 struct __pyx_obj_4lxml_9objectify_PyType;
910 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller;
911 struct __pyx_obj_4lxml_9objectify_ElementMaker;
912 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup;
913 struct __pyx_obj_4lxml_9objectify_ObjectPath;
914 struct __pyx_t_4lxml_9objectify__ObjectPath;
915 typedef struct __pyx_t_4lxml_9objectify__ObjectPath __pyx_t_4lxml_9objectify__ObjectPath;
917 /* "src/lxml/objectpath.pxi":4
920 * ctypedef struct _ObjectPath: # <<<<<<<<<<<<<<
921 * const_xmlChar* href
922 * const_xmlChar* name
924 struct __pyx_t_4lxml_9objectify__ObjectPath {
930 /* "lxml/objectify.pyx":133
931 * # Element class for the main API
933 * cdef class ObjectifiedElement(ElementBase): # <<<<<<<<<<<<<<
934 * u"""Main XML Element class.
937 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement {
938 struct LxmlElementBase __pyx_base;
942 /* "lxml/objectify.pyx":592
943 * # Data type support in subclasses
945 * cdef class ObjectifiedDataElement(ObjectifiedElement): # <<<<<<<<<<<<<<
946 * u"""This is the base class for all data type Elements. Subclasses should
947 * override the 'pyval' property and possibly the __str__ method.
949 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement {
950 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement __pyx_base;
954 /* "lxml/objectify.pyx":612
955 * cetree.setNodeText(self._c_node, s)
957 * cdef class NumberElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
958 * cdef object _parse_value
959 * def _setValueParser(self, function):
961 struct __pyx_obj_4lxml_9objectify_NumberElement {
962 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
963 PyObject *_parse_value;
967 /* "lxml/objectify.pyx":709
968 * return _numericValueOf(self) ^ _numericValueOf(other)
970 * cdef class IntElement(NumberElement): # <<<<<<<<<<<<<<
972 * self._parse_value = int
974 struct __pyx_obj_4lxml_9objectify_IntElement {
975 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
979 /* "lxml/objectify.pyx":716
980 * return int(_parseNumber(self))
982 * cdef class LongElement(NumberElement): # <<<<<<<<<<<<<<
984 * self._parse_value = long
986 struct __pyx_obj_4lxml_9objectify_LongElement {
987 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
991 /* "lxml/objectify.pyx":723
992 * return int(_parseNumber(self))
994 * cdef class FloatElement(NumberElement): # <<<<<<<<<<<<<<
996 * self._parse_value = float
998 struct __pyx_obj_4lxml_9objectify_FloatElement {
999 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
1003 /* "lxml/objectify.pyx":727
1004 * self._parse_value = float
1006 * cdef class StringElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
1007 * u"""String data class.
1010 struct __pyx_obj_4lxml_9objectify_StringElement {
1011 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
1015 /* "lxml/objectify.pyx":789
1016 * return complex(textOf(self._c_node))
1018 * cdef class NoneElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
1019 * def __str__(self):
1022 struct __pyx_obj_4lxml_9objectify_NoneElement {
1023 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
1027 /* "lxml/objectify.pyx":815
1030 * cdef class BoolElement(IntElement): # <<<<<<<<<<<<<<
1031 * u"""Boolean type base on string values: 'true' or 'false'.
1034 struct __pyx_obj_4lxml_9objectify_BoolElement {
1035 struct __pyx_obj_4lxml_9objectify_IntElement __pyx_base;
1039 /* "lxml/objectify.pyx":901
1040 * # Python type registry
1042 * cdef class PyType: # <<<<<<<<<<<<<<
1043 * u"""PyType(self, name, type_check, type_class, stringify=None)
1044 * User defined type.
1046 struct __pyx_obj_4lxml_9objectify_PyType {
1049 PyObject *type_check;
1050 PyObject *stringify;
1052 PyObject *_schema_types;
1056 /* "lxml/objectify.pyx":1131
1059 * cdef class _ObjectifyElementMakerCaller: # <<<<<<<<<<<<<<
1061 * cdef object _nsmap
1063 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller {
1067 PyObject *_element_factory;
1072 /* "lxml/objectify.pyx":1221
1073 * cetree.setNodeText(elem._c_node, text)
1075 * cdef class ElementMaker: # <<<<<<<<<<<<<<
1076 * u"""ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)
1079 struct __pyx_obj_4lxml_9objectify_ElementMaker {
1081 struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker *__pyx_vtab;
1082 PyObject *_makeelement;
1083 PyObject *_namespace;
1090 /* "lxml/objectify.pyx":1377
1091 * # Element class lookup
1093 * cdef class ObjectifyElementClassLookup(ElementClassLookup): # <<<<<<<<<<<<<<
1094 * u"""ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None)
1095 * Element class lookup method that uses the objectify classes.
1097 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup {
1098 struct LxmlElementClassLookup __pyx_base;
1099 PyObject *empty_data_class;
1100 PyObject *tree_class;
1104 /* "src/lxml/objectpath.pxi":13
1107 * cdef class ObjectPath: # <<<<<<<<<<<<<<
1108 * u"""ObjectPath(path)
1109 * Immutable object that represents a compiled object path.
1111 struct __pyx_obj_4lxml_9objectify_ObjectPath {
1115 PyObject *_path_str;
1116 __pyx_t_4lxml_9objectify__ObjectPath *_c_path;
1117 Py_ssize_t _path_len;
1122 /* "lxml/objectify.pyx":1221
1123 * cetree.setNodeText(elem._c_node, text)
1125 * cdef class ElementMaker: # <<<<<<<<<<<<<<
1126 * u"""ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)
1130 struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker {
1131 PyObject *(*_build_element_maker)(struct __pyx_obj_4lxml_9objectify_ElementMaker *, PyObject *, int);
1133 static struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker *__pyx_vtabptr_4lxml_9objectify_ElementMaker;
1134 static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(struct __pyx_obj_4lxml_9objectify_ElementMaker *, PyObject *, int);
1136 /* --- Runtime support code (head) --- */
1137 /* Refnanny.proto */
1138 #ifndef CYTHON_REFNANNY
1139 #define CYTHON_REFNANNY 0
1143 void (*INCREF)(void*, PyObject*, int);
1144 void (*DECREF)(void*, PyObject*, int);
1145 void (*GOTREF)(void*, PyObject*, int);
1146 void (*GIVEREF)(void*, PyObject*, int);
1147 void* (*SetupContext)(const char*, int, const char*);
1148 void (*FinishContext)(void**);
1149 } __Pyx_RefNannyAPIStruct;
1150 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1151 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1152 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1154 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1156 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1157 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1158 PyGILState_Release(__pyx_gilstate_save);\
1160 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1163 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1164 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1166 #define __Pyx_RefNannyFinishContext()\
1167 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1168 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1169 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1170 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1171 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1172 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1173 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1174 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1175 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1177 #define __Pyx_RefNannyDeclarations
1178 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1179 #define __Pyx_RefNannyFinishContext()
1180 #define __Pyx_INCREF(r) Py_INCREF(r)
1181 #define __Pyx_DECREF(r) Py_DECREF(r)
1182 #define __Pyx_GOTREF(r)
1183 #define __Pyx_GIVEREF(r)
1184 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1185 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1186 #define __Pyx_XGOTREF(r)
1187 #define __Pyx_XGIVEREF(r)
1189 #define __Pyx_XDECREF_SET(r, v) do {\
1190 PyObject *tmp = (PyObject *) r;\
1191 r = v; __Pyx_XDECREF(tmp);\
1193 #define __Pyx_DECREF_SET(r, v) do {\
1194 PyObject *tmp = (PyObject *) r;\
1195 r = v; __Pyx_DECREF(tmp);\
1197 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1198 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1200 /* PyObjectGetAttrStr.proto */
1201 #if CYTHON_USE_TYPE_SLOTS
1202 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1204 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1207 /* GetBuiltinName.proto */
1208 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1210 /* PyCFunctionFastCall.proto */
1211 #if CYTHON_FAST_PYCCALL
1212 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1214 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1217 /* PyFunctionFastCall.proto */
1218 #if CYTHON_FAST_PYCALL
1219 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1220 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1221 #if 1 || PY_VERSION_HEX < 0x030600B1
1222 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1224 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1226 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1227 (sizeof(char [1 - 2*!(cond)]) - 1)
1228 #ifndef Py_MEMBER_SIZE
1229 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1231 static size_t __pyx_pyframe_localsplus_offset = 0;
1232 #include "frameobject.h"
1233 #define __Pxy_PyFrame_Initialize_Offsets()\
1234 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1235 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1236 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1237 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1240 /* PyObjectCall.proto */
1241 #if CYTHON_COMPILING_IN_CPYTHON
1242 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1244 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1247 /* PyObjectCall2Args.proto */
1248 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1250 /* PyObjectCallMethO.proto */
1251 #if CYTHON_COMPILING_IN_CPYTHON
1252 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1255 /* PyObjectCallOneArg.proto */
1256 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1258 /* RaiseDoubleKeywords.proto */
1259 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1261 /* ParseKeywords.proto */
1262 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1263 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1264 const char* function_name);
1266 /* RaiseArgTupleInvalid.proto */
1267 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1268 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1270 /* RaiseTooManyValuesToUnpack.proto */
1271 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1273 /* RaiseNeedMoreValuesToUnpack.proto */
1274 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1276 /* RaiseNoneIterError.proto */
1277 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1279 /* decode_c_string_utf16.proto */
1280 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1282 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1284 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1286 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1288 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1290 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1293 /* decode_c_bytes.proto */
1294 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1295 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1296 const char* encoding, const char* errors,
1297 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1299 /* decode_bytes.proto */
1300 static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
1301 PyObject* string, Py_ssize_t start, Py_ssize_t stop,
1302 const char* encoding, const char* errors,
1303 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
1304 return __Pyx_decode_c_bytes(
1305 PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
1306 start, stop, encoding, errors, decode_func);
1309 /* PyObjectCallNoArg.proto */
1310 #if CYTHON_COMPILING_IN_CPYTHON
1311 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1313 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1316 /* PyDictVersioning.proto */
1317 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1318 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1319 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1320 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1321 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1322 (cache_var) = (value);
1323 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1324 static PY_UINT64_T __pyx_dict_version = 0;\
1325 static PyObject *__pyx_dict_cached_value = NULL;\
1326 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1327 (VAR) = __pyx_dict_cached_value;\
1329 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1330 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1333 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1334 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1335 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1337 #define __PYX_GET_DICT_VERSION(dict) (0)
1338 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1339 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1342 /* GetModuleGlobalName.proto */
1343 #if CYTHON_USE_DICT_VERSIONS
1344 #define __Pyx_GetModuleGlobalName(var, name) {\
1345 static PY_UINT64_T __pyx_dict_version = 0;\
1346 static PyObject *__pyx_dict_cached_value = NULL;\
1347 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1348 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1349 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1351 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1352 PY_UINT64_T __pyx_dict_version;\
1353 PyObject *__pyx_dict_cached_value;\
1354 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1356 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1358 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1359 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1360 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1363 /* ExtTypeTest.proto */
1364 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1366 /* PyDictContains.proto */
1367 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1368 int result = PyDict_Contains(dict, item);
1369 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1372 /* ListAppend.proto */
1373 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1374 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1375 PyListObject* L = (PyListObject*) list;
1376 Py_ssize_t len = Py_SIZE(list);
1377 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1379 PyList_SET_ITEM(list, len, x);
1380 Py_SIZE(list) = len+1;
1383 return PyList_Append(list, x);
1386 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1389 /* IncludeStringH.proto */
1392 /* BytesEquals.proto */
1393 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1395 /* UnicodeEquals.proto */
1396 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1398 /* PyObjectFormatSimple.proto */
1399 #if CYTHON_COMPILING_IN_PYPY
1400 #define __Pyx_PyObject_FormatSimple(s, f) (\
1401 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1402 PyObject_Format(s, f))
1403 #elif PY_MAJOR_VERSION < 3
1404 #define __Pyx_PyObject_FormatSimple(s, f) (\
1405 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1406 likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
1407 PyObject_Format(s, f))
1408 #elif CYTHON_USE_TYPE_SLOTS
1409 #define __Pyx_PyObject_FormatSimple(s, f) (\
1410 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1411 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\
1412 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\
1413 PyObject_Format(s, f))
1415 #define __Pyx_PyObject_FormatSimple(s, f) (\
1416 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1417 PyObject_Format(s, f))
1420 /* JoinPyUnicode.proto */
1421 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
1424 /* PyThreadStateGet.proto */
1425 #if CYTHON_FAST_THREAD_STATE
1426 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1427 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1428 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1430 #define __Pyx_PyThreadState_declare
1431 #define __Pyx_PyThreadState_assign
1432 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1435 /* PyErrFetchRestore.proto */
1436 #if CYTHON_FAST_THREAD_STATE
1437 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1438 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1439 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1440 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1441 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1442 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1443 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1444 #if CYTHON_COMPILING_IN_CPYTHON
1445 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1447 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1450 #define __Pyx_PyErr_Clear() PyErr_Clear()
1451 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1452 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1453 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1454 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1455 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1456 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1457 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1460 /* RaiseException.proto */
1461 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1463 /* GetItemInt.proto */
1464 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1465 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1466 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1467 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1468 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1469 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1470 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1471 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1472 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1473 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1474 int wraparound, int boundscheck);
1475 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1476 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1477 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1478 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1479 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1480 int wraparound, int boundscheck);
1481 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1482 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1483 int is_list, int wraparound, int boundscheck);
1485 /* ObjectGetItem.proto */
1486 #if CYTHON_USE_TYPE_SLOTS
1487 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1489 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1492 /* PyObject_Unicode.proto */
1493 #if PY_MAJOR_VERSION >= 3
1494 #define __Pyx_PyObject_Unicode(obj)\
1495 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1497 #define __Pyx_PyObject_Unicode(obj)\
1498 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1501 /* PyObjectSetAttrStr.proto */
1502 #if CYTHON_USE_TYPE_SLOTS
1503 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1504 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1506 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1507 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1510 /* SliceObject.proto */
1511 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1512 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1513 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1514 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1515 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1516 int has_cstart, int has_cstop, int wraparound);
1518 /* dict_getitem_default.proto */
1519 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
1521 /* UnpackUnboundCMethod.proto */
1524 PyObject **method_name;
1528 } __Pyx_CachedCFunction;
1530 /* CallUnboundCMethod1.proto */
1531 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1532 #if CYTHON_COMPILING_IN_CPYTHON
1533 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1535 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
1538 /* CallUnboundCMethod2.proto */
1539 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
1540 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
1541 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
1543 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
1546 /* BuildPyUnicode.proto */
1547 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
1548 int prepend_sign, char padding_char);
1550 /* CIntToPyUnicode.proto */
1551 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
1553 /* PyIntBinop.proto */
1554 #if !CYTHON_COMPILING_IN_PYPY
1555 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1557 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
1558 (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1562 #if CYTHON_USE_PYLONG_INTERNALS
1563 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
1564 #define __Pyx_PyNumber_Absolute(x)\
1565 ((likely(PyLong_CheckExact(x))) ?\
1566 (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
1567 PyNumber_Absolute(x))
1569 #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
1572 /* StrEquals.proto */
1573 #if PY_MAJOR_VERSION >= 3
1574 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1576 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1579 /* GetTopmostException.proto */
1580 #if CYTHON_USE_EXC_INFO_STACK
1581 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1584 /* SaveResetException.proto */
1585 #if CYTHON_FAST_THREAD_STATE
1586 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1587 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1588 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1589 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1591 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1592 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1595 /* PyErrExceptionMatches.proto */
1596 #if CYTHON_FAST_THREAD_STATE
1597 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1598 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1600 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1604 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1606 /* GetAttr3.proto */
1607 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1609 /* CallableCheck.proto */
1610 #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
1611 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL)
1613 #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
1616 /* IterFinish.proto */
1617 static CYTHON_INLINE int __Pyx_IterFinish(void);
1619 /* UnpackItemEndCheck.proto */
1620 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1622 /* PyIntBinop.proto */
1623 #if !CYTHON_COMPILING_IN_PYPY
1624 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1626 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1627 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1630 /* PyIntCompare.proto */
1631 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1633 /* PySequenceContains.proto */
1634 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1635 int result = PySequence_Contains(seq, item);
1636 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1639 /* py_dict_items.proto */
1640 static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
1642 /* CallUnboundCMethod0.proto */
1643 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
1644 #if CYTHON_COMPILING_IN_CPYTHON
1645 #define __Pyx_CallUnboundCMethod0(cfunc, self)\
1646 (likely((cfunc)->func) ?\
1647 (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
1648 (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
1649 (PY_VERSION_HEX >= 0x030700A0 ?\
1650 (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
1651 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
1652 (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
1653 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
1654 (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
1655 ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
1656 __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
1657 __Pyx__CallUnboundCMethod0(cfunc, self))
1659 #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
1662 /* pyfrozenset_new.proto */
1663 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
1665 /* PySetContains.proto */
1666 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
1668 /* py_dict_values.proto */
1669 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
1671 /* KeywordStringCheck.proto */
1672 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1674 /* py_dict_clear.proto */
1675 #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)
1677 /* ArgTypeTest.proto */
1678 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1679 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1680 __Pyx__ArgTypeTest(obj, type, name, exact))
1681 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1683 /* PyUnicode_Unicode.proto */
1684 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
1686 /* PyObjectFormatAndDecref.proto */
1687 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
1688 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
1690 /* SliceObject.proto */
1691 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1692 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1693 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1694 int has_cstart, int has_cstop, int wraparound);
1697 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1699 /* GetException.proto */
1700 #if CYTHON_FAST_THREAD_STATE
1701 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1702 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1704 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1707 /* PyIntCompare.proto */
1708 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1710 /* DelItemInt.proto */
1711 #define __Pyx_DelItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1712 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1713 __Pyx_DelItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound) :\
1714 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1715 __Pyx_DelItem_Generic(o, to_py_func(i))))
1716 static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
1717 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
1718 int is_list, int wraparound);
1720 /* CallNextTpDealloc.proto */
1721 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
1723 /* CallNextTpTraverse.proto */
1724 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
1726 /* CallNextTpClear.proto */
1727 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
1729 /* PyObject_GenericGetAttrNoDict.proto */
1730 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1731 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1733 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1736 /* PyObject_GenericGetAttr.proto */
1737 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1738 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1740 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1743 /* TypeImport.proto */
1744 #ifndef __PYX_HAVE_RT_ImportType_proto
1745 #define __PYX_HAVE_RT_ImportType_proto
1746 enum __Pyx_ImportType_CheckSize {
1747 __Pyx_ImportType_CheckSize_Error = 0,
1748 __Pyx_ImportType_CheckSize_Warn = 1,
1749 __Pyx_ImportType_CheckSize_Ignore = 2
1751 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1754 /* SetVTable.proto */
1755 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1757 /* ImportFrom.proto */
1758 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1760 /* FetchCommonType.proto */
1761 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1763 /* CythonFunctionShared.proto */
1764 #define __Pyx_CyFunction_USED 1
1765 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1766 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1767 #define __Pyx_CYFUNCTION_CCLASS 0x04
1768 #define __Pyx_CyFunction_GetClosure(f)\
1769 (((__pyx_CyFunctionObject *) (f))->func_closure)
1770 #define __Pyx_CyFunction_GetClassObj(f)\
1771 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1772 #define __Pyx_CyFunction_Defaults(type, f)\
1773 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1774 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1775 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1777 PyCFunctionObject func;
1778 #if PY_VERSION_HEX < 0x030500A0
1779 PyObject *func_weakreflist;
1781 PyObject *func_dict;
1782 PyObject *func_name;
1783 PyObject *func_qualname;
1785 PyObject *func_globals;
1786 PyObject *func_code;
1787 PyObject *func_closure;
1788 PyObject *func_classobj;
1790 int defaults_pyobjects;
1791 size_t defaults_size; // used by FusedFunction for copying defaults
1793 PyObject *defaults_tuple;
1794 PyObject *defaults_kwdict;
1795 PyObject *(*defaults_getter)(PyObject *);
1796 PyObject *func_annotations;
1797 } __pyx_CyFunctionObject;
1798 static PyTypeObject *__pyx_CyFunctionType = 0;
1799 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1800 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1801 int flags, PyObject* qualname,
1803 PyObject *module, PyObject *globals,
1805 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1808 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1810 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1812 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1814 static int __pyx_CyFunction_init(void);
1816 /* CythonFunction.proto */
1817 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1818 int flags, PyObject* qualname,
1820 PyObject *module, PyObject *globals,
1823 /* RegisterModuleCleanup.proto */
1824 static void __pyx_module_cleanup(PyObject *self);
1825 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
1826 static int __Pyx_RegisterCleanup(void);
1828 #define __Pyx_RegisterCleanup() (0)
1831 /* CLineInTraceback.proto */
1832 #ifdef CYTHON_CLINE_IN_TRACEBACK
1833 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1835 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1838 /* CodeObjectCache.proto */
1840 PyCodeObject* code_object;
1842 } __Pyx_CodeObjectCacheEntry;
1843 struct __Pyx_CodeObjectCache {
1846 __Pyx_CodeObjectCacheEntry* entries;
1848 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1849 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1850 static PyCodeObject *__pyx_find_code_object(int code_line);
1851 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1853 /* AddTraceback.proto */
1854 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1855 int py_line, const char *filename);
1857 /* CIntToPy.proto */
1858 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1860 /* CIntToPy.proto */
1861 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1863 /* CIntFromPy.proto */
1864 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1866 /* CIntFromPy.proto */
1867 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1869 /* FastTypeChecks.proto */
1870 #if CYTHON_COMPILING_IN_CPYTHON
1871 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1872 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1873 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1874 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1876 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1877 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1878 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1880 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1882 /* CheckBinaryVersion.proto */
1883 static int __Pyx_check_binary_version(void);
1885 /* InitStrings.proto */
1886 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1888 static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag, int __pyx_v_caching); /* proto*/
1890 /* Module declarations from 'cython' */
1892 /* Module declarations from 'libc.string' */
1894 /* Module declarations from 'libc' */
1896 /* Module declarations from 'libc.stdio' */
1898 /* Module declarations from 'lxml.includes.tree' */
1900 /* Module declarations from 'lxml.etree' */
1902 /* Module declarations from 'lxml.includes' */
1904 /* Module declarations from 'lxml.includes.etreepublic' */
1905 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__Document = 0;
1906 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__Element = 0;
1907 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase = 0;
1908 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree = 0;
1909 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup = 0;
1910 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup = 0;
1911 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher = 0;
1912 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator = 0;
1914 /* Module declarations from 'lxml' */
1916 /* Module declarations from 'lxml.python' */
1918 /* Module declarations from 'lxml.objectify' */
1919 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifiedElement = 0;
1920 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement = 0;
1921 static PyTypeObject *__pyx_ptype_4lxml_9objectify_NumberElement = 0;
1922 static PyTypeObject *__pyx_ptype_4lxml_9objectify_IntElement = 0;
1923 static PyTypeObject *__pyx_ptype_4lxml_9objectify_LongElement = 0;
1924 static PyTypeObject *__pyx_ptype_4lxml_9objectify_FloatElement = 0;
1925 static PyTypeObject *__pyx_ptype_4lxml_9objectify_StringElement = 0;
1926 static PyTypeObject *__pyx_ptype_4lxml_9objectify_NoneElement = 0;
1927 static PyTypeObject *__pyx_ptype_4lxml_9objectify_BoolElement = 0;
1928 static PyTypeObject *__pyx_ptype_4lxml_9objectify_PyType = 0;
1929 static PyTypeObject *__pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller = 0;
1930 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ElementMaker = 0;
1931 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup = 0;
1932 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectPath = 0;
1933 static PyObject *__pyx_v_4lxml_9objectify_etree = 0;
1934 static PyObject *__pyx_v_4lxml_9objectify_re = 0;
1935 static PyObject *__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS = 0;
1936 static PyObject *__pyx_v_4lxml_9objectify_is_special_method = 0;
1937 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE = 0;
1938 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 = 0;
1939 static const xmlChar *__pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE;
1940 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME = 0;
1941 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 = 0;
1942 static const xmlChar *__pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME;
1943 static PyObject *__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME = 0;
1944 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_NS = 0;
1945 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8 = 0;
1946 static const xmlChar *__pyx_v_4lxml_9objectify__XML_SCHEMA_NS;
1947 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS = 0;
1948 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8 = 0;
1949 static const xmlChar *__pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS;
1950 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR = 0;
1951 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR = 0;
1952 static PyObject *__pyx_v_4lxml_9objectify__PYTYPE_DICT = 0;
1953 static PyObject *__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT = 0;
1954 static PyObject *__pyx_v_4lxml_9objectify__TYPE_CHECKS = 0;
1955 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_4lxml_9objectify_TREE_PYTYPE = 0;
1956 static int __pyx_v_4lxml_9objectify___RECURSIVE_STR;
1957 static PyObject *__pyx_v_4lxml_9objectify__strip_attributes = 0;
1958 static PyObject *__pyx_v_4lxml_9objectify__cleanup_namespaces = 0;
1959 static PyObject *__pyx_v_4lxml_9objectify___DEFAULT_PARSER = 0;
1960 static PyObject *__pyx_v_4lxml_9objectify_objectify_parser = 0;
1961 static PyObject *__pyx_v_4lxml_9objectify__fromstring = 0;
1962 static PyObject *__pyx_v_4lxml_9objectify__parse = 0;
1963 static PyObject *__pyx_v_4lxml_9objectify__DEFAULT_NSMAP = 0;
1964 static PyObject *__pyx_v_4lxml_9objectify__NO_DEFAULT = 0;
1965 static PyObject *__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT = 0;
1966 static PyObject *__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT = 0;
1967 static PyObject *__pyx_f_4lxml_9objectify_strrepr(PyObject *); /*proto*/
1968 static PyObject *__pyx_f_4lxml_9objectify__typename(PyObject *); /*proto*/
1969 static PyObject *__pyx_f_4lxml_9objectify__unicodeAndUtf8(PyObject *); /*proto*/
1970 static CYTHON_INLINE int __pyx_f_4lxml_9objectify__tagMatches(xmlNode *, const xmlChar *, const xmlChar *); /*proto*/
1971 static Py_ssize_t __pyx_f_4lxml_9objectify__countSiblings(xmlNode *); /*proto*/
1972 static xmlNode *__pyx_f_4lxml_9objectify__findFollowingSibling(xmlNode *, const xmlChar *, const xmlChar *, Py_ssize_t); /*proto*/
1973 static PyObject *__pyx_f_4lxml_9objectify__lookupChild(struct LxmlElement *, PyObject *); /*proto*/
1974 static PyObject *__pyx_f_4lxml_9objectify__lookupChildOrRaise(struct LxmlElement *, PyObject *); /*proto*/
1975 static PyObject *__pyx_f_4lxml_9objectify__buildChildTag(struct LxmlElement *, PyObject *); /*proto*/
1976 static PyObject *__pyx_f_4lxml_9objectify__replaceElement(struct LxmlElement *, PyObject *); /*proto*/
1977 static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
1978 static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *, PyObject *); /*proto*/
1979 static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *, struct LxmlElement *, PyObject *); /*proto*/
1980 static int __pyx_f_4lxml_9objectify___parseBool(PyObject *, int __pyx_skip_dispatch); /*proto*/
1981 static CYTHON_INLINE int __pyx_f_4lxml_9objectify___parseBoolAsInt(PyObject *); /*proto*/
1982 static PyObject *__pyx_f_4lxml_9objectify__parseNumber(struct __pyx_obj_4lxml_9objectify_NumberElement *); /*proto*/
1983 static PyObject *__pyx_f_4lxml_9objectify__strValueOf(PyObject *); /*proto*/
1984 static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *); /*proto*/
1985 static PyObject *__pyx_f_4lxml_9objectify__richcmpPyvals(PyObject *, PyObject *, int); /*proto*/
1986 static PyObject *__pyx_f_4lxml_9objectify__pytypename(PyObject *); /*proto*/
1987 static PyObject *__pyx_f_4lxml_9objectify__registerPyTypes(void); /*proto*/
1988 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__guessPyType(PyObject *, struct __pyx_obj_4lxml_9objectify_PyType *); /*proto*/
1989 static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *); /*proto*/
1990 static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *, PyObject *); /*proto*/
1991 static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *, int); /*proto*/
1992 static PyObject *__pyx_f_4lxml_9objectify__setupPickle(PyObject *); /*proto*/
1993 static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
1994 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__check_type(xmlNode *, struct __pyx_obj_4lxml_9objectify_PyType *); /*proto*/
1995 static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *, int, int, int, int, PyObject *, PyObject *); /*proto*/
1996 static int __pyx_f_4lxml_9objectify__annotate_element(xmlNode *, struct LxmlDocument *, int, int, int, int, PyObject *, struct __pyx_obj_4lxml_9objectify_PyType *, struct __pyx_obj_4lxml_9objectify_PyType *, struct __pyx_obj_4lxml_9objectify_PyType *); /*proto*/
1997 static struct LxmlElement *__pyx_f_4lxml_9objectify__makeElement(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
1998 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *); /*proto*/
1999 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *); /*proto*/
2000 static __pyx_t_4lxml_9objectify__ObjectPath *__pyx_f_4lxml_9objectify__build_object_path_segments(PyObject *); /*proto*/
2001 static PyObject *__pyx_f_4lxml_9objectify__find_object_path(struct LxmlElement *, __pyx_t_4lxml_9objectify__ObjectPath *, Py_ssize_t, PyObject *); /*proto*/
2002 static PyObject *__pyx_f_4lxml_9objectify__create_object_path(struct LxmlElement *, __pyx_t_4lxml_9objectify__ObjectPath *, Py_ssize_t, int, PyObject *); /*proto*/
2003 static PyObject *__pyx_f_4lxml_9objectify__build_descendant_paths(xmlNode *, PyObject *); /*proto*/
2004 static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *, PyObject *, PyObject *); /*proto*/
2005 #define __Pyx_MODULE_NAME "lxml.objectify"
2006 extern int __pyx_module_is_main_lxml__objectify;
2007 int __pyx_module_is_main_lxml__objectify = 0;
2009 /* Implementation of 'lxml.objectify' */
2010 static PyObject *__pyx_builtin_ValueError;
2011 static PyObject *__pyx_builtin_TypeError;
2012 static PyObject *__pyx_builtin_object;
2013 static PyObject *__pyx_builtin_IndexError;
2014 static PyObject *__pyx_builtin_AttributeError;
2015 static PyObject *__pyx_builtin_oct;
2016 static PyObject *__pyx_builtin_hex;
2017 static PyObject *__pyx_builtin_enumerate;
2018 static PyObject *__pyx_builtin_map;
2019 static PyObject *__pyx_builtin_MemoryError;
2020 static const char __pyx_k_[] = "";
2021 static const char __pyx_k_0[] = "0";
2022 static const char __pyx_k_1[] = "1";
2023 static const char __pyx_k_E[] = "E";
2024 static const char __pyx_k_U[] = "U";
2025 static const char __pyx_k_b[] = "b";
2026 static const char __pyx_k_c[] = "c";
2027 static const char __pyx_k_f[] = "f";
2028 static const char __pyx_k_i[] = "i";
2029 static const char __pyx_k_s[] = "{%s}*";
2030 static const char __pyx_k_ID[] = "ID";
2031 static const char __pyx_k__2[] = ".";
2032 static const char __pyx_k__4[] = "'";
2033 static const char __pyx_k__9[] = "{";
2034 static const char __pyx_k_kw[] = "kw";
2035 static const char __pyx_k_ns[] = "ns";
2036 static const char __pyx_k_of[] = "' of '";
2037 static const char __pyx_k_on[] = "on";
2038 static const char __pyx_k_py[] = "py:";
2039 static const char __pyx_k_re[] = "re";
2040 static const char __pyx_k_XML[] = "XML";
2041 static const char __pyx_k__10[] = " ";
2042 static const char __pyx_k__11[] = " = ";
2043 static const char __pyx_k__12[] = " [";
2044 static const char __pyx_k__13[] = "]\n";
2045 static const char __pyx_k__14[] = " * ";
2046 static const char __pyx_k__15[] = "\n";
2047 static const char __pyx_k__17[] = ":";
2048 static const char __pyx_k__19[] = "{}";
2049 static const char __pyx_k__20[] = "[";
2050 static const char __pyx_k__21[] = "]";
2051 static const char __pyx_k__23[] = "__.*__$";
2052 static const char __pyx_k_all[] = "__all__";
2053 static const char __pyx_k_end[] = "end";
2054 static const char __pyx_k_get[] = "get";
2055 static const char __pyx_k_got[] = ", got ";
2056 static const char __pyx_k_hex[] = "hex";
2057 static const char __pyx_k_int[] = "int";
2058 static const char __pyx_k_map[] = "map";
2059 static const char __pyx_k_obj[] = "obj";
2060 static const char __pyx_k_oct[] = "oct";
2061 static const char __pyx_k_s_2[] = "{%s}";
2062 static const char __pyx_k_s_3[] = "s";
2063 static const char __pyx_k_set[] = "__set__";
2064 static const char __pyx_k_str[] = "str";
2065 static const char __pyx_k_tag[] = "tag";
2066 static const char __pyx_k_xml[] = "xml";
2067 static const char __pyx_k_xsd[] = "xsd:";
2068 static const char __pyx_k_xsi[] = "xsi:";
2069 static const char __pyx_k_Name[] = "Name";
2070 static const char __pyx_k_None[] = "None";
2071 static const char __pyx_k_TREE[] = "TREE";
2072 static const char __pyx_k_base[] = "base";
2073 static const char __pyx_k_bool[] = "bool";
2074 static const char __pyx_k_byte[] = "byte";
2075 static const char __pyx_k_call[] = "__call__";
2076 static const char __pyx_k_copy[] = "__copy__";
2077 static const char __pyx_k_data[] = "data";
2078 static const char __pyx_k_dump[] = "dump";
2079 static const char __pyx_k_init[] = "_init";
2080 static const char __pyx_k_item[] = "item";
2081 static const char __pyx_k_long[] = "long";
2082 static const char __pyx_k_lxml[] = "lxml";
2083 static const char __pyx_k_main[] = "__main__";
2084 static const char __pyx_k_name[] = "name";
2085 static const char __pyx_k_none[] = "none";
2086 static const char __pyx_k_path[] = "path";
2087 static const char __pyx_k_py_2[] = "py";
2088 static const char __pyx_k_repr[] = "repr";
2089 static const char __pyx_k_root[] = "root";
2090 static const char __pyx_k_self[] = "self";
2091 static const char __pyx_k_tail[] = "tail";
2092 static const char __pyx_k_temp[] = "temp";
2093 static const char __pyx_k_test[] = "__test__";
2094 static const char __pyx_k_text[] = "text";
2095 static const char __pyx_k_true[] = "true";
2096 static const char __pyx_k_IDREF[] = "IDREF";
2097 static const char __pyx_k_after[] = "after";
2098 static const char __pyx_k_check[] = "check";
2099 static const char __pyx_k_entry[] = "entry";
2100 static const char __pyx_k_etree[] = "etree";
2101 static const char __pyx_k_false[] = "false";
2102 static const char __pyx_k_float[] = "float";
2103 static const char __pyx_k_items[] = "items";
2104 static const char __pyx_k_known[] = "known";
2105 static const char __pyx_k_match[] = "match";
2106 static const char __pyx_k_nsmap[] = "nsmap";
2107 static const char __pyx_k_parse[] = "parse";
2108 static const char __pyx_k_pyval[] = "pyval";
2109 static const char __pyx_k_s_nil[] = "{%s}nil";
2110 static const char __pyx_k_short[] = "short";
2111 static const char __pyx_k_split[] = "split";
2112 static const char __pyx_k_strip[] = "strip";
2113 static const char __pyx_k_tag_2[] = "_tag";
2114 static const char __pyx_k_token[] = "token";
2115 static const char __pyx_k_types[] = "types";
2116 static const char __pyx_k_value[] = "value";
2117 static const char __pyx_k_xsd_2[] = "xsd";
2118 static const char __pyx_k_xsi_2[] = "xsi";
2119 static const char __pyx_k_xsi_3[] = "_xsi";
2120 static const char __pyx_k_ENTITY[] = "ENTITY";
2121 static const char __pyx_k_NCName[] = "NCName";
2122 static const char __pyx_k_PyType[] = "PyType";
2123 static const char __pyx_k_attrib[] = "attrib";
2124 static const char __pyx_k_before[] = "before";
2125 static const char __pyx_k_c_node[] = "c_node";
2126 static const char __pyx_k_double[] = "double";
2127 static const char __pyx_k_encode[] = "encode";
2128 static const char __pyx_k_groups[] = "groups";
2129 static const char __pyx_k_import[] = "__import__";
2130 static const char __pyx_k_name_2[] = "__name__";
2131 static const char __pyx_k_object[] = "object";
2132 static const char __pyx_k_parser[] = "parser";
2133 static const char __pyx_k_pickle[] = "pickle";
2134 static const char __pyx_k_prefix[] = "prefix";
2135 static const char __pyx_k_pytype[] = "pytype";
2136 static const char __pyx_k_reduce[] = "__reduce__";
2137 static const char __pyx_k_remove[] = "remove";
2138 static const char __pyx_k_result[] = "result";
2139 static const char __pyx_k_s_type[] = "{%s}type";
2140 static const char __pyx_k_string[] = "string";
2141 static const char __pyx_k_strlen[] = "strlen";
2142 static const char __pyx_k_strval[] = "strval";
2143 static const char __pyx_k_update[] = "update";
2144 static const char __pyx_k_values[] = "values";
2145 static const char __pyx_k_Element[] = "Element";
2146 static const char __pyx_k_NMTOKEN[] = "NMTOKEN";
2147 static const char __pyx_k_addattr[] = "addattr";
2148 static const char __pyx_k_addnext[] = "addnext";
2149 static const char __pyx_k_boolean[] = "boolean";
2150 static const char __pyx_k_compile[] = "compile";
2151 static const char __pyx_k_complex[] = "__complex__";
2152 static const char __pyx_k_copyreg[] = "copyreg";
2153 static const char __pyx_k_element[] = "element";
2154 static const char __pyx_k_getattr[] = "__getattr__";
2155 static const char __pyx_k_getitem[] = "__getitem__";
2156 static const char __pyx_k_hasattr[] = "hasattr";
2157 static const char __pyx_k_integer[] = "integer";
2158 static const char __pyx_k_py_type[] = "py_type";
2159 static const char __pyx_k_replace[] = "replace";
2160 static const char __pyx_k_setText[] = "_setText";
2161 static const char __pyx_k_setattr[] = "setattr";
2162 static const char __pyx_k_value_2[] = "_value";
2163 static const char __pyx_k_version[] = "__version__";
2164 static const char __pyx_k_xs_type[] = "xs_type";
2165 static const char __pyx_k_xsi_nil[] = "xsi_nil";
2166 static const char __pyx_k_NoneType[] = "NoneType";
2167 static const char __pyx_k_annotate[] = "annotate";
2168 static const char __pyx_k_base_url[] = "base_url";
2169 static const char __pyx_k_copy_reg[] = "copy_reg";
2170 static const char __pyx_k_function[] = "function";
2171 static const char __pyx_k_language[] = "language";
2172 static const char __pyx_k_last_pos[] = "last_pos";
2173 static const char __pyx_k_pytype_2[] = "_pytype";
2174 static const char __pyx_k_register[] = "register";
2175 static const char __pyx_k_tostring[] = "tostring";
2176 static const char __pyx_k_TypeError[] = "TypeError";
2177 static const char __pyx_k_XMLParser[] = "XMLParser";
2178 static const char __pyx_k_attribute[] = "attribute '";
2179 static const char __pyx_k_checkBool[] = "__checkBool";
2180 static const char __pyx_k_enumerate[] = "enumerate";
2181 static const char __pyx_k_first_pos[] = "first_pos";
2182 static const char __pyx_k_getparent[] = "getparent";
2183 static const char __pyx_k_namespace[] = "namespace";
2184 static const char __pyx_k_parseBool[] = "__parseBool";
2185 static const char __pyx_k_stringify[] = "stringify";
2186 static const char __pyx_k_IndexError[] = "IndexError";
2187 static const char __pyx_k_IntElement[] = "IntElement";
2188 static const char __pyx_k_ObjectPath[] = "ObjectPath";
2189 static const char __pyx_k_PyType_s_s[] = "PyType(%s, %s)";
2190 static const char __pyx_k_SubElement[] = "SubElement";
2191 static const char __pyx_k_ValueError[] = "ValueError";
2192 static const char __pyx_k_attributes[] = "_attributes";
2193 static const char __pyx_k_deannotate[] = "deannotate";
2194 static const char __pyx_k_empty_type[] = "empty_type";
2195 static const char __pyx_k_fromstring[] = "fromstring";
2196 static const char __pyx_k_ignore_old[] = "ignore_old";
2197 static const char __pyx_k_ignore_xsi[] = "ignore_xsi";
2198 static const char __pyx_k_lower_bool[] = "__lower_bool";
2199 static const char __pyx_k_makeparser[] = "makeparser";
2200 static const char __pyx_k_new_parser[] = "new_parser";
2201 static const char __pyx_k_pyannotate[] = "pyannotate";
2202 static const char __pyx_k_pytypename[] = "pytypename";
2203 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2204 static const char __pyx_k_tree_class[] = "tree_class";
2205 static const char __pyx_k_type_check[] = "type_check";
2206 static const char __pyx_k_type_class[] = "type_class";
2207 static const char __pyx_k_unregister[] = "unregister";
2208 static const char __pyx_k_BoolElement[] = "BoolElement";
2209 static const char __pyx_k_DataElement[] = "DataElement";
2210 static const char __pyx_k_ElementTree[] = "ElementTree";
2211 static const char __pyx_k_LongElement[] = "LongElement";
2212 static const char __pyx_k_MemoryError[] = "MemoryError";
2213 static const char __pyx_k_NoneElement[] = "NoneElement";
2214 static const char __pyx_k_getchildren[] = "getchildren";
2215 static const char __pyx_k_makeelement[] = "makeelement";
2216 static const char __pyx_k_unsignedInt[] = "unsignedInt";
2217 static const char __pyx_k_xsiannotate[] = "xsiannotate";
2218 static const char __pyx_k_ElementMaker[] = "ElementMaker";
2219 static const char __pyx_k_FloatElement[] = "FloatElement";
2220 static const char __pyx_k_annotate_xsi[] = "annotate_xsi";
2221 static const char __pyx_k_empty_pytype[] = "empty_pytype";
2222 static const char __pyx_k_invalid_path[] = "invalid path";
2223 static const char __pyx_k_iterchildren[] = "iterchildren";
2224 static const char __pyx_k_unsignedByte[] = "unsignedByte";
2225 static const char __pyx_k_unsignedLong[] = "unsignedLong";
2226 static const char __pyx_k_ElementTree_2[] = "_ElementTree";
2227 static const char __pyx_k_Invalid_slice[] = "Invalid slice";
2228 static const char __pyx_k_NumberElement[] = "NumberElement";
2229 static const char __pyx_k_StringElement[] = "StringElement";
2230 static const char __pyx_k_attribute_tag[] = "attribute_tag";
2231 static const char __pyx_k_countchildren[] = "countchildren";
2232 static const char __pyx_k_ignore_pytype[] = "ignore_pytype";
2233 static const char __pyx_k_no_such_child[] = "no such child: ";
2234 static const char __pyx_k_unsignedShort[] = "unsignedShort";
2235 static const char __pyx_k_AttributeError[] = "AttributeError";
2236 static const char __pyx_k_lxml_objectify[] = "lxml.objectify";
2237 static const char __pyx_k_setValueParser[] = "_setValueParser";
2238 static const char __pyx_k_unicode_escape[] = "unicode-escape";
2239 static const char __pyx_k_xmlSchemaTypes[] = "xmlSchemaTypes";
2240 static const char __pyx_k_PyType_register[] = "PyType.register";
2241 static const char __pyx_k_annotate_pytype[] = "annotate_pytype";
2242 static const char __pyx_k_attribute_names[] = "attribute_names";
2243 static const char __pyx_k_descendantpaths[] = "descendantpaths";
2244 static const char __pyx_k_element_or_tree[] = "element_or_tree";
2245 static const char __pyx_k_negativeInteger[] = "negativeInteger";
2246 static const char __pyx_k_positiveInteger[] = "positiveInteger";
2247 static const char __pyx_k_s_s_s_s_s_0_9_s[] = "(\\.?)\\s*(?:\\{([^}]*)\\})?\\s*([^.{}\\[\\]\\s]+)\\s*(?:\\[\\s*([-0-9]+)\\s*\\])?";
2248 static const char __pyx_k_IntElement__init[] = "IntElement._init";
2249 static const char __pyx_k_PYTYPE_ATTRIBUTE[] = "PYTYPE_ATTRIBUTE";
2250 static const char __pyx_k_empty_data_class[] = "empty_data_class";
2251 static const char __pyx_k_normalizedString[] = "normalizedString";
2252 static const char __pyx_k_strip_attributes[] = "strip_attributes";
2253 static const char __pyx_k_BoolElement__init[] = "BoolElement._init";
2254 static const char __pyx_k_LongElement__init[] = "LongElement._init";
2255 static const char __pyx_k_PyType_unregister[] = "PyType.unregister";
2256 static const char __pyx_k_remove_blank_text[] = "remove_blank_text";
2257 static const char __pyx_k_FloatElement__init[] = "FloatElement._init";
2258 static const char __pyx_k_ObjectPath_addattr[] = "ObjectPath.addattr";
2259 static const char __pyx_k_ObjectPath_hasattr[] = "ObjectPath.hasattr";
2260 static const char __pyx_k_ObjectPath_setattr[] = "ObjectPath.setattr";
2261 static const char __pyx_k_ObjectifiedElement[] = "ObjectifiedElement";
2262 static const char __pyx_k_cleanup_namespaces[] = "cleanup_namespaces";
2263 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2264 static const char __pyx_k_getRegisteredTypes[] = "getRegisteredTypes";
2265 static const char __pyx_k_nonNegativeInteger[] = "nonNegativeInteger";
2266 static const char __pyx_k_nonPositiveInteger[] = "nonPositiveInteger";
2267 static const char __pyx_k_set_default_parser[] = "set_default_parser";
2268 static const char __pyx_k_unpickleElementTree[] = "__unpickleElementTree";
2269 static const char __pyx_k_ElementChildIterator[] = "ElementChildIterator";
2270 static const char __pyx_k_StringElement_strlen[] = "StringElement.strlen";
2271 static const char __pyx_k_enable_recursive_str[] = "enable_recursive_str";
2272 static const char __pyx_k_Invalid_boolean_value[] = "Invalid boolean value: '";
2273 static const char __pyx_k_ObjectifiedDataElement[] = "ObjectifiedDataElement";
2274 static const char __pyx_k_src_lxml_objectify_pyx[] = "src/lxml/objectify.pyx";
2275 static const char __pyx_k_NumberElement___complex[] = "NumberElement.__complex__";
2276 static const char __pyx_k_StringElement___complex[] = "StringElement.__complex__";
2277 static const char __pyx_k_cannot_update_root_node[] = "cannot update root node";
2278 static const char __pyx_k_objects_is_not_writable[] = "' objects is not writable";
2279 static const char __pyx_k_pickleReduceElementTree[] = "pickleReduceElementTree";
2280 static const char __pyx_k_src_lxml_objectpath_pxi[] = "src/lxml/objectpath.pxi";
2281 static const char __pyx_k_set_element_class_lookup[] = "set_element_class_lookup";
2282 static const char __pyx_k_set_pytype_attribute_tag[] = "set_pytype_attribute_tag";
2283 static const char __pyx_k_Cannot_register_tree_type[] = "Cannot register tree type";
2284 static const char __pyx_k_index_must_be_enclosed_in[] = "index must be enclosed in []";
2285 static const char __pyx_k_to_extended_slice_of_size[] = " to extended slice of size ";
2286 static const char __pyx_k_ObjectifiedElement_addattr[] = "ObjectifiedElement.addattr";
2287 static const char __pyx_k_Type_name_must_be_a_string[] = "Type name must be a string";
2288 static const char __pyx_k_invalid_types_for_operator[] = "invalid types for * operator";
2289 static const char __pyx_k_ObjectifiedElement___reduce[] = "ObjectifiedElement.__reduce__";
2290 static const char __pyx_k_ObjectifyElementClassLookup[] = "ObjectifyElementClassLookup";
2291 static const char __pyx_k_NumberElement__setValueParser[] = "NumberElement._setValueParser";
2292 static const char __pyx_k_ObjectifiedElement_getchildren[] = "ObjectifiedElement.getchildren";
2293 static const char __pyx_k_http_www_w3_org_2001_XMLSchema[] = "http://www.w3.org/2001/XMLSchema";
2294 static const char __pyx_k_index_not_allowed_on_root_node[] = "index not allowed on root node";
2295 static const char __pyx_k_ObjectifiedDataElement__setText[] = "ObjectifiedDataElement._setText";
2296 static const char __pyx_k_The_lxml_objectify_module_imple[] = "\nThe ``lxml.objectify`` module implements a Python object API for XML.\nIt is based on `lxml.etree`.\n";
2297 static const char __pyx_k_deleting_items_not_supported_by[] = "deleting items not supported by root element";
2298 static const char __pyx_k_Data_classes_must_inherit_from_O[] = "Data classes must inherit from ObjectifiedDataElement";
2299 static const char __pyx_k_ObjectifiedElement_countchildren[] = "ObjectifiedElement.countchildren";
2300 static const char __pyx_k_ObjectifiedElement_descendantpat[] = "ObjectifiedElement.descendantpaths";
2301 static const char __pyx_k_Type_check_function_must_be_call[] = "Type check function must be callable (or None)";
2302 static const char __pyx_k_XSD_types_require_the_XSD_namesp[] = "XSD types require the XSD namespace";
2303 static const char __pyx_k_argument_of_makeelement_paramete[] = "argument of 'makeelement' parameter must be callable, got ";
2304 static const char __pyx_k_assignment_to_root_element_is_in[] = "assignment to root element is invalid";
2305 static const char __pyx_k_attempt_to_assign_sequence_of_si[] = "attempt to assign sequence of size ";
2306 static const char __pyx_k_creating_indexed_path_attributes[] = "creating indexed path attributes is not supported";
2307 static const char __pyx_k_http_codespeak_net_lxml_objectif[] = "http://codespeak.net/lxml/objectify/pytype";
2308 static const char __pyx_k_http_www_w3_org_2001_XMLSchema_i[] = "http://www.w3.org/2001/XMLSchema-instance";
2309 static const char __pyx_k_inconsistent_before_after_depend[] = "inconsistent before/after dependencies";
2310 static const char __pyx_k_invalid_number_of_arguments_need[] = "invalid number of arguments: needs one or two";
2311 static const char __pyx_k_parser_must_inherit_from_lxml_et[] = "parser must inherit from lxml.etree.XMLParser";
2312 static const char __pyx_k_root_element_does_not_match_need[] = "root element does not match: need ";
2313 static PyObject *__pyx_kp_s_;
2314 static PyObject *__pyx_kp_u_;
2315 static PyObject *__pyx_kp_s_0;
2316 static PyObject *__pyx_kp_s_1;
2317 static PyObject *__pyx_n_s_AttributeError;
2318 static PyObject *__pyx_n_s_BoolElement;
2319 static PyObject *__pyx_n_u_BoolElement;
2320 static PyObject *__pyx_n_s_BoolElement__init;
2321 static PyObject *__pyx_kp_u_Cannot_register_tree_type;
2322 static PyObject *__pyx_n_s_DataElement;
2323 static PyObject *__pyx_n_u_DataElement;
2324 static PyObject *__pyx_kp_u_Data_classes_must_inherit_from_O;
2325 static PyObject *__pyx_n_s_E;
2326 static PyObject *__pyx_n_u_E;
2327 static PyObject *__pyx_n_u_ENTITY;
2328 static PyObject *__pyx_n_s_Element;
2329 static PyObject *__pyx_n_u_Element;
2330 static PyObject *__pyx_n_s_ElementChildIterator;
2331 static PyObject *__pyx_n_s_ElementMaker;
2332 static PyObject *__pyx_n_u_ElementMaker;
2333 static PyObject *__pyx_n_s_ElementTree;
2334 static PyObject *__pyx_n_s_ElementTree_2;
2335 static PyObject *__pyx_n_s_FloatElement;
2336 static PyObject *__pyx_n_u_FloatElement;
2337 static PyObject *__pyx_n_s_FloatElement__init;
2338 static PyObject *__pyx_n_u_ID;
2339 static PyObject *__pyx_n_u_IDREF;
2340 static PyObject *__pyx_n_s_IndexError;
2341 static PyObject *__pyx_n_s_IntElement;
2342 static PyObject *__pyx_n_u_IntElement;
2343 static PyObject *__pyx_n_s_IntElement__init;
2344 static PyObject *__pyx_kp_u_Invalid_boolean_value;
2345 static PyObject *__pyx_kp_u_Invalid_slice;
2346 static PyObject *__pyx_n_s_LongElement;
2347 static PyObject *__pyx_n_u_LongElement;
2348 static PyObject *__pyx_n_s_LongElement__init;
2349 static PyObject *__pyx_n_s_MemoryError;
2350 static PyObject *__pyx_n_u_NCName;
2351 static PyObject *__pyx_n_u_NMTOKEN;
2352 static PyObject *__pyx_n_u_Name;
2353 static PyObject *__pyx_n_s_None;
2354 static PyObject *__pyx_n_u_None;
2355 static PyObject *__pyx_n_s_NoneElement;
2356 static PyObject *__pyx_n_u_NoneElement;
2357 static PyObject *__pyx_n_s_NoneType;
2358 static PyObject *__pyx_n_u_NoneType;
2359 static PyObject *__pyx_n_s_NumberElement;
2360 static PyObject *__pyx_n_u_NumberElement;
2361 static PyObject *__pyx_n_s_NumberElement___complex;
2362 static PyObject *__pyx_n_s_NumberElement__setValueParser;
2363 static PyObject *__pyx_n_s_ObjectPath;
2364 static PyObject *__pyx_n_u_ObjectPath;
2365 static PyObject *__pyx_n_s_ObjectPath_addattr;
2366 static PyObject *__pyx_n_s_ObjectPath_hasattr;
2367 static PyObject *__pyx_n_s_ObjectPath_setattr;
2368 static PyObject *__pyx_n_s_ObjectifiedDataElement;
2369 static PyObject *__pyx_n_u_ObjectifiedDataElement;
2370 static PyObject *__pyx_n_s_ObjectifiedDataElement__setText;
2371 static PyObject *__pyx_n_s_ObjectifiedElement;
2372 static PyObject *__pyx_n_u_ObjectifiedElement;
2373 static PyObject *__pyx_n_s_ObjectifiedElement___reduce;
2374 static PyObject *__pyx_n_s_ObjectifiedElement_addattr;
2375 static PyObject *__pyx_n_s_ObjectifiedElement_countchildren;
2376 static PyObject *__pyx_n_s_ObjectifiedElement_descendantpat;
2377 static PyObject *__pyx_n_s_ObjectifiedElement_getchildren;
2378 static PyObject *__pyx_n_s_ObjectifyElementClassLookup;
2379 static PyObject *__pyx_n_u_ObjectifyElementClassLookup;
2380 static PyObject *__pyx_n_s_PYTYPE_ATTRIBUTE;
2381 static PyObject *__pyx_n_u_PYTYPE_ATTRIBUTE;
2382 static PyObject *__pyx_n_s_PyType;
2383 static PyObject *__pyx_n_u_PyType;
2384 static PyObject *__pyx_n_s_PyType_register;
2385 static PyObject *__pyx_kp_s_PyType_s_s;
2386 static PyObject *__pyx_n_s_PyType_unregister;
2387 static PyObject *__pyx_n_s_StringElement;
2388 static PyObject *__pyx_n_u_StringElement;
2389 static PyObject *__pyx_n_s_StringElement___complex;
2390 static PyObject *__pyx_n_s_StringElement_strlen;
2391 static PyObject *__pyx_n_s_SubElement;
2392 static PyObject *__pyx_n_u_SubElement;
2393 static PyObject *__pyx_n_u_TREE;
2394 static PyObject *__pyx_n_s_TypeError;
2395 static PyObject *__pyx_kp_u_Type_check_function_must_be_call;
2396 static PyObject *__pyx_kp_u_Type_name_must_be_a_string;
2397 static PyObject *__pyx_n_s_U;
2398 static PyObject *__pyx_n_s_ValueError;
2399 static PyObject *__pyx_n_s_XML;
2400 static PyObject *__pyx_n_u_XML;
2401 static PyObject *__pyx_n_s_XMLParser;
2402 static PyObject *__pyx_kp_u_XSD_types_require_the_XSD_namesp;
2403 static PyObject *__pyx_kp_u__10;
2404 static PyObject *__pyx_kp_u__11;
2405 static PyObject *__pyx_kp_u__12;
2406 static PyObject *__pyx_kp_u__13;
2407 static PyObject *__pyx_kp_u__14;
2408 static PyObject *__pyx_kp_u__15;
2409 static PyObject *__pyx_kp_b__17;
2410 static PyObject *__pyx_kp_u__17;
2411 static PyObject *__pyx_kp_u__19;
2412 static PyObject *__pyx_kp_u__2;
2413 static PyObject *__pyx_kp_u__20;
2414 static PyObject *__pyx_kp_u__21;
2415 static PyObject *__pyx_kp_u__23;
2416 static PyObject *__pyx_kp_u__4;
2417 static PyObject *__pyx_kp_u__9;
2418 static PyObject *__pyx_n_s_addattr;
2419 static PyObject *__pyx_n_s_addnext;
2420 static PyObject *__pyx_n_s_after;
2421 static PyObject *__pyx_n_s_all;
2422 static PyObject *__pyx_n_s_annotate;
2423 static PyObject *__pyx_n_u_annotate;
2424 static PyObject *__pyx_n_s_annotate_pytype;
2425 static PyObject *__pyx_n_s_annotate_xsi;
2426 static PyObject *__pyx_kp_u_argument_of_makeelement_paramete;
2427 static PyObject *__pyx_kp_u_assignment_to_root_element_is_in;
2428 static PyObject *__pyx_kp_u_attempt_to_assign_sequence_of_si;
2429 static PyObject *__pyx_n_s_attrib;
2430 static PyObject *__pyx_kp_u_attribute;
2431 static PyObject *__pyx_n_s_attribute_names;
2432 static PyObject *__pyx_n_s_attribute_tag;
2433 static PyObject *__pyx_n_s_attributes;
2434 static PyObject *__pyx_n_s_b;
2435 static PyObject *__pyx_n_s_base;
2436 static PyObject *__pyx_n_u_base;
2437 static PyObject *__pyx_n_s_base_url;
2438 static PyObject *__pyx_n_s_before;
2439 static PyObject *__pyx_n_u_bool;
2440 static PyObject *__pyx_n_u_boolean;
2441 static PyObject *__pyx_n_u_byte;
2442 static PyObject *__pyx_n_s_c;
2443 static PyObject *__pyx_n_s_c_node;
2444 static PyObject *__pyx_n_s_call;
2445 static PyObject *__pyx_kp_u_cannot_update_root_node;
2446 static PyObject *__pyx_n_s_check;
2447 static PyObject *__pyx_n_s_checkBool;
2448 static PyObject *__pyx_n_s_cleanup_namespaces;
2449 static PyObject *__pyx_n_s_cline_in_traceback;
2450 static PyObject *__pyx_n_s_compile;
2451 static PyObject *__pyx_n_s_complex;
2452 static PyObject *__pyx_n_s_copy;
2453 static PyObject *__pyx_n_s_copy_reg;
2454 static PyObject *__pyx_n_s_copyreg;
2455 static PyObject *__pyx_n_s_countchildren;
2456 static PyObject *__pyx_kp_u_creating_indexed_path_attributes;
2457 static PyObject *__pyx_n_s_data;
2458 static PyObject *__pyx_n_s_deannotate;
2459 static PyObject *__pyx_n_u_deannotate;
2460 static PyObject *__pyx_kp_u_deleting_items_not_supported_by;
2461 static PyObject *__pyx_n_s_descendantpaths;
2462 static PyObject *__pyx_n_u_double;
2463 static PyObject *__pyx_n_s_dump;
2464 static PyObject *__pyx_n_u_dump;
2465 static PyObject *__pyx_n_s_element;
2466 static PyObject *__pyx_n_s_element_or_tree;
2467 static PyObject *__pyx_n_s_empty_data_class;
2468 static PyObject *__pyx_n_s_empty_pytype;
2469 static PyObject *__pyx_n_s_empty_type;
2470 static PyObject *__pyx_n_s_enable_recursive_str;
2471 static PyObject *__pyx_n_u_enable_recursive_str;
2472 static PyObject *__pyx_n_s_encode;
2473 static PyObject *__pyx_n_s_end;
2474 static PyObject *__pyx_n_s_entry;
2475 static PyObject *__pyx_n_s_enumerate;
2476 static PyObject *__pyx_n_s_etree;
2477 static PyObject *__pyx_n_s_f;
2478 static PyObject *__pyx_n_s_false;
2479 static PyObject *__pyx_n_u_false;
2480 static PyObject *__pyx_n_s_first_pos;
2481 static PyObject *__pyx_n_u_float;
2482 static PyObject *__pyx_n_s_fromstring;
2483 static PyObject *__pyx_n_u_fromstring;
2484 static PyObject *__pyx_n_s_function;
2485 static PyObject *__pyx_n_s_get;
2486 static PyObject *__pyx_n_s_getRegisteredTypes;
2487 static PyObject *__pyx_n_u_getRegisteredTypes;
2488 static PyObject *__pyx_n_s_getattr;
2489 static PyObject *__pyx_n_s_getchildren;
2490 static PyObject *__pyx_n_s_getitem;
2491 static PyObject *__pyx_n_s_getparent;
2492 static PyObject *__pyx_kp_u_got;
2493 static PyObject *__pyx_n_s_groups;
2494 static PyObject *__pyx_n_s_hasattr;
2495 static PyObject *__pyx_n_s_hex;
2496 static PyObject *__pyx_kp_u_http_codespeak_net_lxml_objectif;
2497 static PyObject *__pyx_kp_u_http_www_w3_org_2001_XMLSchema;
2498 static PyObject *__pyx_kp_u_http_www_w3_org_2001_XMLSchema_i;
2499 static PyObject *__pyx_n_s_i;
2500 static PyObject *__pyx_n_s_ignore_old;
2501 static PyObject *__pyx_n_s_ignore_pytype;
2502 static PyObject *__pyx_n_s_ignore_xsi;
2503 static PyObject *__pyx_n_s_import;
2504 static PyObject *__pyx_kp_u_inconsistent_before_after_depend;
2505 static PyObject *__pyx_kp_u_index_must_be_enclosed_in;
2506 static PyObject *__pyx_kp_u_index_not_allowed_on_root_node;
2507 static PyObject *__pyx_n_s_init;
2508 static PyObject *__pyx_n_u_int;
2509 static PyObject *__pyx_n_u_integer;
2510 static PyObject *__pyx_kp_u_invalid_number_of_arguments_need;
2511 static PyObject *__pyx_kp_u_invalid_path;
2512 static PyObject *__pyx_kp_u_invalid_types_for_operator;
2513 static PyObject *__pyx_n_s_item;
2514 static PyObject *__pyx_n_s_items;
2515 static PyObject *__pyx_n_s_iterchildren;
2516 static PyObject *__pyx_n_s_known;
2517 static PyObject *__pyx_n_s_kw;
2518 static PyObject *__pyx_n_u_language;
2519 static PyObject *__pyx_n_s_last_pos;
2520 static PyObject *__pyx_n_u_long;
2521 static PyObject *__pyx_n_s_lower_bool;
2522 static PyObject *__pyx_n_s_lxml;
2523 static PyObject *__pyx_n_s_lxml_objectify;
2524 static PyObject *__pyx_n_s_main;
2525 static PyObject *__pyx_n_s_makeelement;
2526 static PyObject *__pyx_n_s_makeparser;
2527 static PyObject *__pyx_n_u_makeparser;
2528 static PyObject *__pyx_n_s_map;
2529 static PyObject *__pyx_n_s_match;
2530 static PyObject *__pyx_n_s_name;
2531 static PyObject *__pyx_n_s_name_2;
2532 static PyObject *__pyx_n_s_namespace;
2533 static PyObject *__pyx_n_u_negativeInteger;
2534 static PyObject *__pyx_n_s_new_parser;
2535 static PyObject *__pyx_kp_u_no_such_child;
2536 static PyObject *__pyx_n_u_nonNegativeInteger;
2537 static PyObject *__pyx_n_u_nonPositiveInteger;
2538 static PyObject *__pyx_n_s_none;
2539 static PyObject *__pyx_n_u_none;
2540 static PyObject *__pyx_n_u_normalizedString;
2541 static PyObject *__pyx_n_s_ns;
2542 static PyObject *__pyx_n_s_nsmap;
2543 static PyObject *__pyx_n_s_obj;
2544 static PyObject *__pyx_n_s_object;
2545 static PyObject *__pyx_kp_u_objects_is_not_writable;
2546 static PyObject *__pyx_n_s_oct;
2547 static PyObject *__pyx_kp_u_of;
2548 static PyObject *__pyx_n_s_on;
2549 static PyObject *__pyx_n_s_parse;
2550 static PyObject *__pyx_n_u_parse;
2551 static PyObject *__pyx_n_s_parseBool;
2552 static PyObject *__pyx_n_s_parser;
2553 static PyObject *__pyx_kp_u_parser_must_inherit_from_lxml_et;
2554 static PyObject *__pyx_n_s_path;
2555 static PyObject *__pyx_n_s_pickle;
2556 static PyObject *__pyx_n_s_pickleReduceElementTree;
2557 static PyObject *__pyx_n_u_positiveInteger;
2558 static PyObject *__pyx_n_s_prefix;
2559 static PyObject *__pyx_kp_u_py;
2560 static PyObject *__pyx_n_s_py_2;
2561 static PyObject *__pyx_n_s_py_type;
2562 static PyObject *__pyx_n_s_pyannotate;
2563 static PyObject *__pyx_n_u_pyannotate;
2564 static PyObject *__pyx_n_s_pytype;
2565 static PyObject *__pyx_n_u_pytype;
2566 static PyObject *__pyx_n_s_pytype_2;
2567 static PyObject *__pyx_n_s_pytypename;
2568 static PyObject *__pyx_n_u_pytypename;
2569 static PyObject *__pyx_n_s_pyval;
2570 static PyObject *__pyx_n_u_pyval;
2571 static PyObject *__pyx_n_s_pyx_vtable;
2572 static PyObject *__pyx_n_s_re;
2573 static PyObject *__pyx_n_s_reduce;
2574 static PyObject *__pyx_n_s_register;
2575 static PyObject *__pyx_n_s_remove;
2576 static PyObject *__pyx_n_s_remove_blank_text;
2577 static PyObject *__pyx_n_s_replace;
2578 static PyObject *__pyx_n_s_repr;
2579 static PyObject *__pyx_n_s_result;
2580 static PyObject *__pyx_n_s_root;
2581 static PyObject *__pyx_kp_u_root_element_does_not_match_need;
2582 static PyObject *__pyx_kp_u_s;
2583 static PyObject *__pyx_kp_u_s_2;
2584 static PyObject *__pyx_n_s_s_3;
2585 static PyObject *__pyx_kp_u_s_nil;
2586 static PyObject *__pyx_kp_u_s_s_s_s_s_0_9_s;
2587 static PyObject *__pyx_kp_u_s_type;
2588 static PyObject *__pyx_n_s_self;
2589 static PyObject *__pyx_n_s_set;
2590 static PyObject *__pyx_n_s_setText;
2591 static PyObject *__pyx_n_s_setValueParser;
2592 static PyObject *__pyx_n_s_set_default_parser;
2593 static PyObject *__pyx_n_u_set_default_parser;
2594 static PyObject *__pyx_n_s_set_element_class_lookup;
2595 static PyObject *__pyx_n_s_set_pytype_attribute_tag;
2596 static PyObject *__pyx_n_u_set_pytype_attribute_tag;
2597 static PyObject *__pyx_n_s_setattr;
2598 static PyObject *__pyx_n_u_short;
2599 static PyObject *__pyx_n_s_split;
2600 static PyObject *__pyx_kp_s_src_lxml_objectify_pyx;
2601 static PyObject *__pyx_kp_s_src_lxml_objectpath_pxi;
2602 static PyObject *__pyx_n_u_str;
2603 static PyObject *__pyx_n_u_string;
2604 static PyObject *__pyx_n_s_stringify;
2605 static PyObject *__pyx_n_s_strip;
2606 static PyObject *__pyx_n_s_strip_attributes;
2607 static PyObject *__pyx_n_s_strlen;
2608 static PyObject *__pyx_n_s_strval;
2609 static PyObject *__pyx_n_s_tag;
2610 static PyObject *__pyx_n_u_tag;
2611 static PyObject *__pyx_n_s_tag_2;
2612 static PyObject *__pyx_n_u_tail;
2613 static PyObject *__pyx_n_s_temp;
2614 static PyObject *__pyx_n_s_test;
2615 static PyObject *__pyx_n_s_text;
2616 static PyObject *__pyx_n_u_text;
2617 static PyObject *__pyx_kp_u_to_extended_slice_of_size;
2618 static PyObject *__pyx_n_u_token;
2619 static PyObject *__pyx_n_s_tostring;
2620 static PyObject *__pyx_n_s_tree_class;
2621 static PyObject *__pyx_n_s_true;
2622 static PyObject *__pyx_n_u_true;
2623 static PyObject *__pyx_n_s_type_check;
2624 static PyObject *__pyx_n_s_type_class;
2625 static PyObject *__pyx_n_s_types;
2626 static PyObject *__pyx_kp_s_unicode_escape;
2627 static PyObject *__pyx_n_s_unpickleElementTree;
2628 static PyObject *__pyx_n_s_unregister;
2629 static PyObject *__pyx_n_u_unsignedByte;
2630 static PyObject *__pyx_n_u_unsignedInt;
2631 static PyObject *__pyx_n_u_unsignedLong;
2632 static PyObject *__pyx_n_u_unsignedShort;
2633 static PyObject *__pyx_n_s_update;
2634 static PyObject *__pyx_n_s_value;
2635 static PyObject *__pyx_n_u_value;
2636 static PyObject *__pyx_n_s_value_2;
2637 static PyObject *__pyx_n_s_values;
2638 static PyObject *__pyx_n_s_version;
2639 static PyObject *__pyx_n_s_xml;
2640 static PyObject *__pyx_n_s_xmlSchemaTypes;
2641 static PyObject *__pyx_n_s_xs_type;
2642 static PyObject *__pyx_kp_u_xsd;
2643 static PyObject *__pyx_n_s_xsd_2;
2644 static PyObject *__pyx_kp_u_xsi;
2645 static PyObject *__pyx_n_s_xsi_2;
2646 static PyObject *__pyx_n_s_xsi_3;
2647 static PyObject *__pyx_n_s_xsi_nil;
2648 static PyObject *__pyx_n_s_xsiannotate;
2649 static PyObject *__pyx_n_u_xsiannotate;
2650 static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attribute_tag); /* proto */
2651 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2652 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2653 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2654 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2655 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2656 static Py_ssize_t __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2657 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2658 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2659 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2660 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_14__setattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value); /* proto */
2661 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2662 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_18addattr(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value); /* proto */
2663 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
2664 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_22__setitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
2665 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
2666 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
2667 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2668 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2669 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2670 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
2671 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_function); /* proto */
2672 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2673 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_2__int__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2674 #if PY_MAJOR_VERSION < 3
2675 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_4__long__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2677 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_6__float__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2678 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2679 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_10__str__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2680 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2681 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2682 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2684 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2685 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2687 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_18__richcmp__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
2688 static Py_hash_t __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2689 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_22__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2690 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2691 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2692 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2693 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_28__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2695 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2696 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2697 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo); /* proto */
2698 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2699 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2700 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2701 static int __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2702 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2703 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2704 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2705 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_50__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2706 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_52__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2707 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2708 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement__init(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self); /* proto */
2709 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement_2__index__(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self); /* proto */
2710 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement__init(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self); /* proto */
2711 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement_2__index__(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self); /* proto */
2712 static PyObject *__pyx_pf_4lxml_9objectify_12FloatElement__init(struct __pyx_obj_4lxml_9objectify_FloatElement *__pyx_v_self); /* proto */
2713 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2714 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement___repr__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2715 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_2strlen(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2716 static int __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2717 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_6__richcmp__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
2718 static Py_hash_t __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2719 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_10__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2720 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_12__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2721 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_14__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2722 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_16__int__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2723 #if PY_MAJOR_VERSION < 3
2724 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_18__long__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2726 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_20__float__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2727 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_22__complex__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2728 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement___str__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2729 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2730 static int __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2731 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_6__richcmp__(struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
2732 static Py_hash_t __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2733 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2734 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement__init(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2735 static int __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2736 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_4__richcmp__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */
2737 static Py_hash_t __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2738 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_8__str__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2739 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2740 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2741 static PyObject *__pyx_pf_4lxml_9objectify_2__checkBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
2742 static PyObject *__pyx_pf_4lxml_9objectify_4__parseBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
2743 static int __pyx_pf_4lxml_9objectify_6PyType___init__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type_check, PyObject *__pyx_v_type_class, PyObject *__pyx_v_stringify); /* proto */
2744 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_2__repr__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2745 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4register(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after); /* proto */
2746 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2747 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2748 static int __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
2749 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4name___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2750 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2751 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2752 static PyObject *__pyx_pf_4lxml_9objectify_6__lower_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */
2753 static PyObject *__pyx_pf_4lxml_9objectify_8pytypename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
2754 static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2755 static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__(struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_self, PyObject *__pyx_v_children, PyObject *__pyx_v_attrib); /* proto */
2756 static int __pyx_pf_4lxml_9objectify_12ElementMaker___init__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_namespace, PyObject *__pyx_v_nsmap, PyObject *__pyx_v_annotate, PyObject *__pyx_v_makeelement); /* proto */
2757 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2758 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_4__call__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
2759 static PyObject *__pyx_pf_4lxml_9objectify_12enable_recursive_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */
2760 static PyObject *__pyx_pf_4lxml_9objectify_14dump(CYTHON_UNUSED PyObject *__pyx_self, struct LxmlElement *__pyx_v_element); /* proto */
2761 static PyObject *__pyx_pf_4lxml_9objectify_16__unpickleElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
2762 static PyObject *__pyx_pf_4lxml_9objectify_18pickleReduceElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
2763 static int __pyx_pf_4lxml_9objectify_27ObjectifyElementClassLookup___init__(struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *__pyx_v_self, PyObject *__pyx_v_tree_class, PyObject *__pyx_v_empty_data_class); /* proto */
2764 static PyObject *__pyx_pf_4lxml_9objectify_20pyannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_xsi, PyObject *__pyx_v_empty_pytype); /* proto */
2765 static PyObject *__pyx_pf_4lxml_9objectify_22xsiannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_pytype, PyObject *__pyx_v_empty_type); /* proto */
2766 static PyObject *__pyx_pf_4lxml_9objectify_24annotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_xsi, PyObject *__pyx_v_empty_pytype, PyObject *__pyx_v_empty_type, PyObject *__pyx_v_annotate_xsi, PyObject *__pyx_v_annotate_pytype); /* proto */
2767 static PyObject *__pyx_pf_4lxml_9objectify_26deannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, int __pyx_v_pytype, int __pyx_v_xsi, int __pyx_v_xsi_nil, int __pyx_v_cleanup_namespaces); /* proto */
2768 static PyObject *__pyx_pf_4lxml_9objectify_28set_default_parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_new_parser); /* proto */
2769 static PyObject *__pyx_pf_4lxml_9objectify_30makeparser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kw); /* proto */
2770 static PyObject *__pyx_pf_4lxml_9objectify_32fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xml, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url); /* proto */
2771 static PyObject *__pyx_pf_4lxml_9objectify_34XML(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xml, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url); /* proto */
2772 static PyObject *__pyx_pf_4lxml_9objectify_36parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url); /* proto */
2773 static PyObject *__pyx_pf_4lxml_9objectify_38Element(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v__pytype, PyObject *__pyx_v__attributes); /* proto */
2774 static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__value, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v__pytype, PyObject *__pyx_v__xsi, PyObject *__pyx_v__attributes); /* proto */
2775 static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
2776 static void __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2777 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2778 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_6__call__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v__default); /* proto */
2779 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root); /* proto */
2780 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_10setattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v_value); /* proto */
2781 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_12addattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v_value); /* proto */
2782 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2783 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2784 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2785 static PyObject *__pyx_tp_new_4lxml_9objectify_NumberElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2786 static PyObject *__pyx_tp_new_4lxml_9objectify_IntElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2787 static PyObject *__pyx_tp_new_4lxml_9objectify_LongElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2788 static PyObject *__pyx_tp_new_4lxml_9objectify_FloatElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2789 static PyObject *__pyx_tp_new_4lxml_9objectify_StringElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2790 static PyObject *__pyx_tp_new_4lxml_9objectify_NoneElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2791 static PyObject *__pyx_tp_new_4lxml_9objectify_BoolElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2792 static PyObject *__pyx_tp_new_4lxml_9objectify_PyType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2793 static PyObject *__pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2794 static PyObject *__pyx_tp_new_4lxml_9objectify_ElementMaker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2795 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2796 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectPath(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2797 static __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type_split = {0, &__pyx_n_s_split, 0, 0, 0};
2798 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
2799 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
2800 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, &__pyx_n_s_values, 0, 0, 0};
2801 static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_remove = {0, &__pyx_n_s_remove, 0, 0, 0};
2802 static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, &__pyx_n_s_strip, 0, 0, 0};
2803 static PyObject *__pyx_int_0;
2804 static PyObject *__pyx_int_1;
2805 static PyObject *__pyx_int_neg_1;
2806 static PyObject *__pyx_slice__3;
2807 static PyObject *__pyx_tuple__5;
2808 static PyObject *__pyx_tuple__6;
2809 static PyObject *__pyx_tuple__7;
2810 static PyObject *__pyx_tuple__8;
2811 static PyObject *__pyx_slice__16;
2812 static PyObject *__pyx_tuple__18;
2813 static PyObject *__pyx_tuple__22;
2814 static PyObject *__pyx_tuple__24;
2815 static PyObject *__pyx_tuple__25;
2816 static PyObject *__pyx_tuple__27;
2817 static PyObject *__pyx_tuple__28;
2818 static PyObject *__pyx_tuple__30;
2819 static PyObject *__pyx_tuple__32;
2820 static PyObject *__pyx_tuple__34;
2821 static PyObject *__pyx_tuple__36;
2822 static PyObject *__pyx_tuple__38;
2823 static PyObject *__pyx_tuple__40;
2824 static PyObject *__pyx_tuple__42;
2825 static PyObject *__pyx_tuple__44;
2826 static PyObject *__pyx_tuple__46;
2827 static PyObject *__pyx_tuple__48;
2828 static PyObject *__pyx_tuple__50;
2829 static PyObject *__pyx_tuple__52;
2830 static PyObject *__pyx_tuple__54;
2831 static PyObject *__pyx_tuple__56;
2832 static PyObject *__pyx_tuple__58;
2833 static PyObject *__pyx_tuple__60;
2834 static PyObject *__pyx_tuple__62;
2835 static PyObject *__pyx_tuple__64;
2836 static PyObject *__pyx_tuple__66;
2837 static PyObject *__pyx_tuple__68;
2838 static PyObject *__pyx_tuple__70;
2839 static PyObject *__pyx_tuple__72;
2840 static PyObject *__pyx_tuple__73;
2841 static PyObject *__pyx_tuple__75;
2842 static PyObject *__pyx_tuple__77;
2843 static PyObject *__pyx_tuple__79;
2844 static PyObject *__pyx_tuple__81;
2845 static PyObject *__pyx_tuple__83;
2846 static PyObject *__pyx_tuple__85;
2847 static PyObject *__pyx_tuple__87;
2848 static PyObject *__pyx_tuple__89;
2849 static PyObject *__pyx_tuple__90;
2850 static PyObject *__pyx_tuple__92;
2851 static PyObject *__pyx_tuple__94;
2852 static PyObject *__pyx_tuple__95;
2853 static PyObject *__pyx_tuple__97;
2854 static PyObject *__pyx_tuple__98;
2855 static PyObject *__pyx_tuple__100;
2856 static PyObject *__pyx_tuple__101;
2857 static PyObject *__pyx_tuple__103;
2858 static PyObject *__pyx_tuple__104;
2859 static PyObject *__pyx_tuple__106;
2860 static PyObject *__pyx_tuple__107;
2861 static PyObject *__pyx_tuple__109;
2862 static PyObject *__pyx_tuple__111;
2863 static PyObject *__pyx_tuple__113;
2864 static PyObject *__pyx_codeobj__26;
2865 static PyObject *__pyx_codeobj__29;
2866 static PyObject *__pyx_codeobj__31;
2867 static PyObject *__pyx_codeobj__33;
2868 static PyObject *__pyx_codeobj__35;
2869 static PyObject *__pyx_codeobj__37;
2870 static PyObject *__pyx_codeobj__39;
2871 static PyObject *__pyx_codeobj__41;
2872 static PyObject *__pyx_codeobj__43;
2873 static PyObject *__pyx_codeobj__45;
2874 static PyObject *__pyx_codeobj__47;
2875 static PyObject *__pyx_codeobj__49;
2876 static PyObject *__pyx_codeobj__51;
2877 static PyObject *__pyx_codeobj__53;
2878 static PyObject *__pyx_codeobj__55;
2879 static PyObject *__pyx_codeobj__57;
2880 static PyObject *__pyx_codeobj__59;
2881 static PyObject *__pyx_codeobj__61;
2882 static PyObject *__pyx_codeobj__63;
2883 static PyObject *__pyx_codeobj__65;
2884 static PyObject *__pyx_codeobj__67;
2885 static PyObject *__pyx_codeobj__69;
2886 static PyObject *__pyx_codeobj__71;
2887 static PyObject *__pyx_codeobj__74;
2888 static PyObject *__pyx_codeobj__76;
2889 static PyObject *__pyx_codeobj__78;
2890 static PyObject *__pyx_codeobj__80;
2891 static PyObject *__pyx_codeobj__82;
2892 static PyObject *__pyx_codeobj__84;
2893 static PyObject *__pyx_codeobj__86;
2894 static PyObject *__pyx_codeobj__88;
2895 static PyObject *__pyx_codeobj__91;
2896 static PyObject *__pyx_codeobj__93;
2897 static PyObject *__pyx_codeobj__96;
2898 static PyObject *__pyx_codeobj__99;
2899 static PyObject *__pyx_codeobj__102;
2900 static PyObject *__pyx_codeobj__105;
2901 static PyObject *__pyx_codeobj__108;
2902 static PyObject *__pyx_codeobj__110;
2903 static PyObject *__pyx_codeobj__112;
2906 /* "lxml/objectify.pyx":50
2907 * # Duplicated from apihelpers.pxi, since dependencies obstruct
2908 * # including apihelpers.pxi.
2909 * cdef strrepr(s): # <<<<<<<<<<<<<<
2910 * """Build a representation of strings which we can use in __repr__
2911 * methods, e.g. _Element.__repr__().
2914 static PyObject *__pyx_f_4lxml_9objectify_strrepr(PyObject *__pyx_v_s) {
2915 PyObject *__pyx_r = NULL;
2916 __Pyx_RefNannyDeclarations
2917 PyObject *__pyx_t_1 = NULL;
2918 PyObject *__pyx_t_2 = NULL;
2919 PyObject *__pyx_t_3 = NULL;
2920 PyObject *__pyx_t_4 = NULL;
2921 int __pyx_lineno = 0;
2922 const char *__pyx_filename = NULL;
2923 int __pyx_clineno = 0;
2924 __Pyx_RefNannySetupContext("strrepr", 0);
2926 /* "lxml/objectify.pyx":54
2927 * methods, e.g. _Element.__repr__().
2929 * return s.encode('unicode-escape') if python.IS_PYTHON2 else s # <<<<<<<<<<<<<<
2933 __Pyx_XDECREF(__pyx_r);
2934 if ((IS_PYTHON2 != 0)) {
2935 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
2936 __Pyx_GOTREF(__pyx_t_3);
2938 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2939 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2940 if (likely(__pyx_t_4)) {
2941 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2942 __Pyx_INCREF(__pyx_t_4);
2943 __Pyx_INCREF(function);
2944 __Pyx_DECREF_SET(__pyx_t_3, function);
2947 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_unicode_escape) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_unicode_escape);
2948 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2949 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
2950 __Pyx_GOTREF(__pyx_t_2);
2951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2952 __pyx_t_1 = __pyx_t_2;
2955 __Pyx_INCREF(__pyx_v_s);
2956 __pyx_t_1 = __pyx_v_s;
2958 __pyx_r = __pyx_t_1;
2962 /* "lxml/objectify.pyx":50
2963 * # Duplicated from apihelpers.pxi, since dependencies obstruct
2964 * # including apihelpers.pxi.
2965 * cdef strrepr(s): # <<<<<<<<<<<<<<
2966 * """Build a representation of strings which we can use in __repr__
2967 * methods, e.g. _Element.__repr__().
2970 /* function exit code */
2972 __Pyx_XDECREF(__pyx_t_1);
2973 __Pyx_XDECREF(__pyx_t_2);
2974 __Pyx_XDECREF(__pyx_t_3);
2975 __Pyx_XDECREF(__pyx_t_4);
2976 __Pyx_AddTraceback("lxml.objectify.strrepr", __pyx_clineno, __pyx_lineno, __pyx_filename);
2979 __Pyx_XGIVEREF(__pyx_r);
2980 __Pyx_RefNannyFinishContext();
2984 /* "lxml/objectify.pyx":57
2987 * cdef object _typename(object t): # <<<<<<<<<<<<<<
2988 * cdef const_char* c_name
2989 * c_name = python._fqtypename(t)
2992 static PyObject *__pyx_f_4lxml_9objectify__typename(PyObject *__pyx_v_t) {
2993 const char *__pyx_v_c_name;
2995 PyObject *__pyx_r = NULL;
2996 __Pyx_RefNannyDeclarations
2998 PyObject *__pyx_t_2 = NULL;
2999 int __pyx_lineno = 0;
3000 const char *__pyx_filename = NULL;
3001 int __pyx_clineno = 0;
3002 __Pyx_RefNannySetupContext("_typename", 0);
3004 /* "lxml/objectify.pyx":59
3005 * cdef object _typename(object t):
3006 * cdef const_char* c_name
3007 * c_name = python._fqtypename(t) # <<<<<<<<<<<<<<
3008 * s = cstring_h.strrchr(c_name, c'.')
3011 __pyx_v_c_name = _fqtypename(__pyx_v_t);
3013 /* "lxml/objectify.pyx":60
3014 * cdef const_char* c_name
3015 * c_name = python._fqtypename(t)
3016 * s = cstring_h.strrchr(c_name, c'.') # <<<<<<<<<<<<<<
3020 __pyx_v_s = strrchr(__pyx_v_c_name, '.');
3022 /* "lxml/objectify.pyx":61
3023 * c_name = python._fqtypename(t)
3024 * s = cstring_h.strrchr(c_name, c'.')
3025 * if s is not NULL: # <<<<<<<<<<<<<<
3027 * return pyunicode(<const_xmlChar*>c_name)
3029 __pyx_t_1 = ((__pyx_v_s != NULL) != 0);
3032 /* "lxml/objectify.pyx":62
3033 * s = cstring_h.strrchr(c_name, c'.')
3035 * c_name = s + 1 # <<<<<<<<<<<<<<
3036 * return pyunicode(<const_xmlChar*>c_name)
3039 __pyx_v_c_name = (__pyx_v_s + 1);
3041 /* "lxml/objectify.pyx":61
3042 * c_name = python._fqtypename(t)
3043 * s = cstring_h.strrchr(c_name, c'.')
3044 * if s is not NULL: # <<<<<<<<<<<<<<
3046 * return pyunicode(<const_xmlChar*>c_name)
3050 /* "lxml/objectify.pyx":63
3053 * return pyunicode(<const_xmlChar*>c_name) # <<<<<<<<<<<<<<
3057 __Pyx_XDECREF(__pyx_r);
3058 __pyx_t_2 = pyunicode(((const xmlChar *)__pyx_v_c_name)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3059 __Pyx_GOTREF(__pyx_t_2);
3060 __pyx_r = __pyx_t_2;
3064 /* "lxml/objectify.pyx":57
3067 * cdef object _typename(object t): # <<<<<<<<<<<<<<
3068 * cdef const_char* c_name
3069 * c_name = python._fqtypename(t)
3072 /* function exit code */
3074 __Pyx_XDECREF(__pyx_t_2);
3075 __Pyx_AddTraceback("lxml.objectify._typename", __pyx_clineno, __pyx_lineno, __pyx_filename);
3078 __Pyx_XGIVEREF(__pyx_r);
3079 __Pyx_RefNannyFinishContext();
3083 /* "lxml/objectify.pyx":79
3084 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
3086 * cdef tuple _unicodeAndUtf8(s): # <<<<<<<<<<<<<<
3087 * return s, python.PyUnicode_AsUTF8String(s)
3091 static PyObject *__pyx_f_4lxml_9objectify__unicodeAndUtf8(PyObject *__pyx_v_s) {
3092 PyObject *__pyx_r = NULL;
3093 __Pyx_RefNannyDeclarations
3094 PyObject *__pyx_t_1 = NULL;
3095 PyObject *__pyx_t_2 = NULL;
3096 int __pyx_lineno = 0;
3097 const char *__pyx_filename = NULL;
3098 int __pyx_clineno = 0;
3099 __Pyx_RefNannySetupContext("_unicodeAndUtf8", 0);
3101 /* "lxml/objectify.pyx":80
3103 * cdef tuple _unicodeAndUtf8(s):
3104 * return s, python.PyUnicode_AsUTF8String(s) # <<<<<<<<<<<<<<
3106 * def set_pytype_attribute_tag(attribute_tag=None):
3108 __Pyx_XDECREF(__pyx_r);
3109 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
3110 __Pyx_GOTREF(__pyx_t_1);
3111 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
3112 __Pyx_GOTREF(__pyx_t_2);
3113 __Pyx_INCREF(__pyx_v_s);
3114 __Pyx_GIVEREF(__pyx_v_s);
3115 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
3116 __Pyx_GIVEREF(__pyx_t_1);
3117 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3119 __pyx_r = ((PyObject*)__pyx_t_2);
3123 /* "lxml/objectify.pyx":79
3124 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
3126 * cdef tuple _unicodeAndUtf8(s): # <<<<<<<<<<<<<<
3127 * return s, python.PyUnicode_AsUTF8String(s)
3131 /* function exit code */
3133 __Pyx_XDECREF(__pyx_t_1);
3134 __Pyx_XDECREF(__pyx_t_2);
3135 __Pyx_AddTraceback("lxml.objectify._unicodeAndUtf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
3138 __Pyx_XGIVEREF(__pyx_r);
3139 __Pyx_RefNannyFinishContext();
3143 /* "lxml/objectify.pyx":82
3144 * return s, python.PyUnicode_AsUTF8String(s)
3146 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
3147 * u"""set_pytype_attribute_tag(attribute_tag=None)
3148 * Change name and namespace of the XML attribute that holds Python type
3151 /* Python wrapper */
3152 static PyObject *__pyx_pw_4lxml_9objectify_1set_pytype_attribute_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3153 static char __pyx_doc_4lxml_9objectify_set_pytype_attribute_tag[] = "set_pytype_attribute_tag(attribute_tag=None)\n Change name and namespace of the XML attribute that holds Python type\n information.\n\n Do not use this unless you know what you are doing.\n\n Reset by calling without argument.\n\n Default: \"{http://codespeak.net/lxml/objectify/pytype}pytype\"\n ";
3154 static PyMethodDef __pyx_mdef_4lxml_9objectify_1set_pytype_attribute_tag = {"set_pytype_attribute_tag", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_1set_pytype_attribute_tag, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_set_pytype_attribute_tag};
3155 static PyObject *__pyx_pw_4lxml_9objectify_1set_pytype_attribute_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3156 PyObject *__pyx_v_attribute_tag = 0;
3157 int __pyx_lineno = 0;
3158 const char *__pyx_filename = NULL;
3159 int __pyx_clineno = 0;
3160 PyObject *__pyx_r = 0;
3161 __Pyx_RefNannyDeclarations
3162 __Pyx_RefNannySetupContext("set_pytype_attribute_tag (wrapper)", 0);
3164 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attribute_tag,0};
3165 PyObject* values[1] = {0};
3166 values[0] = ((PyObject *)((PyObject *)Py_None));
3167 if (unlikely(__pyx_kwds)) {
3169 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3171 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3174 default: goto __pyx_L5_argtuple_error;
3176 kw_args = PyDict_Size(__pyx_kwds);
3180 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute_tag);
3181 if (value) { values[0] = value; kw_args--; }
3184 if (unlikely(kw_args > 0)) {
3185 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_pytype_attribute_tag") < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
3188 switch (PyTuple_GET_SIZE(__pyx_args)) {
3189 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3192 default: goto __pyx_L5_argtuple_error;
3195 __pyx_v_attribute_tag = values[0];
3197 goto __pyx_L4_argument_unpacking_done;
3198 __pyx_L5_argtuple_error:;
3199 __Pyx_RaiseArgtupleInvalid("set_pytype_attribute_tag", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error)
3201 __Pyx_AddTraceback("lxml.objectify.set_pytype_attribute_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
3202 __Pyx_RefNannyFinishContext();
3204 __pyx_L4_argument_unpacking_done:;
3205 __pyx_r = __pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(__pyx_self, __pyx_v_attribute_tag);
3207 /* function exit code */
3208 __Pyx_RefNannyFinishContext();
3212 static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attribute_tag) {
3213 PyObject *__pyx_r = NULL;
3214 __Pyx_RefNannyDeclarations
3217 PyObject *__pyx_t_3 = NULL;
3218 PyObject *__pyx_t_4 = NULL;
3219 PyObject *__pyx_t_5 = NULL;
3220 const xmlChar *__pyx_t_6;
3221 int __pyx_lineno = 0;
3222 const char *__pyx_filename = NULL;
3223 int __pyx_clineno = 0;
3224 __Pyx_RefNannySetupContext("set_pytype_attribute_tag", 0);
3226 /* "lxml/objectify.pyx":96
3227 * global PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8
3228 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3229 * if attribute_tag is None: # <<<<<<<<<<<<<<
3230 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3231 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3233 __pyx_t_1 = (__pyx_v_attribute_tag == Py_None);
3234 __pyx_t_2 = (__pyx_t_1 != 0);
3237 /* "lxml/objectify.pyx":98
3238 * if attribute_tag is None:
3239 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3240 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype") # <<<<<<<<<<<<<<
3241 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3242 * _unicodeAndUtf8(u"pytype")
3244 __pyx_t_3 = __pyx_f_4lxml_9objectify__unicodeAndUtf8(__pyx_kp_u_http_codespeak_net_lxml_objectif); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
3245 __Pyx_GOTREF(__pyx_t_3);
3246 if (likely(__pyx_t_3 != Py_None)) {
3247 PyObject* sequence = __pyx_t_3;
3248 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3249 if (unlikely(size != 2)) {
3250 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3251 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3252 __PYX_ERR(0, 97, __pyx_L1_error)
3254 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3255 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
3256 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3257 __Pyx_INCREF(__pyx_t_4);
3258 __Pyx_INCREF(__pyx_t_5);
3260 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
3261 __Pyx_GOTREF(__pyx_t_4);
3262 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
3263 __Pyx_GOTREF(__pyx_t_5);
3265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3267 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 97, __pyx_L1_error)
3270 /* "lxml/objectify.pyx":97
3271 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3272 * if attribute_tag is None:
3273 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \ # <<<<<<<<<<<<<<
3274 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3275 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3277 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 97, __pyx_L1_error)
3278 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
3279 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE, __pyx_t_4);
3280 __Pyx_GIVEREF(__pyx_t_4);
3282 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
3283 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, ((PyObject*)__pyx_t_5));
3284 __Pyx_GIVEREF(__pyx_t_5);
3287 /* "lxml/objectify.pyx":100
3288 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3289 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3290 * _unicodeAndUtf8(u"pytype") # <<<<<<<<<<<<<<
3292 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3294 __pyx_t_3 = __pyx_f_4lxml_9objectify__unicodeAndUtf8(__pyx_n_u_pytype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
3295 __Pyx_GOTREF(__pyx_t_3);
3296 if (likely(__pyx_t_3 != Py_None)) {
3297 PyObject* sequence = __pyx_t_3;
3298 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3299 if (unlikely(size != 2)) {
3300 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3301 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3302 __PYX_ERR(0, 99, __pyx_L1_error)
3304 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3305 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3306 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
3307 __Pyx_INCREF(__pyx_t_5);
3308 __Pyx_INCREF(__pyx_t_4);
3310 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error)
3311 __Pyx_GOTREF(__pyx_t_5);
3312 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
3313 __Pyx_GOTREF(__pyx_t_4);
3315 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3317 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 99, __pyx_L1_error)
3320 /* "lxml/objectify.pyx":99
3321 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3322 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3323 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3324 * _unicodeAndUtf8(u"pytype")
3327 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 99, __pyx_L1_error)
3328 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
3329 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME, __pyx_t_5);
3330 __Pyx_GIVEREF(__pyx_t_5);
3332 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
3333 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, ((PyObject*)__pyx_t_4));
3334 __Pyx_GIVEREF(__pyx_t_4);
3337 /* "lxml/objectify.pyx":96
3338 * global PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8
3339 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3340 * if attribute_tag is None: # <<<<<<<<<<<<<<
3341 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3342 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3347 /* "lxml/objectify.pyx":102
3348 * _unicodeAndUtf8(u"pytype")
3350 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3351 * cetree.getNsTag(attribute_tag)
3352 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3356 /* "lxml/objectify.pyx":103
3358 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3359 * cetree.getNsTag(attribute_tag) # <<<<<<<<<<<<<<
3360 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3361 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3363 __pyx_t_3 = getNsTag(__pyx_v_attribute_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
3364 __Pyx_GOTREF(__pyx_t_3);
3365 if (likely(__pyx_t_3 != Py_None)) {
3366 PyObject* sequence = __pyx_t_3;
3367 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3368 if (unlikely(size != 2)) {
3369 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3370 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3371 __PYX_ERR(0, 102, __pyx_L1_error)
3373 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3374 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
3375 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3376 __Pyx_INCREF(__pyx_t_4);
3377 __Pyx_INCREF(__pyx_t_5);
3379 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
3380 __Pyx_GOTREF(__pyx_t_4);
3381 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error)
3382 __Pyx_GOTREF(__pyx_t_5);
3384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3386 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 102, __pyx_L1_error)
3389 /* "lxml/objectify.pyx":102
3390 * _unicodeAndUtf8(u"pytype")
3392 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3393 * cetree.getNsTag(attribute_tag)
3394 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3396 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 102, __pyx_L1_error)
3397 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 102, __pyx_L1_error)
3398 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
3399 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, ((PyObject*)__pyx_t_4));
3400 __Pyx_GIVEREF(__pyx_t_4);
3402 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
3403 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, ((PyObject*)__pyx_t_5));
3404 __Pyx_GIVEREF(__pyx_t_5);
3407 /* "lxml/objectify.pyx":104
3408 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3409 * cetree.getNsTag(attribute_tag)
3410 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8') # <<<<<<<<<<<<<<
3411 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3414 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
3415 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
3416 __PYX_ERR(0, 104, __pyx_L1_error)
3418 __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
3419 __Pyx_GOTREF(__pyx_t_3);
3420 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
3421 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE, __pyx_t_3);
3422 __Pyx_GIVEREF(__pyx_t_3);
3425 /* "lxml/objectify.pyx":105
3426 * cetree.getNsTag(attribute_tag)
3427 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3428 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8') # <<<<<<<<<<<<<<
3430 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3432 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
3433 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
3434 __PYX_ERR(0, 105, __pyx_L1_error)
3436 __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_3);
3438 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
3439 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME, __pyx_t_3);
3440 __Pyx_GIVEREF(__pyx_t_3);
3445 /* "lxml/objectify.pyx":107
3446 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3448 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8 # <<<<<<<<<<<<<<
3449 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8
3450 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
3452 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
3453 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
3454 __PYX_ERR(0, 107, __pyx_L1_error)
3456 __pyx_t_6 = __Pyx_PyBytes_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error)
3457 __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE = __pyx_t_6;
3459 /* "lxml/objectify.pyx":108
3461 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3462 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8 # <<<<<<<<<<<<<<
3463 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
3464 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
3466 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
3467 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
3468 __PYX_ERR(0, 108, __pyx_L1_error)
3470 __pyx_t_6 = __Pyx_PyBytes_AsUString(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
3471 __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME = __pyx_t_6;
3473 /* "lxml/objectify.pyx":109
3474 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3475 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8
3476 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName( # <<<<<<<<<<<<<<
3477 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
3480 __pyx_t_3 = namespacedNameFromNsName(__pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_3);
3482 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYTYPE_ATTRIBUTE, __pyx_t_3) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
3483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3485 /* "lxml/objectify.pyx":82
3486 * return s, python.PyUnicode_AsUTF8String(s)
3488 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
3489 * u"""set_pytype_attribute_tag(attribute_tag=None)
3490 * Change name and namespace of the XML attribute that holds Python type
3493 /* function exit code */
3494 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3497 __Pyx_XDECREF(__pyx_t_3);
3498 __Pyx_XDECREF(__pyx_t_4);
3499 __Pyx_XDECREF(__pyx_t_5);
3500 __Pyx_AddTraceback("lxml.objectify.set_pytype_attribute_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
3503 __Pyx_XGIVEREF(__pyx_r);
3504 __Pyx_RefNannyFinishContext();
3508 /* "lxml/objectify.pyx":147
3511 * def __iter__(self): # <<<<<<<<<<<<<<
3512 * u"""Iterate over self and all siblings with the same tag.
3516 /* Python wrapper */
3517 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__(PyObject *__pyx_v_self); /*proto*/
3518 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement___iter__[] = "Iterate over self and all siblings with the same tag.\n ";
3519 #if CYTHON_COMPILING_IN_CPYTHON
3520 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__;
3522 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__(PyObject *__pyx_v_self) {
3523 PyObject *__pyx_r = 0;
3524 __Pyx_RefNannyDeclarations
3525 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
3526 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3528 /* function exit code */
3529 __Pyx_RefNannyFinishContext();
3533 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3534 PyObject *__pyx_v_parent = NULL;
3535 PyObject *__pyx_r = NULL;
3536 __Pyx_RefNannyDeclarations
3537 PyObject *__pyx_t_1 = NULL;
3538 PyObject *__pyx_t_2 = NULL;
3539 PyObject *__pyx_t_3 = NULL;
3542 PyObject *__pyx_t_6 = NULL;
3543 int __pyx_lineno = 0;
3544 const char *__pyx_filename = NULL;
3545 int __pyx_clineno = 0;
3546 __Pyx_RefNannySetupContext("__iter__", 0);
3548 /* "lxml/objectify.pyx":150
3549 * u"""Iterate over self and all siblings with the same tag.
3551 * parent = self.getparent() # <<<<<<<<<<<<<<
3552 * if parent is None:
3553 * return iter([self])
3555 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getparent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
3556 __Pyx_GOTREF(__pyx_t_2);
3558 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3559 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3560 if (likely(__pyx_t_3)) {
3561 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3562 __Pyx_INCREF(__pyx_t_3);
3563 __Pyx_INCREF(function);
3564 __Pyx_DECREF_SET(__pyx_t_2, function);
3567 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3568 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3569 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
3570 __Pyx_GOTREF(__pyx_t_1);
3571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3572 __pyx_v_parent = __pyx_t_1;
3575 /* "lxml/objectify.pyx":151
3577 * parent = self.getparent()
3578 * if parent is None: # <<<<<<<<<<<<<<
3579 * return iter([self])
3580 * return etree.ElementChildIterator(parent, tag=self.tag)
3582 __pyx_t_4 = (__pyx_v_parent == Py_None);
3583 __pyx_t_5 = (__pyx_t_4 != 0);
3586 /* "lxml/objectify.pyx":152
3587 * parent = self.getparent()
3588 * if parent is None:
3589 * return iter([self]) # <<<<<<<<<<<<<<
3590 * return etree.ElementChildIterator(parent, tag=self.tag)
3593 __Pyx_XDECREF(__pyx_r);
3594 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
3595 __Pyx_GOTREF(__pyx_t_1);
3596 __Pyx_INCREF(((PyObject *)__pyx_v_self));
3597 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3598 PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
3599 __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
3600 __Pyx_GOTREF(__pyx_t_2);
3601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3602 __pyx_r = __pyx_t_2;
3606 /* "lxml/objectify.pyx":151
3608 * parent = self.getparent()
3609 * if parent is None: # <<<<<<<<<<<<<<
3610 * return iter([self])
3611 * return etree.ElementChildIterator(parent, tag=self.tag)
3615 /* "lxml/objectify.pyx":153
3616 * if parent is None:
3617 * return iter([self])
3618 * return etree.ElementChildIterator(parent, tag=self.tag) # <<<<<<<<<<<<<<
3620 * def __str__(self):
3622 __Pyx_XDECREF(__pyx_r);
3623 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_ElementChildIterator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
3624 __Pyx_GOTREF(__pyx_t_2);
3625 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
3626 __Pyx_GOTREF(__pyx_t_1);
3627 __Pyx_INCREF(__pyx_v_parent);
3628 __Pyx_GIVEREF(__pyx_v_parent);
3629 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_parent);
3630 __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3631 __Pyx_GOTREF(__pyx_t_3);
3632 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
3633 __Pyx_GOTREF(__pyx_t_6);
3634 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tag, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
3635 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3636 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
3637 __Pyx_GOTREF(__pyx_t_6);
3638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3640 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3641 __pyx_r = __pyx_t_6;
3645 /* "lxml/objectify.pyx":147
3648 * def __iter__(self): # <<<<<<<<<<<<<<
3649 * u"""Iterate over self and all siblings with the same tag.
3653 /* function exit code */
3655 __Pyx_XDECREF(__pyx_t_1);
3656 __Pyx_XDECREF(__pyx_t_2);
3657 __Pyx_XDECREF(__pyx_t_3);
3658 __Pyx_XDECREF(__pyx_t_6);
3659 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3662 __Pyx_XDECREF(__pyx_v_parent);
3663 __Pyx_XGIVEREF(__pyx_r);
3664 __Pyx_RefNannyFinishContext();
3668 /* "lxml/objectify.pyx":155
3669 * return etree.ElementChildIterator(parent, tag=self.tag)
3671 * def __str__(self): # <<<<<<<<<<<<<<
3672 * if __RECURSIVE_STR:
3673 * return _dump(self, 0)
3676 /* Python wrapper */
3677 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__(PyObject *__pyx_v_self); /*proto*/
3678 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__(PyObject *__pyx_v_self) {
3679 PyObject *__pyx_r = 0;
3680 __Pyx_RefNannyDeclarations
3681 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
3682 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3684 /* function exit code */
3685 __Pyx_RefNannyFinishContext();
3689 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3690 PyObject *__pyx_r = NULL;
3691 __Pyx_RefNannyDeclarations
3693 PyObject *__pyx_t_2 = NULL;
3694 PyObject *__pyx_t_3 = NULL;
3695 int __pyx_lineno = 0;
3696 const char *__pyx_filename = NULL;
3697 int __pyx_clineno = 0;
3698 __Pyx_RefNannySetupContext("__str__", 0);
3700 /* "lxml/objectify.pyx":156
3702 * def __str__(self):
3703 * if __RECURSIVE_STR: # <<<<<<<<<<<<<<
3704 * return _dump(self, 0)
3707 __pyx_t_1 = (__pyx_v_4lxml_9objectify___RECURSIVE_STR != 0);
3710 /* "lxml/objectify.pyx":157
3711 * def __str__(self):
3712 * if __RECURSIVE_STR:
3713 * return _dump(self, 0) # <<<<<<<<<<<<<<
3715 * return textOf(self._c_node) or u''
3717 __Pyx_XDECREF(__pyx_r);
3718 __pyx_t_2 = __pyx_f_4lxml_9objectify__dump(((struct LxmlElement *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
3719 __Pyx_GOTREF(__pyx_t_2);
3720 __pyx_r = __pyx_t_2;
3724 /* "lxml/objectify.pyx":156
3726 * def __str__(self):
3727 * if __RECURSIVE_STR: # <<<<<<<<<<<<<<
3728 * return _dump(self, 0)
3733 /* "lxml/objectify.pyx":159
3734 * return _dump(self, 0)
3736 * return textOf(self._c_node) or u'' # <<<<<<<<<<<<<<
3738 * # pickle support for objectified Element
3741 __Pyx_XDECREF(__pyx_r);
3742 __pyx_t_3 = textOf(__pyx_v_self->__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3743 __Pyx_GOTREF(__pyx_t_3);
3744 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3748 __Pyx_INCREF(__pyx_t_3);
3749 __pyx_t_2 = __pyx_t_3;
3750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3751 goto __pyx_L4_bool_binop_done;
3753 __Pyx_INCREF(__pyx_kp_u_);
3754 __pyx_t_2 = __pyx_kp_u_;
3755 __pyx_L4_bool_binop_done:;
3756 __pyx_r = __pyx_t_2;
3761 /* "lxml/objectify.pyx":155
3762 * return etree.ElementChildIterator(parent, tag=self.tag)
3764 * def __str__(self): # <<<<<<<<<<<<<<
3765 * if __RECURSIVE_STR:
3766 * return _dump(self, 0)
3769 /* function exit code */
3771 __Pyx_XDECREF(__pyx_t_2);
3772 __Pyx_XDECREF(__pyx_t_3);
3773 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3776 __Pyx_XGIVEREF(__pyx_r);
3777 __Pyx_RefNannyFinishContext();
3781 /* "lxml/objectify.pyx":162
3783 * # pickle support for objectified Element
3784 * def __reduce__(self): # <<<<<<<<<<<<<<
3785 * return fromstring, (etree.tostring(self),)
3789 /* Python wrapper */
3790 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3791 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__, METH_NOARGS, 0};
3792 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3793 PyObject *__pyx_r = 0;
3794 __Pyx_RefNannyDeclarations
3795 __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
3796 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3798 /* function exit code */
3799 __Pyx_RefNannyFinishContext();
3803 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3804 PyObject *__pyx_r = NULL;
3805 __Pyx_RefNannyDeclarations
3806 PyObject *__pyx_t_1 = NULL;
3807 PyObject *__pyx_t_2 = NULL;
3808 PyObject *__pyx_t_3 = NULL;
3809 PyObject *__pyx_t_4 = NULL;
3810 int __pyx_lineno = 0;
3811 const char *__pyx_filename = NULL;
3812 int __pyx_clineno = 0;
3813 __Pyx_RefNannySetupContext("__reduce__", 0);
3815 /* "lxml/objectify.pyx":163
3816 * # pickle support for objectified Element
3817 * def __reduce__(self):
3818 * return fromstring, (etree.tostring(self),) # <<<<<<<<<<<<<<
3822 __Pyx_XDECREF(__pyx_r);
3823 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
3824 __Pyx_GOTREF(__pyx_t_1);
3825 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_tostring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3826 __Pyx_GOTREF(__pyx_t_3);
3828 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3829 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3830 if (likely(__pyx_t_4)) {
3831 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3832 __Pyx_INCREF(__pyx_t_4);
3833 __Pyx_INCREF(function);
3834 __Pyx_DECREF_SET(__pyx_t_3, function);
3837 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_self)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self));
3838 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3839 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
3840 __Pyx_GOTREF(__pyx_t_2);
3841 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3842 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3843 __Pyx_GOTREF(__pyx_t_3);
3844 __Pyx_GIVEREF(__pyx_t_2);
3845 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3847 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
3848 __Pyx_GOTREF(__pyx_t_2);
3849 __Pyx_GIVEREF(__pyx_t_1);
3850 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3851 __Pyx_GIVEREF(__pyx_t_3);
3852 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3855 __pyx_r = __pyx_t_2;
3859 /* "lxml/objectify.pyx":162
3861 * # pickle support for objectified Element
3862 * def __reduce__(self): # <<<<<<<<<<<<<<
3863 * return fromstring, (etree.tostring(self),)
3867 /* function exit code */
3869 __Pyx_XDECREF(__pyx_t_1);
3870 __Pyx_XDECREF(__pyx_t_2);
3871 __Pyx_XDECREF(__pyx_t_3);
3872 __Pyx_XDECREF(__pyx_t_4);
3873 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3876 __Pyx_XGIVEREF(__pyx_r);
3877 __Pyx_RefNannyFinishContext();
3881 /* "lxml/objectify.pyx":166
3884 * def text(self): # <<<<<<<<<<<<<<
3885 * return textOf(self._c_node)
3889 /* Python wrapper */
3890 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(PyObject *__pyx_v_self); /*proto*/
3891 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(PyObject *__pyx_v_self) {
3892 PyObject *__pyx_r = 0;
3893 __Pyx_RefNannyDeclarations
3894 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3895 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3897 /* function exit code */
3898 __Pyx_RefNannyFinishContext();
3902 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3903 PyObject *__pyx_r = NULL;
3904 __Pyx_RefNannyDeclarations
3905 PyObject *__pyx_t_1 = NULL;
3906 int __pyx_lineno = 0;
3907 const char *__pyx_filename = NULL;
3908 int __pyx_clineno = 0;
3909 __Pyx_RefNannySetupContext("__get__", 0);
3911 /* "lxml/objectify.pyx":167
3914 * return textOf(self._c_node) # <<<<<<<<<<<<<<
3918 __Pyx_XDECREF(__pyx_r);
3919 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
3920 __Pyx_GOTREF(__pyx_t_1);
3921 __pyx_r = __pyx_t_1;
3925 /* "lxml/objectify.pyx":166
3928 * def text(self): # <<<<<<<<<<<<<<
3929 * return textOf(self._c_node)
3933 /* function exit code */
3935 __Pyx_XDECREF(__pyx_t_1);
3936 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.text.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3939 __Pyx_XGIVEREF(__pyx_r);
3940 __Pyx_RefNannyFinishContext();
3944 /* "lxml/objectify.pyx":170
3947 * def __dict__(self): # <<<<<<<<<<<<<<
3948 * """A fake implementation for __dict__ to support dir() etc.
3952 /* Python wrapper */
3953 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(PyObject *__pyx_v_self); /*proto*/
3954 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(PyObject *__pyx_v_self) {
3955 PyObject *__pyx_r = 0;
3956 __Pyx_RefNannyDeclarations
3957 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3958 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3960 /* function exit code */
3961 __Pyx_RefNannyFinishContext();
3965 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3966 struct LxmlElement *__pyx_v_child = 0;
3967 PyObject *__pyx_v_children = 0;
3968 const xmlChar *__pyx_v_c_ns;
3969 PyObject *__pyx_v_tag = NULL;
3970 PyObject *__pyx_v_name = NULL;
3971 PyObject *__pyx_r = NULL;
3972 __Pyx_RefNannyDeclarations
3973 PyObject *__pyx_t_1 = NULL;
3974 PyObject *__pyx_t_2 = NULL;
3975 PyObject *__pyx_t_3 = NULL;
3976 PyObject *__pyx_t_4 = NULL;
3977 Py_ssize_t __pyx_t_5;
3978 PyObject *(*__pyx_t_6)(PyObject *);
3981 int __pyx_lineno = 0;
3982 const char *__pyx_filename = NULL;
3983 int __pyx_clineno = 0;
3984 __Pyx_RefNannySetupContext("__get__", 0);
3986 /* "lxml/objectify.pyx":177
3987 * cdef _Element child
3988 * cdef dict children
3989 * c_ns = tree._getNs(self._c_node) # <<<<<<<<<<<<<<
3990 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
3993 __pyx_v_c_ns = _getNs(__pyx_v_self->__pyx_base.__pyx_base._c_node);
3995 /* "lxml/objectify.pyx":178
3996 * cdef dict children
3997 * c_ns = tree._getNs(self._c_node)
3998 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None # <<<<<<<<<<<<<<
4000 * for child in etree.ElementChildIterator(self, tag=tag):
4002 if (((__pyx_v_c_ns != NULL) != 0)) {
4003 __pyx_t_2 = pyunicode(__pyx_v_c_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
4004 __Pyx_GOTREF(__pyx_t_2);
4005 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
4006 __Pyx_GOTREF(__pyx_t_3);
4007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4008 __pyx_t_1 = __pyx_t_3;
4011 __Pyx_INCREF(Py_None);
4012 __pyx_t_1 = Py_None;
4014 __pyx_v_tag = __pyx_t_1;
4017 /* "lxml/objectify.pyx":179
4018 * c_ns = tree._getNs(self._c_node)
4019 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4020 * children = {} # <<<<<<<<<<<<<<
4021 * for child in etree.ElementChildIterator(self, tag=tag):
4022 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4024 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4025 __Pyx_GOTREF(__pyx_t_1);
4026 __pyx_v_children = ((PyObject*)__pyx_t_1);
4029 /* "lxml/objectify.pyx":180
4030 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4032 * for child in etree.ElementChildIterator(self, tag=tag): # <<<<<<<<<<<<<<
4033 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4036 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_ElementChildIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
4037 __Pyx_GOTREF(__pyx_t_1);
4038 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
4039 __Pyx_GOTREF(__pyx_t_3);
4040 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4041 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4042 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
4043 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
4044 __Pyx_GOTREF(__pyx_t_2);
4045 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
4046 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
4047 __Pyx_GOTREF(__pyx_t_4);
4048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4050 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4051 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
4052 __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4055 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
4056 __Pyx_GOTREF(__pyx_t_2);
4057 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error)
4059 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4061 if (likely(!__pyx_t_6)) {
4062 if (likely(PyList_CheckExact(__pyx_t_2))) {
4063 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
4064 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4065 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
4067 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
4068 __Pyx_GOTREF(__pyx_t_4);
4071 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
4072 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4073 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
4075 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
4076 __Pyx_GOTREF(__pyx_t_4);
4080 __pyx_t_4 = __pyx_t_6(__pyx_t_2);
4081 if (unlikely(!__pyx_t_4)) {
4082 PyObject* exc_type = PyErr_Occurred();
4084 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4085 else __PYX_ERR(0, 180, __pyx_L1_error)
4089 __Pyx_GOTREF(__pyx_t_4);
4091 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 180, __pyx_L1_error)
4092 __Pyx_XDECREF_SET(__pyx_v_child, ((struct LxmlElement *)__pyx_t_4));
4095 /* "lxml/objectify.pyx":181
4097 * for child in etree.ElementChildIterator(self, tag=tag):
4098 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL: # <<<<<<<<<<<<<<
4100 * name = pyunicode(child._c_node.name)
4102 __pyx_t_8 = ((__pyx_v_c_ns == NULL) != 0);
4105 __pyx_t_7 = __pyx_t_8;
4106 goto __pyx_L6_bool_binop_done;
4108 __pyx_t_8 = ((_getNs(__pyx_v_child->_c_node) != NULL) != 0);
4109 __pyx_t_7 = __pyx_t_8;
4110 __pyx_L6_bool_binop_done:;
4113 /* "lxml/objectify.pyx":182
4114 * for child in etree.ElementChildIterator(self, tag=tag):
4115 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4116 * continue # <<<<<<<<<<<<<<
4117 * name = pyunicode(child._c_node.name)
4118 * if name not in children:
4120 goto __pyx_L3_continue;
4122 /* "lxml/objectify.pyx":181
4124 * for child in etree.ElementChildIterator(self, tag=tag):
4125 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL: # <<<<<<<<<<<<<<
4127 * name = pyunicode(child._c_node.name)
4131 /* "lxml/objectify.pyx":183
4132 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4134 * name = pyunicode(child._c_node.name) # <<<<<<<<<<<<<<
4135 * if name not in children:
4136 * children[name] = child
4138 __pyx_t_4 = pyunicode(__pyx_v_child->_c_node->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
4139 __Pyx_GOTREF(__pyx_t_4);
4140 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
4143 /* "lxml/objectify.pyx":184
4145 * name = pyunicode(child._c_node.name)
4146 * if name not in children: # <<<<<<<<<<<<<<
4147 * children[name] = child
4150 __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_children, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 184, __pyx_L1_error)
4151 __pyx_t_8 = (__pyx_t_7 != 0);
4154 /* "lxml/objectify.pyx":185
4155 * name = pyunicode(child._c_node.name)
4156 * if name not in children:
4157 * children[name] = child # <<<<<<<<<<<<<<
4161 if (unlikely(PyDict_SetItem(__pyx_v_children, __pyx_v_name, ((PyObject *)__pyx_v_child)) < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
4163 /* "lxml/objectify.pyx":184
4165 * name = pyunicode(child._c_node.name)
4166 * if name not in children: # <<<<<<<<<<<<<<
4167 * children[name] = child
4172 /* "lxml/objectify.pyx":180
4173 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4175 * for child in etree.ElementChildIterator(self, tag=tag): # <<<<<<<<<<<<<<
4176 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4181 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4183 /* "lxml/objectify.pyx":186
4184 * if name not in children:
4185 * children[name] = child
4186 * return children # <<<<<<<<<<<<<<
4188 * def __len__(self):
4190 __Pyx_XDECREF(__pyx_r);
4191 __Pyx_INCREF(__pyx_v_children);
4192 __pyx_r = __pyx_v_children;
4195 /* "lxml/objectify.pyx":170
4198 * def __dict__(self): # <<<<<<<<<<<<<<
4199 * """A fake implementation for __dict__ to support dir() etc.
4203 /* function exit code */
4205 __Pyx_XDECREF(__pyx_t_1);
4206 __Pyx_XDECREF(__pyx_t_2);
4207 __Pyx_XDECREF(__pyx_t_3);
4208 __Pyx_XDECREF(__pyx_t_4);
4209 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__dict__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4212 __Pyx_XDECREF((PyObject *)__pyx_v_child);
4213 __Pyx_XDECREF(__pyx_v_children);
4214 __Pyx_XDECREF(__pyx_v_tag);
4215 __Pyx_XDECREF(__pyx_v_name);
4216 __Pyx_XGIVEREF(__pyx_r);
4217 __Pyx_RefNannyFinishContext();
4221 /* "lxml/objectify.pyx":188
4224 * def __len__(self): # <<<<<<<<<<<<<<
4225 * u"""Count self and siblings with the same tag.
4229 /* Python wrapper */
4230 static Py_ssize_t __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__(PyObject *__pyx_v_self); /*proto*/
4231 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_6__len__[] = "Count self and siblings with the same tag.\n ";
4232 #if CYTHON_COMPILING_IN_CPYTHON
4233 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__;
4235 static Py_ssize_t __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__(PyObject *__pyx_v_self) {
4237 __Pyx_RefNannyDeclarations
4238 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
4239 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4241 /* function exit code */
4242 __Pyx_RefNannyFinishContext();
4246 static Py_ssize_t __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4248 __Pyx_RefNannyDeclarations
4249 __Pyx_RefNannySetupContext("__len__", 0);
4251 /* "lxml/objectify.pyx":191
4252 * u"""Count self and siblings with the same tag.
4254 * return _countSiblings(self._c_node) # <<<<<<<<<<<<<<
4256 * def countchildren(self):
4258 __pyx_r = __pyx_f_4lxml_9objectify__countSiblings(__pyx_v_self->__pyx_base.__pyx_base._c_node);
4261 /* "lxml/objectify.pyx":188
4264 * def __len__(self): # <<<<<<<<<<<<<<
4265 * u"""Count self and siblings with the same tag.
4269 /* function exit code */
4271 __Pyx_RefNannyFinishContext();
4275 /* "lxml/objectify.pyx":193
4276 * return _countSiblings(self._c_node)
4278 * def countchildren(self): # <<<<<<<<<<<<<<
4279 * u"""countchildren(self)
4283 /* Python wrapper */
4284 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4285 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_8countchildren[] = "countchildren(self)\n\n Return the number of children of this element, regardless of their\n name.\n ";
4286 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_9countchildren = {"countchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_8countchildren};
4287 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4288 PyObject *__pyx_r = 0;
4289 __Pyx_RefNannyDeclarations
4290 __Pyx_RefNannySetupContext("countchildren (wrapper)", 0);
4291 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4293 /* function exit code */
4294 __Pyx_RefNannyFinishContext();
4298 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4299 Py_ssize_t __pyx_v_c;
4300 xmlNode *__pyx_v_c_node;
4301 PyObject *__pyx_r = NULL;
4302 __Pyx_RefNannyDeclarations
4305 PyObject *__pyx_t_3 = NULL;
4306 int __pyx_lineno = 0;
4307 const char *__pyx_filename = NULL;
4308 int __pyx_clineno = 0;
4309 __Pyx_RefNannySetupContext("countchildren", 0);
4311 /* "lxml/objectify.pyx":202
4313 * cdef tree.xmlNode* c_node
4314 * c = 0 # <<<<<<<<<<<<<<
4315 * c_node = self._c_node.children
4316 * while c_node is not NULL:
4320 /* "lxml/objectify.pyx":203
4321 * cdef tree.xmlNode* c_node
4323 * c_node = self._c_node.children # <<<<<<<<<<<<<<
4324 * while c_node is not NULL:
4325 * if tree._isElement(c_node):
4327 __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._c_node->children;
4328 __pyx_v_c_node = __pyx_t_1;
4330 /* "lxml/objectify.pyx":204
4332 * c_node = self._c_node.children
4333 * while c_node is not NULL: # <<<<<<<<<<<<<<
4334 * if tree._isElement(c_node):
4338 __pyx_t_2 = ((__pyx_v_c_node != NULL) != 0);
4339 if (!__pyx_t_2) break;
4341 /* "lxml/objectify.pyx":205
4342 * c_node = self._c_node.children
4343 * while c_node is not NULL:
4344 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4346 * c_node = c_node.next
4348 __pyx_t_2 = (_isElement(__pyx_v_c_node) != 0);
4351 /* "lxml/objectify.pyx":206
4352 * while c_node is not NULL:
4353 * if tree._isElement(c_node):
4354 * c += 1 # <<<<<<<<<<<<<<
4355 * c_node = c_node.next
4358 __pyx_v_c = (__pyx_v_c + 1);
4360 /* "lxml/objectify.pyx":205
4361 * c_node = self._c_node.children
4362 * while c_node is not NULL:
4363 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4365 * c_node = c_node.next
4369 /* "lxml/objectify.pyx":207
4370 * if tree._isElement(c_node):
4372 * c_node = c_node.next # <<<<<<<<<<<<<<
4376 __pyx_t_1 = __pyx_v_c_node->next;
4377 __pyx_v_c_node = __pyx_t_1;
4380 /* "lxml/objectify.pyx":208
4382 * c_node = c_node.next
4383 * return c # <<<<<<<<<<<<<<
4385 * def getchildren(self):
4387 __Pyx_XDECREF(__pyx_r);
4388 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
4389 __Pyx_GOTREF(__pyx_t_3);
4390 __pyx_r = __pyx_t_3;
4394 /* "lxml/objectify.pyx":193
4395 * return _countSiblings(self._c_node)
4397 * def countchildren(self): # <<<<<<<<<<<<<<
4398 * u"""countchildren(self)
4402 /* function exit code */
4404 __Pyx_XDECREF(__pyx_t_3);
4405 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.countchildren", __pyx_clineno, __pyx_lineno, __pyx_filename);
4408 __Pyx_XGIVEREF(__pyx_r);
4409 __Pyx_RefNannyFinishContext();
4413 /* "lxml/objectify.pyx":210
4416 * def getchildren(self): # <<<<<<<<<<<<<<
4417 * u"""getchildren(self)
4421 /* Python wrapper */
4422 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4423 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_10getchildren[] = "getchildren(self)\n\n Returns a sequence of all direct children. The elements are\n returned in document order.\n ";
4424 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_11getchildren = {"getchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_10getchildren};
4425 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4426 PyObject *__pyx_r = 0;
4427 __Pyx_RefNannyDeclarations
4428 __Pyx_RefNannySetupContext("getchildren (wrapper)", 0);
4429 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4431 /* function exit code */
4432 __Pyx_RefNannyFinishContext();
4436 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4437 xmlNode *__pyx_v_c_node;
4438 PyObject *__pyx_v_result = NULL;
4439 PyObject *__pyx_r = NULL;
4440 __Pyx_RefNannyDeclarations
4441 PyObject *__pyx_t_1 = NULL;
4444 PyObject *__pyx_t_4 = NULL;
4446 int __pyx_lineno = 0;
4447 const char *__pyx_filename = NULL;
4448 int __pyx_clineno = 0;
4449 __Pyx_RefNannySetupContext("getchildren", 0);
4451 /* "lxml/objectify.pyx":217
4453 * cdef tree.xmlNode* c_node
4454 * result = [] # <<<<<<<<<<<<<<
4455 * c_node = self._c_node.children
4456 * while c_node is not NULL:
4458 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
4459 __Pyx_GOTREF(__pyx_t_1);
4460 __pyx_v_result = ((PyObject*)__pyx_t_1);
4463 /* "lxml/objectify.pyx":218
4464 * cdef tree.xmlNode* c_node
4466 * c_node = self._c_node.children # <<<<<<<<<<<<<<
4467 * while c_node is not NULL:
4468 * if tree._isElement(c_node):
4470 __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._c_node->children;
4471 __pyx_v_c_node = __pyx_t_2;
4473 /* "lxml/objectify.pyx":219
4475 * c_node = self._c_node.children
4476 * while c_node is not NULL: # <<<<<<<<<<<<<<
4477 * if tree._isElement(c_node):
4478 * result.append(cetree.elementFactory(self._doc, c_node))
4481 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
4482 if (!__pyx_t_3) break;
4484 /* "lxml/objectify.pyx":220
4485 * c_node = self._c_node.children
4486 * while c_node is not NULL:
4487 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4488 * result.append(cetree.elementFactory(self._doc, c_node))
4489 * c_node = c_node.next
4491 __pyx_t_3 = (_isElement(__pyx_v_c_node) != 0);
4494 /* "lxml/objectify.pyx":221
4495 * while c_node is not NULL:
4496 * if tree._isElement(c_node):
4497 * result.append(cetree.elementFactory(self._doc, c_node)) # <<<<<<<<<<<<<<
4498 * c_node = c_node.next
4501 __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
4502 __Pyx_INCREF(__pyx_t_1);
4503 __pyx_t_4 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error)
4504 __Pyx_GOTREF(__pyx_t_4);
4505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4506 __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error)
4507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4509 /* "lxml/objectify.pyx":220
4510 * c_node = self._c_node.children
4511 * while c_node is not NULL:
4512 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4513 * result.append(cetree.elementFactory(self._doc, c_node))
4514 * c_node = c_node.next
4518 /* "lxml/objectify.pyx":222
4519 * if tree._isElement(c_node):
4520 * result.append(cetree.elementFactory(self._doc, c_node))
4521 * c_node = c_node.next # <<<<<<<<<<<<<<
4525 __pyx_t_2 = __pyx_v_c_node->next;
4526 __pyx_v_c_node = __pyx_t_2;
4529 /* "lxml/objectify.pyx":223
4530 * result.append(cetree.elementFactory(self._doc, c_node))
4531 * c_node = c_node.next
4532 * return result # <<<<<<<<<<<<<<
4534 * def __getattr__(self, tag):
4536 __Pyx_XDECREF(__pyx_r);
4537 __Pyx_INCREF(__pyx_v_result);
4538 __pyx_r = __pyx_v_result;
4541 /* "lxml/objectify.pyx":210
4544 * def getchildren(self): # <<<<<<<<<<<<<<
4545 * u"""getchildren(self)
4549 /* function exit code */
4551 __Pyx_XDECREF(__pyx_t_1);
4552 __Pyx_XDECREF(__pyx_t_4);
4553 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.getchildren", __pyx_clineno, __pyx_lineno, __pyx_filename);
4556 __Pyx_XDECREF(__pyx_v_result);
4557 __Pyx_XGIVEREF(__pyx_r);
4558 __Pyx_RefNannyFinishContext();
4562 /* "lxml/objectify.pyx":225
4565 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
4566 * u"""Return the (first) child with the given tag name. If no namespace
4567 * is provided, the child will be looked up in the same one as self.
4570 /* Python wrapper */
4571 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
4572 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_12__getattr__[] = "Return the (first) child with the given tag name. If no namespace\n is provided, the child will be looked up in the same one as self.\n ";
4573 #if CYTHON_COMPILING_IN_CPYTHON
4574 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
4576 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
4577 PyObject *__pyx_r = 0;
4578 __Pyx_RefNannyDeclarations
4579 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
4580 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
4582 /* function exit code */
4583 __Pyx_RefNannyFinishContext();
4587 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag) {
4588 PyObject *__pyx_r = NULL;
4589 __Pyx_RefNannyDeclarations
4590 PyObject *__pyx_t_1 = NULL;
4591 PyObject *__pyx_t_2 = NULL;
4592 PyObject *__pyx_t_3 = NULL;
4595 PyObject *__pyx_t_6 = NULL;
4596 int __pyx_lineno = 0;
4597 const char *__pyx_filename = NULL;
4598 int __pyx_clineno = 0;
4599 __Pyx_RefNannySetupContext("__getattr__", 0);
4601 /* "lxml/objectify.pyx":229
4602 * is provided, the child will be looked up in the same one as self.
4604 * if is_special_method(tag): # <<<<<<<<<<<<<<
4605 * return object.__getattr__(self, tag)
4606 * return _lookupChildOrRaise(self, tag)
4608 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
4609 __pyx_t_2 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_3 = NULL;
4610 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4611 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4612 if (likely(__pyx_t_3)) {
4613 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4614 __Pyx_INCREF(__pyx_t_3);
4615 __Pyx_INCREF(function);
4616 __Pyx_DECREF_SET(__pyx_t_2, function);
4619 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_tag) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_tag);
4620 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4621 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
4622 __Pyx_GOTREF(__pyx_t_1);
4623 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4624 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
4625 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4628 /* "lxml/objectify.pyx":230
4630 * if is_special_method(tag):
4631 * return object.__getattr__(self, tag) # <<<<<<<<<<<<<<
4632 * return _lookupChildOrRaise(self, tag)
4635 __Pyx_XDECREF(__pyx_r);
4636 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4637 __Pyx_GOTREF(__pyx_t_2);
4640 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4641 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4642 if (likely(__pyx_t_3)) {
4643 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4644 __Pyx_INCREF(__pyx_t_3);
4645 __Pyx_INCREF(function);
4646 __Pyx_DECREF_SET(__pyx_t_2, function);
4650 #if CYTHON_FAST_PYCALL
4651 if (PyFunction_Check(__pyx_t_2)) {
4652 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_tag};
4653 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4654 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4655 __Pyx_GOTREF(__pyx_t_1);
4658 #if CYTHON_FAST_PYCCALL
4659 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4660 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_tag};
4661 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4662 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4663 __Pyx_GOTREF(__pyx_t_1);
4667 __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
4668 __Pyx_GOTREF(__pyx_t_6);
4670 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
4672 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4673 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4674 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
4675 __Pyx_INCREF(__pyx_v_tag);
4676 __Pyx_GIVEREF(__pyx_v_tag);
4677 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_tag);
4678 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4679 __Pyx_GOTREF(__pyx_t_1);
4680 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4682 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4683 __pyx_r = __pyx_t_1;
4687 /* "lxml/objectify.pyx":229
4688 * is provided, the child will be looked up in the same one as self.
4690 * if is_special_method(tag): # <<<<<<<<<<<<<<
4691 * return object.__getattr__(self, tag)
4692 * return _lookupChildOrRaise(self, tag)
4696 /* "lxml/objectify.pyx":231
4697 * if is_special_method(tag):
4698 * return object.__getattr__(self, tag)
4699 * return _lookupChildOrRaise(self, tag) # <<<<<<<<<<<<<<
4701 * def __setattr__(self, tag, value):
4703 __Pyx_XDECREF(__pyx_r);
4704 __pyx_t_1 = __pyx_f_4lxml_9objectify__lookupChildOrRaise(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
4705 __Pyx_GOTREF(__pyx_t_1);
4706 __pyx_r = __pyx_t_1;
4710 /* "lxml/objectify.pyx":225
4713 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
4714 * u"""Return the (first) child with the given tag name. If no namespace
4715 * is provided, the child will be looked up in the same one as self.
4718 /* function exit code */
4720 __Pyx_XDECREF(__pyx_t_1);
4721 __Pyx_XDECREF(__pyx_t_2);
4722 __Pyx_XDECREF(__pyx_t_3);
4723 __Pyx_XDECREF(__pyx_t_6);
4724 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4727 __Pyx_XGIVEREF(__pyx_r);
4728 __Pyx_RefNannyFinishContext();
4732 /* "lxml/objectify.pyx":233
4733 * return _lookupChildOrRaise(self, tag)
4735 * def __setattr__(self, tag, value): # <<<<<<<<<<<<<<
4736 * u"""Set the value of the (first) child with the given tag name. If no
4737 * namespace is provided, the child will be looked up in the same one as
4740 /* Python wrapper */
4741 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value); /*proto*/
4742 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_14__setattr__[] = "Set the value of the (first) child with the given tag name. If no\n namespace is provided, the child will be looked up in the same one as\n self.\n ";
4743 #if CYTHON_COMPILING_IN_CPYTHON
4744 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
4746 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
4748 __Pyx_RefNannyDeclarations
4749 __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
4750 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_14__setattr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_tag), ((PyObject *)__pyx_v_value));
4752 /* function exit code */
4753 __Pyx_RefNannyFinishContext();
4757 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_14__setattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
4758 struct LxmlElement *__pyx_v_element = 0;
4760 __Pyx_RefNannyDeclarations
4763 PyObject *__pyx_t_3 = NULL;
4764 Py_ssize_t __pyx_t_4;
4766 PyObject *__pyx_t_6 = NULL;
4767 PyObject *__pyx_t_7 = NULL;
4769 PyObject *__pyx_t_9 = NULL;
4770 int __pyx_lineno = 0;
4771 const char *__pyx_filename = NULL;
4772 int __pyx_clineno = 0;
4773 __Pyx_RefNannySetupContext("__setattr__", 0);
4774 __Pyx_INCREF(__pyx_v_tag);
4776 /* "lxml/objectify.pyx":240
4777 * cdef _Element element
4778 * # properties are looked up /after/ __setattr__, so we must emulate them
4779 * if tag == u'text' or tag == u'pyval': # <<<<<<<<<<<<<<
4781 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4783 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_tag, __pyx_n_u_text, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
4786 __pyx_t_1 = __pyx_t_2;
4787 goto __pyx_L4_bool_binop_done;
4789 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_tag, __pyx_n_u_pyval, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 240, __pyx_L1_error)
4790 __pyx_t_1 = __pyx_t_2;
4791 __pyx_L4_bool_binop_done:;
4792 if (unlikely(__pyx_t_1)) {
4794 /* "lxml/objectify.pyx":242
4795 * if tag == u'text' or tag == u'pyval':
4797 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable" # <<<<<<<<<<<<<<
4798 * elif tag == u'tail':
4799 * cetree.setTailText(self._c_node, value)
4801 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
4802 __Pyx_GOTREF(__pyx_t_3);
4805 __Pyx_INCREF(__pyx_kp_u_attribute);
4807 __Pyx_GIVEREF(__pyx_kp_u_attribute);
4808 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_attribute);
4809 __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
4810 __Pyx_GOTREF(__pyx_t_6);
4811 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
4812 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
4813 __Pyx_GIVEREF(__pyx_t_6);
4814 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
4816 __Pyx_INCREF(__pyx_kp_u_of);
4818 __Pyx_GIVEREF(__pyx_kp_u_of);
4819 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_of);
4820 __pyx_t_6 = __pyx_f_4lxml_9objectify__typename(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
4821 __Pyx_GOTREF(__pyx_t_6);
4822 __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
4823 __Pyx_GOTREF(__pyx_t_7);
4824 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4825 __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
4826 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
4827 __Pyx_GIVEREF(__pyx_t_7);
4828 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
4830 __Pyx_INCREF(__pyx_kp_u_objects_is_not_writable);
4832 __Pyx_GIVEREF(__pyx_kp_u_objects_is_not_writable);
4833 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_objects_is_not_writable);
4834 __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
4835 __Pyx_GOTREF(__pyx_t_7);
4836 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4837 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
4838 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4839 __PYX_ERR(0, 242, __pyx_L1_error)
4841 /* "lxml/objectify.pyx":240
4842 * cdef _Element element
4843 * # properties are looked up /after/ __setattr__, so we must emulate them
4844 * if tag == u'text' or tag == u'pyval': # <<<<<<<<<<<<<<
4846 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4850 /* "lxml/objectify.pyx":243
4852 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4853 * elif tag == u'tail': # <<<<<<<<<<<<<<
4854 * cetree.setTailText(self._c_node, value)
4857 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_tag, __pyx_n_u_tail, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
4860 /* "lxml/objectify.pyx":244
4861 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4862 * elif tag == u'tail':
4863 * cetree.setTailText(self._c_node, value) # <<<<<<<<<<<<<<
4865 * elif tag == u'tag':
4867 __pyx_t_8 = setTailText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 244, __pyx_L1_error)
4869 /* "lxml/objectify.pyx":245
4870 * elif tag == u'tail':
4871 * cetree.setTailText(self._c_node, value)
4872 * return # <<<<<<<<<<<<<<
4873 * elif tag == u'tag':
4874 * ElementBase.tag.__set__(self, value)
4879 /* "lxml/objectify.pyx":243
4881 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4882 * elif tag == u'tail': # <<<<<<<<<<<<<<
4883 * cetree.setTailText(self._c_node, value)
4888 /* "lxml/objectify.pyx":246
4889 * cetree.setTailText(self._c_node, value)
4891 * elif tag == u'tag': # <<<<<<<<<<<<<<
4892 * ElementBase.tag.__set__(self, value)
4895 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_tag, __pyx_n_u_tag, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
4898 /* "lxml/objectify.pyx":247
4900 * elif tag == u'tag':
4901 * ElementBase.tag.__set__(self, value) # <<<<<<<<<<<<<<
4903 * elif tag == u'base':
4905 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase), __pyx_n_s_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error)
4906 __Pyx_GOTREF(__pyx_t_3);
4907 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
4908 __Pyx_GOTREF(__pyx_t_6);
4909 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4912 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4913 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
4914 if (likely(__pyx_t_3)) {
4915 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4916 __Pyx_INCREF(__pyx_t_3);
4917 __Pyx_INCREF(function);
4918 __Pyx_DECREF_SET(__pyx_t_6, function);
4922 #if CYTHON_FAST_PYCALL
4923 if (PyFunction_Check(__pyx_t_6)) {
4924 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_value};
4925 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
4926 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4927 __Pyx_GOTREF(__pyx_t_7);
4930 #if CYTHON_FAST_PYCCALL
4931 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4932 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_value};
4933 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
4934 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4935 __Pyx_GOTREF(__pyx_t_7);
4939 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error)
4940 __Pyx_GOTREF(__pyx_t_9);
4942 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
4944 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4945 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4946 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
4947 __Pyx_INCREF(__pyx_v_value);
4948 __Pyx_GIVEREF(__pyx_v_value);
4949 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_value);
4950 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
4951 __Pyx_GOTREF(__pyx_t_7);
4952 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4954 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4955 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4957 /* "lxml/objectify.pyx":248
4958 * elif tag == u'tag':
4959 * ElementBase.tag.__set__(self, value)
4960 * return # <<<<<<<<<<<<<<
4961 * elif tag == u'base':
4962 * ElementBase.base.__set__(self, value)
4967 /* "lxml/objectify.pyx":246
4968 * cetree.setTailText(self._c_node, value)
4970 * elif tag == u'tag': # <<<<<<<<<<<<<<
4971 * ElementBase.tag.__set__(self, value)
4976 /* "lxml/objectify.pyx":249
4977 * ElementBase.tag.__set__(self, value)
4979 * elif tag == u'base': # <<<<<<<<<<<<<<
4980 * ElementBase.base.__set__(self, value)
4983 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_tag, __pyx_n_u_base, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
4986 /* "lxml/objectify.pyx":250
4988 * elif tag == u'base':
4989 * ElementBase.base.__set__(self, value) # <<<<<<<<<<<<<<
4991 * tag = _buildChildTag(self, tag)
4993 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase), __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
4994 __Pyx_GOTREF(__pyx_t_6);
4995 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 250, __pyx_L1_error)
4996 __Pyx_GOTREF(__pyx_t_9);
4997 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5000 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5001 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
5002 if (likely(__pyx_t_6)) {
5003 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
5004 __Pyx_INCREF(__pyx_t_6);
5005 __Pyx_INCREF(function);
5006 __Pyx_DECREF_SET(__pyx_t_9, function);
5010 #if CYTHON_FAST_PYCALL
5011 if (PyFunction_Check(__pyx_t_9)) {
5012 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_value};
5013 __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
5014 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5015 __Pyx_GOTREF(__pyx_t_7);
5018 #if CYTHON_FAST_PYCCALL
5019 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5020 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_value};
5021 __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
5022 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5023 __Pyx_GOTREF(__pyx_t_7);
5027 __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
5028 __Pyx_GOTREF(__pyx_t_3);
5030 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
5032 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5033 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5034 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
5035 __Pyx_INCREF(__pyx_v_value);
5036 __Pyx_GIVEREF(__pyx_v_value);
5037 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_value);
5038 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
5039 __Pyx_GOTREF(__pyx_t_7);
5040 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5042 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5043 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5045 /* "lxml/objectify.pyx":251
5046 * elif tag == u'base':
5047 * ElementBase.base.__set__(self, value)
5048 * return # <<<<<<<<<<<<<<
5049 * tag = _buildChildTag(self, tag)
5050 * element = _lookupChild(self, tag)
5055 /* "lxml/objectify.pyx":249
5056 * ElementBase.tag.__set__(self, value)
5058 * elif tag == u'base': # <<<<<<<<<<<<<<
5059 * ElementBase.base.__set__(self, value)
5064 /* "lxml/objectify.pyx":252
5065 * ElementBase.base.__set__(self, value)
5067 * tag = _buildChildTag(self, tag) # <<<<<<<<<<<<<<
5068 * element = _lookupChild(self, tag)
5069 * if element is None:
5071 __pyx_t_7 = __pyx_f_4lxml_9objectify__buildChildTag(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error)
5072 __Pyx_GOTREF(__pyx_t_7);
5073 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_7);
5076 /* "lxml/objectify.pyx":253
5078 * tag = _buildChildTag(self, tag)
5079 * element = _lookupChild(self, tag) # <<<<<<<<<<<<<<
5080 * if element is None:
5081 * _appendValue(self, tag, value)
5083 __pyx_t_7 = __pyx_f_4lxml_9objectify__lookupChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error)
5084 __Pyx_GOTREF(__pyx_t_7);
5085 if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 253, __pyx_L1_error)
5086 __pyx_v_element = ((struct LxmlElement *)__pyx_t_7);
5089 /* "lxml/objectify.pyx":254
5090 * tag = _buildChildTag(self, tag)
5091 * element = _lookupChild(self, tag)
5092 * if element is None: # <<<<<<<<<<<<<<
5093 * _appendValue(self, tag, value)
5096 __pyx_t_1 = (((PyObject *)__pyx_v_element) == Py_None);
5097 __pyx_t_2 = (__pyx_t_1 != 0);
5100 /* "lxml/objectify.pyx":255
5101 * element = _lookupChild(self, tag)
5102 * if element is None:
5103 * _appendValue(self, tag, value) # <<<<<<<<<<<<<<
5105 * _replaceElement(element, value)
5107 __pyx_t_7 = __pyx_f_4lxml_9objectify__appendValue(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag, __pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
5108 __Pyx_GOTREF(__pyx_t_7);
5109 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5111 /* "lxml/objectify.pyx":254
5112 * tag = _buildChildTag(self, tag)
5113 * element = _lookupChild(self, tag)
5114 * if element is None: # <<<<<<<<<<<<<<
5115 * _appendValue(self, tag, value)
5121 /* "lxml/objectify.pyx":257
5122 * _appendValue(self, tag, value)
5124 * _replaceElement(element, value) # <<<<<<<<<<<<<<
5126 * def __delattr__(self, tag):
5129 __pyx_t_7 = __pyx_f_4lxml_9objectify__replaceElement(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
5130 __Pyx_GOTREF(__pyx_t_7);
5131 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5135 /* "lxml/objectify.pyx":233
5136 * return _lookupChildOrRaise(self, tag)
5138 * def __setattr__(self, tag, value): # <<<<<<<<<<<<<<
5139 * u"""Set the value of the (first) child with the given tag name. If no
5140 * namespace is provided, the child will be looked up in the same one as
5143 /* function exit code */
5147 __Pyx_XDECREF(__pyx_t_3);
5148 __Pyx_XDECREF(__pyx_t_6);
5149 __Pyx_XDECREF(__pyx_t_7);
5150 __Pyx_XDECREF(__pyx_t_9);
5151 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5154 __Pyx_XDECREF((PyObject *)__pyx_v_element);
5155 __Pyx_XDECREF(__pyx_v_tag);
5156 __Pyx_RefNannyFinishContext();
5160 /* "lxml/objectify.pyx":259
5161 * _replaceElement(element, value)
5163 * def __delattr__(self, tag): # <<<<<<<<<<<<<<
5164 * child = _lookupChildOrRaise(self, tag)
5165 * self.remove(child)
5168 /* Python wrapper */
5169 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
5170 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
5172 __Pyx_RefNannyDeclarations
5173 __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0);
5174 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
5176 /* function exit code */
5177 __Pyx_RefNannyFinishContext();
5181 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag) {
5182 PyObject *__pyx_v_child = NULL;
5184 __Pyx_RefNannyDeclarations
5185 PyObject *__pyx_t_1 = NULL;
5186 PyObject *__pyx_t_2 = NULL;
5187 PyObject *__pyx_t_3 = NULL;
5188 int __pyx_lineno = 0;
5189 const char *__pyx_filename = NULL;
5190 int __pyx_clineno = 0;
5191 __Pyx_RefNannySetupContext("__delattr__", 0);
5193 /* "lxml/objectify.pyx":260
5195 * def __delattr__(self, tag):
5196 * child = _lookupChildOrRaise(self, tag) # <<<<<<<<<<<<<<
5197 * self.remove(child)
5200 __pyx_t_1 = __pyx_f_4lxml_9objectify__lookupChildOrRaise(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_1);
5202 __pyx_v_child = __pyx_t_1;
5205 /* "lxml/objectify.pyx":261
5206 * def __delattr__(self, tag):
5207 * child = _lookupChildOrRaise(self, tag)
5208 * self.remove(child) # <<<<<<<<<<<<<<
5210 * def addattr(self, tag, value):
5212 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
5213 __Pyx_GOTREF(__pyx_t_2);
5215 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5216 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5217 if (likely(__pyx_t_3)) {
5218 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5219 __Pyx_INCREF(__pyx_t_3);
5220 __Pyx_INCREF(function);
5221 __Pyx_DECREF_SET(__pyx_t_2, function);
5224 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_child) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_child);
5225 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5226 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_1);
5228 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5231 /* "lxml/objectify.pyx":259
5232 * _replaceElement(element, value)
5234 * def __delattr__(self, tag): # <<<<<<<<<<<<<<
5235 * child = _lookupChildOrRaise(self, tag)
5236 * self.remove(child)
5239 /* function exit code */
5243 __Pyx_XDECREF(__pyx_t_1);
5244 __Pyx_XDECREF(__pyx_t_2);
5245 __Pyx_XDECREF(__pyx_t_3);
5246 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5249 __Pyx_XDECREF(__pyx_v_child);
5250 __Pyx_RefNannyFinishContext();
5254 /* "lxml/objectify.pyx":263
5255 * self.remove(child)
5257 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
5258 * u"""addattr(self, tag, value)
5262 /* Python wrapper */
5263 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5264 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_18addattr[] = "addattr(self, tag, value)\n\n Add a child value to the element.\n\n As opposed to append(), it sets a data value, not an element.\n ";
5265 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_19addattr = {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_18addattr};
5266 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5267 PyObject *__pyx_v_tag = 0;
5268 PyObject *__pyx_v_value = 0;
5269 int __pyx_lineno = 0;
5270 const char *__pyx_filename = NULL;
5271 int __pyx_clineno = 0;
5272 PyObject *__pyx_r = 0;
5273 __Pyx_RefNannyDeclarations
5274 __Pyx_RefNannySetupContext("addattr (wrapper)", 0);
5276 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag,&__pyx_n_s_value,0};
5277 PyObject* values[2] = {0,0};
5278 if (unlikely(__pyx_kwds)) {
5280 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5282 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5284 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5287 default: goto __pyx_L5_argtuple_error;
5289 kw_args = PyDict_Size(__pyx_kwds);
5292 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
5293 else goto __pyx_L5_argtuple_error;
5296 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5298 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, 1); __PYX_ERR(0, 263, __pyx_L3_error)
5301 if (unlikely(kw_args > 0)) {
5302 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addattr") < 0)) __PYX_ERR(0, 263, __pyx_L3_error)
5304 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5305 goto __pyx_L5_argtuple_error;
5307 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5308 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5310 __pyx_v_tag = values[0];
5311 __pyx_v_value = values[1];
5313 goto __pyx_L4_argument_unpacking_done;
5314 __pyx_L5_argtuple_error:;
5315 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error)
5317 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5318 __Pyx_RefNannyFinishContext();
5320 __pyx_L4_argument_unpacking_done:;
5321 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_18addattr(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), __pyx_v_tag, __pyx_v_value);
5323 /* function exit code */
5324 __Pyx_RefNannyFinishContext();
5328 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_18addattr(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
5329 PyObject *__pyx_r = NULL;
5330 __Pyx_RefNannyDeclarations
5331 PyObject *__pyx_t_1 = NULL;
5332 PyObject *__pyx_t_2 = NULL;
5333 int __pyx_lineno = 0;
5334 const char *__pyx_filename = NULL;
5335 int __pyx_clineno = 0;
5336 __Pyx_RefNannySetupContext("addattr", 0);
5338 /* "lxml/objectify.pyx":270
5339 * As opposed to append(), it sets a data value, not an element.
5341 * _appendValue(self, _buildChildTag(self, tag), value) # <<<<<<<<<<<<<<
5343 * def __getitem__(self, key):
5345 __pyx_t_1 = __pyx_f_4lxml_9objectify__buildChildTag(((struct LxmlElement *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
5346 __Pyx_GOTREF(__pyx_t_1);
5347 __pyx_t_2 = __pyx_f_4lxml_9objectify__appendValue(((struct LxmlElement *)__pyx_v_self), __pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
5348 __Pyx_GOTREF(__pyx_t_2);
5349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5350 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5352 /* "lxml/objectify.pyx":263
5353 * self.remove(child)
5355 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
5356 * u"""addattr(self, tag, value)
5360 /* function exit code */
5361 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5364 __Pyx_XDECREF(__pyx_t_1);
5365 __Pyx_XDECREF(__pyx_t_2);
5366 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5369 __Pyx_XGIVEREF(__pyx_r);
5370 __Pyx_RefNannyFinishContext();
5374 /* "lxml/objectify.pyx":272
5375 * _appendValue(self, _buildChildTag(self, tag), value)
5377 * def __getitem__(self, key): # <<<<<<<<<<<<<<
5378 * u"""Return a sibling, counting from the first child of the parent. The
5379 * method behaves like both a dict and a sequence.
5382 /* Python wrapper */
5383 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
5384 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_20__getitem__[] = "Return a sibling, counting from the first child of the parent. The\n method behaves like both a dict and a sequence.\n\n * If argument is an integer, returns the sibling at that position.\n\n * If argument is a string, does the same as getattr(). This can be\n used to provide namespaces for element lookup, or to look up\n children with special names (``text`` etc.).\n\n * If argument is a slice object, returns the matching slice.\n ";
5385 #if CYTHON_COMPILING_IN_CPYTHON
5386 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
5388 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
5389 PyObject *__pyx_r = 0;
5390 __Pyx_RefNannyDeclarations
5391 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
5392 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_key));
5394 /* function exit code */
5395 __Pyx_RefNannyFinishContext();
5399 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key) {
5400 xmlNode *__pyx_v_c_self_node;
5401 xmlNode *__pyx_v_c_parent;
5402 xmlNode *__pyx_v_c_node;
5403 Py_ssize_t __pyx_v_c_index;
5404 PyObject *__pyx_r = NULL;
5405 __Pyx_RefNannyDeclarations
5407 PyObject *__pyx_t_2 = NULL;
5409 PyObject *__pyx_t_4 = NULL;
5410 Py_ssize_t __pyx_t_5;
5412 int __pyx_lineno = 0;
5413 const char *__pyx_filename = NULL;
5414 int __pyx_clineno = 0;
5415 __Pyx_RefNannySetupContext("__getitem__", 0);
5417 /* "lxml/objectify.pyx":288
5418 * cdef tree.xmlNode* c_node
5419 * cdef Py_ssize_t c_index
5420 * if python._isString(key): # <<<<<<<<<<<<<<
5421 * return _lookupChildOrRaise(self, key)
5422 * elif isinstance(key, slice):
5424 __pyx_t_1 = (_isString(__pyx_v_key) != 0);
5427 /* "lxml/objectify.pyx":289
5428 * cdef Py_ssize_t c_index
5429 * if python._isString(key):
5430 * return _lookupChildOrRaise(self, key) # <<<<<<<<<<<<<<
5431 * elif isinstance(key, slice):
5432 * return list(self)[key]
5434 __Pyx_XDECREF(__pyx_r);
5435 __pyx_t_2 = __pyx_f_4lxml_9objectify__lookupChildOrRaise(((struct LxmlElement *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
5436 __Pyx_GOTREF(__pyx_t_2);
5437 __pyx_r = __pyx_t_2;
5441 /* "lxml/objectify.pyx":288
5442 * cdef tree.xmlNode* c_node
5443 * cdef Py_ssize_t c_index
5444 * if python._isString(key): # <<<<<<<<<<<<<<
5445 * return _lookupChildOrRaise(self, key)
5446 * elif isinstance(key, slice):
5450 /* "lxml/objectify.pyx":290
5451 * if python._isString(key):
5452 * return _lookupChildOrRaise(self, key)
5453 * elif isinstance(key, slice): # <<<<<<<<<<<<<<
5454 * return list(self)[key]
5455 * # normal item access
5457 __pyx_t_1 = PySlice_Check(__pyx_v_key);
5458 __pyx_t_3 = (__pyx_t_1 != 0);
5461 /* "lxml/objectify.pyx":291
5462 * return _lookupChildOrRaise(self, key)
5463 * elif isinstance(key, slice):
5464 * return list(self)[key] # <<<<<<<<<<<<<<
5465 * # normal item access
5466 * c_index = key # raises TypeError if necessary
5468 __Pyx_XDECREF(__pyx_r);
5469 __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
5470 __Pyx_GOTREF(__pyx_t_2);
5471 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
5472 __Pyx_GOTREF(__pyx_t_4);
5473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5474 __pyx_r = __pyx_t_4;
5478 /* "lxml/objectify.pyx":290
5479 * if python._isString(key):
5480 * return _lookupChildOrRaise(self, key)
5481 * elif isinstance(key, slice): # <<<<<<<<<<<<<<
5482 * return list(self)[key]
5483 * # normal item access
5487 /* "lxml/objectify.pyx":293
5488 * return list(self)[key]
5489 * # normal item access
5490 * c_index = key # raises TypeError if necessary # <<<<<<<<<<<<<<
5491 * c_self_node = self._c_node
5492 * c_parent = c_self_node.parent
5494 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error)
5495 __pyx_v_c_index = __pyx_t_5;
5497 /* "lxml/objectify.pyx":294
5498 * # normal item access
5499 * c_index = key # raises TypeError if necessary
5500 * c_self_node = self._c_node # <<<<<<<<<<<<<<
5501 * c_parent = c_self_node.parent
5502 * if c_parent is NULL:
5504 __pyx_t_6 = __pyx_v_self->__pyx_base.__pyx_base._c_node;
5505 __pyx_v_c_self_node = __pyx_t_6;
5507 /* "lxml/objectify.pyx":295
5508 * c_index = key # raises TypeError if necessary
5509 * c_self_node = self._c_node
5510 * c_parent = c_self_node.parent # <<<<<<<<<<<<<<
5511 * if c_parent is NULL:
5512 * if c_index == 0 or c_index == -1:
5514 __pyx_t_6 = __pyx_v_c_self_node->parent;
5515 __pyx_v_c_parent = __pyx_t_6;
5517 /* "lxml/objectify.pyx":296
5518 * c_self_node = self._c_node
5519 * c_parent = c_self_node.parent
5520 * if c_parent is NULL: # <<<<<<<<<<<<<<
5521 * if c_index == 0 or c_index == -1:
5524 __pyx_t_3 = ((__pyx_v_c_parent == NULL) != 0);
5527 /* "lxml/objectify.pyx":297
5528 * c_parent = c_self_node.parent
5529 * if c_parent is NULL:
5530 * if c_index == 0 or c_index == -1: # <<<<<<<<<<<<<<
5532 * raise IndexError, unicode(key)
5534 switch (__pyx_v_c_index) {
5538 /* "lxml/objectify.pyx":298
5539 * if c_parent is NULL:
5540 * if c_index == 0 or c_index == -1:
5541 * return self # <<<<<<<<<<<<<<
5542 * raise IndexError, unicode(key)
5545 __Pyx_XDECREF(__pyx_r);
5546 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5547 __pyx_r = ((PyObject *)__pyx_v_self);
5550 /* "lxml/objectify.pyx":297
5551 * c_parent = c_self_node.parent
5552 * if c_parent is NULL:
5553 * if c_index == 0 or c_index == -1: # <<<<<<<<<<<<<<
5555 * raise IndexError, unicode(key)
5561 /* "lxml/objectify.pyx":299
5562 * if c_index == 0 or c_index == -1:
5564 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5566 * c_node = c_parent.last
5568 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
5569 __Pyx_GOTREF(__pyx_t_4);
5570 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0, 0);
5571 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5572 __PYX_ERR(0, 299, __pyx_L1_error)
5574 /* "lxml/objectify.pyx":296
5575 * c_self_node = self._c_node
5576 * c_parent = c_self_node.parent
5577 * if c_parent is NULL: # <<<<<<<<<<<<<<
5578 * if c_index == 0 or c_index == -1:
5583 /* "lxml/objectify.pyx":300
5585 * raise IndexError, unicode(key)
5586 * if c_index < 0: # <<<<<<<<<<<<<<
5587 * c_node = c_parent.last
5590 __pyx_t_3 = ((__pyx_v_c_index < 0) != 0);
5593 /* "lxml/objectify.pyx":301
5594 * raise IndexError, unicode(key)
5596 * c_node = c_parent.last # <<<<<<<<<<<<<<
5598 * c_node = c_parent.children
5600 __pyx_t_6 = __pyx_v_c_parent->last;
5601 __pyx_v_c_node = __pyx_t_6;
5603 /* "lxml/objectify.pyx":300
5605 * raise IndexError, unicode(key)
5606 * if c_index < 0: # <<<<<<<<<<<<<<
5607 * c_node = c_parent.last
5613 /* "lxml/objectify.pyx":303
5614 * c_node = c_parent.last
5616 * c_node = c_parent.children # <<<<<<<<<<<<<<
5617 * c_node = _findFollowingSibling(
5618 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5621 __pyx_t_6 = __pyx_v_c_parent->children;
5622 __pyx_v_c_node = __pyx_t_6;
5626 /* "lxml/objectify.pyx":304
5628 * c_node = c_parent.children
5629 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
5630 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5631 * if c_node is NULL:
5633 __pyx_v_c_node = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node, _getNs(__pyx_v_c_self_node), __pyx_v_c_self_node->name, __pyx_v_c_index);
5635 /* "lxml/objectify.pyx":306
5636 * c_node = _findFollowingSibling(
5637 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5638 * if c_node is NULL: # <<<<<<<<<<<<<<
5639 * raise IndexError, unicode(key)
5640 * return elementFactory(self._doc, c_node)
5642 __pyx_t_3 = ((__pyx_v_c_node == NULL) != 0);
5643 if (unlikely(__pyx_t_3)) {
5645 /* "lxml/objectify.pyx":307
5646 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5647 * if c_node is NULL:
5648 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5649 * return elementFactory(self._doc, c_node)
5652 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
5653 __Pyx_GOTREF(__pyx_t_4);
5654 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0, 0);
5655 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5656 __PYX_ERR(0, 307, __pyx_L1_error)
5658 /* "lxml/objectify.pyx":306
5659 * c_node = _findFollowingSibling(
5660 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5661 * if c_node is NULL: # <<<<<<<<<<<<<<
5662 * raise IndexError, unicode(key)
5663 * return elementFactory(self._doc, c_node)
5667 /* "lxml/objectify.pyx":308
5668 * if c_node is NULL:
5669 * raise IndexError, unicode(key)
5670 * return elementFactory(self._doc, c_node) # <<<<<<<<<<<<<<
5672 * def __setitem__(self, key, value):
5674 __Pyx_XDECREF(__pyx_r);
5675 __pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
5676 __Pyx_INCREF(__pyx_t_4);
5677 __pyx_t_2 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
5678 __Pyx_GOTREF(__pyx_t_2);
5679 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5680 __pyx_r = __pyx_t_2;
5684 /* "lxml/objectify.pyx":272
5685 * _appendValue(self, _buildChildTag(self, tag), value)
5687 * def __getitem__(self, key): # <<<<<<<<<<<<<<
5688 * u"""Return a sibling, counting from the first child of the parent. The
5689 * method behaves like both a dict and a sequence.
5692 /* function exit code */
5694 __Pyx_XDECREF(__pyx_t_2);
5695 __Pyx_XDECREF(__pyx_t_4);
5696 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5699 __Pyx_XGIVEREF(__pyx_r);
5700 __Pyx_RefNannyFinishContext();
5704 /* "lxml/objectify.pyx":310
5705 * return elementFactory(self._doc, c_node)
5707 * def __setitem__(self, key, value): # <<<<<<<<<<<<<<
5708 * u"""Set the value of a sibling, counting from the first child of the
5709 * parent. Implements key assignment, item assignment and slice
5712 /* Python wrapper */
5713 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
5714 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_22__setitem__[] = "Set the value of a sibling, counting from the first child of the\n parent. Implements key assignment, item assignment and slice\n assignment.\n\n * If argument is an integer, sets the sibling at that position.\n\n * If argument is a string, does the same as setattr(). This is used\n to provide namespaces for element lookup.\n\n * If argument is a sequence (list, tuple, etc.), assign the contained\n items to the siblings.\n ";
5715 #if CYTHON_COMPILING_IN_CPYTHON
5716 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
5718 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
5720 __Pyx_RefNannyDeclarations
5721 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
5722 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_22__setitem__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));
5724 /* function exit code */
5725 __Pyx_RefNannyFinishContext();
5729 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_22__setitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
5730 struct LxmlElement *__pyx_v_element = 0;
5731 xmlNode *__pyx_v_c_node;
5733 __Pyx_RefNannyDeclarations
5735 PyObject *__pyx_t_2 = NULL;
5738 Py_ssize_t __pyx_t_5;
5739 PyObject *__pyx_t_6 = NULL;
5740 int __pyx_lineno = 0;
5741 const char *__pyx_filename = NULL;
5742 int __pyx_clineno = 0;
5743 __Pyx_RefNannySetupContext("__setitem__", 0);
5744 __Pyx_INCREF(__pyx_v_key);
5746 /* "lxml/objectify.pyx":325
5747 * cdef _Element element
5748 * cdef tree.xmlNode* c_node
5749 * if python._isString(key): # <<<<<<<<<<<<<<
5750 * key = _buildChildTag(self, key)
5751 * element = _lookupChild(self, key)
5753 __pyx_t_1 = (_isString(__pyx_v_key) != 0);
5756 /* "lxml/objectify.pyx":326
5757 * cdef tree.xmlNode* c_node
5758 * if python._isString(key):
5759 * key = _buildChildTag(self, key) # <<<<<<<<<<<<<<
5760 * element = _lookupChild(self, key)
5761 * if element is None:
5763 __pyx_t_2 = __pyx_f_4lxml_9objectify__buildChildTag(((struct LxmlElement *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
5764 __Pyx_GOTREF(__pyx_t_2);
5765 __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2);
5768 /* "lxml/objectify.pyx":327
5769 * if python._isString(key):
5770 * key = _buildChildTag(self, key)
5771 * element = _lookupChild(self, key) # <<<<<<<<<<<<<<
5772 * if element is None:
5773 * _appendValue(self, key, value)
5775 __pyx_t_2 = __pyx_f_4lxml_9objectify__lookupChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
5776 __Pyx_GOTREF(__pyx_t_2);
5777 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 327, __pyx_L1_error)
5778 __pyx_v_element = ((struct LxmlElement *)__pyx_t_2);
5781 /* "lxml/objectify.pyx":328
5782 * key = _buildChildTag(self, key)
5783 * element = _lookupChild(self, key)
5784 * if element is None: # <<<<<<<<<<<<<<
5785 * _appendValue(self, key, value)
5788 __pyx_t_1 = (((PyObject *)__pyx_v_element) == Py_None);
5789 __pyx_t_3 = (__pyx_t_1 != 0);
5792 /* "lxml/objectify.pyx":329
5793 * element = _lookupChild(self, key)
5794 * if element is None:
5795 * _appendValue(self, key, value) # <<<<<<<<<<<<<<
5797 * _replaceElement(element, value)
5799 __pyx_t_2 = __pyx_f_4lxml_9objectify__appendValue(((struct LxmlElement *)__pyx_v_self), __pyx_v_key, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
5800 __Pyx_GOTREF(__pyx_t_2);
5801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5803 /* "lxml/objectify.pyx":328
5804 * key = _buildChildTag(self, key)
5805 * element = _lookupChild(self, key)
5806 * if element is None: # <<<<<<<<<<<<<<
5807 * _appendValue(self, key, value)
5813 /* "lxml/objectify.pyx":331
5814 * _appendValue(self, key, value)
5816 * _replaceElement(element, value) # <<<<<<<<<<<<<<
5821 __pyx_t_2 = __pyx_f_4lxml_9objectify__replaceElement(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
5822 __Pyx_GOTREF(__pyx_t_2);
5823 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5827 /* "lxml/objectify.pyx":332
5829 * _replaceElement(element, value)
5830 * return # <<<<<<<<<<<<<<
5832 * if self._c_node.parent is NULL:
5837 /* "lxml/objectify.pyx":325
5838 * cdef _Element element
5839 * cdef tree.xmlNode* c_node
5840 * if python._isString(key): # <<<<<<<<<<<<<<
5841 * key = _buildChildTag(self, key)
5842 * element = _lookupChild(self, key)
5846 /* "lxml/objectify.pyx":334
5849 * if self._c_node.parent is NULL: # <<<<<<<<<<<<<<
5850 * # the 'root[i] = ...' case
5851 * raise TypeError, u"assignment to root element is invalid"
5853 __pyx_t_3 = ((__pyx_v_self->__pyx_base.__pyx_base._c_node->parent == NULL) != 0);
5854 if (unlikely(__pyx_t_3)) {
5856 /* "lxml/objectify.pyx":336
5857 * if self._c_node.parent is NULL:
5858 * # the 'root[i] = ...' case
5859 * raise TypeError, u"assignment to root element is invalid" # <<<<<<<<<<<<<<
5861 * if isinstance(key, slice):
5863 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_assignment_to_root_element_is_in, 0, 0);
5864 __PYX_ERR(0, 336, __pyx_L1_error)
5866 /* "lxml/objectify.pyx":334
5869 * if self._c_node.parent is NULL: # <<<<<<<<<<<<<<
5870 * # the 'root[i] = ...' case
5871 * raise TypeError, u"assignment to root element is invalid"
5875 /* "lxml/objectify.pyx":338
5876 * raise TypeError, u"assignment to root element is invalid"
5878 * if isinstance(key, slice): # <<<<<<<<<<<<<<
5879 * # slice assignment
5880 * _setSlice(key, self, value)
5882 __pyx_t_3 = PySlice_Check(__pyx_v_key);
5883 __pyx_t_1 = (__pyx_t_3 != 0);
5886 /* "lxml/objectify.pyx":340
5887 * if isinstance(key, slice):
5888 * # slice assignment
5889 * _setSlice(key, self, value) # <<<<<<<<<<<<<<
5891 * # normal index assignment
5893 __pyx_t_2 = __pyx_f_4lxml_9objectify__setSlice(__pyx_v_key, ((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
5894 __Pyx_GOTREF(__pyx_t_2);
5895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5897 /* "lxml/objectify.pyx":338
5898 * raise TypeError, u"assignment to root element is invalid"
5900 * if isinstance(key, slice): # <<<<<<<<<<<<<<
5901 * # slice assignment
5902 * _setSlice(key, self, value)
5907 /* "lxml/objectify.pyx":343
5909 * # normal index assignment
5910 * if key < 0: # <<<<<<<<<<<<<<
5911 * c_node = self._c_node.parent.last
5915 __pyx_t_2 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
5916 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
5917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5920 /* "lxml/objectify.pyx":344
5921 * # normal index assignment
5923 * c_node = self._c_node.parent.last # <<<<<<<<<<<<<<
5925 * c_node = self._c_node.parent.children
5927 __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base._c_node->parent->last;
5928 __pyx_v_c_node = __pyx_t_4;
5930 /* "lxml/objectify.pyx":343
5932 * # normal index assignment
5933 * if key < 0: # <<<<<<<<<<<<<<
5934 * c_node = self._c_node.parent.last
5940 /* "lxml/objectify.pyx":346
5941 * c_node = self._c_node.parent.last
5943 * c_node = self._c_node.parent.children # <<<<<<<<<<<<<<
5944 * c_node = _findFollowingSibling(
5945 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5948 __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base._c_node->parent->children;
5949 __pyx_v_c_node = __pyx_t_4;
5953 /* "lxml/objectify.pyx":348
5954 * c_node = self._c_node.parent.children
5955 * c_node = _findFollowingSibling(
5956 * c_node, tree._getNs(self._c_node), self._c_node.name, key) # <<<<<<<<<<<<<<
5957 * if c_node is NULL:
5958 * raise IndexError, unicode(key)
5960 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L1_error)
5962 /* "lxml/objectify.pyx":347
5964 * c_node = self._c_node.parent.children
5965 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
5966 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5967 * if c_node is NULL:
5969 __pyx_v_c_node = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node, _getNs(__pyx_v_self->__pyx_base.__pyx_base._c_node), __pyx_v_self->__pyx_base.__pyx_base._c_node->name, __pyx_t_5);
5971 /* "lxml/objectify.pyx":349
5972 * c_node = _findFollowingSibling(
5973 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5974 * if c_node is NULL: # <<<<<<<<<<<<<<
5975 * raise IndexError, unicode(key)
5976 * element = elementFactory(self._doc, c_node)
5978 __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
5979 if (unlikely(__pyx_t_1)) {
5981 /* "lxml/objectify.pyx":350
5982 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5983 * if c_node is NULL:
5984 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5985 * element = elementFactory(self._doc, c_node)
5986 * _replaceElement(element, value)
5988 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
5989 __Pyx_GOTREF(__pyx_t_2);
5990 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_2, 0, 0);
5991 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5992 __PYX_ERR(0, 350, __pyx_L1_error)
5994 /* "lxml/objectify.pyx":349
5995 * c_node = _findFollowingSibling(
5996 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5997 * if c_node is NULL: # <<<<<<<<<<<<<<
5998 * raise IndexError, unicode(key)
5999 * element = elementFactory(self._doc, c_node)
6003 /* "lxml/objectify.pyx":351
6004 * if c_node is NULL:
6005 * raise IndexError, unicode(key)
6006 * element = elementFactory(self._doc, c_node) # <<<<<<<<<<<<<<
6007 * _replaceElement(element, value)
6010 __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
6011 __Pyx_INCREF(__pyx_t_2);
6012 __pyx_t_6 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_6);
6014 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6015 __pyx_v_element = ((struct LxmlElement *)__pyx_t_6);
6018 /* "lxml/objectify.pyx":352
6019 * raise IndexError, unicode(key)
6020 * element = elementFactory(self._doc, c_node)
6021 * _replaceElement(element, value) # <<<<<<<<<<<<<<
6023 * def __delitem__(self, key):
6025 __pyx_t_6 = __pyx_f_4lxml_9objectify__replaceElement(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
6026 __Pyx_GOTREF(__pyx_t_6);
6027 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6031 /* "lxml/objectify.pyx":310
6032 * return elementFactory(self._doc, c_node)
6034 * def __setitem__(self, key, value): # <<<<<<<<<<<<<<
6035 * u"""Set the value of a sibling, counting from the first child of the
6036 * parent. Implements key assignment, item assignment and slice
6039 /* function exit code */
6043 __Pyx_XDECREF(__pyx_t_2);
6044 __Pyx_XDECREF(__pyx_t_6);
6045 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6048 __Pyx_XDECREF((PyObject *)__pyx_v_element);
6049 __Pyx_XDECREF(__pyx_v_key);
6050 __Pyx_RefNannyFinishContext();
6054 /* "lxml/objectify.pyx":354
6055 * _replaceElement(element, value)
6057 * def __delitem__(self, key): # <<<<<<<<<<<<<<
6058 * parent = self.getparent()
6059 * if parent is None:
6062 /* Python wrapper */
6063 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
6064 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
6066 __Pyx_RefNannyDeclarations
6067 __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0);
6068 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_key));
6070 /* function exit code */
6071 __Pyx_RefNannyFinishContext();
6075 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key) {
6076 PyObject *__pyx_v_parent = NULL;
6077 PyObject *__pyx_v_del_items = NULL;
6078 PyObject *__pyx_v_remove = NULL;
6079 PyObject *__pyx_v_el = NULL;
6080 PyObject *__pyx_v_sibling = NULL;
6082 __Pyx_RefNannyDeclarations
6083 PyObject *__pyx_t_1 = NULL;
6084 PyObject *__pyx_t_2 = NULL;
6085 PyObject *__pyx_t_3 = NULL;
6088 Py_ssize_t __pyx_t_6;
6089 PyObject *(*__pyx_t_7)(PyObject *);
6090 PyObject *__pyx_t_8 = NULL;
6091 int __pyx_lineno = 0;
6092 const char *__pyx_filename = NULL;
6093 int __pyx_clineno = 0;
6094 __Pyx_RefNannySetupContext("__delitem__", 0);
6096 /* "lxml/objectify.pyx":355
6098 * def __delitem__(self, key):
6099 * parent = self.getparent() # <<<<<<<<<<<<<<
6100 * if parent is None:
6101 * raise TypeError, u"deleting items not supported by root element"
6103 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getparent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
6104 __Pyx_GOTREF(__pyx_t_2);
6106 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6107 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6108 if (likely(__pyx_t_3)) {
6109 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6110 __Pyx_INCREF(__pyx_t_3);
6111 __Pyx_INCREF(function);
6112 __Pyx_DECREF_SET(__pyx_t_2, function);
6115 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6116 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6117 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
6118 __Pyx_GOTREF(__pyx_t_1);
6119 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6120 __pyx_v_parent = __pyx_t_1;
6123 /* "lxml/objectify.pyx":356
6124 * def __delitem__(self, key):
6125 * parent = self.getparent()
6126 * if parent is None: # <<<<<<<<<<<<<<
6127 * raise TypeError, u"deleting items not supported by root element"
6128 * if isinstance(key, slice):
6130 __pyx_t_4 = (__pyx_v_parent == Py_None);
6131 __pyx_t_5 = (__pyx_t_4 != 0);
6132 if (unlikely(__pyx_t_5)) {
6134 /* "lxml/objectify.pyx":357
6135 * parent = self.getparent()
6136 * if parent is None:
6137 * raise TypeError, u"deleting items not supported by root element" # <<<<<<<<<<<<<<
6138 * if isinstance(key, slice):
6141 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_deleting_items_not_supported_by, 0, 0);
6142 __PYX_ERR(0, 357, __pyx_L1_error)
6144 /* "lxml/objectify.pyx":356
6145 * def __delitem__(self, key):
6146 * parent = self.getparent()
6147 * if parent is None: # <<<<<<<<<<<<<<
6148 * raise TypeError, u"deleting items not supported by root element"
6149 * if isinstance(key, slice):
6153 /* "lxml/objectify.pyx":358
6154 * if parent is None:
6155 * raise TypeError, u"deleting items not supported by root element"
6156 * if isinstance(key, slice): # <<<<<<<<<<<<<<
6158 * del_items = list(self)[key]
6160 __pyx_t_5 = PySlice_Check(__pyx_v_key);
6161 __pyx_t_4 = (__pyx_t_5 != 0);
6164 /* "lxml/objectify.pyx":360
6165 * if isinstance(key, slice):
6167 * del_items = list(self)[key] # <<<<<<<<<<<<<<
6168 * remove = parent.remove
6169 * for el in del_items:
6171 __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
6172 __Pyx_GOTREF(__pyx_t_1);
6173 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_2);
6175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6176 __pyx_v_del_items = __pyx_t_2;
6179 /* "lxml/objectify.pyx":361
6181 * del_items = list(self)[key]
6182 * remove = parent.remove # <<<<<<<<<<<<<<
6183 * for el in del_items:
6186 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
6187 __Pyx_GOTREF(__pyx_t_2);
6188 __pyx_v_remove = __pyx_t_2;
6191 /* "lxml/objectify.pyx":362
6192 * del_items = list(self)[key]
6193 * remove = parent.remove
6194 * for el in del_items: # <<<<<<<<<<<<<<
6198 if (likely(PyList_CheckExact(__pyx_v_del_items)) || PyTuple_CheckExact(__pyx_v_del_items)) {
6199 __pyx_t_2 = __pyx_v_del_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
6202 __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_del_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
6203 __Pyx_GOTREF(__pyx_t_2);
6204 __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
6207 if (likely(!__pyx_t_7)) {
6208 if (likely(PyList_CheckExact(__pyx_t_2))) {
6209 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
6210 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6211 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
6213 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6214 __Pyx_GOTREF(__pyx_t_1);
6217 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
6218 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6219 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
6221 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6222 __Pyx_GOTREF(__pyx_t_1);
6226 __pyx_t_1 = __pyx_t_7(__pyx_t_2);
6227 if (unlikely(!__pyx_t_1)) {
6228 PyObject* exc_type = PyErr_Occurred();
6230 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6231 else __PYX_ERR(0, 362, __pyx_L1_error)
6235 __Pyx_GOTREF(__pyx_t_1);
6237 __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
6240 /* "lxml/objectify.pyx":363
6241 * remove = parent.remove
6242 * for el in del_items:
6243 * remove(el) # <<<<<<<<<<<<<<
6245 * # normal index deletion
6247 __Pyx_INCREF(__pyx_v_remove);
6248 __pyx_t_3 = __pyx_v_remove; __pyx_t_8 = NULL;
6249 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6250 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
6251 if (likely(__pyx_t_8)) {
6252 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6253 __Pyx_INCREF(__pyx_t_8);
6254 __Pyx_INCREF(function);
6255 __Pyx_DECREF_SET(__pyx_t_3, function);
6258 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_el);
6259 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6260 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
6261 __Pyx_GOTREF(__pyx_t_1);
6262 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6263 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6265 /* "lxml/objectify.pyx":362
6266 * del_items = list(self)[key]
6267 * remove = parent.remove
6268 * for el in del_items: # <<<<<<<<<<<<<<
6273 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6275 /* "lxml/objectify.pyx":358
6276 * if parent is None:
6277 * raise TypeError, u"deleting items not supported by root element"
6278 * if isinstance(key, slice): # <<<<<<<<<<<<<<
6280 * del_items = list(self)[key]
6285 /* "lxml/objectify.pyx":366
6287 * # normal index deletion
6288 * sibling = self.__getitem__(key) # <<<<<<<<<<<<<<
6289 * parent.remove(sibling)
6293 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
6294 __Pyx_GOTREF(__pyx_t_1);
6296 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6297 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
6298 if (likely(__pyx_t_3)) {
6299 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6300 __Pyx_INCREF(__pyx_t_3);
6301 __Pyx_INCREF(function);
6302 __Pyx_DECREF_SET(__pyx_t_1, function);
6305 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_key);
6306 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6307 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
6308 __Pyx_GOTREF(__pyx_t_2);
6309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6310 __pyx_v_sibling = __pyx_t_2;
6313 /* "lxml/objectify.pyx":367
6314 * # normal index deletion
6315 * sibling = self.__getitem__(key)
6316 * parent.remove(sibling) # <<<<<<<<<<<<<<
6318 * def descendantpaths(self, prefix=None):
6320 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_remove); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
6321 __Pyx_GOTREF(__pyx_t_1);
6323 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6324 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
6325 if (likely(__pyx_t_3)) {
6326 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6327 __Pyx_INCREF(__pyx_t_3);
6328 __Pyx_INCREF(function);
6329 __Pyx_DECREF_SET(__pyx_t_1, function);
6332 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_sibling) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_sibling);
6333 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6334 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
6335 __Pyx_GOTREF(__pyx_t_2);
6336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6337 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6341 /* "lxml/objectify.pyx":354
6342 * _replaceElement(element, value)
6344 * def __delitem__(self, key): # <<<<<<<<<<<<<<
6345 * parent = self.getparent()
6346 * if parent is None:
6349 /* function exit code */
6353 __Pyx_XDECREF(__pyx_t_1);
6354 __Pyx_XDECREF(__pyx_t_2);
6355 __Pyx_XDECREF(__pyx_t_3);
6356 __Pyx_XDECREF(__pyx_t_8);
6357 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6360 __Pyx_XDECREF(__pyx_v_parent);
6361 __Pyx_XDECREF(__pyx_v_del_items);
6362 __Pyx_XDECREF(__pyx_v_remove);
6363 __Pyx_XDECREF(__pyx_v_el);
6364 __Pyx_XDECREF(__pyx_v_sibling);
6365 __Pyx_RefNannyFinishContext();
6369 /* "lxml/objectify.pyx":369
6370 * parent.remove(sibling)
6372 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
6373 * u"""descendantpaths(self, prefix=None)
6377 /* Python wrapper */
6378 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6379 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_26descendantpaths[] = "descendantpaths(self, prefix=None)\n\n Returns a list of object path expressions for all descendants.\n ";
6380 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_27descendantpaths = {"descendantpaths", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_26descendantpaths};
6381 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6382 PyObject *__pyx_v_prefix = 0;
6383 int __pyx_lineno = 0;
6384 const char *__pyx_filename = NULL;
6385 int __pyx_clineno = 0;
6386 PyObject *__pyx_r = 0;
6387 __Pyx_RefNannyDeclarations
6388 __Pyx_RefNannySetupContext("descendantpaths (wrapper)", 0);
6390 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
6391 PyObject* values[1] = {0};
6392 values[0] = ((PyObject *)Py_None);
6393 if (unlikely(__pyx_kwds)) {
6395 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6397 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6400 default: goto __pyx_L5_argtuple_error;
6402 kw_args = PyDict_Size(__pyx_kwds);
6406 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
6407 if (value) { values[0] = value; kw_args--; }
6410 if (unlikely(kw_args > 0)) {
6411 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "descendantpaths") < 0)) __PYX_ERR(0, 369, __pyx_L3_error)
6414 switch (PyTuple_GET_SIZE(__pyx_args)) {
6415 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6418 default: goto __pyx_L5_argtuple_error;
6421 __pyx_v_prefix = values[0];
6423 goto __pyx_L4_argument_unpacking_done;
6424 __pyx_L5_argtuple_error:;
6425 __Pyx_RaiseArgtupleInvalid("descendantpaths", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error)
6427 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.descendantpaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
6428 __Pyx_RefNannyFinishContext();
6430 __pyx_L4_argument_unpacking_done:;
6431 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), __pyx_v_prefix);
6433 /* function exit code */
6434 __Pyx_RefNannyFinishContext();
6438 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_prefix) {
6439 PyObject *__pyx_r = NULL;
6440 __Pyx_RefNannyDeclarations
6444 PyObject *__pyx_t_4 = NULL;
6445 int __pyx_lineno = 0;
6446 const char *__pyx_filename = NULL;
6447 int __pyx_clineno = 0;
6448 __Pyx_RefNannySetupContext("descendantpaths", 0);
6449 __Pyx_INCREF(__pyx_v_prefix);
6451 /* "lxml/objectify.pyx":374
6452 * Returns a list of object path expressions for all descendants.
6454 * if prefix is not None and not python._isString(prefix): # <<<<<<<<<<<<<<
6455 * prefix = u'.'.join(prefix)
6456 * return _build_descendant_paths(self._c_node, prefix)
6458 __pyx_t_2 = (__pyx_v_prefix != Py_None);
6459 __pyx_t_3 = (__pyx_t_2 != 0);
6462 __pyx_t_1 = __pyx_t_3;
6463 goto __pyx_L4_bool_binop_done;
6465 __pyx_t_3 = ((!(_isString(__pyx_v_prefix) != 0)) != 0);
6466 __pyx_t_1 = __pyx_t_3;
6467 __pyx_L4_bool_binop_done:;
6470 /* "lxml/objectify.pyx":375
6472 * if prefix is not None and not python._isString(prefix):
6473 * prefix = u'.'.join(prefix) # <<<<<<<<<<<<<<
6474 * return _build_descendant_paths(self._c_node, prefix)
6477 __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error)
6478 __Pyx_GOTREF(__pyx_t_4);
6479 __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_4);
6482 /* "lxml/objectify.pyx":374
6483 * Returns a list of object path expressions for all descendants.
6485 * if prefix is not None and not python._isString(prefix): # <<<<<<<<<<<<<<
6486 * prefix = u'.'.join(prefix)
6487 * return _build_descendant_paths(self._c_node, prefix)
6491 /* "lxml/objectify.pyx":376
6492 * if prefix is not None and not python._isString(prefix):
6493 * prefix = u'.'.join(prefix)
6494 * return _build_descendant_paths(self._c_node, prefix) # <<<<<<<<<<<<<<
6498 __Pyx_XDECREF(__pyx_r);
6499 __pyx_t_4 = __pyx_f_4lxml_9objectify__build_descendant_paths(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
6500 __Pyx_GOTREF(__pyx_t_4);
6501 __pyx_r = __pyx_t_4;
6505 /* "lxml/objectify.pyx":369
6506 * parent.remove(sibling)
6508 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
6509 * u"""descendantpaths(self, prefix=None)
6513 /* function exit code */
6515 __Pyx_XDECREF(__pyx_t_4);
6516 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.descendantpaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
6519 __Pyx_XDECREF(__pyx_v_prefix);
6520 __Pyx_XGIVEREF(__pyx_r);
6521 __Pyx_RefNannyFinishContext();
6525 /* "lxml/objectify.pyx":379
6528 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name): # <<<<<<<<<<<<<<
6529 * if c_node.name != c_name:
6533 static CYTHON_INLINE int __pyx_f_4lxml_9objectify__tagMatches(xmlNode *__pyx_v_c_node, const xmlChar *__pyx_v_c_href, const xmlChar *__pyx_v_c_name) {
6534 const xmlChar *__pyx_v_c_node_href;
6536 __Pyx_RefNannyDeclarations
6538 __Pyx_RefNannySetupContext("_tagMatches", 0);
6540 /* "lxml/objectify.pyx":380
6542 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6543 * if c_node.name != c_name: # <<<<<<<<<<<<<<
6545 * if c_href == NULL:
6547 __pyx_t_1 = ((__pyx_v_c_node->name != __pyx_v_c_name) != 0);
6550 /* "lxml/objectify.pyx":381
6551 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6552 * if c_node.name != c_name:
6553 * return 0 # <<<<<<<<<<<<<<
6554 * if c_href == NULL:
6560 /* "lxml/objectify.pyx":380
6562 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6563 * if c_node.name != c_name: # <<<<<<<<<<<<<<
6565 * if c_href == NULL:
6569 /* "lxml/objectify.pyx":382
6570 * if c_node.name != c_name:
6572 * if c_href == NULL: # <<<<<<<<<<<<<<
6574 * c_node_href = tree._getNs(c_node)
6576 __pyx_t_1 = ((__pyx_v_c_href == NULL) != 0);
6579 /* "lxml/objectify.pyx":383
6581 * if c_href == NULL:
6582 * return 1 # <<<<<<<<<<<<<<
6583 * c_node_href = tree._getNs(c_node)
6584 * if c_node_href == NULL:
6589 /* "lxml/objectify.pyx":382
6590 * if c_node.name != c_name:
6592 * if c_href == NULL: # <<<<<<<<<<<<<<
6594 * c_node_href = tree._getNs(c_node)
6598 /* "lxml/objectify.pyx":384
6599 * if c_href == NULL:
6601 * c_node_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
6602 * if c_node_href == NULL:
6603 * return c_href[0] == c'\0'
6605 __pyx_v_c_node_href = _getNs(__pyx_v_c_node);
6607 /* "lxml/objectify.pyx":385
6609 * c_node_href = tree._getNs(c_node)
6610 * if c_node_href == NULL: # <<<<<<<<<<<<<<
6611 * return c_href[0] == c'\0'
6612 * return tree.xmlStrcmp(c_node_href, c_href) == 0
6614 __pyx_t_1 = ((__pyx_v_c_node_href == NULL) != 0);
6617 /* "lxml/objectify.pyx":386
6618 * c_node_href = tree._getNs(c_node)
6619 * if c_node_href == NULL:
6620 * return c_href[0] == c'\0' # <<<<<<<<<<<<<<
6621 * return tree.xmlStrcmp(c_node_href, c_href) == 0
6624 __pyx_r = ((__pyx_v_c_href[0]) == '\x00');
6627 /* "lxml/objectify.pyx":385
6629 * c_node_href = tree._getNs(c_node)
6630 * if c_node_href == NULL: # <<<<<<<<<<<<<<
6631 * return c_href[0] == c'\0'
6632 * return tree.xmlStrcmp(c_node_href, c_href) == 0
6636 /* "lxml/objectify.pyx":387
6637 * if c_node_href == NULL:
6638 * return c_href[0] == c'\0'
6639 * return tree.xmlStrcmp(c_node_href, c_href) == 0 # <<<<<<<<<<<<<<
6643 __pyx_r = (xmlStrcmp(__pyx_v_c_node_href, __pyx_v_c_href) == 0);
6646 /* "lxml/objectify.pyx":379
6649 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name): # <<<<<<<<<<<<<<
6650 * if c_node.name != c_name:
6654 /* function exit code */
6656 __Pyx_RefNannyFinishContext();
6660 /* "lxml/objectify.pyx":390
6663 * cdef Py_ssize_t _countSiblings(tree.xmlNode* c_start_node): # <<<<<<<<<<<<<<
6664 * cdef tree.xmlNode* c_node
6665 * cdef Py_ssize_t count
6668 static Py_ssize_t __pyx_f_4lxml_9objectify__countSiblings(xmlNode *__pyx_v_c_start_node) {
6669 xmlNode *__pyx_v_c_node;
6670 Py_ssize_t __pyx_v_count;
6671 const xmlChar *__pyx_v_c_tag;
6672 const xmlChar *__pyx_v_c_href;
6674 __Pyx_RefNannyDeclarations
6675 const xmlChar *__pyx_t_1;
6679 __Pyx_RefNannySetupContext("_countSiblings", 0);
6681 /* "lxml/objectify.pyx":393
6682 * cdef tree.xmlNode* c_node
6683 * cdef Py_ssize_t count
6684 * c_tag = c_start_node.name # <<<<<<<<<<<<<<
6685 * c_href = tree._getNs(c_start_node)
6688 __pyx_t_1 = __pyx_v_c_start_node->name;
6689 __pyx_v_c_tag = __pyx_t_1;
6691 /* "lxml/objectify.pyx":394
6692 * cdef Py_ssize_t count
6693 * c_tag = c_start_node.name
6694 * c_href = tree._getNs(c_start_node) # <<<<<<<<<<<<<<
6696 * c_node = c_start_node.next
6698 __pyx_v_c_href = _getNs(__pyx_v_c_start_node);
6700 /* "lxml/objectify.pyx":395
6701 * c_tag = c_start_node.name
6702 * c_href = tree._getNs(c_start_node)
6703 * count = 1 # <<<<<<<<<<<<<<
6704 * c_node = c_start_node.next
6705 * while c_node is not NULL:
6709 /* "lxml/objectify.pyx":396
6710 * c_href = tree._getNs(c_start_node)
6712 * c_node = c_start_node.next # <<<<<<<<<<<<<<
6713 * while c_node is not NULL:
6714 * if c_node.type == tree.XML_ELEMENT_NODE and \
6716 __pyx_t_2 = __pyx_v_c_start_node->next;
6717 __pyx_v_c_node = __pyx_t_2;
6719 /* "lxml/objectify.pyx":397
6721 * c_node = c_start_node.next
6722 * while c_node is not NULL: # <<<<<<<<<<<<<<
6723 * if c_node.type == tree.XML_ELEMENT_NODE and \
6724 * _tagMatches(c_node, c_href, c_tag):
6727 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
6728 if (!__pyx_t_3) break;
6730 /* "lxml/objectify.pyx":398
6731 * c_node = c_start_node.next
6732 * while c_node is not NULL:
6733 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6734 * _tagMatches(c_node, c_href, c_tag):
6737 __pyx_t_4 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6740 __pyx_t_3 = __pyx_t_4;
6741 goto __pyx_L6_bool_binop_done;
6744 /* "lxml/objectify.pyx":399
6745 * while c_node is not NULL:
6746 * if c_node.type == tree.XML_ELEMENT_NODE and \
6747 * _tagMatches(c_node, c_href, c_tag): # <<<<<<<<<<<<<<
6749 * c_node = c_node.next
6751 __pyx_t_4 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_tag) != 0);
6752 __pyx_t_3 = __pyx_t_4;
6753 __pyx_L6_bool_binop_done:;
6755 /* "lxml/objectify.pyx":398
6756 * c_node = c_start_node.next
6757 * while c_node is not NULL:
6758 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6759 * _tagMatches(c_node, c_href, c_tag):
6764 /* "lxml/objectify.pyx":400
6765 * if c_node.type == tree.XML_ELEMENT_NODE and \
6766 * _tagMatches(c_node, c_href, c_tag):
6767 * count += 1 # <<<<<<<<<<<<<<
6768 * c_node = c_node.next
6769 * c_node = c_start_node.prev
6771 __pyx_v_count = (__pyx_v_count + 1);
6773 /* "lxml/objectify.pyx":398
6774 * c_node = c_start_node.next
6775 * while c_node is not NULL:
6776 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6777 * _tagMatches(c_node, c_href, c_tag):
6782 /* "lxml/objectify.pyx":401
6783 * _tagMatches(c_node, c_href, c_tag):
6785 * c_node = c_node.next # <<<<<<<<<<<<<<
6786 * c_node = c_start_node.prev
6787 * while c_node is not NULL:
6789 __pyx_t_2 = __pyx_v_c_node->next;
6790 __pyx_v_c_node = __pyx_t_2;
6793 /* "lxml/objectify.pyx":402
6795 * c_node = c_node.next
6796 * c_node = c_start_node.prev # <<<<<<<<<<<<<<
6797 * while c_node is not NULL:
6798 * if c_node.type == tree.XML_ELEMENT_NODE and \
6800 __pyx_t_2 = __pyx_v_c_start_node->prev;
6801 __pyx_v_c_node = __pyx_t_2;
6803 /* "lxml/objectify.pyx":403
6804 * c_node = c_node.next
6805 * c_node = c_start_node.prev
6806 * while c_node is not NULL: # <<<<<<<<<<<<<<
6807 * if c_node.type == tree.XML_ELEMENT_NODE and \
6808 * _tagMatches(c_node, c_href, c_tag):
6811 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
6812 if (!__pyx_t_3) break;
6814 /* "lxml/objectify.pyx":404
6815 * c_node = c_start_node.prev
6816 * while c_node is not NULL:
6817 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6818 * _tagMatches(c_node, c_href, c_tag):
6821 __pyx_t_4 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6824 __pyx_t_3 = __pyx_t_4;
6825 goto __pyx_L11_bool_binop_done;
6828 /* "lxml/objectify.pyx":405
6829 * while c_node is not NULL:
6830 * if c_node.type == tree.XML_ELEMENT_NODE and \
6831 * _tagMatches(c_node, c_href, c_tag): # <<<<<<<<<<<<<<
6833 * c_node = c_node.prev
6835 __pyx_t_4 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_tag) != 0);
6836 __pyx_t_3 = __pyx_t_4;
6837 __pyx_L11_bool_binop_done:;
6839 /* "lxml/objectify.pyx":404
6840 * c_node = c_start_node.prev
6841 * while c_node is not NULL:
6842 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6843 * _tagMatches(c_node, c_href, c_tag):
6848 /* "lxml/objectify.pyx":406
6849 * if c_node.type == tree.XML_ELEMENT_NODE and \
6850 * _tagMatches(c_node, c_href, c_tag):
6851 * count += 1 # <<<<<<<<<<<<<<
6852 * c_node = c_node.prev
6855 __pyx_v_count = (__pyx_v_count + 1);
6857 /* "lxml/objectify.pyx":404
6858 * c_node = c_start_node.prev
6859 * while c_node is not NULL:
6860 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6861 * _tagMatches(c_node, c_href, c_tag):
6866 /* "lxml/objectify.pyx":407
6867 * _tagMatches(c_node, c_href, c_tag):
6869 * c_node = c_node.prev # <<<<<<<<<<<<<<
6873 __pyx_t_2 = __pyx_v_c_node->prev;
6874 __pyx_v_c_node = __pyx_t_2;
6877 /* "lxml/objectify.pyx":408
6879 * c_node = c_node.prev
6880 * return count # <<<<<<<<<<<<<<
6882 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node,
6884 __pyx_r = __pyx_v_count;
6887 /* "lxml/objectify.pyx":390
6890 * cdef Py_ssize_t _countSiblings(tree.xmlNode* c_start_node): # <<<<<<<<<<<<<<
6891 * cdef tree.xmlNode* c_node
6892 * cdef Py_ssize_t count
6895 /* function exit code */
6897 __Pyx_RefNannyFinishContext();
6901 /* "lxml/objectify.pyx":410
6904 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
6905 * const_xmlChar* href, const_xmlChar* name,
6906 * Py_ssize_t index):
6909 static xmlNode *__pyx_f_4lxml_9objectify__findFollowingSibling(xmlNode *__pyx_v_c_node, const xmlChar *__pyx_v_href, const xmlChar *__pyx_v_name, Py_ssize_t __pyx_v_index) {
6910 xmlNode *(*__pyx_v_next)(xmlNode *);
6912 __Pyx_RefNannyDeclarations
6915 __Pyx_RefNannySetupContext("_findFollowingSibling", 0);
6917 /* "lxml/objectify.pyx":414
6918 * Py_ssize_t index):
6919 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6920 * if index >= 0: # <<<<<<<<<<<<<<
6921 * next = cetree.nextElement
6924 __pyx_t_1 = ((__pyx_v_index >= 0) != 0);
6927 /* "lxml/objectify.pyx":415
6928 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6930 * next = cetree.nextElement # <<<<<<<<<<<<<<
6932 * index = -1 - index
6934 __pyx_v_next = nextElement;
6936 /* "lxml/objectify.pyx":414
6937 * Py_ssize_t index):
6938 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6939 * if index >= 0: # <<<<<<<<<<<<<<
6940 * next = cetree.nextElement
6946 /* "lxml/objectify.pyx":417
6947 * next = cetree.nextElement
6949 * index = -1 - index # <<<<<<<<<<<<<<
6950 * next = cetree.previousElement
6951 * while c_node is not NULL:
6954 __pyx_v_index = (-1L - __pyx_v_index);
6956 /* "lxml/objectify.pyx":418
6958 * index = -1 - index
6959 * next = cetree.previousElement # <<<<<<<<<<<<<<
6960 * while c_node is not NULL:
6961 * if c_node.type == tree.XML_ELEMENT_NODE and \
6963 __pyx_v_next = previousElement;
6967 /* "lxml/objectify.pyx":419
6968 * index = -1 - index
6969 * next = cetree.previousElement
6970 * while c_node is not NULL: # <<<<<<<<<<<<<<
6971 * if c_node.type == tree.XML_ELEMENT_NODE and \
6972 * _tagMatches(c_node, href, name):
6975 __pyx_t_1 = ((__pyx_v_c_node != NULL) != 0);
6976 if (!__pyx_t_1) break;
6978 /* "lxml/objectify.pyx":420
6979 * next = cetree.previousElement
6980 * while c_node is not NULL:
6981 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6982 * _tagMatches(c_node, href, name):
6985 __pyx_t_2 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6988 __pyx_t_1 = __pyx_t_2;
6989 goto __pyx_L7_bool_binop_done;
6992 /* "lxml/objectify.pyx":421
6993 * while c_node is not NULL:
6994 * if c_node.type == tree.XML_ELEMENT_NODE and \
6995 * _tagMatches(c_node, href, name): # <<<<<<<<<<<<<<
6999 __pyx_t_2 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_href, __pyx_v_name) != 0);
7000 __pyx_t_1 = __pyx_t_2;
7001 __pyx_L7_bool_binop_done:;
7003 /* "lxml/objectify.pyx":420
7004 * next = cetree.previousElement
7005 * while c_node is not NULL:
7006 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
7007 * _tagMatches(c_node, href, name):
7012 /* "lxml/objectify.pyx":422
7013 * if c_node.type == tree.XML_ELEMENT_NODE and \
7014 * _tagMatches(c_node, href, name):
7015 * index = index - 1 # <<<<<<<<<<<<<<
7019 __pyx_v_index = (__pyx_v_index - 1);
7021 /* "lxml/objectify.pyx":423
7022 * _tagMatches(c_node, href, name):
7024 * if index < 0: # <<<<<<<<<<<<<<
7026 * c_node = next(c_node)
7028 __pyx_t_1 = ((__pyx_v_index < 0) != 0);
7031 /* "lxml/objectify.pyx":424
7034 * return c_node # <<<<<<<<<<<<<<
7035 * c_node = next(c_node)
7038 __pyx_r = __pyx_v_c_node;
7041 /* "lxml/objectify.pyx":423
7042 * _tagMatches(c_node, href, name):
7044 * if index < 0: # <<<<<<<<<<<<<<
7046 * c_node = next(c_node)
7050 /* "lxml/objectify.pyx":420
7051 * next = cetree.previousElement
7052 * while c_node is not NULL:
7053 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
7054 * _tagMatches(c_node, href, name):
7059 /* "lxml/objectify.pyx":425
7062 * c_node = next(c_node) # <<<<<<<<<<<<<<
7066 __pyx_v_c_node = __pyx_v_next(__pyx_v_c_node);
7069 /* "lxml/objectify.pyx":426
7071 * c_node = next(c_node)
7072 * return NULL # <<<<<<<<<<<<<<
7074 * cdef object _lookupChild(_Element parent, tag):
7079 /* "lxml/objectify.pyx":410
7082 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
7083 * const_xmlChar* href, const_xmlChar* name,
7084 * Py_ssize_t index):
7087 /* function exit code */
7089 __Pyx_RefNannyFinishContext();
7093 /* "lxml/objectify.pyx":428
7096 * cdef object _lookupChild(_Element parent, tag): # <<<<<<<<<<<<<<
7097 * cdef tree.xmlNode* c_result
7098 * cdef tree.xmlNode* c_node
7101 static PyObject *__pyx_f_4lxml_9objectify__lookupChild(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7102 xmlNode *__pyx_v_c_result;
7103 xmlNode *__pyx_v_c_node;
7104 PyObject *__pyx_v_ns = NULL;
7105 const xmlChar *__pyx_v_c_tag;
7106 const xmlChar *__pyx_v_c_href;
7107 PyObject *__pyx_r = NULL;
7108 __Pyx_RefNannyDeclarations
7110 PyObject *__pyx_t_2 = NULL;
7111 PyObject *__pyx_t_3 = NULL;
7112 PyObject *__pyx_t_4 = NULL;
7115 const xmlChar *__pyx_t_7;
7116 const xmlChar *__pyx_t_8;
7117 int __pyx_lineno = 0;
7118 const char *__pyx_filename = NULL;
7119 int __pyx_clineno = 0;
7120 __Pyx_RefNannySetupContext("_lookupChild", 0);
7121 __Pyx_INCREF(__pyx_v_tag);
7123 /* "lxml/objectify.pyx":431
7124 * cdef tree.xmlNode* c_result
7125 * cdef tree.xmlNode* c_node
7126 * c_node = parent._c_node # <<<<<<<<<<<<<<
7127 * ns, tag = cetree.getNsTagWithEmptyNs(tag)
7128 * c_tag = tree.xmlDictExists(
7130 __pyx_t_1 = __pyx_v_parent->_c_node;
7131 __pyx_v_c_node = __pyx_t_1;
7133 /* "lxml/objectify.pyx":432
7134 * cdef tree.xmlNode* c_node
7135 * c_node = parent._c_node
7136 * ns, tag = cetree.getNsTagWithEmptyNs(tag) # <<<<<<<<<<<<<<
7137 * c_tag = tree.xmlDictExists(
7138 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7140 __pyx_t_2 = getNsTagWithEmptyNs(__pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
7141 __Pyx_GOTREF(__pyx_t_2);
7142 if (likely(__pyx_t_2 != Py_None)) {
7143 PyObject* sequence = __pyx_t_2;
7144 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7145 if (unlikely(size != 2)) {
7146 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7147 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7148 __PYX_ERR(0, 432, __pyx_L1_error)
7150 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7151 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7152 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7153 __Pyx_INCREF(__pyx_t_3);
7154 __Pyx_INCREF(__pyx_t_4);
7156 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
7157 __Pyx_GOTREF(__pyx_t_3);
7158 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
7159 __Pyx_GOTREF(__pyx_t_4);
7161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7163 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 432, __pyx_L1_error)
7165 __pyx_v_ns = __pyx_t_3;
7167 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_4);
7170 /* "lxml/objectify.pyx":433
7171 * c_node = parent._c_node
7172 * ns, tag = cetree.getNsTagWithEmptyNs(tag)
7173 * c_tag = tree.xmlDictExists( # <<<<<<<<<<<<<<
7174 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7177 __pyx_v_c_tag = xmlDictExists(__pyx_v_c_node->doc->dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag), PyBytes_GET_SIZE(__pyx_v_tag));
7179 /* "lxml/objectify.pyx":435
7180 * c_tag = tree.xmlDictExists(
7181 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7182 * if c_tag is NULL: # <<<<<<<<<<<<<<
7183 * return None # not in the hash map => not in the tree
7186 __pyx_t_5 = ((__pyx_v_c_tag == NULL) != 0);
7189 /* "lxml/objectify.pyx":436
7190 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7192 * return None # not in the hash map => not in the tree # <<<<<<<<<<<<<<
7194 * # either inherit ns from parent or use empty (i.e. no) namespace
7196 __Pyx_XDECREF(__pyx_r);
7197 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7200 /* "lxml/objectify.pyx":435
7201 * c_tag = tree.xmlDictExists(
7202 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7203 * if c_tag is NULL: # <<<<<<<<<<<<<<
7204 * return None # not in the hash map => not in the tree
7209 /* "lxml/objectify.pyx":437
7211 * return None # not in the hash map => not in the tree
7212 * if ns is None: # <<<<<<<<<<<<<<
7213 * # either inherit ns from parent or use empty (i.e. no) namespace
7214 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
7216 __pyx_t_5 = (__pyx_v_ns == Py_None);
7217 __pyx_t_6 = (__pyx_t_5 != 0);
7220 /* "lxml/objectify.pyx":439
7222 * # either inherit ns from parent or use empty (i.e. no) namespace
7223 * c_href = tree._getNs(c_node) or <const_xmlChar*>'' # <<<<<<<<<<<<<<
7225 * c_href = _xcstr(ns)
7227 __pyx_t_8 = _getNs(__pyx_v_c_node);
7230 __pyx_t_7 = __pyx_t_8;
7231 goto __pyx_L5_bool_binop_done;
7233 __pyx_t_8 = ((const xmlChar *)((const xmlChar *)((char const *)"")));
7234 __pyx_t_7 = __pyx_t_8;
7235 __pyx_L5_bool_binop_done:;
7236 __pyx_v_c_href = __pyx_t_7;
7238 /* "lxml/objectify.pyx":437
7240 * return None # not in the hash map => not in the tree
7241 * if ns is None: # <<<<<<<<<<<<<<
7242 * # either inherit ns from parent or use empty (i.e. no) namespace
7243 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
7248 /* "lxml/objectify.pyx":441
7249 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
7251 * c_href = _xcstr(ns) # <<<<<<<<<<<<<<
7252 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7253 * if c_result is NULL:
7256 __pyx_v_c_href = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns);
7260 /* "lxml/objectify.pyx":442
7262 * c_href = _xcstr(ns)
7263 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0) # <<<<<<<<<<<<<<
7264 * if c_result is NULL:
7267 __pyx_v_c_result = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node->children, __pyx_v_c_href, __pyx_v_c_tag, 0);
7269 /* "lxml/objectify.pyx":443
7270 * c_href = _xcstr(ns)
7271 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7272 * if c_result is NULL: # <<<<<<<<<<<<<<
7274 * return elementFactory(parent._doc, c_result)
7276 __pyx_t_6 = ((__pyx_v_c_result == NULL) != 0);
7279 /* "lxml/objectify.pyx":444
7280 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7281 * if c_result is NULL:
7282 * return None # <<<<<<<<<<<<<<
7283 * return elementFactory(parent._doc, c_result)
7286 __Pyx_XDECREF(__pyx_r);
7287 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7290 /* "lxml/objectify.pyx":443
7291 * c_href = _xcstr(ns)
7292 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7293 * if c_result is NULL: # <<<<<<<<<<<<<<
7295 * return elementFactory(parent._doc, c_result)
7299 /* "lxml/objectify.pyx":445
7300 * if c_result is NULL:
7302 * return elementFactory(parent._doc, c_result) # <<<<<<<<<<<<<<
7304 * cdef object _lookupChildOrRaise(_Element parent, tag):
7306 __Pyx_XDECREF(__pyx_r);
7307 __pyx_t_2 = ((PyObject *)__pyx_v_parent->_doc);
7308 __Pyx_INCREF(__pyx_t_2);
7309 __pyx_t_4 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_result)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 445, __pyx_L1_error)
7310 __Pyx_GOTREF(__pyx_t_4);
7311 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7312 __pyx_r = __pyx_t_4;
7316 /* "lxml/objectify.pyx":428
7319 * cdef object _lookupChild(_Element parent, tag): # <<<<<<<<<<<<<<
7320 * cdef tree.xmlNode* c_result
7321 * cdef tree.xmlNode* c_node
7324 /* function exit code */
7326 __Pyx_XDECREF(__pyx_t_2);
7327 __Pyx_XDECREF(__pyx_t_3);
7328 __Pyx_XDECREF(__pyx_t_4);
7329 __Pyx_AddTraceback("lxml.objectify._lookupChild", __pyx_clineno, __pyx_lineno, __pyx_filename);
7332 __Pyx_XDECREF(__pyx_v_ns);
7333 __Pyx_XDECREF(__pyx_v_tag);
7334 __Pyx_XGIVEREF(__pyx_r);
7335 __Pyx_RefNannyFinishContext();
7339 /* "lxml/objectify.pyx":447
7340 * return elementFactory(parent._doc, c_result)
7342 * cdef object _lookupChildOrRaise(_Element parent, tag): # <<<<<<<<<<<<<<
7343 * element = _lookupChild(parent, tag)
7344 * if element is None:
7347 static PyObject *__pyx_f_4lxml_9objectify__lookupChildOrRaise(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7348 PyObject *__pyx_v_element = NULL;
7349 PyObject *__pyx_r = NULL;
7350 __Pyx_RefNannyDeclarations
7351 PyObject *__pyx_t_1 = NULL;
7354 PyObject *__pyx_t_4 = NULL;
7355 int __pyx_lineno = 0;
7356 const char *__pyx_filename = NULL;
7357 int __pyx_clineno = 0;
7358 __Pyx_RefNannySetupContext("_lookupChildOrRaise", 0);
7360 /* "lxml/objectify.pyx":448
7362 * cdef object _lookupChildOrRaise(_Element parent, tag):
7363 * element = _lookupChild(parent, tag) # <<<<<<<<<<<<<<
7364 * if element is None:
7365 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7367 __pyx_t_1 = __pyx_f_4lxml_9objectify__lookupChild(__pyx_v_parent, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
7368 __Pyx_GOTREF(__pyx_t_1);
7369 __pyx_v_element = __pyx_t_1;
7372 /* "lxml/objectify.pyx":449
7373 * cdef object _lookupChildOrRaise(_Element parent, tag):
7374 * element = _lookupChild(parent, tag)
7375 * if element is None: # <<<<<<<<<<<<<<
7376 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7379 __pyx_t_2 = (__pyx_v_element == Py_None);
7380 __pyx_t_3 = (__pyx_t_2 != 0);
7381 if (unlikely(__pyx_t_3)) {
7383 /* "lxml/objectify.pyx":450
7384 * element = _lookupChild(parent, tag)
7385 * if element is None:
7386 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag) # <<<<<<<<<<<<<<
7390 __pyx_t_1 = __pyx_f_4lxml_9objectify__buildChildTag(__pyx_v_parent, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
7391 __Pyx_GOTREF(__pyx_t_1);
7392 __pyx_t_4 = PyNumber_Add(__pyx_kp_u_no_such_child, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
7393 __Pyx_GOTREF(__pyx_t_4);
7394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7395 __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_t_4, 0, 0);
7396 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7397 __PYX_ERR(0, 450, __pyx_L1_error)
7399 /* "lxml/objectify.pyx":449
7400 * cdef object _lookupChildOrRaise(_Element parent, tag):
7401 * element = _lookupChild(parent, tag)
7402 * if element is None: # <<<<<<<<<<<<<<
7403 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7408 /* "lxml/objectify.pyx":451
7409 * if element is None:
7410 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7411 * return element # <<<<<<<<<<<<<<
7413 * cdef object _buildChildTag(_Element parent, tag):
7415 __Pyx_XDECREF(__pyx_r);
7416 __Pyx_INCREF(__pyx_v_element);
7417 __pyx_r = __pyx_v_element;
7420 /* "lxml/objectify.pyx":447
7421 * return elementFactory(parent._doc, c_result)
7423 * cdef object _lookupChildOrRaise(_Element parent, tag): # <<<<<<<<<<<<<<
7424 * element = _lookupChild(parent, tag)
7425 * if element is None:
7428 /* function exit code */
7430 __Pyx_XDECREF(__pyx_t_1);
7431 __Pyx_XDECREF(__pyx_t_4);
7432 __Pyx_AddTraceback("lxml.objectify._lookupChildOrRaise", __pyx_clineno, __pyx_lineno, __pyx_filename);
7435 __Pyx_XDECREF(__pyx_v_element);
7436 __Pyx_XGIVEREF(__pyx_r);
7437 __Pyx_RefNannyFinishContext();
7441 /* "lxml/objectify.pyx":453
7444 * cdef object _buildChildTag(_Element parent, tag): # <<<<<<<<<<<<<<
7445 * ns, tag = cetree.getNsTag(tag)
7446 * c_tag = _xcstr(tag)
7449 static PyObject *__pyx_f_4lxml_9objectify__buildChildTag(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7450 PyObject *__pyx_v_ns = NULL;
7451 const xmlChar *__pyx_v_c_tag;
7452 const xmlChar *__pyx_v_c_href;
7453 PyObject *__pyx_r = NULL;
7454 __Pyx_RefNannyDeclarations
7455 PyObject *__pyx_t_1 = NULL;
7456 PyObject *__pyx_t_2 = NULL;
7457 PyObject *__pyx_t_3 = NULL;
7458 const xmlChar *__pyx_t_4;
7460 int __pyx_lineno = 0;
7461 const char *__pyx_filename = NULL;
7462 int __pyx_clineno = 0;
7463 __Pyx_RefNannySetupContext("_buildChildTag", 0);
7464 __Pyx_INCREF(__pyx_v_tag);
7466 /* "lxml/objectify.pyx":454
7468 * cdef object _buildChildTag(_Element parent, tag):
7469 * ns, tag = cetree.getNsTag(tag) # <<<<<<<<<<<<<<
7470 * c_tag = _xcstr(tag)
7471 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7473 __pyx_t_1 = getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
7474 __Pyx_GOTREF(__pyx_t_1);
7475 if (likely(__pyx_t_1 != Py_None)) {
7476 PyObject* sequence = __pyx_t_1;
7477 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7478 if (unlikely(size != 2)) {
7479 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7480 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7481 __PYX_ERR(0, 454, __pyx_L1_error)
7483 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7484 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
7485 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
7486 __Pyx_INCREF(__pyx_t_2);
7487 __Pyx_INCREF(__pyx_t_3);
7489 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
7490 __Pyx_GOTREF(__pyx_t_2);
7491 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
7492 __Pyx_GOTREF(__pyx_t_3);
7494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7496 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 454, __pyx_L1_error)
7498 __pyx_v_ns = __pyx_t_2;
7500 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_3);
7503 /* "lxml/objectify.pyx":455
7504 * cdef object _buildChildTag(_Element parent, tag):
7505 * ns, tag = cetree.getNsTag(tag)
7506 * c_tag = _xcstr(tag) # <<<<<<<<<<<<<<
7507 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7508 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7510 __pyx_v_c_tag = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag);
7512 /* "lxml/objectify.pyx":456
7513 * ns, tag = cetree.getNsTag(tag)
7514 * c_tag = _xcstr(tag)
7515 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns) # <<<<<<<<<<<<<<
7516 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7519 __pyx_t_5 = (__pyx_v_ns == Py_None);
7520 if ((__pyx_t_5 != 0)) {
7521 __pyx_t_4 = _getNs(__pyx_v_parent->_c_node);
7523 __pyx_t_4 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns);
7525 __pyx_v_c_href = __pyx_t_4;
7527 /* "lxml/objectify.pyx":457
7528 * c_tag = _xcstr(tag)
7529 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7530 * return cetree.namespacedNameFromNsName(c_href, c_tag) # <<<<<<<<<<<<<<
7532 * cdef _replaceElement(_Element element, value):
7534 __Pyx_XDECREF(__pyx_r);
7535 __pyx_t_1 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
7536 __Pyx_GOTREF(__pyx_t_1);
7537 __pyx_r = __pyx_t_1;
7541 /* "lxml/objectify.pyx":453
7544 * cdef object _buildChildTag(_Element parent, tag): # <<<<<<<<<<<<<<
7545 * ns, tag = cetree.getNsTag(tag)
7546 * c_tag = _xcstr(tag)
7549 /* function exit code */
7551 __Pyx_XDECREF(__pyx_t_1);
7552 __Pyx_XDECREF(__pyx_t_2);
7553 __Pyx_XDECREF(__pyx_t_3);
7554 __Pyx_AddTraceback("lxml.objectify._buildChildTag", __pyx_clineno, __pyx_lineno, __pyx_filename);
7557 __Pyx_XDECREF(__pyx_v_ns);
7558 __Pyx_XDECREF(__pyx_v_tag);
7559 __Pyx_XGIVEREF(__pyx_r);
7560 __Pyx_RefNannyFinishContext();
7564 /* "lxml/objectify.pyx":459
7565 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7567 * cdef _replaceElement(_Element element, value): # <<<<<<<<<<<<<<
7568 * cdef _Element new_element
7569 * if isinstance(value, _Element):
7572 static PyObject *__pyx_f_4lxml_9objectify__replaceElement(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_value) {
7573 struct LxmlElement *__pyx_v_new_element = 0;
7574 PyObject *__pyx_r = NULL;
7575 __Pyx_RefNannyDeclarations
7578 PyObject *__pyx_t_3 = NULL;
7579 PyObject *__pyx_t_4 = NULL;
7581 PyObject *__pyx_t_6 = NULL;
7582 PyObject *__pyx_t_7 = NULL;
7584 int __pyx_lineno = 0;
7585 const char *__pyx_filename = NULL;
7586 int __pyx_clineno = 0;
7587 __Pyx_RefNannySetupContext("_replaceElement", 0);
7589 /* "lxml/objectify.pyx":461
7590 * cdef _replaceElement(_Element element, value):
7591 * cdef _Element new_element
7592 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7593 * # deep copy the new element
7594 * new_element = cetree.deepcopyNodeToDocument(
7596 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
7597 __pyx_t_2 = (__pyx_t_1 != 0);
7600 /* "lxml/objectify.pyx":464
7601 * # deep copy the new element
7602 * new_element = cetree.deepcopyNodeToDocument(
7603 * element._doc, (<_Element>value)._c_node) # <<<<<<<<<<<<<<
7604 * new_element.tag = element.tag
7605 * elif isinstance(value, (list, tuple)):
7607 __pyx_t_3 = ((PyObject *)__pyx_v_element->_doc);
7608 __Pyx_INCREF(__pyx_t_3);
7610 /* "lxml/objectify.pyx":463
7611 * if isinstance(value, _Element):
7612 * # deep copy the new element
7613 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
7614 * element._doc, (<_Element>value)._c_node)
7615 * new_element.tag = element.tag
7617 __pyx_t_4 = ((PyObject *)deepcopyNodeToDocument(((struct LxmlDocument *)__pyx_t_3), ((struct LxmlElement *)__pyx_v_value)->_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
7618 __Pyx_GOTREF(__pyx_t_4);
7619 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7620 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7623 /* "lxml/objectify.pyx":465
7624 * new_element = cetree.deepcopyNodeToDocument(
7625 * element._doc, (<_Element>value)._c_node)
7626 * new_element.tag = element.tag # <<<<<<<<<<<<<<
7627 * elif isinstance(value, (list, tuple)):
7628 * element[:] = value
7630 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
7631 __Pyx_GOTREF(__pyx_t_4);
7632 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_t_4) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
7633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7635 /* "lxml/objectify.pyx":461
7636 * cdef _replaceElement(_Element element, value):
7637 * cdef _Element new_element
7638 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7639 * # deep copy the new element
7640 * new_element = cetree.deepcopyNodeToDocument(
7645 /* "lxml/objectify.pyx":466
7646 * element._doc, (<_Element>value)._c_node)
7647 * new_element.tag = element.tag
7648 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7649 * element[:] = value
7652 __pyx_t_1 = PyList_Check(__pyx_v_value);
7653 __pyx_t_5 = (__pyx_t_1 != 0);
7656 __pyx_t_2 = __pyx_t_5;
7657 goto __pyx_L4_bool_binop_done;
7659 __pyx_t_5 = PyTuple_Check(__pyx_v_value);
7660 __pyx_t_1 = (__pyx_t_5 != 0);
7661 __pyx_t_2 = __pyx_t_1;
7662 __pyx_L4_bool_binop_done:;
7663 __pyx_t_1 = (__pyx_t_2 != 0);
7666 /* "lxml/objectify.pyx":467
7667 * new_element.tag = element.tag
7668 * elif isinstance(value, (list, tuple)):
7669 * element[:] = value # <<<<<<<<<<<<<<
7673 if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_element), __pyx_v_value, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
7675 /* "lxml/objectify.pyx":468
7676 * elif isinstance(value, (list, tuple)):
7677 * element[:] = value
7678 * return # <<<<<<<<<<<<<<
7680 * new_element = element.makeelement(element.tag)
7682 __Pyx_XDECREF(__pyx_r);
7683 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7686 /* "lxml/objectify.pyx":466
7687 * element._doc, (<_Element>value)._c_node)
7688 * new_element.tag = element.tag
7689 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7690 * element[:] = value
7695 /* "lxml/objectify.pyx":470
7698 * new_element = element.makeelement(element.tag) # <<<<<<<<<<<<<<
7699 * _setElementValue(new_element, value)
7700 * element.getparent().replace(element, new_element)
7703 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_makeelement); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
7704 __Pyx_GOTREF(__pyx_t_3);
7705 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error)
7706 __Pyx_GOTREF(__pyx_t_6);
7708 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7709 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
7710 if (likely(__pyx_t_7)) {
7711 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7712 __Pyx_INCREF(__pyx_t_7);
7713 __Pyx_INCREF(function);
7714 __Pyx_DECREF_SET(__pyx_t_3, function);
7717 __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
7718 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7719 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7720 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
7721 __Pyx_GOTREF(__pyx_t_4);
7722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7723 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 470, __pyx_L1_error)
7724 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7727 /* "lxml/objectify.pyx":471
7729 * new_element = element.makeelement(element.tag)
7730 * _setElementValue(new_element, value) # <<<<<<<<<<<<<<
7731 * element.getparent().replace(element, new_element)
7734 __pyx_t_4 = __pyx_f_4lxml_9objectify__setElementValue(__pyx_v_new_element, __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 471, __pyx_L1_error)
7735 __Pyx_GOTREF(__pyx_t_4);
7736 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7740 /* "lxml/objectify.pyx":472
7741 * new_element = element.makeelement(element.tag)
7742 * _setElementValue(new_element, value)
7743 * element.getparent().replace(element, new_element) # <<<<<<<<<<<<<<
7745 * cdef _appendValue(_Element parent, tag, value):
7747 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_getparent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error)
7748 __Pyx_GOTREF(__pyx_t_6);
7750 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7751 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
7752 if (likely(__pyx_t_7)) {
7753 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7754 __Pyx_INCREF(__pyx_t_7);
7755 __Pyx_INCREF(function);
7756 __Pyx_DECREF_SET(__pyx_t_6, function);
7759 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
7760 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7761 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
7762 __Pyx_GOTREF(__pyx_t_3);
7763 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7764 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error)
7765 __Pyx_GOTREF(__pyx_t_6);
7766 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7769 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7770 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
7771 if (likely(__pyx_t_3)) {
7772 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7773 __Pyx_INCREF(__pyx_t_3);
7774 __Pyx_INCREF(function);
7775 __Pyx_DECREF_SET(__pyx_t_6, function);
7779 #if CYTHON_FAST_PYCALL
7780 if (PyFunction_Check(__pyx_t_6)) {
7781 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_new_element)};
7782 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
7783 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7784 __Pyx_GOTREF(__pyx_t_4);
7787 #if CYTHON_FAST_PYCCALL
7788 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7789 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_new_element)};
7790 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
7791 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7792 __Pyx_GOTREF(__pyx_t_4);
7796 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error)
7797 __Pyx_GOTREF(__pyx_t_7);
7799 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
7801 __Pyx_INCREF(((PyObject *)__pyx_v_element));
7802 __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
7803 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, ((PyObject *)__pyx_v_element));
7804 __Pyx_INCREF(((PyObject *)__pyx_v_new_element));
7805 __Pyx_GIVEREF(((PyObject *)__pyx_v_new_element));
7806 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)__pyx_v_new_element));
7807 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
7808 __Pyx_GOTREF(__pyx_t_4);
7809 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7811 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7812 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7814 /* "lxml/objectify.pyx":459
7815 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7817 * cdef _replaceElement(_Element element, value): # <<<<<<<<<<<<<<
7818 * cdef _Element new_element
7819 * if isinstance(value, _Element):
7822 /* function exit code */
7823 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7826 __Pyx_XDECREF(__pyx_t_3);
7827 __Pyx_XDECREF(__pyx_t_4);
7828 __Pyx_XDECREF(__pyx_t_6);
7829 __Pyx_XDECREF(__pyx_t_7);
7830 __Pyx_AddTraceback("lxml.objectify._replaceElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
7833 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
7834 __Pyx_XGIVEREF(__pyx_r);
7835 __Pyx_RefNannyFinishContext();
7839 /* "lxml/objectify.pyx":474
7840 * element.getparent().replace(element, new_element)
7842 * cdef _appendValue(_Element parent, tag, value): # <<<<<<<<<<<<<<
7843 * cdef _Element new_element
7844 * if isinstance(value, _Element):
7847 static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
7848 struct LxmlElement *__pyx_v_new_element = 0;
7849 PyObject *__pyx_v_item = NULL;
7850 PyObject *__pyx_r = NULL;
7851 __Pyx_RefNannyDeclarations
7854 PyObject *__pyx_t_3 = NULL;
7855 PyObject *__pyx_t_4 = NULL;
7858 Py_ssize_t __pyx_t_7;
7859 PyObject *(*__pyx_t_8)(PyObject *);
7860 int __pyx_lineno = 0;
7861 const char *__pyx_filename = NULL;
7862 int __pyx_clineno = 0;
7863 __Pyx_RefNannySetupContext("_appendValue", 0);
7865 /* "lxml/objectify.pyx":476
7866 * cdef _appendValue(_Element parent, tag, value):
7867 * cdef _Element new_element
7868 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7869 * # deep copy the new element
7870 * new_element = cetree.deepcopyNodeToDocument(
7872 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
7873 __pyx_t_2 = (__pyx_t_1 != 0);
7876 /* "lxml/objectify.pyx":479
7877 * # deep copy the new element
7878 * new_element = cetree.deepcopyNodeToDocument(
7879 * parent._doc, (<_Element>value)._c_node) # <<<<<<<<<<<<<<
7880 * new_element.tag = tag
7881 * cetree.appendChildToElement(parent, new_element)
7883 __pyx_t_3 = ((PyObject *)__pyx_v_parent->_doc);
7884 __Pyx_INCREF(__pyx_t_3);
7886 /* "lxml/objectify.pyx":478
7887 * if isinstance(value, _Element):
7888 * # deep copy the new element
7889 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
7890 * parent._doc, (<_Element>value)._c_node)
7891 * new_element.tag = tag
7893 __pyx_t_4 = ((PyObject *)deepcopyNodeToDocument(((struct LxmlDocument *)__pyx_t_3), ((struct LxmlElement *)__pyx_v_value)->_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __pyx_L1_error)
7894 __Pyx_GOTREF(__pyx_t_4);
7895 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7896 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7899 /* "lxml/objectify.pyx":480
7900 * new_element = cetree.deepcopyNodeToDocument(
7901 * parent._doc, (<_Element>value)._c_node)
7902 * new_element.tag = tag # <<<<<<<<<<<<<<
7903 * cetree.appendChildToElement(parent, new_element)
7904 * elif isinstance(value, (list, tuple)):
7906 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
7908 /* "lxml/objectify.pyx":481
7909 * parent._doc, (<_Element>value)._c_node)
7910 * new_element.tag = tag
7911 * cetree.appendChildToElement(parent, new_element) # <<<<<<<<<<<<<<
7912 * elif isinstance(value, (list, tuple)):
7913 * for item in value:
7915 __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 481, __pyx_L1_error)
7917 /* "lxml/objectify.pyx":476
7918 * cdef _appendValue(_Element parent, tag, value):
7919 * cdef _Element new_element
7920 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7921 * # deep copy the new element
7922 * new_element = cetree.deepcopyNodeToDocument(
7927 /* "lxml/objectify.pyx":482
7928 * new_element.tag = tag
7929 * cetree.appendChildToElement(parent, new_element)
7930 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7931 * for item in value:
7932 * _appendValue(parent, tag, item)
7934 __pyx_t_1 = PyList_Check(__pyx_v_value);
7935 __pyx_t_6 = (__pyx_t_1 != 0);
7938 __pyx_t_2 = __pyx_t_6;
7939 goto __pyx_L4_bool_binop_done;
7941 __pyx_t_6 = PyTuple_Check(__pyx_v_value);
7942 __pyx_t_1 = (__pyx_t_6 != 0);
7943 __pyx_t_2 = __pyx_t_1;
7944 __pyx_L4_bool_binop_done:;
7945 __pyx_t_1 = (__pyx_t_2 != 0);
7948 /* "lxml/objectify.pyx":483
7949 * cetree.appendChildToElement(parent, new_element)
7950 * elif isinstance(value, (list, tuple)):
7951 * for item in value: # <<<<<<<<<<<<<<
7952 * _appendValue(parent, tag, item)
7955 if (likely(PyList_CheckExact(__pyx_v_value)) || PyTuple_CheckExact(__pyx_v_value)) {
7956 __pyx_t_4 = __pyx_v_value; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
7959 __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
7960 __Pyx_GOTREF(__pyx_t_4);
7961 __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error)
7964 if (likely(!__pyx_t_8)) {
7965 if (likely(PyList_CheckExact(__pyx_t_4))) {
7966 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
7967 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7968 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
7970 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
7971 __Pyx_GOTREF(__pyx_t_3);
7974 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
7975 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7976 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 483, __pyx_L1_error)
7978 __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error)
7979 __Pyx_GOTREF(__pyx_t_3);
7983 __pyx_t_3 = __pyx_t_8(__pyx_t_4);
7984 if (unlikely(!__pyx_t_3)) {
7985 PyObject* exc_type = PyErr_Occurred();
7987 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7988 else __PYX_ERR(0, 483, __pyx_L1_error)
7992 __Pyx_GOTREF(__pyx_t_3);
7994 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
7997 /* "lxml/objectify.pyx":484
7998 * elif isinstance(value, (list, tuple)):
7999 * for item in value:
8000 * _appendValue(parent, tag, item) # <<<<<<<<<<<<<<
8002 * new_element = cetree.makeElement(
8004 __pyx_t_3 = __pyx_f_4lxml_9objectify__appendValue(__pyx_v_parent, __pyx_v_tag, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
8005 __Pyx_GOTREF(__pyx_t_3);
8006 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8008 /* "lxml/objectify.pyx":483
8009 * cetree.appendChildToElement(parent, new_element)
8010 * elif isinstance(value, (list, tuple)):
8011 * for item in value: # <<<<<<<<<<<<<<
8012 * _appendValue(parent, tag, item)
8016 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8018 /* "lxml/objectify.pyx":482
8019 * new_element.tag = tag
8020 * cetree.appendChildToElement(parent, new_element)
8021 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
8022 * for item in value:
8023 * _appendValue(parent, tag, item)
8028 /* "lxml/objectify.pyx":486
8029 * _appendValue(parent, tag, item)
8031 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8032 * tag, parent._doc, None, None, None, None, None)
8033 * _setElementValue(new_element, value)
8037 /* "lxml/objectify.pyx":487
8039 * new_element = cetree.makeElement(
8040 * tag, parent._doc, None, None, None, None, None) # <<<<<<<<<<<<<<
8041 * _setElementValue(new_element, value)
8042 * cetree.appendChildToElement(parent, new_element)
8044 __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
8045 __Pyx_INCREF(__pyx_t_4);
8047 /* "lxml/objectify.pyx":486
8048 * _appendValue(parent, tag, item)
8050 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8051 * tag, parent._doc, None, None, None, None, None)
8052 * _setElementValue(new_element, value)
8054 __pyx_t_3 = ((PyObject *)makeElement(__pyx_v_tag, ((struct LxmlDocument *)__pyx_t_4), Py_None, Py_None, Py_None, Py_None, Py_None)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L1_error)
8055 __Pyx_GOTREF(__pyx_t_3);
8056 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8057 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_3);
8060 /* "lxml/objectify.pyx":488
8061 * new_element = cetree.makeElement(
8062 * tag, parent._doc, None, None, None, None, None)
8063 * _setElementValue(new_element, value) # <<<<<<<<<<<<<<
8064 * cetree.appendChildToElement(parent, new_element)
8067 __pyx_t_3 = __pyx_f_4lxml_9objectify__setElementValue(__pyx_v_new_element, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
8068 __Pyx_GOTREF(__pyx_t_3);
8069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8071 /* "lxml/objectify.pyx":489
8072 * tag, parent._doc, None, None, None, None, None)
8073 * _setElementValue(new_element, value)
8074 * cetree.appendChildToElement(parent, new_element) # <<<<<<<<<<<<<<
8076 * cdef _setElementValue(_Element element, value):
8078 __pyx_t_5 = appendChildToElement(__pyx_v_parent, __pyx_v_new_element); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 489, __pyx_L1_error)
8082 /* "lxml/objectify.pyx":474
8083 * element.getparent().replace(element, new_element)
8085 * cdef _appendValue(_Element parent, tag, value): # <<<<<<<<<<<<<<
8086 * cdef _Element new_element
8087 * if isinstance(value, _Element):
8090 /* function exit code */
8091 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8094 __Pyx_XDECREF(__pyx_t_3);
8095 __Pyx_XDECREF(__pyx_t_4);
8096 __Pyx_AddTraceback("lxml.objectify._appendValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
8099 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
8100 __Pyx_XDECREF(__pyx_v_item);
8101 __Pyx_XGIVEREF(__pyx_r);
8102 __Pyx_RefNannyFinishContext();
8106 /* "lxml/objectify.pyx":491
8107 * cetree.appendChildToElement(parent, new_element)
8109 * cdef _setElementValue(_Element element, value): # <<<<<<<<<<<<<<
8111 * cetree.setAttributeValue(
8114 static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_value) {
8115 PyObject *__pyx_v_pytype_name = NULL;
8116 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
8117 PyObject *__pyx_r = NULL;
8118 __Pyx_RefNannyDeclarations
8121 PyObject *__pyx_t_3 = NULL;
8123 PyObject *__pyx_t_5 = NULL;
8124 PyObject *__pyx_t_6 = NULL;
8125 int __pyx_lineno = 0;
8126 const char *__pyx_filename = NULL;
8127 int __pyx_clineno = 0;
8128 __Pyx_RefNannySetupContext("_setElementValue", 0);
8129 __Pyx_INCREF(__pyx_v_value);
8131 /* "lxml/objectify.pyx":492
8133 * cdef _setElementValue(_Element element, value):
8134 * if value is None: # <<<<<<<<<<<<<<
8135 * cetree.setAttributeValue(
8136 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8138 __pyx_t_1 = (__pyx_v_value == Py_None);
8139 __pyx_t_2 = (__pyx_t_1 != 0);
8142 /* "lxml/objectify.pyx":494
8144 * cetree.setAttributeValue(
8145 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true") # <<<<<<<<<<<<<<
8146 * elif isinstance(value, _Element):
8147 * _replaceElement(element, value)
8149 __pyx_t_3 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
8150 __Pyx_INCREF(__pyx_t_3);
8152 /* "lxml/objectify.pyx":493
8153 * cdef _setElementValue(_Element element, value):
8155 * cetree.setAttributeValue( # <<<<<<<<<<<<<<
8156 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8157 * elif isinstance(value, _Element):
8159 __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_3, __pyx_n_u_true); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 493, __pyx_L1_error)
8160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8162 /* "lxml/objectify.pyx":492
8164 * cdef _setElementValue(_Element element, value):
8165 * if value is None: # <<<<<<<<<<<<<<
8166 * cetree.setAttributeValue(
8167 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8172 /* "lxml/objectify.pyx":495
8173 * cetree.setAttributeValue(
8174 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8175 * elif isinstance(value, _Element): # <<<<<<<<<<<<<<
8176 * _replaceElement(element, value)
8179 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
8180 __pyx_t_1 = (__pyx_t_2 != 0);
8183 /* "lxml/objectify.pyx":496
8184 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8185 * elif isinstance(value, _Element):
8186 * _replaceElement(element, value) # <<<<<<<<<<<<<<
8190 __pyx_t_3 = __pyx_f_4lxml_9objectify__replaceElement(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
8191 __Pyx_GOTREF(__pyx_t_3);
8192 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8194 /* "lxml/objectify.pyx":497
8195 * elif isinstance(value, _Element):
8196 * _replaceElement(element, value)
8197 * return # <<<<<<<<<<<<<<
8199 * cetree.delAttributeFromNsName(
8201 __Pyx_XDECREF(__pyx_r);
8202 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8205 /* "lxml/objectify.pyx":495
8206 * cetree.setAttributeValue(
8207 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8208 * elif isinstance(value, _Element): # <<<<<<<<<<<<<<
8209 * _replaceElement(element, value)
8214 /* "lxml/objectify.pyx":499
8217 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
8218 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8219 * if python._isString(value):
8223 /* "lxml/objectify.pyx":500
8225 * cetree.delAttributeFromNsName(
8226 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") # <<<<<<<<<<<<<<
8227 * if python._isString(value):
8228 * pytype_name = u"str"
8230 (void)(delAttributeFromNsName(__pyx_v_element->_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"nil")))));
8232 /* "lxml/objectify.pyx":501
8233 * cetree.delAttributeFromNsName(
8234 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8235 * if python._isString(value): # <<<<<<<<<<<<<<
8236 * pytype_name = u"str"
8237 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8239 __pyx_t_1 = (_isString(__pyx_v_value) != 0);
8242 /* "lxml/objectify.pyx":502
8243 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8244 * if python._isString(value):
8245 * pytype_name = u"str" # <<<<<<<<<<<<<<
8246 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8249 __Pyx_INCREF(__pyx_n_u_str);
8250 __pyx_v_pytype_name = __pyx_n_u_str;
8252 /* "lxml/objectify.pyx":503
8253 * if python._isString(value):
8254 * pytype_name = u"str"
8255 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name) # <<<<<<<<<<<<<<
8257 * pytype_name = _typename(value)
8259 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
8260 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
8261 __PYX_ERR(0, 503, __pyx_L1_error)
8263 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_pytype_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
8264 __Pyx_GOTREF(__pyx_t_3);
8265 __pyx_t_5 = __pyx_t_3;
8266 __Pyx_INCREF(__pyx_t_5);
8267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8268 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_5);
8271 /* "lxml/objectify.pyx":501
8272 * cetree.delAttributeFromNsName(
8273 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8274 * if python._isString(value): # <<<<<<<<<<<<<<
8275 * pytype_name = u"str"
8276 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8281 /* "lxml/objectify.pyx":505
8282 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8284 * pytype_name = _typename(value) # <<<<<<<<<<<<<<
8285 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8286 * if py_type is not None:
8289 __pyx_t_5 = __pyx_f_4lxml_9objectify__typename(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
8290 __Pyx_GOTREF(__pyx_t_5);
8291 __pyx_v_pytype_name = __pyx_t_5;
8294 /* "lxml/objectify.pyx":506
8296 * pytype_name = _typename(value)
8297 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name) # <<<<<<<<<<<<<<
8298 * if py_type is not None:
8299 * value = py_type.stringify(value)
8301 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
8302 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
8303 __PYX_ERR(0, 506, __pyx_L1_error)
8305 __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_pytype_name, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
8306 __Pyx_GOTREF(__pyx_t_5);
8307 __pyx_t_3 = __pyx_t_5;
8308 __Pyx_INCREF(__pyx_t_3);
8309 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8310 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
8313 /* "lxml/objectify.pyx":507
8314 * pytype_name = _typename(value)
8315 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8316 * if py_type is not None: # <<<<<<<<<<<<<<
8317 * value = py_type.stringify(value)
8320 __pyx_t_1 = (((PyObject *)__pyx_v_py_type) != Py_None);
8321 __pyx_t_2 = (__pyx_t_1 != 0);
8324 /* "lxml/objectify.pyx":508
8325 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8326 * if py_type is not None:
8327 * value = py_type.stringify(value) # <<<<<<<<<<<<<<
8329 * value = unicode(value)
8331 __Pyx_INCREF(__pyx_v_py_type->stringify);
8332 __pyx_t_5 = __pyx_v_py_type->stringify; __pyx_t_6 = NULL;
8333 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8334 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8335 if (likely(__pyx_t_6)) {
8336 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8337 __Pyx_INCREF(__pyx_t_6);
8338 __Pyx_INCREF(function);
8339 __Pyx_DECREF_SET(__pyx_t_5, function);
8342 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
8343 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8344 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
8345 __Pyx_GOTREF(__pyx_t_3);
8346 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8347 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
8350 /* "lxml/objectify.pyx":507
8351 * pytype_name = _typename(value)
8352 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8353 * if py_type is not None: # <<<<<<<<<<<<<<
8354 * value = py_type.stringify(value)
8360 /* "lxml/objectify.pyx":510
8361 * value = py_type.stringify(value)
8363 * value = unicode(value) # <<<<<<<<<<<<<<
8364 * if py_type is not None:
8365 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8368 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
8369 __Pyx_GOTREF(__pyx_t_3);
8370 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
8377 /* "lxml/objectify.pyx":511
8379 * value = unicode(value)
8380 * if py_type is not None: # <<<<<<<<<<<<<<
8381 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8384 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
8385 __pyx_t_1 = (__pyx_t_2 != 0);
8388 /* "lxml/objectify.pyx":512
8389 * value = unicode(value)
8390 * if py_type is not None:
8391 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name) # <<<<<<<<<<<<<<
8393 * cetree.delAttributeFromNsName(
8395 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
8396 __Pyx_GOTREF(__pyx_t_3);
8397 __pyx_t_4 = setAttributeValue(__pyx_v_element, __pyx_t_3, __pyx_v_pytype_name); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 512, __pyx_L1_error)
8398 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8400 /* "lxml/objectify.pyx":511
8402 * value = unicode(value)
8403 * if py_type is not None: # <<<<<<<<<<<<<<
8404 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8410 /* "lxml/objectify.pyx":514
8411 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8413 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
8414 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
8415 * cetree.setNodeText(element._c_node, value)
8419 /* "lxml/objectify.pyx":515
8421 * cetree.delAttributeFromNsName(
8422 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME) # <<<<<<<<<<<<<<
8423 * cetree.setNodeText(element._c_node, value)
8426 (void)(delAttributeFromNsName(__pyx_v_element->_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME));
8432 /* "lxml/objectify.pyx":516
8433 * cetree.delAttributeFromNsName(
8434 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
8435 * cetree.setNodeText(element._c_node, value) # <<<<<<<<<<<<<<
8437 * cdef _setSlice(sliceobject, _Element target, items):
8439 __pyx_t_4 = setNodeText(__pyx_v_element->_c_node, __pyx_v_value); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 516, __pyx_L1_error)
8441 /* "lxml/objectify.pyx":491
8442 * cetree.appendChildToElement(parent, new_element)
8444 * cdef _setElementValue(_Element element, value): # <<<<<<<<<<<<<<
8446 * cetree.setAttributeValue(
8449 /* function exit code */
8450 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8453 __Pyx_XDECREF(__pyx_t_3);
8454 __Pyx_XDECREF(__pyx_t_5);
8455 __Pyx_XDECREF(__pyx_t_6);
8456 __Pyx_AddTraceback("lxml.objectify._setElementValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
8459 __Pyx_XDECREF(__pyx_v_pytype_name);
8460 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
8461 __Pyx_XDECREF(__pyx_v_value);
8462 __Pyx_XGIVEREF(__pyx_r);
8463 __Pyx_RefNannyFinishContext();
8467 /* "lxml/objectify.pyx":518
8468 * cetree.setNodeText(element._c_node, value)
8470 * cdef _setSlice(sliceobject, _Element target, items): # <<<<<<<<<<<<<<
8471 * cdef _Element parent
8472 * cdef tree.xmlNode* c_node
8475 static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobject, struct LxmlElement *__pyx_v_target, PyObject *__pyx_v_items) {
8476 struct LxmlElement *__pyx_v_parent = 0;
8477 xmlNode *__pyx_v_c_node;
8478 Py_ssize_t __pyx_v_c_step;
8479 Py_ssize_t __pyx_v_pos;
8480 PyObject *__pyx_v_del_items = 0;
8481 PyObject *__pyx_v_new_items = NULL;
8482 PyObject *__pyx_v_tag = NULL;
8483 PyObject *__pyx_v_item = NULL;
8484 struct LxmlElement *__pyx_v_new_element = NULL;
8485 PyObject *__pyx_v_replace = NULL;
8486 PyObject *__pyx_v_remove = NULL;
8487 PyObject *__pyx_v_add = NULL;
8488 PyObject *__pyx_r = NULL;
8489 __Pyx_RefNannyDeclarations
8492 Py_ssize_t __pyx_t_3;
8493 PyObject *__pyx_t_4 = NULL;
8494 PyObject *(*__pyx_t_5)(PyObject *);
8495 PyObject *__pyx_t_6 = NULL;
8496 PyObject *__pyx_t_7 = NULL;
8498 Py_ssize_t __pyx_t_9;
8500 PyObject *__pyx_t_11 = NULL;
8501 PyObject *__pyx_t_12 = NULL;
8503 PyObject *__pyx_t_14 = NULL;
8504 xmlNode *__pyx_t_15;
8505 int __pyx_lineno = 0;
8506 const char *__pyx_filename = NULL;
8507 int __pyx_clineno = 0;
8508 __Pyx_RefNannySetupContext("_setSlice", 0);
8510 /* "lxml/objectify.pyx":523
8511 * cdef Py_ssize_t c_step, c_start, pos
8512 * # collect existing slice
8513 * if (<slice>sliceobject).step is None: # <<<<<<<<<<<<<<
8517 __pyx_t_1 = (((PySliceObject*)((PyObject*)__pyx_v_sliceobject))->step == Py_None);
8518 __pyx_t_2 = (__pyx_t_1 != 0);
8521 /* "lxml/objectify.pyx":524
8522 * # collect existing slice
8523 * if (<slice>sliceobject).step is None:
8524 * c_step = 1 # <<<<<<<<<<<<<<
8526 * c_step = (<slice>sliceobject).step
8530 /* "lxml/objectify.pyx":523
8531 * cdef Py_ssize_t c_step, c_start, pos
8532 * # collect existing slice
8533 * if (<slice>sliceobject).step is None: # <<<<<<<<<<<<<<
8540 /* "lxml/objectify.pyx":526
8543 * c_step = (<slice>sliceobject).step # <<<<<<<<<<<<<<
8545 * raise ValueError, u"Invalid slice"
8548 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(((PySliceObject*)((PyObject*)__pyx_v_sliceobject))->step); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error)
8549 __pyx_v_c_step = __pyx_t_3;
8553 /* "lxml/objectify.pyx":527
8555 * c_step = (<slice>sliceobject).step
8556 * if c_step == 0: # <<<<<<<<<<<<<<
8557 * raise ValueError, u"Invalid slice"
8558 * cdef list del_items = target[sliceobject]
8560 __pyx_t_2 = ((__pyx_v_c_step == 0) != 0);
8561 if (unlikely(__pyx_t_2)) {
8563 /* "lxml/objectify.pyx":528
8564 * c_step = (<slice>sliceobject).step
8566 * raise ValueError, u"Invalid slice" # <<<<<<<<<<<<<<
8567 * cdef list del_items = target[sliceobject]
8570 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Invalid_slice, 0, 0);
8571 __PYX_ERR(0, 528, __pyx_L1_error)
8573 /* "lxml/objectify.pyx":527
8575 * c_step = (<slice>sliceobject).step
8576 * if c_step == 0: # <<<<<<<<<<<<<<
8577 * raise ValueError, u"Invalid slice"
8578 * cdef list del_items = target[sliceobject]
8582 /* "lxml/objectify.pyx":529
8584 * raise ValueError, u"Invalid slice"
8585 * cdef list del_items = target[sliceobject] # <<<<<<<<<<<<<<
8587 * # collect new values
8589 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_target), __pyx_v_sliceobject); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
8590 __Pyx_GOTREF(__pyx_t_4);
8591 if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 529, __pyx_L1_error)
8592 __pyx_v_del_items = ((PyObject*)__pyx_t_4);
8595 /* "lxml/objectify.pyx":532
8597 * # collect new values
8598 * new_items = [] # <<<<<<<<<<<<<<
8600 * for item in items:
8602 __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
8603 __Pyx_GOTREF(__pyx_t_4);
8604 __pyx_v_new_items = ((PyObject*)__pyx_t_4);
8607 /* "lxml/objectify.pyx":533
8608 * # collect new values
8610 * tag = target.tag # <<<<<<<<<<<<<<
8611 * for item in items:
8612 * if isinstance(item, _Element):
8614 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target), __pyx_n_s_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
8615 __Pyx_GOTREF(__pyx_t_4);
8616 __pyx_v_tag = __pyx_t_4;
8619 /* "lxml/objectify.pyx":534
8622 * for item in items: # <<<<<<<<<<<<<<
8623 * if isinstance(item, _Element):
8624 * # deep copy the new element
8626 if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) {
8627 __pyx_t_4 = __pyx_v_items; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0;
8630 __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
8631 __Pyx_GOTREF(__pyx_t_4);
8632 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
8635 if (likely(!__pyx_t_5)) {
8636 if (likely(PyList_CheckExact(__pyx_t_4))) {
8637 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
8638 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8639 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L1_error)
8641 __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
8642 __Pyx_GOTREF(__pyx_t_6);
8645 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
8646 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8647 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 534, __pyx_L1_error)
8649 __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 534, __pyx_L1_error)
8650 __Pyx_GOTREF(__pyx_t_6);
8654 __pyx_t_6 = __pyx_t_5(__pyx_t_4);
8655 if (unlikely(!__pyx_t_6)) {
8656 PyObject* exc_type = PyErr_Occurred();
8658 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8659 else __PYX_ERR(0, 534, __pyx_L1_error)
8663 __Pyx_GOTREF(__pyx_t_6);
8665 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
8668 /* "lxml/objectify.pyx":535
8670 * for item in items:
8671 * if isinstance(item, _Element): # <<<<<<<<<<<<<<
8672 * # deep copy the new element
8673 * new_element = cetree.deepcopyNodeToDocument(
8675 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
8676 __pyx_t_1 = (__pyx_t_2 != 0);
8679 /* "lxml/objectify.pyx":538
8680 * # deep copy the new element
8681 * new_element = cetree.deepcopyNodeToDocument(
8682 * target._doc, (<_Element>item)._c_node) # <<<<<<<<<<<<<<
8683 * new_element.tag = tag
8686 __pyx_t_6 = ((PyObject *)__pyx_v_target->_doc);
8687 __Pyx_INCREF(__pyx_t_6);
8689 /* "lxml/objectify.pyx":537
8690 * if isinstance(item, _Element):
8691 * # deep copy the new element
8692 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
8693 * target._doc, (<_Element>item)._c_node)
8694 * new_element.tag = tag
8696 __pyx_t_7 = ((PyObject *)deepcopyNodeToDocument(((struct LxmlDocument *)__pyx_t_6), ((struct LxmlElement *)__pyx_v_item)->_c_node)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
8697 __Pyx_GOTREF(__pyx_t_7);
8698 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8699 __Pyx_XDECREF_SET(__pyx_v_new_element, ((struct LxmlElement *)__pyx_t_7));
8702 /* "lxml/objectify.pyx":539
8703 * new_element = cetree.deepcopyNodeToDocument(
8704 * target._doc, (<_Element>item)._c_node)
8705 * new_element.tag = tag # <<<<<<<<<<<<<<
8707 * new_element = cetree.makeElement(
8709 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
8711 /* "lxml/objectify.pyx":535
8713 * for item in items:
8714 * if isinstance(item, _Element): # <<<<<<<<<<<<<<
8715 * # deep copy the new element
8716 * new_element = cetree.deepcopyNodeToDocument(
8721 /* "lxml/objectify.pyx":541
8722 * new_element.tag = tag
8724 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8725 * tag, target._doc, None, None, None, None, None)
8726 * _setElementValue(new_element, item)
8730 /* "lxml/objectify.pyx":542
8732 * new_element = cetree.makeElement(
8733 * tag, target._doc, None, None, None, None, None) # <<<<<<<<<<<<<<
8734 * _setElementValue(new_element, item)
8735 * new_items.append(new_element)
8737 __pyx_t_7 = ((PyObject *)__pyx_v_target->_doc);
8738 __Pyx_INCREF(__pyx_t_7);
8740 /* "lxml/objectify.pyx":541
8741 * new_element.tag = tag
8743 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8744 * tag, target._doc, None, None, None, None, None)
8745 * _setElementValue(new_element, item)
8747 __pyx_t_6 = ((PyObject *)makeElement(__pyx_v_tag, ((struct LxmlDocument *)__pyx_t_7), Py_None, Py_None, Py_None, Py_None, Py_None)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
8748 __Pyx_GOTREF(__pyx_t_6);
8749 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8750 __Pyx_XDECREF_SET(__pyx_v_new_element, ((struct LxmlElement *)__pyx_t_6));
8753 /* "lxml/objectify.pyx":543
8754 * new_element = cetree.makeElement(
8755 * tag, target._doc, None, None, None, None, None)
8756 * _setElementValue(new_element, item) # <<<<<<<<<<<<<<
8757 * new_items.append(new_element)
8760 __pyx_t_6 = __pyx_f_4lxml_9objectify__setElementValue(__pyx_v_new_element, __pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 543, __pyx_L1_error)
8761 __Pyx_GOTREF(__pyx_t_6);
8762 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8766 /* "lxml/objectify.pyx":544
8767 * tag, target._doc, None, None, None, None, None)
8768 * _setElementValue(new_element, item)
8769 * new_items.append(new_element) # <<<<<<<<<<<<<<
8771 * # sanity check - raise what a list would raise
8773 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_items, ((PyObject *)__pyx_v_new_element)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 544, __pyx_L1_error)
8775 /* "lxml/objectify.pyx":534
8778 * for item in items: # <<<<<<<<<<<<<<
8779 * if isinstance(item, _Element):
8780 * # deep copy the new element
8783 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8785 /* "lxml/objectify.pyx":547
8787 * # sanity check - raise what a list would raise
8788 * if c_step != 1 and len(del_items) != len(new_items): # <<<<<<<<<<<<<<
8789 * raise ValueError, \
8790 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}"
8792 __pyx_t_2 = ((__pyx_v_c_step != 1) != 0);
8795 __pyx_t_1 = __pyx_t_2;
8796 goto __pyx_L9_bool_binop_done;
8798 if (unlikely(__pyx_v_del_items == Py_None)) {
8799 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8800 __PYX_ERR(0, 547, __pyx_L1_error)
8802 __pyx_t_3 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 547, __pyx_L1_error)
8803 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 547, __pyx_L1_error)
8804 __pyx_t_2 = ((__pyx_t_3 != __pyx_t_9) != 0);
8805 __pyx_t_1 = __pyx_t_2;
8806 __pyx_L9_bool_binop_done:;
8807 if (unlikely(__pyx_t_1)) {
8809 /* "lxml/objectify.pyx":549
8810 * if c_step != 1 and len(del_items) != len(new_items):
8811 * raise ValueError, \
8812 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}" # <<<<<<<<<<<<<<
8814 * # replace existing items
8816 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
8817 __Pyx_GOTREF(__pyx_t_4);
8820 __Pyx_INCREF(__pyx_kp_u_attempt_to_assign_sequence_of_si);
8822 __Pyx_GIVEREF(__pyx_kp_u_attempt_to_assign_sequence_of_si);
8823 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_attempt_to_assign_sequence_of_si);
8824 __pyx_t_3 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 549, __pyx_L1_error)
8825 __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_3, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error)
8826 __Pyx_GOTREF(__pyx_t_6);
8827 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
8828 __Pyx_GIVEREF(__pyx_t_6);
8829 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
8831 __Pyx_INCREF(__pyx_kp_u_to_extended_slice_of_size);
8833 __Pyx_GIVEREF(__pyx_kp_u_to_extended_slice_of_size);
8834 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_to_extended_slice_of_size);
8835 if (unlikely(__pyx_v_del_items == Py_None)) {
8836 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8837 __PYX_ERR(0, 549, __pyx_L1_error)
8839 __pyx_t_3 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 549, __pyx_L1_error)
8840 __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_3, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error)
8841 __Pyx_GOTREF(__pyx_t_6);
8842 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
8843 __Pyx_GIVEREF(__pyx_t_6);
8844 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_6);
8846 __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error)
8847 __Pyx_GOTREF(__pyx_t_6);
8848 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8849 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
8850 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8851 __PYX_ERR(0, 548, __pyx_L1_error)
8853 /* "lxml/objectify.pyx":547
8855 * # sanity check - raise what a list would raise
8856 * if c_step != 1 and len(del_items) != len(new_items): # <<<<<<<<<<<<<<
8857 * raise ValueError, \
8858 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}"
8862 /* "lxml/objectify.pyx":552
8864 * # replace existing items
8865 * pos = 0 # <<<<<<<<<<<<<<
8866 * parent = target.getparent()
8867 * replace = parent.replace
8871 /* "lxml/objectify.pyx":553
8872 * # replace existing items
8874 * parent = target.getparent() # <<<<<<<<<<<<<<
8875 * replace = parent.replace
8876 * while pos < len(new_items) and pos < len(del_items):
8878 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_target), __pyx_n_s_getparent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
8879 __Pyx_GOTREF(__pyx_t_4);
8881 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8882 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
8883 if (likely(__pyx_t_7)) {
8884 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8885 __Pyx_INCREF(__pyx_t_7);
8886 __Pyx_INCREF(function);
8887 __Pyx_DECREF_SET(__pyx_t_4, function);
8890 __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8891 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8892 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
8893 __Pyx_GOTREF(__pyx_t_6);
8894 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8895 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 553, __pyx_L1_error)
8896 __pyx_v_parent = ((struct LxmlElement *)__pyx_t_6);
8899 /* "lxml/objectify.pyx":554
8901 * parent = target.getparent()
8902 * replace = parent.replace # <<<<<<<<<<<<<<
8903 * while pos < len(new_items) and pos < len(del_items):
8904 * replace(del_items[pos], new_items[pos])
8906 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error)
8907 __Pyx_GOTREF(__pyx_t_6);
8908 __pyx_v_replace = __pyx_t_6;
8911 /* "lxml/objectify.pyx":555
8912 * parent = target.getparent()
8913 * replace = parent.replace
8914 * while pos < len(new_items) and pos < len(del_items): # <<<<<<<<<<<<<<
8915 * replace(del_items[pos], new_items[pos])
8919 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 555, __pyx_L1_error)
8920 __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
8923 __pyx_t_1 = __pyx_t_2;
8924 goto __pyx_L13_bool_binop_done;
8926 if (unlikely(__pyx_v_del_items == Py_None)) {
8927 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8928 __PYX_ERR(0, 555, __pyx_L1_error)
8930 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 555, __pyx_L1_error)
8931 __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
8932 __pyx_t_1 = __pyx_t_2;
8933 __pyx_L13_bool_binop_done:;
8934 if (!__pyx_t_1) break;
8936 /* "lxml/objectify.pyx":556
8937 * replace = parent.replace
8938 * while pos < len(new_items) and pos < len(del_items):
8939 * replace(del_items[pos], new_items[pos]) # <<<<<<<<<<<<<<
8941 * # remove leftover items
8943 if (unlikely(__pyx_v_del_items == Py_None)) {
8944 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8945 __PYX_ERR(0, 556, __pyx_L1_error)
8947 __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_del_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
8948 __Pyx_GOTREF(__pyx_t_4);
8949 __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_new_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
8950 __Pyx_GOTREF(__pyx_t_7);
8951 __Pyx_INCREF(__pyx_v_replace);
8952 __pyx_t_11 = __pyx_v_replace; __pyx_t_12 = NULL;
8954 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
8955 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
8956 if (likely(__pyx_t_12)) {
8957 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
8958 __Pyx_INCREF(__pyx_t_12);
8959 __Pyx_INCREF(function);
8960 __Pyx_DECREF_SET(__pyx_t_11, function);
8964 #if CYTHON_FAST_PYCALL
8965 if (PyFunction_Check(__pyx_t_11)) {
8966 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
8967 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
8968 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8969 __Pyx_GOTREF(__pyx_t_6);
8970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8971 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8974 #if CYTHON_FAST_PYCCALL
8975 if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
8976 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
8977 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
8978 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8979 __Pyx_GOTREF(__pyx_t_6);
8980 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8981 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8985 __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 556, __pyx_L1_error)
8986 __Pyx_GOTREF(__pyx_t_14);
8988 __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
8990 __Pyx_GIVEREF(__pyx_t_4);
8991 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_4);
8992 __Pyx_GIVEREF(__pyx_t_7);
8993 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_7);
8996 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
8997 __Pyx_GOTREF(__pyx_t_6);
8998 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9000 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9001 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9003 /* "lxml/objectify.pyx":557
9004 * while pos < len(new_items) and pos < len(del_items):
9005 * replace(del_items[pos], new_items[pos])
9006 * pos += 1 # <<<<<<<<<<<<<<
9007 * # remove leftover items
9008 * if pos < len(del_items):
9010 __pyx_v_pos = (__pyx_v_pos + 1);
9013 /* "lxml/objectify.pyx":559
9015 * # remove leftover items
9016 * if pos < len(del_items): # <<<<<<<<<<<<<<
9017 * remove = parent.remove
9018 * while pos < len(del_items):
9020 if (unlikely(__pyx_v_del_items == Py_None)) {
9021 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9022 __PYX_ERR(0, 559, __pyx_L1_error)
9024 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 559, __pyx_L1_error)
9025 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9028 /* "lxml/objectify.pyx":560
9029 * # remove leftover items
9030 * if pos < len(del_items):
9031 * remove = parent.remove # <<<<<<<<<<<<<<
9032 * while pos < len(del_items):
9033 * remove(del_items[pos])
9035 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parent), __pyx_n_s_remove); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 560, __pyx_L1_error)
9036 __Pyx_GOTREF(__pyx_t_6);
9037 __pyx_v_remove = __pyx_t_6;
9040 /* "lxml/objectify.pyx":561
9041 * if pos < len(del_items):
9042 * remove = parent.remove
9043 * while pos < len(del_items): # <<<<<<<<<<<<<<
9044 * remove(del_items[pos])
9048 if (unlikely(__pyx_v_del_items == Py_None)) {
9049 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9050 __PYX_ERR(0, 561, __pyx_L1_error)
9052 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_del_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 561, __pyx_L1_error)
9053 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9054 if (!__pyx_t_1) break;
9056 /* "lxml/objectify.pyx":562
9057 * remove = parent.remove
9058 * while pos < len(del_items):
9059 * remove(del_items[pos]) # <<<<<<<<<<<<<<
9061 * # append remaining new items
9063 if (unlikely(__pyx_v_del_items == Py_None)) {
9064 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
9065 __PYX_ERR(0, 562, __pyx_L1_error)
9067 __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_del_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 562, __pyx_L1_error)
9068 __Pyx_GOTREF(__pyx_t_11);
9069 __Pyx_INCREF(__pyx_v_remove);
9070 __pyx_t_14 = __pyx_v_remove; __pyx_t_7 = NULL;
9071 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
9072 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
9073 if (likely(__pyx_t_7)) {
9074 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
9075 __Pyx_INCREF(__pyx_t_7);
9076 __Pyx_INCREF(function);
9077 __Pyx_DECREF_SET(__pyx_t_14, function);
9080 __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_7, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_11);
9081 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9082 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9083 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error)
9084 __Pyx_GOTREF(__pyx_t_6);
9085 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9086 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9088 /* "lxml/objectify.pyx":563
9089 * while pos < len(del_items):
9090 * remove(del_items[pos])
9091 * pos += 1 # <<<<<<<<<<<<<<
9092 * # append remaining new items
9093 * if pos < len(new_items):
9095 __pyx_v_pos = (__pyx_v_pos + 1);
9098 /* "lxml/objectify.pyx":559
9100 * # remove leftover items
9101 * if pos < len(del_items): # <<<<<<<<<<<<<<
9102 * remove = parent.remove
9103 * while pos < len(del_items):
9107 /* "lxml/objectify.pyx":565
9109 * # append remaining new items
9110 * if pos < len(new_items): # <<<<<<<<<<<<<<
9111 * # the sanity check above guarantees (step == 1)
9114 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 565, __pyx_L1_error)
9115 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9118 /* "lxml/objectify.pyx":567
9119 * if pos < len(new_items):
9120 * # the sanity check above guarantees (step == 1)
9121 * if pos > 0: # <<<<<<<<<<<<<<
9122 * item = new_items[pos-1]
9125 __pyx_t_1 = ((__pyx_v_pos > 0) != 0);
9128 /* "lxml/objectify.pyx":568
9129 * # the sanity check above guarantees (step == 1)
9131 * item = new_items[pos-1] # <<<<<<<<<<<<<<
9133 * if (<slice>sliceobject).start > 0:
9135 __pyx_t_9 = (__pyx_v_pos - 1);
9136 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_new_items, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
9137 __Pyx_GOTREF(__pyx_t_6);
9138 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
9141 /* "lxml/objectify.pyx":567
9142 * if pos < len(new_items):
9143 * # the sanity check above guarantees (step == 1)
9144 * if pos > 0: # <<<<<<<<<<<<<<
9145 * item = new_items[pos-1]
9151 /* "lxml/objectify.pyx":570
9152 * item = new_items[pos-1]
9154 * if (<slice>sliceobject).start > 0: # <<<<<<<<<<<<<<
9155 * c_node = parent._c_node.children
9159 __pyx_t_6 = PyObject_RichCompare(((PySliceObject*)((PyObject*)__pyx_v_sliceobject))->start, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
9160 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
9161 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9164 /* "lxml/objectify.pyx":571
9166 * if (<slice>sliceobject).start > 0:
9167 * c_node = parent._c_node.children # <<<<<<<<<<<<<<
9169 * c_node = parent._c_node.last
9171 __pyx_t_15 = __pyx_v_parent->_c_node->children;
9172 __pyx_v_c_node = __pyx_t_15;
9174 /* "lxml/objectify.pyx":570
9175 * item = new_items[pos-1]
9177 * if (<slice>sliceobject).start > 0: # <<<<<<<<<<<<<<
9178 * c_node = parent._c_node.children
9184 /* "lxml/objectify.pyx":573
9185 * c_node = parent._c_node.children
9187 * c_node = parent._c_node.last # <<<<<<<<<<<<<<
9188 * c_node = _findFollowingSibling(
9189 * c_node, tree._getNs(target._c_node), target._c_node.name,
9192 __pyx_t_15 = __pyx_v_parent->_c_node->last;
9193 __pyx_v_c_node = __pyx_t_15;
9197 /* "lxml/objectify.pyx":576
9198 * c_node = _findFollowingSibling(
9199 * c_node, tree._getNs(target._c_node), target._c_node.name,
9200 * (<slice>sliceobject).start - 1) # <<<<<<<<<<<<<<
9201 * if c_node is NULL:
9202 * while pos < len(new_items):
9204 __pyx_t_6 = __Pyx_PyInt_SubtractObjC(((PySliceObject*)((PyObject*)__pyx_v_sliceobject))->start, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 576, __pyx_L1_error)
9205 __Pyx_GOTREF(__pyx_t_6);
9206 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 576, __pyx_L1_error)
9207 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9209 /* "lxml/objectify.pyx":574
9211 * c_node = parent._c_node.last
9212 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
9213 * c_node, tree._getNs(target._c_node), target._c_node.name,
9214 * (<slice>sliceobject).start - 1)
9216 __pyx_v_c_node = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node, _getNs(__pyx_v_target->_c_node), __pyx_v_target->_c_node->name, __pyx_t_9);
9218 /* "lxml/objectify.pyx":577
9219 * c_node, tree._getNs(target._c_node), target._c_node.name,
9220 * (<slice>sliceobject).start - 1)
9221 * if c_node is NULL: # <<<<<<<<<<<<<<
9222 * while pos < len(new_items):
9223 * cetree.appendChildToElement(parent, new_items[pos])
9225 __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
9228 /* "lxml/objectify.pyx":578
9229 * (<slice>sliceobject).start - 1)
9230 * if c_node is NULL:
9231 * while pos < len(new_items): # <<<<<<<<<<<<<<
9232 * cetree.appendChildToElement(parent, new_items[pos])
9236 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 578, __pyx_L1_error)
9237 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9238 if (!__pyx_t_1) break;
9240 /* "lxml/objectify.pyx":579
9241 * if c_node is NULL:
9242 * while pos < len(new_items):
9243 * cetree.appendChildToElement(parent, new_items[pos]) # <<<<<<<<<<<<<<
9247 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_new_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error)
9248 __Pyx_GOTREF(__pyx_t_6);
9249 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 579, __pyx_L1_error)
9250 __pyx_t_13 = appendChildToElement(__pyx_v_parent, ((struct LxmlElement *)__pyx_t_6)); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 579, __pyx_L1_error)
9251 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9253 /* "lxml/objectify.pyx":580
9254 * while pos < len(new_items):
9255 * cetree.appendChildToElement(parent, new_items[pos])
9256 * pos += 1 # <<<<<<<<<<<<<<
9258 * item = cetree.elementFactory(parent._doc, c_node)
9260 __pyx_v_pos = (__pyx_v_pos + 1);
9263 /* "lxml/objectify.pyx":581
9264 * cetree.appendChildToElement(parent, new_items[pos])
9266 * return # <<<<<<<<<<<<<<
9267 * item = cetree.elementFactory(parent._doc, c_node)
9268 * while pos < len(new_items):
9270 __Pyx_XDECREF(__pyx_r);
9271 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9274 /* "lxml/objectify.pyx":577
9275 * c_node, tree._getNs(target._c_node), target._c_node.name,
9276 * (<slice>sliceobject).start - 1)
9277 * if c_node is NULL: # <<<<<<<<<<<<<<
9278 * while pos < len(new_items):
9279 * cetree.appendChildToElement(parent, new_items[pos])
9283 /* "lxml/objectify.pyx":582
9286 * item = cetree.elementFactory(parent._doc, c_node) # <<<<<<<<<<<<<<
9287 * while pos < len(new_items):
9288 * add = item.addnext
9290 __pyx_t_6 = ((PyObject *)__pyx_v_parent->_doc);
9291 __Pyx_INCREF(__pyx_t_6);
9292 __pyx_t_14 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_6), __pyx_v_c_node)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 582, __pyx_L1_error)
9293 __Pyx_GOTREF(__pyx_t_14);
9294 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9295 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_14);
9300 /* "lxml/objectify.pyx":583
9302 * item = cetree.elementFactory(parent._doc, c_node)
9303 * while pos < len(new_items): # <<<<<<<<<<<<<<
9304 * add = item.addnext
9305 * item = new_items[pos]
9308 __pyx_t_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 583, __pyx_L1_error)
9309 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9310 if (!__pyx_t_1) break;
9312 /* "lxml/objectify.pyx":584
9313 * item = cetree.elementFactory(parent._doc, c_node)
9314 * while pos < len(new_items):
9315 * add = item.addnext # <<<<<<<<<<<<<<
9316 * item = new_items[pos]
9319 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_addnext); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 584, __pyx_L1_error)
9320 __Pyx_GOTREF(__pyx_t_14);
9321 __Pyx_XDECREF_SET(__pyx_v_add, __pyx_t_14);
9324 /* "lxml/objectify.pyx":585
9325 * while pos < len(new_items):
9326 * add = item.addnext
9327 * item = new_items[pos] # <<<<<<<<<<<<<<
9331 __pyx_t_14 = __Pyx_GetItemInt_List(__pyx_v_new_items, __pyx_v_pos, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 585, __pyx_L1_error)
9332 __Pyx_GOTREF(__pyx_t_14);
9333 __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_14);
9336 /* "lxml/objectify.pyx":586
9337 * add = item.addnext
9338 * item = new_items[pos]
9339 * add(item) # <<<<<<<<<<<<<<
9343 __Pyx_INCREF(__pyx_v_add);
9344 __pyx_t_6 = __pyx_v_add; __pyx_t_11 = NULL;
9345 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
9346 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
9347 if (likely(__pyx_t_11)) {
9348 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9349 __Pyx_INCREF(__pyx_t_11);
9350 __Pyx_INCREF(function);
9351 __Pyx_DECREF_SET(__pyx_t_6, function);
9354 __pyx_t_14 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_item);
9355 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
9356 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 586, __pyx_L1_error)
9357 __Pyx_GOTREF(__pyx_t_14);
9358 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9359 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9361 /* "lxml/objectify.pyx":587
9362 * item = new_items[pos]
9364 * pos += 1 # <<<<<<<<<<<<<<
9366 * ################################################################################
9368 __pyx_v_pos = (__pyx_v_pos + 1);
9371 /* "lxml/objectify.pyx":565
9373 * # append remaining new items
9374 * if pos < len(new_items): # <<<<<<<<<<<<<<
9375 * # the sanity check above guarantees (step == 1)
9380 /* "lxml/objectify.pyx":518
9381 * cetree.setNodeText(element._c_node, value)
9383 * cdef _setSlice(sliceobject, _Element target, items): # <<<<<<<<<<<<<<
9384 * cdef _Element parent
9385 * cdef tree.xmlNode* c_node
9388 /* function exit code */
9389 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9392 __Pyx_XDECREF(__pyx_t_4);
9393 __Pyx_XDECREF(__pyx_t_6);
9394 __Pyx_XDECREF(__pyx_t_7);
9395 __Pyx_XDECREF(__pyx_t_11);
9396 __Pyx_XDECREF(__pyx_t_12);
9397 __Pyx_XDECREF(__pyx_t_14);
9398 __Pyx_AddTraceback("lxml.objectify._setSlice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9401 __Pyx_XDECREF((PyObject *)__pyx_v_parent);
9402 __Pyx_XDECREF(__pyx_v_del_items);
9403 __Pyx_XDECREF(__pyx_v_new_items);
9404 __Pyx_XDECREF(__pyx_v_tag);
9405 __Pyx_XDECREF(__pyx_v_item);
9406 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
9407 __Pyx_XDECREF(__pyx_v_replace);
9408 __Pyx_XDECREF(__pyx_v_remove);
9409 __Pyx_XDECREF(__pyx_v_add);
9410 __Pyx_XGIVEREF(__pyx_r);
9411 __Pyx_RefNannyFinishContext();
9415 /* "lxml/objectify.pyx":597
9418 * def pyval(self): # <<<<<<<<<<<<<<
9419 * return textOf(self._c_node)
9423 /* Python wrapper */
9424 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
9425 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(PyObject *__pyx_v_self) {
9426 PyObject *__pyx_r = 0;
9427 __Pyx_RefNannyDeclarations
9428 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9429 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9431 /* function exit code */
9432 __Pyx_RefNannyFinishContext();
9436 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9437 PyObject *__pyx_r = NULL;
9438 __Pyx_RefNannyDeclarations
9439 PyObject *__pyx_t_1 = NULL;
9440 int __pyx_lineno = 0;
9441 const char *__pyx_filename = NULL;
9442 int __pyx_clineno = 0;
9443 __Pyx_RefNannySetupContext("__get__", 0);
9445 /* "lxml/objectify.pyx":598
9448 * return textOf(self._c_node) # <<<<<<<<<<<<<<
9450 * def __str__(self):
9452 __Pyx_XDECREF(__pyx_r);
9453 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
9454 __Pyx_GOTREF(__pyx_t_1);
9455 __pyx_r = __pyx_t_1;
9459 /* "lxml/objectify.pyx":597
9462 * def pyval(self): # <<<<<<<<<<<<<<
9463 * return textOf(self._c_node)
9467 /* function exit code */
9469 __Pyx_XDECREF(__pyx_t_1);
9470 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9473 __Pyx_XGIVEREF(__pyx_r);
9474 __Pyx_RefNannyFinishContext();
9478 /* "lxml/objectify.pyx":600
9479 * return textOf(self._c_node)
9481 * def __str__(self): # <<<<<<<<<<<<<<
9482 * return textOf(self._c_node) or ''
9486 /* Python wrapper */
9487 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__(PyObject *__pyx_v_self); /*proto*/
9488 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__(PyObject *__pyx_v_self) {
9489 PyObject *__pyx_r = 0;
9490 __Pyx_RefNannyDeclarations
9491 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
9492 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9494 /* function exit code */
9495 __Pyx_RefNannyFinishContext();
9499 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9500 PyObject *__pyx_r = NULL;
9501 __Pyx_RefNannyDeclarations
9502 PyObject *__pyx_t_1 = NULL;
9503 PyObject *__pyx_t_2 = NULL;
9505 int __pyx_lineno = 0;
9506 const char *__pyx_filename = NULL;
9507 int __pyx_clineno = 0;
9508 __Pyx_RefNannySetupContext("__str__", 0);
9510 /* "lxml/objectify.pyx":601
9512 * def __str__(self):
9513 * return textOf(self._c_node) or '' # <<<<<<<<<<<<<<
9515 * def __repr__(self):
9517 __Pyx_XDECREF(__pyx_r);
9518 __pyx_t_2 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
9519 __Pyx_GOTREF(__pyx_t_2);
9520 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
9522 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9524 __Pyx_INCREF(__pyx_t_2);
9525 __pyx_t_1 = __pyx_t_2;
9526 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9527 goto __pyx_L3_bool_binop_done;
9529 __Pyx_INCREF(__pyx_kp_s_);
9530 __pyx_t_1 = __pyx_kp_s_;
9531 __pyx_L3_bool_binop_done:;
9532 __pyx_r = __pyx_t_1;
9536 /* "lxml/objectify.pyx":600
9537 * return textOf(self._c_node)
9539 * def __str__(self): # <<<<<<<<<<<<<<
9540 * return textOf(self._c_node) or ''
9544 /* function exit code */
9546 __Pyx_XDECREF(__pyx_t_1);
9547 __Pyx_XDECREF(__pyx_t_2);
9548 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9551 __Pyx_XGIVEREF(__pyx_r);
9552 __Pyx_RefNannyFinishContext();
9556 /* "lxml/objectify.pyx":603
9557 * return textOf(self._c_node) or ''
9559 * def __repr__(self): # <<<<<<<<<<<<<<
9560 * return strrepr(textOf(self._c_node) or '')
9564 /* Python wrapper */
9565 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__(PyObject *__pyx_v_self); /*proto*/
9566 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__(PyObject *__pyx_v_self) {
9567 PyObject *__pyx_r = 0;
9568 __Pyx_RefNannyDeclarations
9569 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9570 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9572 /* function exit code */
9573 __Pyx_RefNannyFinishContext();
9577 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9578 PyObject *__pyx_r = NULL;
9579 __Pyx_RefNannyDeclarations
9580 PyObject *__pyx_t_1 = NULL;
9581 PyObject *__pyx_t_2 = NULL;
9583 int __pyx_lineno = 0;
9584 const char *__pyx_filename = NULL;
9585 int __pyx_clineno = 0;
9586 __Pyx_RefNannySetupContext("__repr__", 0);
9588 /* "lxml/objectify.pyx":604
9590 * def __repr__(self):
9591 * return strrepr(textOf(self._c_node) or '') # <<<<<<<<<<<<<<
9593 * def _setText(self, s):
9595 __Pyx_XDECREF(__pyx_r);
9596 __pyx_t_2 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
9597 __Pyx_GOTREF(__pyx_t_2);
9598 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
9600 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9602 __Pyx_INCREF(__pyx_t_2);
9603 __pyx_t_1 = __pyx_t_2;
9604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9605 goto __pyx_L3_bool_binop_done;
9607 __Pyx_INCREF(__pyx_kp_s_);
9608 __pyx_t_1 = __pyx_kp_s_;
9609 __pyx_L3_bool_binop_done:;
9610 __pyx_t_2 = __pyx_f_4lxml_9objectify_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
9611 __Pyx_GOTREF(__pyx_t_2);
9612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9613 __pyx_r = __pyx_t_2;
9617 /* "lxml/objectify.pyx":603
9618 * return textOf(self._c_node) or ''
9620 * def __repr__(self): # <<<<<<<<<<<<<<
9621 * return strrepr(textOf(self._c_node) or '')
9625 /* function exit code */
9627 __Pyx_XDECREF(__pyx_t_1);
9628 __Pyx_XDECREF(__pyx_t_2);
9629 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9632 __Pyx_XGIVEREF(__pyx_r);
9633 __Pyx_RefNannyFinishContext();
9637 /* "lxml/objectify.pyx":606
9638 * return strrepr(textOf(self._c_node) or '')
9640 * def _setText(self, s): # <<<<<<<<<<<<<<
9641 * u"""For use in subclasses only. Don't use unless you know what you are
9645 /* Python wrapper */
9646 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/
9647 static char __pyx_doc_4lxml_9objectify_22ObjectifiedDataElement_4_setText[] = "For use in subclasses only. Don't use unless you know what you are\n doing.\n ";
9648 static PyMethodDef __pyx_mdef_4lxml_9objectify_22ObjectifiedDataElement_5_setText = {"_setText", (PyCFunction)__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText, METH_O, __pyx_doc_4lxml_9objectify_22ObjectifiedDataElement_4_setText};
9649 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText(PyObject *__pyx_v_self, PyObject *__pyx_v_s) {
9650 PyObject *__pyx_r = 0;
9651 __Pyx_RefNannyDeclarations
9652 __Pyx_RefNannySetupContext("_setText (wrapper)", 0);
9653 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self), ((PyObject *)__pyx_v_s));
9655 /* function exit code */
9656 __Pyx_RefNannyFinishContext();
9660 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self, PyObject *__pyx_v_s) {
9661 PyObject *__pyx_r = NULL;
9662 __Pyx_RefNannyDeclarations
9664 int __pyx_lineno = 0;
9665 const char *__pyx_filename = NULL;
9666 int __pyx_clineno = 0;
9667 __Pyx_RefNannySetupContext("_setText", 0);
9669 /* "lxml/objectify.pyx":610
9672 * cetree.setNodeText(self._c_node, s) # <<<<<<<<<<<<<<
9674 * cdef class NumberElement(ObjectifiedDataElement):
9676 __pyx_t_1 = setNodeText(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node, __pyx_v_s); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 610, __pyx_L1_error)
9678 /* "lxml/objectify.pyx":606
9679 * return strrepr(textOf(self._c_node) or '')
9681 * def _setText(self, s): # <<<<<<<<<<<<<<
9682 * u"""For use in subclasses only. Don't use unless you know what you are
9686 /* function exit code */
9687 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9690 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement._setText", __pyx_clineno, __pyx_lineno, __pyx_filename);
9693 __Pyx_XGIVEREF(__pyx_r);
9694 __Pyx_RefNannyFinishContext();
9698 /* "lxml/objectify.pyx":614
9699 * cdef class NumberElement(ObjectifiedDataElement):
9700 * cdef object _parse_value
9701 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
9702 * u"""Set the function that parses the Python value from a string.
9706 /* Python wrapper */
9707 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser(PyObject *__pyx_v_self, PyObject *__pyx_v_function); /*proto*/
9708 static char __pyx_doc_4lxml_9objectify_13NumberElement__setValueParser[] = "Set the function that parses the Python value from a string.\n\n Do not use this unless you know what you are doing.\n ";
9709 static PyMethodDef __pyx_mdef_4lxml_9objectify_13NumberElement_1_setValueParser = {"_setValueParser", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser, METH_O, __pyx_doc_4lxml_9objectify_13NumberElement__setValueParser};
9710 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser(PyObject *__pyx_v_self, PyObject *__pyx_v_function) {
9711 PyObject *__pyx_r = 0;
9712 __Pyx_RefNannyDeclarations
9713 __Pyx_RefNannySetupContext("_setValueParser (wrapper)", 0);
9714 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self), ((PyObject *)__pyx_v_function));
9716 /* function exit code */
9717 __Pyx_RefNannyFinishContext();
9721 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_function) {
9722 PyObject *__pyx_r = NULL;
9723 __Pyx_RefNannyDeclarations
9724 __Pyx_RefNannySetupContext("_setValueParser", 0);
9726 /* "lxml/objectify.pyx":619
9727 * Do not use this unless you know what you are doing.
9729 * self._parse_value = function # <<<<<<<<<<<<<<
9733 __Pyx_INCREF(__pyx_v_function);
9734 __Pyx_GIVEREF(__pyx_v_function);
9735 __Pyx_GOTREF(__pyx_v_self->_parse_value);
9736 __Pyx_DECREF(__pyx_v_self->_parse_value);
9737 __pyx_v_self->_parse_value = __pyx_v_function;
9739 /* "lxml/objectify.pyx":614
9740 * cdef class NumberElement(ObjectifiedDataElement):
9741 * cdef object _parse_value
9742 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
9743 * u"""Set the function that parses the Python value from a string.
9747 /* function exit code */
9748 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9749 __Pyx_XGIVEREF(__pyx_r);
9750 __Pyx_RefNannyFinishContext();
9754 /* "lxml/objectify.pyx":622
9757 * def pyval(self): # <<<<<<<<<<<<<<
9758 * return _parseNumber(self)
9762 /* Python wrapper */
9763 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
9764 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(PyObject *__pyx_v_self) {
9765 PyObject *__pyx_r = 0;
9766 __Pyx_RefNannyDeclarations
9767 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9768 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9770 /* function exit code */
9771 __Pyx_RefNannyFinishContext();
9775 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9776 PyObject *__pyx_r = NULL;
9777 __Pyx_RefNannyDeclarations
9778 PyObject *__pyx_t_1 = NULL;
9779 int __pyx_lineno = 0;
9780 const char *__pyx_filename = NULL;
9781 int __pyx_clineno = 0;
9782 __Pyx_RefNannySetupContext("__get__", 0);
9784 /* "lxml/objectify.pyx":623
9787 * return _parseNumber(self) # <<<<<<<<<<<<<<
9789 * def __int__(self):
9791 __Pyx_XDECREF(__pyx_r);
9792 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
9793 __Pyx_GOTREF(__pyx_t_1);
9794 __pyx_r = __pyx_t_1;
9798 /* "lxml/objectify.pyx":622
9801 * def pyval(self): # <<<<<<<<<<<<<<
9802 * return _parseNumber(self)
9806 /* function exit code */
9808 __Pyx_XDECREF(__pyx_t_1);
9809 __Pyx_AddTraceback("lxml.objectify.NumberElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9812 __Pyx_XGIVEREF(__pyx_r);
9813 __Pyx_RefNannyFinishContext();
9817 /* "lxml/objectify.pyx":625
9818 * return _parseNumber(self)
9820 * def __int__(self): # <<<<<<<<<<<<<<
9821 * return int(_parseNumber(self))
9825 /* Python wrapper */
9826 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_3__int__(PyObject *__pyx_v_self); /*proto*/
9827 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_3__int__(PyObject *__pyx_v_self) {
9828 PyObject *__pyx_r = 0;
9829 __Pyx_RefNannyDeclarations
9830 __Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
9831 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_2__int__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9833 /* function exit code */
9834 __Pyx_RefNannyFinishContext();
9838 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_2__int__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9839 PyObject *__pyx_r = NULL;
9840 __Pyx_RefNannyDeclarations
9841 PyObject *__pyx_t_1 = NULL;
9842 PyObject *__pyx_t_2 = NULL;
9843 int __pyx_lineno = 0;
9844 const char *__pyx_filename = NULL;
9845 int __pyx_clineno = 0;
9846 __Pyx_RefNannySetupContext("__int__", 0);
9848 /* "lxml/objectify.pyx":626
9850 * def __int__(self):
9851 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
9853 * def __long__(self):
9855 __Pyx_XDECREF(__pyx_r);
9856 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
9857 __Pyx_GOTREF(__pyx_t_1);
9858 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
9859 __Pyx_GOTREF(__pyx_t_2);
9860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9861 __pyx_r = __pyx_t_2;
9865 /* "lxml/objectify.pyx":625
9866 * return _parseNumber(self)
9868 * def __int__(self): # <<<<<<<<<<<<<<
9869 * return int(_parseNumber(self))
9873 /* function exit code */
9875 __Pyx_XDECREF(__pyx_t_1);
9876 __Pyx_XDECREF(__pyx_t_2);
9877 __Pyx_AddTraceback("lxml.objectify.NumberElement.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9880 __Pyx_XGIVEREF(__pyx_r);
9881 __Pyx_RefNannyFinishContext();
9885 /* "lxml/objectify.pyx":628
9886 * return int(_parseNumber(self))
9888 * def __long__(self): # <<<<<<<<<<<<<<
9889 * return long(_parseNumber(self))
9893 /* Python wrapper */
9894 #if PY_MAJOR_VERSION < 3
9895 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5__long__(PyObject *__pyx_v_self); /*proto*/
9896 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5__long__(PyObject *__pyx_v_self) {
9897 PyObject *__pyx_r = 0;
9898 __Pyx_RefNannyDeclarations
9899 __Pyx_RefNannySetupContext("__long__ (wrapper)", 0);
9900 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_4__long__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9902 /* function exit code */
9903 __Pyx_RefNannyFinishContext();
9906 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
9908 #if PY_MAJOR_VERSION < 3
9909 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_4__long__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9910 PyObject *__pyx_r = NULL;
9911 __Pyx_RefNannyDeclarations
9912 PyObject *__pyx_t_1 = NULL;
9913 PyObject *__pyx_t_2 = NULL;
9914 int __pyx_lineno = 0;
9915 const char *__pyx_filename = NULL;
9916 int __pyx_clineno = 0;
9917 __Pyx_RefNannySetupContext("__long__", 0);
9919 /* "lxml/objectify.pyx":629
9921 * def __long__(self):
9922 * return long(_parseNumber(self)) # <<<<<<<<<<<<<<
9924 * def __float__(self):
9926 __Pyx_XDECREF(__pyx_r);
9927 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
9928 __Pyx_GOTREF(__pyx_t_1);
9929 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyLong_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
9930 __Pyx_GOTREF(__pyx_t_2);
9931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9932 __pyx_r = __pyx_t_2;
9936 /* "lxml/objectify.pyx":628
9937 * return int(_parseNumber(self))
9939 * def __long__(self): # <<<<<<<<<<<<<<
9940 * return long(_parseNumber(self))
9944 /* function exit code */
9946 __Pyx_XDECREF(__pyx_t_1);
9947 __Pyx_XDECREF(__pyx_t_2);
9948 __Pyx_AddTraceback("lxml.objectify.NumberElement.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9951 __Pyx_XGIVEREF(__pyx_r);
9952 __Pyx_RefNannyFinishContext();
9955 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
9957 /* "lxml/objectify.pyx":631
9958 * return long(_parseNumber(self))
9960 * def __float__(self): # <<<<<<<<<<<<<<
9961 * return float(_parseNumber(self))
9965 /* Python wrapper */
9966 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_7__float__(PyObject *__pyx_v_self); /*proto*/
9967 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_7__float__(PyObject *__pyx_v_self) {
9968 PyObject *__pyx_r = 0;
9969 __Pyx_RefNannyDeclarations
9970 __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
9971 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_6__float__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9973 /* function exit code */
9974 __Pyx_RefNannyFinishContext();
9978 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_6__float__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9979 PyObject *__pyx_r = NULL;
9980 __Pyx_RefNannyDeclarations
9981 PyObject *__pyx_t_1 = NULL;
9982 PyObject *__pyx_t_2 = NULL;
9983 int __pyx_lineno = 0;
9984 const char *__pyx_filename = NULL;
9985 int __pyx_clineno = 0;
9986 __Pyx_RefNannySetupContext("__float__", 0);
9988 /* "lxml/objectify.pyx":632
9990 * def __float__(self):
9991 * return float(_parseNumber(self)) # <<<<<<<<<<<<<<
9993 * def __complex__(self):
9995 __Pyx_XDECREF(__pyx_r);
9996 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
9997 __Pyx_GOTREF(__pyx_t_1);
9998 __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
9999 __Pyx_GOTREF(__pyx_t_2);
10000 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10001 __pyx_r = __pyx_t_2;
10005 /* "lxml/objectify.pyx":631
10006 * return long(_parseNumber(self))
10008 * def __float__(self): # <<<<<<<<<<<<<<
10009 * return float(_parseNumber(self))
10013 /* function exit code */
10015 __Pyx_XDECREF(__pyx_t_1);
10016 __Pyx_XDECREF(__pyx_t_2);
10017 __Pyx_AddTraceback("lxml.objectify.NumberElement.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10020 __Pyx_XGIVEREF(__pyx_r);
10021 __Pyx_RefNannyFinishContext();
10025 /* "lxml/objectify.pyx":634
10026 * return float(_parseNumber(self))
10028 * def __complex__(self): # <<<<<<<<<<<<<<
10029 * return complex(_parseNumber(self))
10033 /* Python wrapper */
10034 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10035 static PyMethodDef __pyx_mdef_4lxml_9objectify_13NumberElement_9__complex__ = {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__, METH_NOARGS, 0};
10036 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10037 PyObject *__pyx_r = 0;
10038 __Pyx_RefNannyDeclarations
10039 __Pyx_RefNannySetupContext("__complex__ (wrapper)", 0);
10040 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10042 /* function exit code */
10043 __Pyx_RefNannyFinishContext();
10047 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10048 PyObject *__pyx_r = NULL;
10049 __Pyx_RefNannyDeclarations
10050 PyObject *__pyx_t_1 = NULL;
10051 PyObject *__pyx_t_2 = NULL;
10052 int __pyx_lineno = 0;
10053 const char *__pyx_filename = NULL;
10054 int __pyx_clineno = 0;
10055 __Pyx_RefNannySetupContext("__complex__", 0);
10057 /* "lxml/objectify.pyx":635
10059 * def __complex__(self):
10060 * return complex(_parseNumber(self)) # <<<<<<<<<<<<<<
10062 * def __str__(self):
10064 __Pyx_XDECREF(__pyx_r);
10065 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
10066 __Pyx_GOTREF(__pyx_t_1);
10067 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
10068 __Pyx_GOTREF(__pyx_t_2);
10069 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10070 __pyx_r = __pyx_t_2;
10074 /* "lxml/objectify.pyx":634
10075 * return float(_parseNumber(self))
10077 * def __complex__(self): # <<<<<<<<<<<<<<
10078 * return complex(_parseNumber(self))
10082 /* function exit code */
10084 __Pyx_XDECREF(__pyx_t_1);
10085 __Pyx_XDECREF(__pyx_t_2);
10086 __Pyx_AddTraceback("lxml.objectify.NumberElement.__complex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10089 __Pyx_XGIVEREF(__pyx_r);
10090 __Pyx_RefNannyFinishContext();
10094 /* "lxml/objectify.pyx":637
10095 * return complex(_parseNumber(self))
10097 * def __str__(self): # <<<<<<<<<<<<<<
10098 * return unicode(_parseNumber(self))
10102 /* Python wrapper */
10103 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_11__str__(PyObject *__pyx_v_self); /*proto*/
10104 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_11__str__(PyObject *__pyx_v_self) {
10105 PyObject *__pyx_r = 0;
10106 __Pyx_RefNannyDeclarations
10107 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
10108 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_10__str__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10110 /* function exit code */
10111 __Pyx_RefNannyFinishContext();
10115 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_10__str__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10116 PyObject *__pyx_r = NULL;
10117 __Pyx_RefNannyDeclarations
10118 PyObject *__pyx_t_1 = NULL;
10119 PyObject *__pyx_t_2 = NULL;
10120 int __pyx_lineno = 0;
10121 const char *__pyx_filename = NULL;
10122 int __pyx_clineno = 0;
10123 __Pyx_RefNannySetupContext("__str__", 0);
10125 /* "lxml/objectify.pyx":638
10127 * def __str__(self):
10128 * return unicode(_parseNumber(self)) # <<<<<<<<<<<<<<
10130 * def __repr__(self):
10132 __Pyx_XDECREF(__pyx_r);
10133 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
10134 __Pyx_GOTREF(__pyx_t_1);
10135 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
10136 __Pyx_GOTREF(__pyx_t_2);
10137 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10138 __pyx_r = __pyx_t_2;
10142 /* "lxml/objectify.pyx":637
10143 * return complex(_parseNumber(self))
10145 * def __str__(self): # <<<<<<<<<<<<<<
10146 * return unicode(_parseNumber(self))
10150 /* function exit code */
10152 __Pyx_XDECREF(__pyx_t_1);
10153 __Pyx_XDECREF(__pyx_t_2);
10154 __Pyx_AddTraceback("lxml.objectify.NumberElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10157 __Pyx_XGIVEREF(__pyx_r);
10158 __Pyx_RefNannyFinishContext();
10162 /* "lxml/objectify.pyx":640
10163 * return unicode(_parseNumber(self))
10165 * def __repr__(self): # <<<<<<<<<<<<<<
10166 * return repr(_parseNumber(self))
10170 /* Python wrapper */
10171 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_13__repr__(PyObject *__pyx_v_self); /*proto*/
10172 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_13__repr__(PyObject *__pyx_v_self) {
10173 PyObject *__pyx_r = 0;
10174 __Pyx_RefNannyDeclarations
10175 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10176 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10178 /* function exit code */
10179 __Pyx_RefNannyFinishContext();
10183 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10184 PyObject *__pyx_r = NULL;
10185 __Pyx_RefNannyDeclarations
10186 PyObject *__pyx_t_1 = NULL;
10187 PyObject *__pyx_t_2 = NULL;
10188 int __pyx_lineno = 0;
10189 const char *__pyx_filename = NULL;
10190 int __pyx_clineno = 0;
10191 __Pyx_RefNannySetupContext("__repr__", 0);
10193 /* "lxml/objectify.pyx":641
10195 * def __repr__(self):
10196 * return repr(_parseNumber(self)) # <<<<<<<<<<<<<<
10198 * def __oct__(self):
10200 __Pyx_XDECREF(__pyx_r);
10201 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
10202 __Pyx_GOTREF(__pyx_t_1);
10203 __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
10204 __Pyx_GOTREF(__pyx_t_2);
10205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10206 __pyx_r = __pyx_t_2;
10210 /* "lxml/objectify.pyx":640
10211 * return unicode(_parseNumber(self))
10213 * def __repr__(self): # <<<<<<<<<<<<<<
10214 * return repr(_parseNumber(self))
10218 /* function exit code */
10220 __Pyx_XDECREF(__pyx_t_1);
10221 __Pyx_XDECREF(__pyx_t_2);
10222 __Pyx_AddTraceback("lxml.objectify.NumberElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10225 __Pyx_XGIVEREF(__pyx_r);
10226 __Pyx_RefNannyFinishContext();
10230 /* "lxml/objectify.pyx":643
10231 * return repr(_parseNumber(self))
10233 * def __oct__(self): # <<<<<<<<<<<<<<
10234 * return oct(_parseNumber(self))
10238 /* Python wrapper */
10239 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10240 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_15__oct__(PyObject *__pyx_v_self); /*proto*/
10241 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_15__oct__(PyObject *__pyx_v_self) {
10242 PyObject *__pyx_r = 0;
10243 __Pyx_RefNannyDeclarations
10244 __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0);
10245 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10247 /* function exit code */
10248 __Pyx_RefNannyFinishContext();
10251 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10253 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10254 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10255 PyObject *__pyx_r = NULL;
10256 __Pyx_RefNannyDeclarations
10257 PyObject *__pyx_t_1 = NULL;
10258 PyObject *__pyx_t_2 = NULL;
10259 int __pyx_lineno = 0;
10260 const char *__pyx_filename = NULL;
10261 int __pyx_clineno = 0;
10262 __Pyx_RefNannySetupContext("__oct__", 0);
10264 /* "lxml/objectify.pyx":644
10266 * def __oct__(self):
10267 * return oct(_parseNumber(self)) # <<<<<<<<<<<<<<
10269 * def __hex__(self):
10271 __Pyx_XDECREF(__pyx_r);
10272 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
10273 __Pyx_GOTREF(__pyx_t_1);
10274 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_oct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
10275 __Pyx_GOTREF(__pyx_t_2);
10276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10277 __pyx_r = __pyx_t_2;
10281 /* "lxml/objectify.pyx":643
10282 * return repr(_parseNumber(self))
10284 * def __oct__(self): # <<<<<<<<<<<<<<
10285 * return oct(_parseNumber(self))
10289 /* function exit code */
10291 __Pyx_XDECREF(__pyx_t_1);
10292 __Pyx_XDECREF(__pyx_t_2);
10293 __Pyx_AddTraceback("lxml.objectify.NumberElement.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10296 __Pyx_XGIVEREF(__pyx_r);
10297 __Pyx_RefNannyFinishContext();
10300 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10302 /* "lxml/objectify.pyx":646
10303 * return oct(_parseNumber(self))
10305 * def __hex__(self): # <<<<<<<<<<<<<<
10306 * return hex(_parseNumber(self))
10310 /* Python wrapper */
10311 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10312 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_17__hex__(PyObject *__pyx_v_self); /*proto*/
10313 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_17__hex__(PyObject *__pyx_v_self) {
10314 PyObject *__pyx_r = 0;
10315 __Pyx_RefNannyDeclarations
10316 __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0);
10317 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10319 /* function exit code */
10320 __Pyx_RefNannyFinishContext();
10323 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10325 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10326 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10327 PyObject *__pyx_r = NULL;
10328 __Pyx_RefNannyDeclarations
10329 PyObject *__pyx_t_1 = NULL;
10330 PyObject *__pyx_t_2 = NULL;
10331 int __pyx_lineno = 0;
10332 const char *__pyx_filename = NULL;
10333 int __pyx_clineno = 0;
10334 __Pyx_RefNannySetupContext("__hex__", 0);
10336 /* "lxml/objectify.pyx":647
10338 * def __hex__(self):
10339 * return hex(_parseNumber(self)) # <<<<<<<<<<<<<<
10341 * def __richcmp__(self, other, int op):
10343 __Pyx_XDECREF(__pyx_r);
10344 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
10345 __Pyx_GOTREF(__pyx_t_1);
10346 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
10347 __Pyx_GOTREF(__pyx_t_2);
10348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10349 __pyx_r = __pyx_t_2;
10353 /* "lxml/objectify.pyx":646
10354 * return oct(_parseNumber(self))
10356 * def __hex__(self): # <<<<<<<<<<<<<<
10357 * return hex(_parseNumber(self))
10361 /* function exit code */
10363 __Pyx_XDECREF(__pyx_t_1);
10364 __Pyx_XDECREF(__pyx_t_2);
10365 __Pyx_AddTraceback("lxml.objectify.NumberElement.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10368 __Pyx_XGIVEREF(__pyx_r);
10369 __Pyx_RefNannyFinishContext();
10372 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10374 /* "lxml/objectify.pyx":649
10375 * return hex(_parseNumber(self))
10377 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
10378 * return _richcmpPyvals(self, other, op)
10382 /* Python wrapper */
10383 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
10384 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
10385 PyObject *__pyx_r = 0;
10386 __Pyx_RefNannyDeclarations
10387 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
10388 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_18__richcmp__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
10390 /* function exit code */
10391 __Pyx_RefNannyFinishContext();
10395 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_18__richcmp__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
10396 PyObject *__pyx_r = NULL;
10397 __Pyx_RefNannyDeclarations
10398 PyObject *__pyx_t_1 = NULL;
10399 int __pyx_lineno = 0;
10400 const char *__pyx_filename = NULL;
10401 int __pyx_clineno = 0;
10402 __Pyx_RefNannySetupContext("__richcmp__", 0);
10404 /* "lxml/objectify.pyx":650
10406 * def __richcmp__(self, other, int op):
10407 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
10409 * def __hash__(self):
10411 __Pyx_XDECREF(__pyx_r);
10412 __pyx_t_1 = __pyx_f_4lxml_9objectify__richcmpPyvals(((PyObject *)__pyx_v_self), __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
10413 __Pyx_GOTREF(__pyx_t_1);
10414 __pyx_r = __pyx_t_1;
10418 /* "lxml/objectify.pyx":649
10419 * return hex(_parseNumber(self))
10421 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
10422 * return _richcmpPyvals(self, other, op)
10426 /* function exit code */
10428 __Pyx_XDECREF(__pyx_t_1);
10429 __Pyx_AddTraceback("lxml.objectify.NumberElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10432 __Pyx_XGIVEREF(__pyx_r);
10433 __Pyx_RefNannyFinishContext();
10437 /* "lxml/objectify.pyx":652
10438 * return _richcmpPyvals(self, other, op)
10440 * def __hash__(self): # <<<<<<<<<<<<<<
10441 * return hash(_parseNumber(self))
10445 /* Python wrapper */
10446 static Py_hash_t __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__(PyObject *__pyx_v_self); /*proto*/
10447 static Py_hash_t __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__(PyObject *__pyx_v_self) {
10449 __Pyx_RefNannyDeclarations
10450 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
10451 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10453 /* function exit code */
10454 __Pyx_RefNannyFinishContext();
10458 static Py_hash_t __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10460 __Pyx_RefNannyDeclarations
10461 PyObject *__pyx_t_1 = NULL;
10462 Py_hash_t __pyx_t_2;
10463 int __pyx_lineno = 0;
10464 const char *__pyx_filename = NULL;
10465 int __pyx_clineno = 0;
10466 __Pyx_RefNannySetupContext("__hash__", 0);
10468 /* "lxml/objectify.pyx":653
10470 * def __hash__(self):
10471 * return hash(_parseNumber(self)) # <<<<<<<<<<<<<<
10473 * def __add__(self, other):
10475 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
10476 __Pyx_GOTREF(__pyx_t_1);
10477 __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 653, __pyx_L1_error)
10478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10479 __pyx_r = __pyx_t_2;
10482 /* "lxml/objectify.pyx":652
10483 * return _richcmpPyvals(self, other, op)
10485 * def __hash__(self): # <<<<<<<<<<<<<<
10486 * return hash(_parseNumber(self))
10490 /* function exit code */
10492 __Pyx_XDECREF(__pyx_t_1);
10493 __Pyx_AddTraceback("lxml.objectify.NumberElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10496 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
10497 __Pyx_RefNannyFinishContext();
10501 /* "lxml/objectify.pyx":655
10502 * return hash(_parseNumber(self))
10504 * def __add__(self, other): # <<<<<<<<<<<<<<
10505 * return _numericValueOf(self) + _numericValueOf(other)
10509 /* Python wrapper */
10510 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_23__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10511 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_23__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10512 PyObject *__pyx_r = 0;
10513 __Pyx_RefNannyDeclarations
10514 __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
10515 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_22__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10517 /* function exit code */
10518 __Pyx_RefNannyFinishContext();
10522 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_22__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10523 PyObject *__pyx_r = NULL;
10524 __Pyx_RefNannyDeclarations
10525 PyObject *__pyx_t_1 = NULL;
10526 PyObject *__pyx_t_2 = NULL;
10527 PyObject *__pyx_t_3 = NULL;
10528 int __pyx_lineno = 0;
10529 const char *__pyx_filename = NULL;
10530 int __pyx_clineno = 0;
10531 __Pyx_RefNannySetupContext("__add__", 0);
10533 /* "lxml/objectify.pyx":656
10535 * def __add__(self, other):
10536 * return _numericValueOf(self) + _numericValueOf(other) # <<<<<<<<<<<<<<
10538 * def __sub__(self, other):
10540 __Pyx_XDECREF(__pyx_r);
10541 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
10542 __Pyx_GOTREF(__pyx_t_1);
10543 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
10544 __Pyx_GOTREF(__pyx_t_2);
10545 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
10546 __Pyx_GOTREF(__pyx_t_3);
10547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10548 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10549 __pyx_r = __pyx_t_3;
10553 /* "lxml/objectify.pyx":655
10554 * return hash(_parseNumber(self))
10556 * def __add__(self, other): # <<<<<<<<<<<<<<
10557 * return _numericValueOf(self) + _numericValueOf(other)
10561 /* function exit code */
10563 __Pyx_XDECREF(__pyx_t_1);
10564 __Pyx_XDECREF(__pyx_t_2);
10565 __Pyx_XDECREF(__pyx_t_3);
10566 __Pyx_AddTraceback("lxml.objectify.NumberElement.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10569 __Pyx_XGIVEREF(__pyx_r);
10570 __Pyx_RefNannyFinishContext();
10574 /* "lxml/objectify.pyx":658
10575 * return _numericValueOf(self) + _numericValueOf(other)
10577 * def __sub__(self, other): # <<<<<<<<<<<<<<
10578 * return _numericValueOf(self) - _numericValueOf(other)
10582 /* Python wrapper */
10583 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10584 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10585 PyObject *__pyx_r = 0;
10586 __Pyx_RefNannyDeclarations
10587 __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
10588 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10590 /* function exit code */
10591 __Pyx_RefNannyFinishContext();
10595 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10596 PyObject *__pyx_r = NULL;
10597 __Pyx_RefNannyDeclarations
10598 PyObject *__pyx_t_1 = NULL;
10599 PyObject *__pyx_t_2 = NULL;
10600 PyObject *__pyx_t_3 = NULL;
10601 int __pyx_lineno = 0;
10602 const char *__pyx_filename = NULL;
10603 int __pyx_clineno = 0;
10604 __Pyx_RefNannySetupContext("__sub__", 0);
10606 /* "lxml/objectify.pyx":659
10608 * def __sub__(self, other):
10609 * return _numericValueOf(self) - _numericValueOf(other) # <<<<<<<<<<<<<<
10611 * def __mul__(self, other):
10613 __Pyx_XDECREF(__pyx_r);
10614 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
10615 __Pyx_GOTREF(__pyx_t_1);
10616 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
10617 __Pyx_GOTREF(__pyx_t_2);
10618 __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
10619 __Pyx_GOTREF(__pyx_t_3);
10620 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10622 __pyx_r = __pyx_t_3;
10626 /* "lxml/objectify.pyx":658
10627 * return _numericValueOf(self) + _numericValueOf(other)
10629 * def __sub__(self, other): # <<<<<<<<<<<<<<
10630 * return _numericValueOf(self) - _numericValueOf(other)
10634 /* function exit code */
10636 __Pyx_XDECREF(__pyx_t_1);
10637 __Pyx_XDECREF(__pyx_t_2);
10638 __Pyx_XDECREF(__pyx_t_3);
10639 __Pyx_AddTraceback("lxml.objectify.NumberElement.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10642 __Pyx_XGIVEREF(__pyx_r);
10643 __Pyx_RefNannyFinishContext();
10647 /* "lxml/objectify.pyx":661
10648 * return _numericValueOf(self) - _numericValueOf(other)
10650 * def __mul__(self, other): # <<<<<<<<<<<<<<
10651 * return _numericValueOf(self) * _numericValueOf(other)
10655 /* Python wrapper */
10656 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10657 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10658 PyObject *__pyx_r = 0;
10659 __Pyx_RefNannyDeclarations
10660 __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
10661 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10663 /* function exit code */
10664 __Pyx_RefNannyFinishContext();
10668 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10669 PyObject *__pyx_r = NULL;
10670 __Pyx_RefNannyDeclarations
10671 PyObject *__pyx_t_1 = NULL;
10672 PyObject *__pyx_t_2 = NULL;
10673 PyObject *__pyx_t_3 = NULL;
10674 int __pyx_lineno = 0;
10675 const char *__pyx_filename = NULL;
10676 int __pyx_clineno = 0;
10677 __Pyx_RefNannySetupContext("__mul__", 0);
10679 /* "lxml/objectify.pyx":662
10681 * def __mul__(self, other):
10682 * return _numericValueOf(self) * _numericValueOf(other) # <<<<<<<<<<<<<<
10684 * def __div__(self, other):
10686 __Pyx_XDECREF(__pyx_r);
10687 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
10688 __Pyx_GOTREF(__pyx_t_1);
10689 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
10690 __Pyx_GOTREF(__pyx_t_2);
10691 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
10692 __Pyx_GOTREF(__pyx_t_3);
10693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10695 __pyx_r = __pyx_t_3;
10699 /* "lxml/objectify.pyx":661
10700 * return _numericValueOf(self) - _numericValueOf(other)
10702 * def __mul__(self, other): # <<<<<<<<<<<<<<
10703 * return _numericValueOf(self) * _numericValueOf(other)
10707 /* function exit code */
10709 __Pyx_XDECREF(__pyx_t_1);
10710 __Pyx_XDECREF(__pyx_t_2);
10711 __Pyx_XDECREF(__pyx_t_3);
10712 __Pyx_AddTraceback("lxml.objectify.NumberElement.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10715 __Pyx_XGIVEREF(__pyx_r);
10716 __Pyx_RefNannyFinishContext();
10720 /* "lxml/objectify.pyx":664
10721 * return _numericValueOf(self) * _numericValueOf(other)
10723 * def __div__(self, other): # <<<<<<<<<<<<<<
10724 * return _numericValueOf(self) / _numericValueOf(other)
10728 /* Python wrapper */
10729 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10730 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10731 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10732 PyObject *__pyx_r = 0;
10733 __Pyx_RefNannyDeclarations
10734 __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
10735 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_28__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10737 /* function exit code */
10738 __Pyx_RefNannyFinishContext();
10741 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10743 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10744 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_28__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10745 PyObject *__pyx_r = NULL;
10746 __Pyx_RefNannyDeclarations
10747 PyObject *__pyx_t_1 = NULL;
10748 PyObject *__pyx_t_2 = NULL;
10749 PyObject *__pyx_t_3 = NULL;
10750 int __pyx_lineno = 0;
10751 const char *__pyx_filename = NULL;
10752 int __pyx_clineno = 0;
10753 __Pyx_RefNannySetupContext("__div__", 0);
10755 /* "lxml/objectify.pyx":665
10757 * def __div__(self, other):
10758 * return _numericValueOf(self) / _numericValueOf(other) # <<<<<<<<<<<<<<
10760 * def __truediv__(self, other):
10762 __Pyx_XDECREF(__pyx_r);
10763 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
10764 __Pyx_GOTREF(__pyx_t_1);
10765 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
10766 __Pyx_GOTREF(__pyx_t_2);
10767 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_3);
10769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10771 __pyx_r = __pyx_t_3;
10775 /* "lxml/objectify.pyx":664
10776 * return _numericValueOf(self) * _numericValueOf(other)
10778 * def __div__(self, other): # <<<<<<<<<<<<<<
10779 * return _numericValueOf(self) / _numericValueOf(other)
10783 /* function exit code */
10785 __Pyx_XDECREF(__pyx_t_1);
10786 __Pyx_XDECREF(__pyx_t_2);
10787 __Pyx_XDECREF(__pyx_t_3);
10788 __Pyx_AddTraceback("lxml.objectify.NumberElement.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10791 __Pyx_XGIVEREF(__pyx_r);
10792 __Pyx_RefNannyFinishContext();
10795 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10797 /* "lxml/objectify.pyx":667
10798 * return _numericValueOf(self) / _numericValueOf(other)
10800 * def __truediv__(self, other): # <<<<<<<<<<<<<<
10801 * return _numericValueOf(self) / _numericValueOf(other)
10805 /* Python wrapper */
10806 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10807 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10808 PyObject *__pyx_r = 0;
10809 __Pyx_RefNannyDeclarations
10810 __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
10811 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10813 /* function exit code */
10814 __Pyx_RefNannyFinishContext();
10818 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10819 PyObject *__pyx_r = NULL;
10820 __Pyx_RefNannyDeclarations
10821 PyObject *__pyx_t_1 = NULL;
10822 PyObject *__pyx_t_2 = NULL;
10823 PyObject *__pyx_t_3 = NULL;
10824 int __pyx_lineno = 0;
10825 const char *__pyx_filename = NULL;
10826 int __pyx_clineno = 0;
10827 __Pyx_RefNannySetupContext("__truediv__", 0);
10829 /* "lxml/objectify.pyx":668
10831 * def __truediv__(self, other):
10832 * return _numericValueOf(self) / _numericValueOf(other) # <<<<<<<<<<<<<<
10834 * def __mod__(self, other):
10836 __Pyx_XDECREF(__pyx_r);
10837 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
10838 __Pyx_GOTREF(__pyx_t_1);
10839 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
10840 __Pyx_GOTREF(__pyx_t_2);
10841 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
10842 __Pyx_GOTREF(__pyx_t_3);
10843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10845 __pyx_r = __pyx_t_3;
10849 /* "lxml/objectify.pyx":667
10850 * return _numericValueOf(self) / _numericValueOf(other)
10852 * def __truediv__(self, other): # <<<<<<<<<<<<<<
10853 * return _numericValueOf(self) / _numericValueOf(other)
10857 /* function exit code */
10859 __Pyx_XDECREF(__pyx_t_1);
10860 __Pyx_XDECREF(__pyx_t_2);
10861 __Pyx_XDECREF(__pyx_t_3);
10862 __Pyx_AddTraceback("lxml.objectify.NumberElement.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10865 __Pyx_XGIVEREF(__pyx_r);
10866 __Pyx_RefNannyFinishContext();
10870 /* "lxml/objectify.pyx":670
10871 * return _numericValueOf(self) / _numericValueOf(other)
10873 * def __mod__(self, other): # <<<<<<<<<<<<<<
10874 * return _numericValueOf(self) % _numericValueOf(other)
10878 /* Python wrapper */
10879 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10880 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10881 PyObject *__pyx_r = 0;
10882 __Pyx_RefNannyDeclarations
10883 __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
10884 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10886 /* function exit code */
10887 __Pyx_RefNannyFinishContext();
10891 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10892 PyObject *__pyx_r = NULL;
10893 __Pyx_RefNannyDeclarations
10894 PyObject *__pyx_t_1 = NULL;
10895 PyObject *__pyx_t_2 = NULL;
10896 PyObject *__pyx_t_3 = NULL;
10897 int __pyx_lineno = 0;
10898 const char *__pyx_filename = NULL;
10899 int __pyx_clineno = 0;
10900 __Pyx_RefNannySetupContext("__mod__", 0);
10902 /* "lxml/objectify.pyx":671
10904 * def __mod__(self, other):
10905 * return _numericValueOf(self) % _numericValueOf(other) # <<<<<<<<<<<<<<
10907 * def __pow__(self, other, modulo):
10909 __Pyx_XDECREF(__pyx_r);
10910 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_1);
10912 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
10913 __Pyx_GOTREF(__pyx_t_2);
10914 __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
10915 __Pyx_GOTREF(__pyx_t_3);
10916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10918 __pyx_r = __pyx_t_3;
10922 /* "lxml/objectify.pyx":670
10923 * return _numericValueOf(self) / _numericValueOf(other)
10925 * def __mod__(self, other): # <<<<<<<<<<<<<<
10926 * return _numericValueOf(self) % _numericValueOf(other)
10930 /* function exit code */
10932 __Pyx_XDECREF(__pyx_t_1);
10933 __Pyx_XDECREF(__pyx_t_2);
10934 __Pyx_XDECREF(__pyx_t_3);
10935 __Pyx_AddTraceback("lxml.objectify.NumberElement.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10938 __Pyx_XGIVEREF(__pyx_r);
10939 __Pyx_RefNannyFinishContext();
10943 /* "lxml/objectify.pyx":673
10944 * return _numericValueOf(self) % _numericValueOf(other)
10946 * def __pow__(self, other, modulo): # <<<<<<<<<<<<<<
10947 * if modulo is None:
10948 * return _numericValueOf(self) ** _numericValueOf(other)
10951 /* Python wrapper */
10952 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_35__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo); /*proto*/
10953 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_35__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo) {
10954 PyObject *__pyx_r = 0;
10955 __Pyx_RefNannyDeclarations
10956 __Pyx_RefNannySetupContext("__pow__ (wrapper)", 0);
10957 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_modulo));
10959 /* function exit code */
10960 __Pyx_RefNannyFinishContext();
10964 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo) {
10965 PyObject *__pyx_r = NULL;
10966 __Pyx_RefNannyDeclarations
10969 PyObject *__pyx_t_3 = NULL;
10970 PyObject *__pyx_t_4 = NULL;
10971 PyObject *__pyx_t_5 = NULL;
10972 int __pyx_lineno = 0;
10973 const char *__pyx_filename = NULL;
10974 int __pyx_clineno = 0;
10975 __Pyx_RefNannySetupContext("__pow__", 0);
10977 /* "lxml/objectify.pyx":674
10979 * def __pow__(self, other, modulo):
10980 * if modulo is None: # <<<<<<<<<<<<<<
10981 * return _numericValueOf(self) ** _numericValueOf(other)
10984 __pyx_t_1 = (__pyx_v_modulo == Py_None);
10985 __pyx_t_2 = (__pyx_t_1 != 0);
10988 /* "lxml/objectify.pyx":675
10989 * def __pow__(self, other, modulo):
10990 * if modulo is None:
10991 * return _numericValueOf(self) ** _numericValueOf(other) # <<<<<<<<<<<<<<
10993 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
10995 __Pyx_XDECREF(__pyx_r);
10996 __pyx_t_3 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
10997 __Pyx_GOTREF(__pyx_t_3);
10998 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
10999 __Pyx_GOTREF(__pyx_t_4);
11000 __pyx_t_5 = PyNumber_Power(__pyx_t_3, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error)
11001 __Pyx_GOTREF(__pyx_t_5);
11002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11003 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11004 __pyx_r = __pyx_t_5;
11008 /* "lxml/objectify.pyx":674
11010 * def __pow__(self, other, modulo):
11011 * if modulo is None: # <<<<<<<<<<<<<<
11012 * return _numericValueOf(self) ** _numericValueOf(other)
11017 /* "lxml/objectify.pyx":677
11018 * return _numericValueOf(self) ** _numericValueOf(other)
11020 * return pow(_numericValueOf(self), _numericValueOf(other), modulo) # <<<<<<<<<<<<<<
11022 * def __neg__(self):
11025 __Pyx_XDECREF(__pyx_r);
11026 __pyx_t_5 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
11027 __Pyx_GOTREF(__pyx_t_5);
11028 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
11029 __Pyx_GOTREF(__pyx_t_4);
11030 __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_t_4, __pyx_v_modulo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
11031 __Pyx_GOTREF(__pyx_t_3);
11032 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11033 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11034 __pyx_r = __pyx_t_3;
11039 /* "lxml/objectify.pyx":673
11040 * return _numericValueOf(self) % _numericValueOf(other)
11042 * def __pow__(self, other, modulo): # <<<<<<<<<<<<<<
11043 * if modulo is None:
11044 * return _numericValueOf(self) ** _numericValueOf(other)
11047 /* function exit code */
11049 __Pyx_XDECREF(__pyx_t_3);
11050 __Pyx_XDECREF(__pyx_t_4);
11051 __Pyx_XDECREF(__pyx_t_5);
11052 __Pyx_AddTraceback("lxml.objectify.NumberElement.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11055 __Pyx_XGIVEREF(__pyx_r);
11056 __Pyx_RefNannyFinishContext();
11060 /* "lxml/objectify.pyx":679
11061 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
11063 * def __neg__(self): # <<<<<<<<<<<<<<
11064 * return - _numericValueOf(self)
11068 /* Python wrapper */
11069 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_37__neg__(PyObject *__pyx_v_self); /*proto*/
11070 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_37__neg__(PyObject *__pyx_v_self) {
11071 PyObject *__pyx_r = 0;
11072 __Pyx_RefNannyDeclarations
11073 __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
11074 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11076 /* function exit code */
11077 __Pyx_RefNannyFinishContext();
11081 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11082 PyObject *__pyx_r = NULL;
11083 __Pyx_RefNannyDeclarations
11084 PyObject *__pyx_t_1 = NULL;
11085 PyObject *__pyx_t_2 = NULL;
11086 int __pyx_lineno = 0;
11087 const char *__pyx_filename = NULL;
11088 int __pyx_clineno = 0;
11089 __Pyx_RefNannySetupContext("__neg__", 0);
11091 /* "lxml/objectify.pyx":680
11093 * def __neg__(self):
11094 * return - _numericValueOf(self) # <<<<<<<<<<<<<<
11096 * def __pos__(self):
11098 __Pyx_XDECREF(__pyx_r);
11099 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
11100 __Pyx_GOTREF(__pyx_t_1);
11101 __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
11102 __Pyx_GOTREF(__pyx_t_2);
11103 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11104 __pyx_r = __pyx_t_2;
11108 /* "lxml/objectify.pyx":679
11109 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
11111 * def __neg__(self): # <<<<<<<<<<<<<<
11112 * return - _numericValueOf(self)
11116 /* function exit code */
11118 __Pyx_XDECREF(__pyx_t_1);
11119 __Pyx_XDECREF(__pyx_t_2);
11120 __Pyx_AddTraceback("lxml.objectify.NumberElement.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11123 __Pyx_XGIVEREF(__pyx_r);
11124 __Pyx_RefNannyFinishContext();
11128 /* "lxml/objectify.pyx":682
11129 * return - _numericValueOf(self)
11131 * def __pos__(self): # <<<<<<<<<<<<<<
11132 * return + _numericValueOf(self)
11136 /* Python wrapper */
11137 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_39__pos__(PyObject *__pyx_v_self); /*proto*/
11138 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_39__pos__(PyObject *__pyx_v_self) {
11139 PyObject *__pyx_r = 0;
11140 __Pyx_RefNannyDeclarations
11141 __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0);
11142 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11144 /* function exit code */
11145 __Pyx_RefNannyFinishContext();
11149 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11150 PyObject *__pyx_r = NULL;
11151 __Pyx_RefNannyDeclarations
11152 PyObject *__pyx_t_1 = NULL;
11153 PyObject *__pyx_t_2 = NULL;
11154 int __pyx_lineno = 0;
11155 const char *__pyx_filename = NULL;
11156 int __pyx_clineno = 0;
11157 __Pyx_RefNannySetupContext("__pos__", 0);
11159 /* "lxml/objectify.pyx":683
11161 * def __pos__(self):
11162 * return + _numericValueOf(self) # <<<<<<<<<<<<<<
11164 * def __abs__(self):
11166 __Pyx_XDECREF(__pyx_r);
11167 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
11168 __Pyx_GOTREF(__pyx_t_1);
11169 __pyx_t_2 = PyNumber_Positive(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
11170 __Pyx_GOTREF(__pyx_t_2);
11171 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11172 __pyx_r = __pyx_t_2;
11176 /* "lxml/objectify.pyx":682
11177 * return - _numericValueOf(self)
11179 * def __pos__(self): # <<<<<<<<<<<<<<
11180 * return + _numericValueOf(self)
11184 /* function exit code */
11186 __Pyx_XDECREF(__pyx_t_1);
11187 __Pyx_XDECREF(__pyx_t_2);
11188 __Pyx_AddTraceback("lxml.objectify.NumberElement.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11191 __Pyx_XGIVEREF(__pyx_r);
11192 __Pyx_RefNannyFinishContext();
11196 /* "lxml/objectify.pyx":685
11197 * return + _numericValueOf(self)
11199 * def __abs__(self): # <<<<<<<<<<<<<<
11200 * return abs( _numericValueOf(self) )
11204 /* Python wrapper */
11205 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_41__abs__(PyObject *__pyx_v_self); /*proto*/
11206 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_41__abs__(PyObject *__pyx_v_self) {
11207 PyObject *__pyx_r = 0;
11208 __Pyx_RefNannyDeclarations
11209 __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0);
11210 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11212 /* function exit code */
11213 __Pyx_RefNannyFinishContext();
11217 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11218 PyObject *__pyx_r = NULL;
11219 __Pyx_RefNannyDeclarations
11220 PyObject *__pyx_t_1 = NULL;
11221 PyObject *__pyx_t_2 = NULL;
11222 int __pyx_lineno = 0;
11223 const char *__pyx_filename = NULL;
11224 int __pyx_clineno = 0;
11225 __Pyx_RefNannySetupContext("__abs__", 0);
11227 /* "lxml/objectify.pyx":686
11229 * def __abs__(self):
11230 * return abs( _numericValueOf(self) ) # <<<<<<<<<<<<<<
11232 * def __nonzero__(self):
11234 __Pyx_XDECREF(__pyx_r);
11235 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
11236 __Pyx_GOTREF(__pyx_t_1);
11237 __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
11238 __Pyx_GOTREF(__pyx_t_2);
11239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11240 __pyx_r = __pyx_t_2;
11244 /* "lxml/objectify.pyx":685
11245 * return + _numericValueOf(self)
11247 * def __abs__(self): # <<<<<<<<<<<<<<
11248 * return abs( _numericValueOf(self) )
11252 /* function exit code */
11254 __Pyx_XDECREF(__pyx_t_1);
11255 __Pyx_XDECREF(__pyx_t_2);
11256 __Pyx_AddTraceback("lxml.objectify.NumberElement.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11259 __Pyx_XGIVEREF(__pyx_r);
11260 __Pyx_RefNannyFinishContext();
11264 /* "lxml/objectify.pyx":688
11265 * return abs( _numericValueOf(self) )
11267 * def __nonzero__(self): # <<<<<<<<<<<<<<
11268 * return bool(_numericValueOf(self))
11272 /* Python wrapper */
11273 static int __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__(PyObject *__pyx_v_self); /*proto*/
11274 static int __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__(PyObject *__pyx_v_self) {
11276 __Pyx_RefNannyDeclarations
11277 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
11278 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11280 /* function exit code */
11281 __Pyx_RefNannyFinishContext();
11285 static int __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11287 __Pyx_RefNannyDeclarations
11288 PyObject *__pyx_t_1 = NULL;
11290 int __pyx_lineno = 0;
11291 const char *__pyx_filename = NULL;
11292 int __pyx_clineno = 0;
11293 __Pyx_RefNannySetupContext("__nonzero__", 0);
11295 /* "lxml/objectify.pyx":689
11297 * def __nonzero__(self):
11298 * return bool(_numericValueOf(self)) # <<<<<<<<<<<<<<
11300 * def __invert__(self):
11302 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
11303 __Pyx_GOTREF(__pyx_t_1);
11304 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
11305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11306 __pyx_r = (!(!__pyx_t_2));
11309 /* "lxml/objectify.pyx":688
11310 * return abs( _numericValueOf(self) )
11312 * def __nonzero__(self): # <<<<<<<<<<<<<<
11313 * return bool(_numericValueOf(self))
11317 /* function exit code */
11319 __Pyx_XDECREF(__pyx_t_1);
11320 __Pyx_AddTraceback("lxml.objectify.NumberElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11323 __Pyx_RefNannyFinishContext();
11327 /* "lxml/objectify.pyx":691
11328 * return bool(_numericValueOf(self))
11330 * def __invert__(self): # <<<<<<<<<<<<<<
11331 * return ~ _numericValueOf(self)
11335 /* Python wrapper */
11336 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_45__invert__(PyObject *__pyx_v_self); /*proto*/
11337 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_45__invert__(PyObject *__pyx_v_self) {
11338 PyObject *__pyx_r = 0;
11339 __Pyx_RefNannyDeclarations
11340 __Pyx_RefNannySetupContext("__invert__ (wrapper)", 0);
11341 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11343 /* function exit code */
11344 __Pyx_RefNannyFinishContext();
11348 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11349 PyObject *__pyx_r = NULL;
11350 __Pyx_RefNannyDeclarations
11351 PyObject *__pyx_t_1 = NULL;
11352 PyObject *__pyx_t_2 = NULL;
11353 int __pyx_lineno = 0;
11354 const char *__pyx_filename = NULL;
11355 int __pyx_clineno = 0;
11356 __Pyx_RefNannySetupContext("__invert__", 0);
11358 /* "lxml/objectify.pyx":692
11360 * def __invert__(self):
11361 * return ~ _numericValueOf(self) # <<<<<<<<<<<<<<
11363 * def __lshift__(self, other):
11365 __Pyx_XDECREF(__pyx_r);
11366 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
11367 __Pyx_GOTREF(__pyx_t_1);
11368 __pyx_t_2 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
11369 __Pyx_GOTREF(__pyx_t_2);
11370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11371 __pyx_r = __pyx_t_2;
11375 /* "lxml/objectify.pyx":691
11376 * return bool(_numericValueOf(self))
11378 * def __invert__(self): # <<<<<<<<<<<<<<
11379 * return ~ _numericValueOf(self)
11383 /* function exit code */
11385 __Pyx_XDECREF(__pyx_t_1);
11386 __Pyx_XDECREF(__pyx_t_2);
11387 __Pyx_AddTraceback("lxml.objectify.NumberElement.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11390 __Pyx_XGIVEREF(__pyx_r);
11391 __Pyx_RefNannyFinishContext();
11395 /* "lxml/objectify.pyx":694
11396 * return ~ _numericValueOf(self)
11398 * def __lshift__(self, other): # <<<<<<<<<<<<<<
11399 * return _numericValueOf(self) << _numericValueOf(other)
11403 /* Python wrapper */
11404 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11405 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11406 PyObject *__pyx_r = 0;
11407 __Pyx_RefNannyDeclarations
11408 __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0);
11409 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11411 /* function exit code */
11412 __Pyx_RefNannyFinishContext();
11416 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11417 PyObject *__pyx_r = NULL;
11418 __Pyx_RefNannyDeclarations
11419 PyObject *__pyx_t_1 = NULL;
11420 PyObject *__pyx_t_2 = NULL;
11421 PyObject *__pyx_t_3 = NULL;
11422 int __pyx_lineno = 0;
11423 const char *__pyx_filename = NULL;
11424 int __pyx_clineno = 0;
11425 __Pyx_RefNannySetupContext("__lshift__", 0);
11427 /* "lxml/objectify.pyx":695
11429 * def __lshift__(self, other):
11430 * return _numericValueOf(self) << _numericValueOf(other) # <<<<<<<<<<<<<<
11432 * def __rshift__(self, other):
11434 __Pyx_XDECREF(__pyx_r);
11435 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
11436 __Pyx_GOTREF(__pyx_t_1);
11437 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
11438 __Pyx_GOTREF(__pyx_t_2);
11439 __pyx_t_3 = PyNumber_Lshift(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
11440 __Pyx_GOTREF(__pyx_t_3);
11441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11442 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11443 __pyx_r = __pyx_t_3;
11447 /* "lxml/objectify.pyx":694
11448 * return ~ _numericValueOf(self)
11450 * def __lshift__(self, other): # <<<<<<<<<<<<<<
11451 * return _numericValueOf(self) << _numericValueOf(other)
11455 /* function exit code */
11457 __Pyx_XDECREF(__pyx_t_1);
11458 __Pyx_XDECREF(__pyx_t_2);
11459 __Pyx_XDECREF(__pyx_t_3);
11460 __Pyx_AddTraceback("lxml.objectify.NumberElement.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11463 __Pyx_XGIVEREF(__pyx_r);
11464 __Pyx_RefNannyFinishContext();
11468 /* "lxml/objectify.pyx":697
11469 * return _numericValueOf(self) << _numericValueOf(other)
11471 * def __rshift__(self, other): # <<<<<<<<<<<<<<
11472 * return _numericValueOf(self) >> _numericValueOf(other)
11476 /* Python wrapper */
11477 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11478 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11479 PyObject *__pyx_r = 0;
11480 __Pyx_RefNannyDeclarations
11481 __Pyx_RefNannySetupContext("__rshift__ (wrapper)", 0);
11482 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11484 /* function exit code */
11485 __Pyx_RefNannyFinishContext();
11489 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11490 PyObject *__pyx_r = NULL;
11491 __Pyx_RefNannyDeclarations
11492 PyObject *__pyx_t_1 = NULL;
11493 PyObject *__pyx_t_2 = NULL;
11494 PyObject *__pyx_t_3 = NULL;
11495 int __pyx_lineno = 0;
11496 const char *__pyx_filename = NULL;
11497 int __pyx_clineno = 0;
11498 __Pyx_RefNannySetupContext("__rshift__", 0);
11500 /* "lxml/objectify.pyx":698
11502 * def __rshift__(self, other):
11503 * return _numericValueOf(self) >> _numericValueOf(other) # <<<<<<<<<<<<<<
11505 * def __and__(self, other):
11507 __Pyx_XDECREF(__pyx_r);
11508 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
11509 __Pyx_GOTREF(__pyx_t_1);
11510 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
11511 __Pyx_GOTREF(__pyx_t_2);
11512 __pyx_t_3 = PyNumber_Rshift(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
11513 __Pyx_GOTREF(__pyx_t_3);
11514 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11515 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11516 __pyx_r = __pyx_t_3;
11520 /* "lxml/objectify.pyx":697
11521 * return _numericValueOf(self) << _numericValueOf(other)
11523 * def __rshift__(self, other): # <<<<<<<<<<<<<<
11524 * return _numericValueOf(self) >> _numericValueOf(other)
11528 /* function exit code */
11530 __Pyx_XDECREF(__pyx_t_1);
11531 __Pyx_XDECREF(__pyx_t_2);
11532 __Pyx_XDECREF(__pyx_t_3);
11533 __Pyx_AddTraceback("lxml.objectify.NumberElement.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11536 __Pyx_XGIVEREF(__pyx_r);
11537 __Pyx_RefNannyFinishContext();
11541 /* "lxml/objectify.pyx":700
11542 * return _numericValueOf(self) >> _numericValueOf(other)
11544 * def __and__(self, other): # <<<<<<<<<<<<<<
11545 * return _numericValueOf(self) & _numericValueOf(other)
11549 /* Python wrapper */
11550 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_51__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11551 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_51__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11552 PyObject *__pyx_r = 0;
11553 __Pyx_RefNannyDeclarations
11554 __Pyx_RefNannySetupContext("__and__ (wrapper)", 0);
11555 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_50__and__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11557 /* function exit code */
11558 __Pyx_RefNannyFinishContext();
11562 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_50__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11563 PyObject *__pyx_r = NULL;
11564 __Pyx_RefNannyDeclarations
11565 PyObject *__pyx_t_1 = NULL;
11566 PyObject *__pyx_t_2 = NULL;
11567 PyObject *__pyx_t_3 = NULL;
11568 int __pyx_lineno = 0;
11569 const char *__pyx_filename = NULL;
11570 int __pyx_clineno = 0;
11571 __Pyx_RefNannySetupContext("__and__", 0);
11573 /* "lxml/objectify.pyx":701
11575 * def __and__(self, other):
11576 * return _numericValueOf(self) & _numericValueOf(other) # <<<<<<<<<<<<<<
11578 * def __or__(self, other):
11580 __Pyx_XDECREF(__pyx_r);
11581 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
11582 __Pyx_GOTREF(__pyx_t_1);
11583 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
11584 __Pyx_GOTREF(__pyx_t_2);
11585 __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
11586 __Pyx_GOTREF(__pyx_t_3);
11587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11588 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11589 __pyx_r = __pyx_t_3;
11593 /* "lxml/objectify.pyx":700
11594 * return _numericValueOf(self) >> _numericValueOf(other)
11596 * def __and__(self, other): # <<<<<<<<<<<<<<
11597 * return _numericValueOf(self) & _numericValueOf(other)
11601 /* function exit code */
11603 __Pyx_XDECREF(__pyx_t_1);
11604 __Pyx_XDECREF(__pyx_t_2);
11605 __Pyx_XDECREF(__pyx_t_3);
11606 __Pyx_AddTraceback("lxml.objectify.NumberElement.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11609 __Pyx_XGIVEREF(__pyx_r);
11610 __Pyx_RefNannyFinishContext();
11614 /* "lxml/objectify.pyx":703
11615 * return _numericValueOf(self) & _numericValueOf(other)
11617 * def __or__(self, other): # <<<<<<<<<<<<<<
11618 * return _numericValueOf(self) | _numericValueOf(other)
11622 /* Python wrapper */
11623 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_53__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11624 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_53__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11625 PyObject *__pyx_r = 0;
11626 __Pyx_RefNannyDeclarations
11627 __Pyx_RefNannySetupContext("__or__ (wrapper)", 0);
11628 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_52__or__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11630 /* function exit code */
11631 __Pyx_RefNannyFinishContext();
11635 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_52__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11636 PyObject *__pyx_r = NULL;
11637 __Pyx_RefNannyDeclarations
11638 PyObject *__pyx_t_1 = NULL;
11639 PyObject *__pyx_t_2 = NULL;
11640 PyObject *__pyx_t_3 = NULL;
11641 int __pyx_lineno = 0;
11642 const char *__pyx_filename = NULL;
11643 int __pyx_clineno = 0;
11644 __Pyx_RefNannySetupContext("__or__", 0);
11646 /* "lxml/objectify.pyx":704
11648 * def __or__(self, other):
11649 * return _numericValueOf(self) | _numericValueOf(other) # <<<<<<<<<<<<<<
11651 * def __xor__(self, other):
11653 __Pyx_XDECREF(__pyx_r);
11654 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
11655 __Pyx_GOTREF(__pyx_t_1);
11656 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
11657 __Pyx_GOTREF(__pyx_t_2);
11658 __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
11659 __Pyx_GOTREF(__pyx_t_3);
11660 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11661 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11662 __pyx_r = __pyx_t_3;
11666 /* "lxml/objectify.pyx":703
11667 * return _numericValueOf(self) & _numericValueOf(other)
11669 * def __or__(self, other): # <<<<<<<<<<<<<<
11670 * return _numericValueOf(self) | _numericValueOf(other)
11674 /* function exit code */
11676 __Pyx_XDECREF(__pyx_t_1);
11677 __Pyx_XDECREF(__pyx_t_2);
11678 __Pyx_XDECREF(__pyx_t_3);
11679 __Pyx_AddTraceback("lxml.objectify.NumberElement.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11682 __Pyx_XGIVEREF(__pyx_r);
11683 __Pyx_RefNannyFinishContext();
11687 /* "lxml/objectify.pyx":706
11688 * return _numericValueOf(self) | _numericValueOf(other)
11690 * def __xor__(self, other): # <<<<<<<<<<<<<<
11691 * return _numericValueOf(self) ^ _numericValueOf(other)
11695 /* Python wrapper */
11696 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_55__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11697 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_55__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11698 PyObject *__pyx_r = 0;
11699 __Pyx_RefNannyDeclarations
11700 __Pyx_RefNannySetupContext("__xor__ (wrapper)", 0);
11701 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11703 /* function exit code */
11704 __Pyx_RefNannyFinishContext();
11708 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11709 PyObject *__pyx_r = NULL;
11710 __Pyx_RefNannyDeclarations
11711 PyObject *__pyx_t_1 = NULL;
11712 PyObject *__pyx_t_2 = NULL;
11713 PyObject *__pyx_t_3 = NULL;
11714 int __pyx_lineno = 0;
11715 const char *__pyx_filename = NULL;
11716 int __pyx_clineno = 0;
11717 __Pyx_RefNannySetupContext("__xor__", 0);
11719 /* "lxml/objectify.pyx":707
11721 * def __xor__(self, other):
11722 * return _numericValueOf(self) ^ _numericValueOf(other) # <<<<<<<<<<<<<<
11724 * cdef class IntElement(NumberElement):
11726 __Pyx_XDECREF(__pyx_r);
11727 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
11728 __Pyx_GOTREF(__pyx_t_1);
11729 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
11730 __Pyx_GOTREF(__pyx_t_2);
11731 __pyx_t_3 = PyNumber_Xor(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
11732 __Pyx_GOTREF(__pyx_t_3);
11733 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11735 __pyx_r = __pyx_t_3;
11739 /* "lxml/objectify.pyx":706
11740 * return _numericValueOf(self) | _numericValueOf(other)
11742 * def __xor__(self, other): # <<<<<<<<<<<<<<
11743 * return _numericValueOf(self) ^ _numericValueOf(other)
11747 /* function exit code */
11749 __Pyx_XDECREF(__pyx_t_1);
11750 __Pyx_XDECREF(__pyx_t_2);
11751 __Pyx_XDECREF(__pyx_t_3);
11752 __Pyx_AddTraceback("lxml.objectify.NumberElement.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11755 __Pyx_XGIVEREF(__pyx_r);
11756 __Pyx_RefNannyFinishContext();
11760 /* "lxml/objectify.pyx":710
11762 * cdef class IntElement(NumberElement):
11763 * def _init(self): # <<<<<<<<<<<<<<
11764 * self._parse_value = int
11768 /* Python wrapper */
11769 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11770 static PyMethodDef __pyx_mdef_4lxml_9objectify_10IntElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_10IntElement_1_init, METH_NOARGS, 0};
11771 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11772 PyObject *__pyx_r = 0;
11773 __Pyx_RefNannyDeclarations
11774 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
11775 __pyx_r = __pyx_pf_4lxml_9objectify_10IntElement__init(((struct __pyx_obj_4lxml_9objectify_IntElement *)__pyx_v_self));
11777 /* function exit code */
11778 __Pyx_RefNannyFinishContext();
11782 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement__init(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self) {
11783 PyObject *__pyx_r = NULL;
11784 __Pyx_RefNannyDeclarations
11785 __Pyx_RefNannySetupContext("_init", 0);
11787 /* "lxml/objectify.pyx":711
11788 * cdef class IntElement(NumberElement):
11790 * self._parse_value = int # <<<<<<<<<<<<<<
11792 * def __index__(self):
11794 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
11795 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
11796 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
11797 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
11798 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyInt_Type));
11800 /* "lxml/objectify.pyx":710
11802 * cdef class IntElement(NumberElement):
11803 * def _init(self): # <<<<<<<<<<<<<<
11804 * self._parse_value = int
11808 /* function exit code */
11809 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11810 __Pyx_XGIVEREF(__pyx_r);
11811 __Pyx_RefNannyFinishContext();
11815 /* "lxml/objectify.pyx":713
11816 * self._parse_value = int
11818 * def __index__(self): # <<<<<<<<<<<<<<
11819 * return int(_parseNumber(self))
11823 /* Python wrapper */
11824 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_3__index__(PyObject *__pyx_v_self); /*proto*/
11825 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_3__index__(PyObject *__pyx_v_self) {
11826 PyObject *__pyx_r = 0;
11827 __Pyx_RefNannyDeclarations
11828 __Pyx_RefNannySetupContext("__index__ (wrapper)", 0);
11829 __pyx_r = __pyx_pf_4lxml_9objectify_10IntElement_2__index__(((struct __pyx_obj_4lxml_9objectify_IntElement *)__pyx_v_self));
11831 /* function exit code */
11832 __Pyx_RefNannyFinishContext();
11836 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement_2__index__(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self) {
11837 PyObject *__pyx_r = NULL;
11838 __Pyx_RefNannyDeclarations
11839 PyObject *__pyx_t_1 = NULL;
11840 PyObject *__pyx_t_2 = NULL;
11841 int __pyx_lineno = 0;
11842 const char *__pyx_filename = NULL;
11843 int __pyx_clineno = 0;
11844 __Pyx_RefNannySetupContext("__index__", 0);
11846 /* "lxml/objectify.pyx":714
11848 * def __index__(self):
11849 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
11851 * cdef class LongElement(NumberElement):
11853 __Pyx_XDECREF(__pyx_r);
11854 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error)
11855 __Pyx_GOTREF(__pyx_t_1);
11856 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11857 __Pyx_GOTREF(__pyx_t_2);
11858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11859 __pyx_r = __pyx_t_2;
11863 /* "lxml/objectify.pyx":713
11864 * self._parse_value = int
11866 * def __index__(self): # <<<<<<<<<<<<<<
11867 * return int(_parseNumber(self))
11871 /* function exit code */
11873 __Pyx_XDECREF(__pyx_t_1);
11874 __Pyx_XDECREF(__pyx_t_2);
11875 __Pyx_AddTraceback("lxml.objectify.IntElement.__index__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11878 __Pyx_XGIVEREF(__pyx_r);
11879 __Pyx_RefNannyFinishContext();
11883 /* "lxml/objectify.pyx":717
11885 * cdef class LongElement(NumberElement):
11886 * def _init(self): # <<<<<<<<<<<<<<
11887 * self._parse_value = long
11891 /* Python wrapper */
11892 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11893 static PyMethodDef __pyx_mdef_4lxml_9objectify_11LongElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11LongElement_1_init, METH_NOARGS, 0};
11894 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11895 PyObject *__pyx_r = 0;
11896 __Pyx_RefNannyDeclarations
11897 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
11898 __pyx_r = __pyx_pf_4lxml_9objectify_11LongElement__init(((struct __pyx_obj_4lxml_9objectify_LongElement *)__pyx_v_self));
11900 /* function exit code */
11901 __Pyx_RefNannyFinishContext();
11905 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement__init(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self) {
11906 PyObject *__pyx_r = NULL;
11907 __Pyx_RefNannyDeclarations
11908 __Pyx_RefNannySetupContext("_init", 0);
11910 /* "lxml/objectify.pyx":718
11911 * cdef class LongElement(NumberElement):
11913 * self._parse_value = long # <<<<<<<<<<<<<<
11915 * def __index__(self):
11917 __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
11918 __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
11919 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
11920 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
11921 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyLong_Type));
11923 /* "lxml/objectify.pyx":717
11925 * cdef class LongElement(NumberElement):
11926 * def _init(self): # <<<<<<<<<<<<<<
11927 * self._parse_value = long
11931 /* function exit code */
11932 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11933 __Pyx_XGIVEREF(__pyx_r);
11934 __Pyx_RefNannyFinishContext();
11938 /* "lxml/objectify.pyx":720
11939 * self._parse_value = long
11941 * def __index__(self): # <<<<<<<<<<<<<<
11942 * return int(_parseNumber(self))
11946 /* Python wrapper */
11947 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_3__index__(PyObject *__pyx_v_self); /*proto*/
11948 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_3__index__(PyObject *__pyx_v_self) {
11949 PyObject *__pyx_r = 0;
11950 __Pyx_RefNannyDeclarations
11951 __Pyx_RefNannySetupContext("__index__ (wrapper)", 0);
11952 __pyx_r = __pyx_pf_4lxml_9objectify_11LongElement_2__index__(((struct __pyx_obj_4lxml_9objectify_LongElement *)__pyx_v_self));
11954 /* function exit code */
11955 __Pyx_RefNannyFinishContext();
11959 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement_2__index__(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self) {
11960 PyObject *__pyx_r = NULL;
11961 __Pyx_RefNannyDeclarations
11962 PyObject *__pyx_t_1 = NULL;
11963 PyObject *__pyx_t_2 = NULL;
11964 int __pyx_lineno = 0;
11965 const char *__pyx_filename = NULL;
11966 int __pyx_clineno = 0;
11967 __Pyx_RefNannySetupContext("__index__", 0);
11969 /* "lxml/objectify.pyx":721
11971 * def __index__(self):
11972 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
11974 * cdef class FloatElement(NumberElement):
11976 __Pyx_XDECREF(__pyx_r);
11977 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
11978 __Pyx_GOTREF(__pyx_t_1);
11979 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
11980 __Pyx_GOTREF(__pyx_t_2);
11981 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11982 __pyx_r = __pyx_t_2;
11986 /* "lxml/objectify.pyx":720
11987 * self._parse_value = long
11989 * def __index__(self): # <<<<<<<<<<<<<<
11990 * return int(_parseNumber(self))
11994 /* function exit code */
11996 __Pyx_XDECREF(__pyx_t_1);
11997 __Pyx_XDECREF(__pyx_t_2);
11998 __Pyx_AddTraceback("lxml.objectify.LongElement.__index__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12001 __Pyx_XGIVEREF(__pyx_r);
12002 __Pyx_RefNannyFinishContext();
12006 /* "lxml/objectify.pyx":724
12008 * cdef class FloatElement(NumberElement):
12009 * def _init(self): # <<<<<<<<<<<<<<
12010 * self._parse_value = float
12014 /* Python wrapper */
12015 static PyObject *__pyx_pw_4lxml_9objectify_12FloatElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12016 static PyMethodDef __pyx_mdef_4lxml_9objectify_12FloatElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_12FloatElement_1_init, METH_NOARGS, 0};
12017 static PyObject *__pyx_pw_4lxml_9objectify_12FloatElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12018 PyObject *__pyx_r = 0;
12019 __Pyx_RefNannyDeclarations
12020 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
12021 __pyx_r = __pyx_pf_4lxml_9objectify_12FloatElement__init(((struct __pyx_obj_4lxml_9objectify_FloatElement *)__pyx_v_self));
12023 /* function exit code */
12024 __Pyx_RefNannyFinishContext();
12028 static PyObject *__pyx_pf_4lxml_9objectify_12FloatElement__init(struct __pyx_obj_4lxml_9objectify_FloatElement *__pyx_v_self) {
12029 PyObject *__pyx_r = NULL;
12030 __Pyx_RefNannyDeclarations
12031 __Pyx_RefNannySetupContext("_init", 0);
12033 /* "lxml/objectify.pyx":725
12034 * cdef class FloatElement(NumberElement):
12036 * self._parse_value = float # <<<<<<<<<<<<<<
12038 * cdef class StringElement(ObjectifiedDataElement):
12040 __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
12041 __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
12042 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
12043 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
12044 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyFloat_Type));
12046 /* "lxml/objectify.pyx":724
12048 * cdef class FloatElement(NumberElement):
12049 * def _init(self): # <<<<<<<<<<<<<<
12050 * self._parse_value = float
12054 /* function exit code */
12055 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12056 __Pyx_XGIVEREF(__pyx_r);
12057 __Pyx_RefNannyFinishContext();
12061 /* "lxml/objectify.pyx":735
12064 * def pyval(self): # <<<<<<<<<<<<<<
12065 * return textOf(self._c_node) or u''
12069 /* Python wrapper */
12070 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
12071 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(PyObject *__pyx_v_self) {
12072 PyObject *__pyx_r = 0;
12073 __Pyx_RefNannyDeclarations
12074 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12075 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12077 /* function exit code */
12078 __Pyx_RefNannyFinishContext();
12082 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12083 PyObject *__pyx_r = NULL;
12084 __Pyx_RefNannyDeclarations
12085 PyObject *__pyx_t_1 = NULL;
12086 PyObject *__pyx_t_2 = NULL;
12088 int __pyx_lineno = 0;
12089 const char *__pyx_filename = NULL;
12090 int __pyx_clineno = 0;
12091 __Pyx_RefNannySetupContext("__get__", 0);
12093 /* "lxml/objectify.pyx":736
12096 * return textOf(self._c_node) or u'' # <<<<<<<<<<<<<<
12098 * def __repr__(self):
12100 __Pyx_XDECREF(__pyx_r);
12101 __pyx_t_2 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
12102 __Pyx_GOTREF(__pyx_t_2);
12103 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 736, __pyx_L1_error)
12105 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12107 __Pyx_INCREF(__pyx_t_2);
12108 __pyx_t_1 = __pyx_t_2;
12109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12110 goto __pyx_L3_bool_binop_done;
12112 __Pyx_INCREF(__pyx_kp_u_);
12113 __pyx_t_1 = __pyx_kp_u_;
12114 __pyx_L3_bool_binop_done:;
12115 __pyx_r = __pyx_t_1;
12119 /* "lxml/objectify.pyx":735
12122 * def pyval(self): # <<<<<<<<<<<<<<
12123 * return textOf(self._c_node) or u''
12127 /* function exit code */
12129 __Pyx_XDECREF(__pyx_t_1);
12130 __Pyx_XDECREF(__pyx_t_2);
12131 __Pyx_AddTraceback("lxml.objectify.StringElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12134 __Pyx_XGIVEREF(__pyx_r);
12135 __Pyx_RefNannyFinishContext();
12139 /* "lxml/objectify.pyx":738
12140 * return textOf(self._c_node) or u''
12142 * def __repr__(self): # <<<<<<<<<<<<<<
12143 * return repr(textOf(self._c_node) or u'')
12147 /* Python wrapper */
12148 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_1__repr__(PyObject *__pyx_v_self); /*proto*/
12149 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_1__repr__(PyObject *__pyx_v_self) {
12150 PyObject *__pyx_r = 0;
12151 __Pyx_RefNannyDeclarations
12152 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12153 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement___repr__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12155 /* function exit code */
12156 __Pyx_RefNannyFinishContext();
12160 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement___repr__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12161 PyObject *__pyx_r = NULL;
12162 __Pyx_RefNannyDeclarations
12163 PyObject *__pyx_t_1 = NULL;
12164 PyObject *__pyx_t_2 = NULL;
12166 int __pyx_lineno = 0;
12167 const char *__pyx_filename = NULL;
12168 int __pyx_clineno = 0;
12169 __Pyx_RefNannySetupContext("__repr__", 0);
12171 /* "lxml/objectify.pyx":739
12173 * def __repr__(self):
12174 * return repr(textOf(self._c_node) or u'') # <<<<<<<<<<<<<<
12176 * def strlen(self):
12178 __Pyx_XDECREF(__pyx_r);
12179 __pyx_t_2 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
12180 __Pyx_GOTREF(__pyx_t_2);
12181 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
12183 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12185 __Pyx_INCREF(__pyx_t_2);
12186 __pyx_t_1 = __pyx_t_2;
12187 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12188 goto __pyx_L3_bool_binop_done;
12190 __Pyx_INCREF(__pyx_kp_u_);
12191 __pyx_t_1 = __pyx_kp_u_;
12192 __pyx_L3_bool_binop_done:;
12193 __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
12194 __Pyx_GOTREF(__pyx_t_2);
12195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12196 __pyx_r = __pyx_t_2;
12200 /* "lxml/objectify.pyx":738
12201 * return textOf(self._c_node) or u''
12203 * def __repr__(self): # <<<<<<<<<<<<<<
12204 * return repr(textOf(self._c_node) or u'')
12208 /* function exit code */
12210 __Pyx_XDECREF(__pyx_t_1);
12211 __Pyx_XDECREF(__pyx_t_2);
12212 __Pyx_AddTraceback("lxml.objectify.StringElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12215 __Pyx_XGIVEREF(__pyx_r);
12216 __Pyx_RefNannyFinishContext();
12220 /* "lxml/objectify.pyx":741
12221 * return repr(textOf(self._c_node) or u'')
12223 * def strlen(self): # <<<<<<<<<<<<<<
12224 * text = textOf(self._c_node)
12228 /* Python wrapper */
12229 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_3strlen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12230 static PyMethodDef __pyx_mdef_4lxml_9objectify_13StringElement_3strlen = {"strlen", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_3strlen, METH_NOARGS, 0};
12231 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_3strlen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12232 PyObject *__pyx_r = 0;
12233 __Pyx_RefNannyDeclarations
12234 __Pyx_RefNannySetupContext("strlen (wrapper)", 0);
12235 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_2strlen(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12237 /* function exit code */
12238 __Pyx_RefNannyFinishContext();
12242 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_2strlen(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12243 PyObject *__pyx_v_text = NULL;
12244 PyObject *__pyx_r = NULL;
12245 __Pyx_RefNannyDeclarations
12246 PyObject *__pyx_t_1 = NULL;
12249 Py_ssize_t __pyx_t_4;
12250 int __pyx_lineno = 0;
12251 const char *__pyx_filename = NULL;
12252 int __pyx_clineno = 0;
12253 __Pyx_RefNannySetupContext("strlen", 0);
12255 /* "lxml/objectify.pyx":742
12257 * def strlen(self):
12258 * text = textOf(self._c_node) # <<<<<<<<<<<<<<
12262 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
12263 __Pyx_GOTREF(__pyx_t_1);
12264 __pyx_v_text = __pyx_t_1;
12267 /* "lxml/objectify.pyx":743
12268 * def strlen(self):
12269 * text = textOf(self._c_node)
12270 * if text is None: # <<<<<<<<<<<<<<
12274 __pyx_t_2 = (__pyx_v_text == Py_None);
12275 __pyx_t_3 = (__pyx_t_2 != 0);
12278 /* "lxml/objectify.pyx":744
12279 * text = textOf(self._c_node)
12281 * return 0 # <<<<<<<<<<<<<<
12285 __Pyx_XDECREF(__pyx_r);
12286 __Pyx_INCREF(__pyx_int_0);
12287 __pyx_r = __pyx_int_0;
12290 /* "lxml/objectify.pyx":743
12291 * def strlen(self):
12292 * text = textOf(self._c_node)
12293 * if text is None: # <<<<<<<<<<<<<<
12299 /* "lxml/objectify.pyx":746
12302 * return len(text) # <<<<<<<<<<<<<<
12304 * def __nonzero__(self):
12307 __Pyx_XDECREF(__pyx_r);
12308 __pyx_t_4 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 746, __pyx_L1_error)
12309 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
12310 __Pyx_GOTREF(__pyx_t_1);
12311 __pyx_r = __pyx_t_1;
12316 /* "lxml/objectify.pyx":741
12317 * return repr(textOf(self._c_node) or u'')
12319 * def strlen(self): # <<<<<<<<<<<<<<
12320 * text = textOf(self._c_node)
12324 /* function exit code */
12326 __Pyx_XDECREF(__pyx_t_1);
12327 __Pyx_AddTraceback("lxml.objectify.StringElement.strlen", __pyx_clineno, __pyx_lineno, __pyx_filename);
12330 __Pyx_XDECREF(__pyx_v_text);
12331 __Pyx_XGIVEREF(__pyx_r);
12332 __Pyx_RefNannyFinishContext();
12336 /* "lxml/objectify.pyx":748
12339 * def __nonzero__(self): # <<<<<<<<<<<<<<
12340 * return bool(textOf(self._c_node))
12344 /* Python wrapper */
12345 static int __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
12346 static int __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__(PyObject *__pyx_v_self) {
12348 __Pyx_RefNannyDeclarations
12349 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
12350 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12352 /* function exit code */
12353 __Pyx_RefNannyFinishContext();
12357 static int __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12359 __Pyx_RefNannyDeclarations
12360 PyObject *__pyx_t_1 = NULL;
12362 int __pyx_lineno = 0;
12363 const char *__pyx_filename = NULL;
12364 int __pyx_clineno = 0;
12365 __Pyx_RefNannySetupContext("__nonzero__", 0);
12367 /* "lxml/objectify.pyx":749
12369 * def __nonzero__(self):
12370 * return bool(textOf(self._c_node)) # <<<<<<<<<<<<<<
12372 * def __richcmp__(self, other, int op):
12374 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
12375 __Pyx_GOTREF(__pyx_t_1);
12376 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 749, __pyx_L1_error)
12377 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12378 __pyx_r = (!(!__pyx_t_2));
12381 /* "lxml/objectify.pyx":748
12384 * def __nonzero__(self): # <<<<<<<<<<<<<<
12385 * return bool(textOf(self._c_node))
12389 /* function exit code */
12391 __Pyx_XDECREF(__pyx_t_1);
12392 __Pyx_AddTraceback("lxml.objectify.StringElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12395 __Pyx_RefNannyFinishContext();
12399 /* "lxml/objectify.pyx":751
12400 * return bool(textOf(self._c_node))
12402 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
12403 * return _richcmpPyvals(self, other, op)
12407 /* Python wrapper */
12408 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
12409 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
12410 PyObject *__pyx_r = 0;
12411 __Pyx_RefNannyDeclarations
12412 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
12413 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_6__richcmp__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
12415 /* function exit code */
12416 __Pyx_RefNannyFinishContext();
12420 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_6__richcmp__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
12421 PyObject *__pyx_r = NULL;
12422 __Pyx_RefNannyDeclarations
12423 PyObject *__pyx_t_1 = NULL;
12424 int __pyx_lineno = 0;
12425 const char *__pyx_filename = NULL;
12426 int __pyx_clineno = 0;
12427 __Pyx_RefNannySetupContext("__richcmp__", 0);
12429 /* "lxml/objectify.pyx":752
12431 * def __richcmp__(self, other, int op):
12432 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
12434 * def __hash__(self):
12436 __Pyx_XDECREF(__pyx_r);
12437 __pyx_t_1 = __pyx_f_4lxml_9objectify__richcmpPyvals(((PyObject *)__pyx_v_self), __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
12438 __Pyx_GOTREF(__pyx_t_1);
12439 __pyx_r = __pyx_t_1;
12443 /* "lxml/objectify.pyx":751
12444 * return bool(textOf(self._c_node))
12446 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
12447 * return _richcmpPyvals(self, other, op)
12451 /* function exit code */
12453 __Pyx_XDECREF(__pyx_t_1);
12454 __Pyx_AddTraceback("lxml.objectify.StringElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12457 __Pyx_XGIVEREF(__pyx_r);
12458 __Pyx_RefNannyFinishContext();
12462 /* "lxml/objectify.pyx":754
12463 * return _richcmpPyvals(self, other, op)
12465 * def __hash__(self): # <<<<<<<<<<<<<<
12466 * return hash(textOf(self._c_node) or u'')
12470 /* Python wrapper */
12471 static Py_hash_t __pyx_pw_4lxml_9objectify_13StringElement_9__hash__(PyObject *__pyx_v_self); /*proto*/
12472 static Py_hash_t __pyx_pw_4lxml_9objectify_13StringElement_9__hash__(PyObject *__pyx_v_self) {
12474 __Pyx_RefNannyDeclarations
12475 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
12476 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12478 /* function exit code */
12479 __Pyx_RefNannyFinishContext();
12483 static Py_hash_t __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12485 __Pyx_RefNannyDeclarations
12486 PyObject *__pyx_t_1 = NULL;
12487 PyObject *__pyx_t_2 = NULL;
12489 Py_hash_t __pyx_t_4;
12490 int __pyx_lineno = 0;
12491 const char *__pyx_filename = NULL;
12492 int __pyx_clineno = 0;
12493 __Pyx_RefNannySetupContext("__hash__", 0);
12495 /* "lxml/objectify.pyx":755
12497 * def __hash__(self):
12498 * return hash(textOf(self._c_node) or u'') # <<<<<<<<<<<<<<
12500 * def __add__(self, other):
12502 __pyx_t_2 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
12503 __Pyx_GOTREF(__pyx_t_2);
12504 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
12506 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12508 __Pyx_INCREF(__pyx_t_2);
12509 __pyx_t_1 = __pyx_t_2;
12510 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12511 goto __pyx_L3_bool_binop_done;
12513 __Pyx_INCREF(__pyx_kp_u_);
12514 __pyx_t_1 = __pyx_kp_u_;
12515 __pyx_L3_bool_binop_done:;
12516 __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(0, 755, __pyx_L1_error)
12517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12518 __pyx_r = __pyx_t_4;
12521 /* "lxml/objectify.pyx":754
12522 * return _richcmpPyvals(self, other, op)
12524 * def __hash__(self): # <<<<<<<<<<<<<<
12525 * return hash(textOf(self._c_node) or u'')
12529 /* function exit code */
12531 __Pyx_XDECREF(__pyx_t_1);
12532 __Pyx_XDECREF(__pyx_t_2);
12533 __Pyx_AddTraceback("lxml.objectify.StringElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12536 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
12537 __Pyx_RefNannyFinishContext();
12541 /* "lxml/objectify.pyx":757
12542 * return hash(textOf(self._c_node) or u'')
12544 * def __add__(self, other): # <<<<<<<<<<<<<<
12545 * text = _strValueOf(self)
12546 * other = _strValueOf(other)
12549 /* Python wrapper */
12550 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12551 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12552 PyObject *__pyx_r = 0;
12553 __Pyx_RefNannyDeclarations
12554 __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
12555 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_10__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12557 /* function exit code */
12558 __Pyx_RefNannyFinishContext();
12562 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_10__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12563 PyObject *__pyx_v_text = NULL;
12564 PyObject *__pyx_r = NULL;
12565 __Pyx_RefNannyDeclarations
12566 PyObject *__pyx_t_1 = NULL;
12569 int __pyx_lineno = 0;
12570 const char *__pyx_filename = NULL;
12571 int __pyx_clineno = 0;
12572 __Pyx_RefNannySetupContext("__add__", 0);
12573 __Pyx_INCREF(__pyx_v_other);
12575 /* "lxml/objectify.pyx":758
12577 * def __add__(self, other):
12578 * text = _strValueOf(self) # <<<<<<<<<<<<<<
12579 * other = _strValueOf(other)
12582 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
12583 __Pyx_GOTREF(__pyx_t_1);
12584 __pyx_v_text = __pyx_t_1;
12587 /* "lxml/objectify.pyx":759
12588 * def __add__(self, other):
12589 * text = _strValueOf(self)
12590 * other = _strValueOf(other) # <<<<<<<<<<<<<<
12594 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
12595 __Pyx_GOTREF(__pyx_t_1);
12596 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_1);
12599 /* "lxml/objectify.pyx":760
12600 * text = _strValueOf(self)
12601 * other = _strValueOf(other)
12602 * if text is None: # <<<<<<<<<<<<<<
12604 * if other is None:
12606 __pyx_t_2 = (__pyx_v_text == Py_None);
12607 __pyx_t_3 = (__pyx_t_2 != 0);
12610 /* "lxml/objectify.pyx":761
12611 * other = _strValueOf(other)
12613 * return other # <<<<<<<<<<<<<<
12614 * if other is None:
12617 __Pyx_XDECREF(__pyx_r);
12618 __Pyx_INCREF(__pyx_v_other);
12619 __pyx_r = __pyx_v_other;
12622 /* "lxml/objectify.pyx":760
12623 * text = _strValueOf(self)
12624 * other = _strValueOf(other)
12625 * if text is None: # <<<<<<<<<<<<<<
12627 * if other is None:
12631 /* "lxml/objectify.pyx":762
12634 * if other is None: # <<<<<<<<<<<<<<
12636 * return text + other
12638 __pyx_t_3 = (__pyx_v_other == Py_None);
12639 __pyx_t_2 = (__pyx_t_3 != 0);
12642 /* "lxml/objectify.pyx":763
12644 * if other is None:
12645 * return text # <<<<<<<<<<<<<<
12646 * return text + other
12649 __Pyx_XDECREF(__pyx_r);
12650 __Pyx_INCREF(__pyx_v_text);
12651 __pyx_r = __pyx_v_text;
12654 /* "lxml/objectify.pyx":762
12657 * if other is None: # <<<<<<<<<<<<<<
12659 * return text + other
12663 /* "lxml/objectify.pyx":764
12664 * if other is None:
12666 * return text + other # <<<<<<<<<<<<<<
12668 * def __mul__(self, other):
12670 __Pyx_XDECREF(__pyx_r);
12671 __pyx_t_1 = PyNumber_Add(__pyx_v_text, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
12672 __Pyx_GOTREF(__pyx_t_1);
12673 __pyx_r = __pyx_t_1;
12677 /* "lxml/objectify.pyx":757
12678 * return hash(textOf(self._c_node) or u'')
12680 * def __add__(self, other): # <<<<<<<<<<<<<<
12681 * text = _strValueOf(self)
12682 * other = _strValueOf(other)
12685 /* function exit code */
12687 __Pyx_XDECREF(__pyx_t_1);
12688 __Pyx_AddTraceback("lxml.objectify.StringElement.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12691 __Pyx_XDECREF(__pyx_v_text);
12692 __Pyx_XDECREF(__pyx_v_other);
12693 __Pyx_XGIVEREF(__pyx_r);
12694 __Pyx_RefNannyFinishContext();
12698 /* "lxml/objectify.pyx":766
12699 * return text + other
12701 * def __mul__(self, other): # <<<<<<<<<<<<<<
12702 * if isinstance(self, StringElement):
12703 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12706 /* Python wrapper */
12707 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_13__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12708 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_13__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12709 PyObject *__pyx_r = 0;
12710 __Pyx_RefNannyDeclarations
12711 __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
12712 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_12__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12714 /* function exit code */
12715 __Pyx_RefNannyFinishContext();
12719 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_12__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12720 PyObject *__pyx_r = NULL;
12721 __Pyx_RefNannyDeclarations
12724 PyObject *__pyx_t_3 = NULL;
12725 PyObject *__pyx_t_4 = NULL;
12726 PyObject *__pyx_t_5 = NULL;
12727 int __pyx_lineno = 0;
12728 const char *__pyx_filename = NULL;
12729 int __pyx_clineno = 0;
12730 __Pyx_RefNannySetupContext("__mul__", 0);
12732 /* "lxml/objectify.pyx":767
12734 * def __mul__(self, other):
12735 * if isinstance(self, StringElement): # <<<<<<<<<<<<<<
12736 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12737 * elif isinstance(other, StringElement):
12739 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_4lxml_9objectify_StringElement);
12740 __pyx_t_2 = (__pyx_t_1 != 0);
12743 /* "lxml/objectify.pyx":768
12744 * def __mul__(self, other):
12745 * if isinstance(self, StringElement):
12746 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other) # <<<<<<<<<<<<<<
12747 * elif isinstance(other, StringElement):
12748 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12750 __Pyx_XDECREF(__pyx_r);
12751 __pyx_t_3 = textOf(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
12752 __Pyx_GOTREF(__pyx_t_3);
12753 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
12754 __Pyx_GOTREF(__pyx_t_4);
12755 __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error)
12756 __Pyx_GOTREF(__pyx_t_5);
12757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12758 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12759 __pyx_r = __pyx_t_5;
12763 /* "lxml/objectify.pyx":767
12765 * def __mul__(self, other):
12766 * if isinstance(self, StringElement): # <<<<<<<<<<<<<<
12767 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12768 * elif isinstance(other, StringElement):
12772 /* "lxml/objectify.pyx":769
12773 * if isinstance(self, StringElement):
12774 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12775 * elif isinstance(other, StringElement): # <<<<<<<<<<<<<<
12776 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12779 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_4lxml_9objectify_StringElement);
12780 __pyx_t_1 = (__pyx_t_2 != 0);
12781 if (likely(__pyx_t_1)) {
12783 /* "lxml/objectify.pyx":770
12784 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12785 * elif isinstance(other, StringElement):
12786 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node) # <<<<<<<<<<<<<<
12788 * raise TypeError, u"invalid types for * operator"
12790 __Pyx_XDECREF(__pyx_r);
12791 __pyx_t_5 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
12792 __Pyx_GOTREF(__pyx_t_5);
12793 __pyx_t_4 = textOf(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_other)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error)
12794 __Pyx_GOTREF(__pyx_t_4);
12795 __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
12796 __Pyx_GOTREF(__pyx_t_3);
12797 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12798 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12799 __pyx_r = __pyx_t_3;
12803 /* "lxml/objectify.pyx":769
12804 * if isinstance(self, StringElement):
12805 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12806 * elif isinstance(other, StringElement): # <<<<<<<<<<<<<<
12807 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12812 /* "lxml/objectify.pyx":772
12813 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12815 * raise TypeError, u"invalid types for * operator" # <<<<<<<<<<<<<<
12817 * def __mod__(self, other):
12820 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_types_for_operator, 0, 0);
12821 __PYX_ERR(0, 772, __pyx_L1_error)
12824 /* "lxml/objectify.pyx":766
12825 * return text + other
12827 * def __mul__(self, other): # <<<<<<<<<<<<<<
12828 * if isinstance(self, StringElement):
12829 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12832 /* function exit code */
12834 __Pyx_XDECREF(__pyx_t_3);
12835 __Pyx_XDECREF(__pyx_t_4);
12836 __Pyx_XDECREF(__pyx_t_5);
12837 __Pyx_AddTraceback("lxml.objectify.StringElement.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12840 __Pyx_XGIVEREF(__pyx_r);
12841 __Pyx_RefNannyFinishContext();
12845 /* "lxml/objectify.pyx":774
12846 * raise TypeError, u"invalid types for * operator"
12848 * def __mod__(self, other): # <<<<<<<<<<<<<<
12849 * return _strValueOf(self) % other
12853 /* Python wrapper */
12854 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_15__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12855 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_15__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12856 PyObject *__pyx_r = 0;
12857 __Pyx_RefNannyDeclarations
12858 __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
12859 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_14__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12861 /* function exit code */
12862 __Pyx_RefNannyFinishContext();
12866 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_14__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12867 PyObject *__pyx_r = NULL;
12868 __Pyx_RefNannyDeclarations
12869 PyObject *__pyx_t_1 = NULL;
12870 PyObject *__pyx_t_2 = NULL;
12871 int __pyx_lineno = 0;
12872 const char *__pyx_filename = NULL;
12873 int __pyx_clineno = 0;
12874 __Pyx_RefNannySetupContext("__mod__", 0);
12876 /* "lxml/objectify.pyx":775
12878 * def __mod__(self, other):
12879 * return _strValueOf(self) % other # <<<<<<<<<<<<<<
12881 * def __int__(self):
12883 __Pyx_XDECREF(__pyx_r);
12884 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
12885 __Pyx_GOTREF(__pyx_t_1);
12886 __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
12887 __Pyx_GOTREF(__pyx_t_2);
12888 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12889 __pyx_r = __pyx_t_2;
12893 /* "lxml/objectify.pyx":774
12894 * raise TypeError, u"invalid types for * operator"
12896 * def __mod__(self, other): # <<<<<<<<<<<<<<
12897 * return _strValueOf(self) % other
12901 /* function exit code */
12903 __Pyx_XDECREF(__pyx_t_1);
12904 __Pyx_XDECREF(__pyx_t_2);
12905 __Pyx_AddTraceback("lxml.objectify.StringElement.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12908 __Pyx_XGIVEREF(__pyx_r);
12909 __Pyx_RefNannyFinishContext();
12913 /* "lxml/objectify.pyx":777
12914 * return _strValueOf(self) % other
12916 * def __int__(self): # <<<<<<<<<<<<<<
12917 * return int(textOf(self._c_node))
12921 /* Python wrapper */
12922 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_17__int__(PyObject *__pyx_v_self); /*proto*/
12923 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_17__int__(PyObject *__pyx_v_self) {
12924 PyObject *__pyx_r = 0;
12925 __Pyx_RefNannyDeclarations
12926 __Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
12927 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_16__int__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12929 /* function exit code */
12930 __Pyx_RefNannyFinishContext();
12934 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_16__int__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12935 PyObject *__pyx_r = NULL;
12936 __Pyx_RefNannyDeclarations
12937 PyObject *__pyx_t_1 = NULL;
12938 PyObject *__pyx_t_2 = NULL;
12939 int __pyx_lineno = 0;
12940 const char *__pyx_filename = NULL;
12941 int __pyx_clineno = 0;
12942 __Pyx_RefNannySetupContext("__int__", 0);
12944 /* "lxml/objectify.pyx":778
12946 * def __int__(self):
12947 * return int(textOf(self._c_node)) # <<<<<<<<<<<<<<
12949 * def __long__(self):
12951 __Pyx_XDECREF(__pyx_r);
12952 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error)
12953 __Pyx_GOTREF(__pyx_t_1);
12954 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error)
12955 __Pyx_GOTREF(__pyx_t_2);
12956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12957 __pyx_r = __pyx_t_2;
12961 /* "lxml/objectify.pyx":777
12962 * return _strValueOf(self) % other
12964 * def __int__(self): # <<<<<<<<<<<<<<
12965 * return int(textOf(self._c_node))
12969 /* function exit code */
12971 __Pyx_XDECREF(__pyx_t_1);
12972 __Pyx_XDECREF(__pyx_t_2);
12973 __Pyx_AddTraceback("lxml.objectify.StringElement.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12976 __Pyx_XGIVEREF(__pyx_r);
12977 __Pyx_RefNannyFinishContext();
12981 /* "lxml/objectify.pyx":780
12982 * return int(textOf(self._c_node))
12984 * def __long__(self): # <<<<<<<<<<<<<<
12985 * return long(textOf(self._c_node))
12989 /* Python wrapper */
12990 #if PY_MAJOR_VERSION < 3
12991 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_19__long__(PyObject *__pyx_v_self); /*proto*/
12992 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_19__long__(PyObject *__pyx_v_self) {
12993 PyObject *__pyx_r = 0;
12994 __Pyx_RefNannyDeclarations
12995 __Pyx_RefNannySetupContext("__long__ (wrapper)", 0);
12996 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_18__long__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12998 /* function exit code */
12999 __Pyx_RefNannyFinishContext();
13002 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
13004 #if PY_MAJOR_VERSION < 3
13005 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_18__long__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13006 PyObject *__pyx_r = NULL;
13007 __Pyx_RefNannyDeclarations
13008 PyObject *__pyx_t_1 = NULL;
13009 PyObject *__pyx_t_2 = NULL;
13010 int __pyx_lineno = 0;
13011 const char *__pyx_filename = NULL;
13012 int __pyx_clineno = 0;
13013 __Pyx_RefNannySetupContext("__long__", 0);
13015 /* "lxml/objectify.pyx":781
13017 * def __long__(self):
13018 * return long(textOf(self._c_node)) # <<<<<<<<<<<<<<
13020 * def __float__(self):
13022 __Pyx_XDECREF(__pyx_r);
13023 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error)
13024 __Pyx_GOTREF(__pyx_t_1);
13025 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyLong_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
13026 __Pyx_GOTREF(__pyx_t_2);
13027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13028 __pyx_r = __pyx_t_2;
13032 /* "lxml/objectify.pyx":780
13033 * return int(textOf(self._c_node))
13035 * def __long__(self): # <<<<<<<<<<<<<<
13036 * return long(textOf(self._c_node))
13040 /* function exit code */
13042 __Pyx_XDECREF(__pyx_t_1);
13043 __Pyx_XDECREF(__pyx_t_2);
13044 __Pyx_AddTraceback("lxml.objectify.StringElement.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13047 __Pyx_XGIVEREF(__pyx_r);
13048 __Pyx_RefNannyFinishContext();
13051 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
13053 /* "lxml/objectify.pyx":783
13054 * return long(textOf(self._c_node))
13056 * def __float__(self): # <<<<<<<<<<<<<<
13057 * return float(textOf(self._c_node))
13061 /* Python wrapper */
13062 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_21__float__(PyObject *__pyx_v_self); /*proto*/
13063 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_21__float__(PyObject *__pyx_v_self) {
13064 PyObject *__pyx_r = 0;
13065 __Pyx_RefNannyDeclarations
13066 __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
13067 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_20__float__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
13069 /* function exit code */
13070 __Pyx_RefNannyFinishContext();
13074 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_20__float__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13075 PyObject *__pyx_r = NULL;
13076 __Pyx_RefNannyDeclarations
13077 PyObject *__pyx_t_1 = NULL;
13078 PyObject *__pyx_t_2 = NULL;
13079 int __pyx_lineno = 0;
13080 const char *__pyx_filename = NULL;
13081 int __pyx_clineno = 0;
13082 __Pyx_RefNannySetupContext("__float__", 0);
13084 /* "lxml/objectify.pyx":784
13086 * def __float__(self):
13087 * return float(textOf(self._c_node)) # <<<<<<<<<<<<<<
13089 * def __complex__(self):
13091 __Pyx_XDECREF(__pyx_r);
13092 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
13093 __Pyx_GOTREF(__pyx_t_1);
13094 __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
13095 __Pyx_GOTREF(__pyx_t_2);
13096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13097 __pyx_r = __pyx_t_2;
13101 /* "lxml/objectify.pyx":783
13102 * return long(textOf(self._c_node))
13104 * def __float__(self): # <<<<<<<<<<<<<<
13105 * return float(textOf(self._c_node))
13109 /* function exit code */
13111 __Pyx_XDECREF(__pyx_t_1);
13112 __Pyx_XDECREF(__pyx_t_2);
13113 __Pyx_AddTraceback("lxml.objectify.StringElement.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13116 __Pyx_XGIVEREF(__pyx_r);
13117 __Pyx_RefNannyFinishContext();
13121 /* "lxml/objectify.pyx":786
13122 * return float(textOf(self._c_node))
13124 * def __complex__(self): # <<<<<<<<<<<<<<
13125 * return complex(textOf(self._c_node))
13129 /* Python wrapper */
13130 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_23__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13131 static PyMethodDef __pyx_mdef_4lxml_9objectify_13StringElement_23__complex__ = {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_23__complex__, METH_NOARGS, 0};
13132 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_23__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13133 PyObject *__pyx_r = 0;
13134 __Pyx_RefNannyDeclarations
13135 __Pyx_RefNannySetupContext("__complex__ (wrapper)", 0);
13136 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_22__complex__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
13138 /* function exit code */
13139 __Pyx_RefNannyFinishContext();
13143 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_22__complex__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13144 PyObject *__pyx_r = NULL;
13145 __Pyx_RefNannyDeclarations
13146 PyObject *__pyx_t_1 = NULL;
13147 PyObject *__pyx_t_2 = NULL;
13148 int __pyx_lineno = 0;
13149 const char *__pyx_filename = NULL;
13150 int __pyx_clineno = 0;
13151 __Pyx_RefNannySetupContext("__complex__", 0);
13153 /* "lxml/objectify.pyx":787
13155 * def __complex__(self):
13156 * return complex(textOf(self._c_node)) # <<<<<<<<<<<<<<
13158 * cdef class NoneElement(ObjectifiedDataElement):
13160 __Pyx_XDECREF(__pyx_r);
13161 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
13162 __Pyx_GOTREF(__pyx_t_1);
13163 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
13164 __Pyx_GOTREF(__pyx_t_2);
13165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13166 __pyx_r = __pyx_t_2;
13170 /* "lxml/objectify.pyx":786
13171 * return float(textOf(self._c_node))
13173 * def __complex__(self): # <<<<<<<<<<<<<<
13174 * return complex(textOf(self._c_node))
13178 /* function exit code */
13180 __Pyx_XDECREF(__pyx_t_1);
13181 __Pyx_XDECREF(__pyx_t_2);
13182 __Pyx_AddTraceback("lxml.objectify.StringElement.__complex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13185 __Pyx_XGIVEREF(__pyx_r);
13186 __Pyx_RefNannyFinishContext();
13190 /* "lxml/objectify.pyx":790
13192 * cdef class NoneElement(ObjectifiedDataElement):
13193 * def __str__(self): # <<<<<<<<<<<<<<
13198 /* Python wrapper */
13199 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_1__str__(PyObject *__pyx_v_self); /*proto*/
13200 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_1__str__(PyObject *__pyx_v_self) {
13201 PyObject *__pyx_r = 0;
13202 __Pyx_RefNannyDeclarations
13203 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13204 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement___str__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13206 /* function exit code */
13207 __Pyx_RefNannyFinishContext();
13211 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement___str__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13212 PyObject *__pyx_r = NULL;
13213 __Pyx_RefNannyDeclarations
13214 __Pyx_RefNannySetupContext("__str__", 0);
13216 /* "lxml/objectify.pyx":791
13217 * cdef class NoneElement(ObjectifiedDataElement):
13218 * def __str__(self):
13219 * return u"None" # <<<<<<<<<<<<<<
13221 * def __repr__(self):
13223 __Pyx_XDECREF(__pyx_r);
13224 __Pyx_INCREF(__pyx_n_u_None);
13225 __pyx_r = __pyx_n_u_None;
13228 /* "lxml/objectify.pyx":790
13230 * cdef class NoneElement(ObjectifiedDataElement):
13231 * def __str__(self): # <<<<<<<<<<<<<<
13236 /* function exit code */
13238 __Pyx_XGIVEREF(__pyx_r);
13239 __Pyx_RefNannyFinishContext();
13243 /* "lxml/objectify.pyx":793
13246 * def __repr__(self): # <<<<<<<<<<<<<<
13251 /* Python wrapper */
13252 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_3__repr__(PyObject *__pyx_v_self); /*proto*/
13253 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_3__repr__(PyObject *__pyx_v_self) {
13254 PyObject *__pyx_r = 0;
13255 __Pyx_RefNannyDeclarations
13256 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13257 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13259 /* function exit code */
13260 __Pyx_RefNannyFinishContext();
13264 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13265 PyObject *__pyx_r = NULL;
13266 __Pyx_RefNannyDeclarations
13267 __Pyx_RefNannySetupContext("__repr__", 0);
13269 /* "lxml/objectify.pyx":794
13271 * def __repr__(self):
13272 * return "None" # <<<<<<<<<<<<<<
13274 * def __nonzero__(self):
13276 __Pyx_XDECREF(__pyx_r);
13277 __Pyx_INCREF(__pyx_n_s_None);
13278 __pyx_r = __pyx_n_s_None;
13281 /* "lxml/objectify.pyx":793
13284 * def __repr__(self): # <<<<<<<<<<<<<<
13289 /* function exit code */
13291 __Pyx_XGIVEREF(__pyx_r);
13292 __Pyx_RefNannyFinishContext();
13296 /* "lxml/objectify.pyx":796
13299 * def __nonzero__(self): # <<<<<<<<<<<<<<
13304 /* Python wrapper */
13305 static int __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
13306 static int __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__(PyObject *__pyx_v_self) {
13308 __Pyx_RefNannyDeclarations
13309 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
13310 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13312 /* function exit code */
13313 __Pyx_RefNannyFinishContext();
13317 static int __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13319 __Pyx_RefNannyDeclarations
13320 __Pyx_RefNannySetupContext("__nonzero__", 0);
13322 /* "lxml/objectify.pyx":797
13324 * def __nonzero__(self):
13325 * return False # <<<<<<<<<<<<<<
13327 * def __richcmp__(self, other, int op):
13332 /* "lxml/objectify.pyx":796
13335 * def __nonzero__(self): # <<<<<<<<<<<<<<
13340 /* function exit code */
13342 __Pyx_RefNannyFinishContext();
13346 /* "lxml/objectify.pyx":799
13349 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13350 * if other is None or self is None:
13351 * return python.PyObject_RichCompare(None, None, op)
13354 /* Python wrapper */
13355 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
13356 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13357 PyObject *__pyx_r = 0;
13358 __Pyx_RefNannyDeclarations
13359 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
13360 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_6__richcmp__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
13362 /* function exit code */
13363 __Pyx_RefNannyFinishContext();
13367 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_6__richcmp__(struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13368 PyObject *__pyx_r = NULL;
13369 __Pyx_RefNannyDeclarations
13373 PyObject *__pyx_t_4 = NULL;
13374 int __pyx_lineno = 0;
13375 const char *__pyx_filename = NULL;
13376 int __pyx_clineno = 0;
13377 __Pyx_RefNannySetupContext("__richcmp__", 0);
13379 /* "lxml/objectify.pyx":800
13381 * def __richcmp__(self, other, int op):
13382 * if other is None or self is None: # <<<<<<<<<<<<<<
13383 * return python.PyObject_RichCompare(None, None, op)
13384 * if isinstance(self, NoneElement):
13386 __pyx_t_2 = (__pyx_v_other == Py_None);
13387 __pyx_t_3 = (__pyx_t_2 != 0);
13390 __pyx_t_1 = __pyx_t_3;
13391 goto __pyx_L4_bool_binop_done;
13393 __pyx_t_3 = (((PyObject *)__pyx_v_self) == Py_None);
13394 __pyx_t_2 = (__pyx_t_3 != 0);
13395 __pyx_t_1 = __pyx_t_2;
13396 __pyx_L4_bool_binop_done:;
13399 /* "lxml/objectify.pyx":801
13400 * def __richcmp__(self, other, int op):
13401 * if other is None or self is None:
13402 * return python.PyObject_RichCompare(None, None, op) # <<<<<<<<<<<<<<
13403 * if isinstance(self, NoneElement):
13404 * return python.PyObject_RichCompare(None, other, op)
13406 __Pyx_XDECREF(__pyx_r);
13407 __pyx_t_4 = PyObject_RichCompare(Py_None, Py_None, __pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error)
13408 __Pyx_GOTREF(__pyx_t_4);
13409 __pyx_r = __pyx_t_4;
13413 /* "lxml/objectify.pyx":800
13415 * def __richcmp__(self, other, int op):
13416 * if other is None or self is None: # <<<<<<<<<<<<<<
13417 * return python.PyObject_RichCompare(None, None, op)
13418 * if isinstance(self, NoneElement):
13422 /* "lxml/objectify.pyx":802
13423 * if other is None or self is None:
13424 * return python.PyObject_RichCompare(None, None, op)
13425 * if isinstance(self, NoneElement): # <<<<<<<<<<<<<<
13426 * return python.PyObject_RichCompare(None, other, op)
13429 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_9objectify_NoneElement);
13430 __pyx_t_2 = (__pyx_t_1 != 0);
13433 /* "lxml/objectify.pyx":803
13434 * return python.PyObject_RichCompare(None, None, op)
13435 * if isinstance(self, NoneElement):
13436 * return python.PyObject_RichCompare(None, other, op) # <<<<<<<<<<<<<<
13438 * return python.PyObject_RichCompare(self, None, op)
13440 __Pyx_XDECREF(__pyx_r);
13441 __pyx_t_4 = PyObject_RichCompare(Py_None, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error)
13442 __Pyx_GOTREF(__pyx_t_4);
13443 __pyx_r = __pyx_t_4;
13447 /* "lxml/objectify.pyx":802
13448 * if other is None or self is None:
13449 * return python.PyObject_RichCompare(None, None, op)
13450 * if isinstance(self, NoneElement): # <<<<<<<<<<<<<<
13451 * return python.PyObject_RichCompare(None, other, op)
13456 /* "lxml/objectify.pyx":805
13457 * return python.PyObject_RichCompare(None, other, op)
13459 * return python.PyObject_RichCompare(self, None, op) # <<<<<<<<<<<<<<
13461 * def __hash__(self):
13464 __Pyx_XDECREF(__pyx_r);
13465 __pyx_t_4 = PyObject_RichCompare(((PyObject *)__pyx_v_self), Py_None, __pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error)
13466 __Pyx_GOTREF(__pyx_t_4);
13467 __pyx_r = __pyx_t_4;
13472 /* "lxml/objectify.pyx":799
13475 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13476 * if other is None or self is None:
13477 * return python.PyObject_RichCompare(None, None, op)
13480 /* function exit code */
13482 __Pyx_XDECREF(__pyx_t_4);
13483 __Pyx_AddTraceback("lxml.objectify.NoneElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13486 __Pyx_XGIVEREF(__pyx_r);
13487 __Pyx_RefNannyFinishContext();
13491 /* "lxml/objectify.pyx":807
13492 * return python.PyObject_RichCompare(self, None, op)
13494 * def __hash__(self): # <<<<<<<<<<<<<<
13495 * return hash(None)
13499 /* Python wrapper */
13500 static Py_hash_t __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__(PyObject *__pyx_v_self); /*proto*/
13501 static Py_hash_t __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__(PyObject *__pyx_v_self) {
13503 __Pyx_RefNannyDeclarations
13504 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
13505 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13507 /* function exit code */
13508 __Pyx_RefNannyFinishContext();
13512 static Py_hash_t __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13514 __Pyx_RefNannyDeclarations
13515 Py_hash_t __pyx_t_1;
13516 int __pyx_lineno = 0;
13517 const char *__pyx_filename = NULL;
13518 int __pyx_clineno = 0;
13519 __Pyx_RefNannySetupContext("__hash__", 0);
13521 /* "lxml/objectify.pyx":808
13523 * def __hash__(self):
13524 * return hash(None) # <<<<<<<<<<<<<<
13528 __pyx_t_1 = PyObject_Hash(Py_None); if (unlikely(__pyx_t_1 == ((Py_hash_t)-1))) __PYX_ERR(0, 808, __pyx_L1_error)
13529 __pyx_r = __pyx_t_1;
13532 /* "lxml/objectify.pyx":807
13533 * return python.PyObject_RichCompare(self, None, op)
13535 * def __hash__(self): # <<<<<<<<<<<<<<
13536 * return hash(None)
13540 /* function exit code */
13542 __Pyx_AddTraceback("lxml.objectify.NoneElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13545 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
13546 __Pyx_RefNannyFinishContext();
13550 /* "lxml/objectify.pyx":811
13553 * def pyval(self): # <<<<<<<<<<<<<<
13558 /* Python wrapper */
13559 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
13560 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(PyObject *__pyx_v_self) {
13561 PyObject *__pyx_r = 0;
13562 __Pyx_RefNannyDeclarations
13563 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13564 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13566 /* function exit code */
13567 __Pyx_RefNannyFinishContext();
13571 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13572 PyObject *__pyx_r = NULL;
13573 __Pyx_RefNannyDeclarations
13574 __Pyx_RefNannySetupContext("__get__", 0);
13576 /* "lxml/objectify.pyx":812
13579 * return None # <<<<<<<<<<<<<<
13583 __Pyx_XDECREF(__pyx_r);
13584 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13587 /* "lxml/objectify.pyx":811
13590 * def pyval(self): # <<<<<<<<<<<<<<
13595 /* function exit code */
13597 __Pyx_XGIVEREF(__pyx_r);
13598 __Pyx_RefNannyFinishContext();
13602 /* "lxml/objectify.pyx":821
13603 * Python's bool type.
13605 * def _init(self): # <<<<<<<<<<<<<<
13606 * self._parse_value = __parseBool
13610 /* Python wrapper */
13611 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13612 static PyMethodDef __pyx_mdef_4lxml_9objectify_11BoolElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11BoolElement_1_init, METH_NOARGS, 0};
13613 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13614 PyObject *__pyx_r = 0;
13615 __Pyx_RefNannyDeclarations
13616 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
13617 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement__init(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13619 /* function exit code */
13620 __Pyx_RefNannyFinishContext();
13624 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement__init(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13625 PyObject *__pyx_r = NULL;
13626 __Pyx_RefNannyDeclarations
13627 PyObject *__pyx_t_1 = NULL;
13628 int __pyx_lineno = 0;
13629 const char *__pyx_filename = NULL;
13630 int __pyx_clineno = 0;
13631 __Pyx_RefNannySetupContext("_init", 0);
13633 /* "lxml/objectify.pyx":822
13636 * self._parse_value = __parseBool # <<<<<<<<<<<<<<
13638 * def __nonzero__(self):
13640 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parseBool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
13641 __Pyx_GOTREF(__pyx_t_1);
13642 __Pyx_GIVEREF(__pyx_t_1);
13643 __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base._parse_value);
13644 __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base._parse_value);
13645 __pyx_v_self->__pyx_base.__pyx_base._parse_value = __pyx_t_1;
13648 /* "lxml/objectify.pyx":821
13649 * Python's bool type.
13651 * def _init(self): # <<<<<<<<<<<<<<
13652 * self._parse_value = __parseBool
13656 /* function exit code */
13657 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13660 __Pyx_XDECREF(__pyx_t_1);
13661 __Pyx_AddTraceback("lxml.objectify.BoolElement._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
13664 __Pyx_XGIVEREF(__pyx_r);
13665 __Pyx_RefNannyFinishContext();
13669 /* "lxml/objectify.pyx":824
13670 * self._parse_value = __parseBool
13672 * def __nonzero__(self): # <<<<<<<<<<<<<<
13673 * return __parseBool(textOf(self._c_node))
13677 /* Python wrapper */
13678 static int __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__(PyObject *__pyx_v_self); /*proto*/
13679 static int __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__(PyObject *__pyx_v_self) {
13681 __Pyx_RefNannyDeclarations
13682 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
13683 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13685 /* function exit code */
13686 __Pyx_RefNannyFinishContext();
13690 static int __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13692 __Pyx_RefNannyDeclarations
13693 PyObject *__pyx_t_1 = NULL;
13695 int __pyx_lineno = 0;
13696 const char *__pyx_filename = NULL;
13697 int __pyx_clineno = 0;
13698 __Pyx_RefNannySetupContext("__nonzero__", 0);
13700 /* "lxml/objectify.pyx":825
13702 * def __nonzero__(self):
13703 * return __parseBool(textOf(self._c_node)) # <<<<<<<<<<<<<<
13705 * def __richcmp__(self, other, int op):
13707 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error)
13708 __Pyx_GOTREF(__pyx_t_1);
13709 __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 825, __pyx_L1_error)
13710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13711 __pyx_r = __pyx_t_2;
13714 /* "lxml/objectify.pyx":824
13715 * self._parse_value = __parseBool
13717 * def __nonzero__(self): # <<<<<<<<<<<<<<
13718 * return __parseBool(textOf(self._c_node))
13722 /* function exit code */
13724 __Pyx_XDECREF(__pyx_t_1);
13725 __Pyx_AddTraceback("lxml.objectify.BoolElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13728 __Pyx_RefNannyFinishContext();
13732 /* "lxml/objectify.pyx":827
13733 * return __parseBool(textOf(self._c_node))
13735 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13736 * return _richcmpPyvals(self, other, op)
13740 /* Python wrapper */
13741 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
13742 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13743 PyObject *__pyx_r = 0;
13744 __Pyx_RefNannyDeclarations
13745 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
13746 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_4__richcmp__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op));
13748 /* function exit code */
13749 __Pyx_RefNannyFinishContext();
13753 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_4__richcmp__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13754 PyObject *__pyx_r = NULL;
13755 __Pyx_RefNannyDeclarations
13756 PyObject *__pyx_t_1 = NULL;
13757 int __pyx_lineno = 0;
13758 const char *__pyx_filename = NULL;
13759 int __pyx_clineno = 0;
13760 __Pyx_RefNannySetupContext("__richcmp__", 0);
13762 /* "lxml/objectify.pyx":828
13764 * def __richcmp__(self, other, int op):
13765 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
13767 * def __hash__(self):
13769 __Pyx_XDECREF(__pyx_r);
13770 __pyx_t_1 = __pyx_f_4lxml_9objectify__richcmpPyvals(((PyObject *)__pyx_v_self), __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error)
13771 __Pyx_GOTREF(__pyx_t_1);
13772 __pyx_r = __pyx_t_1;
13776 /* "lxml/objectify.pyx":827
13777 * return __parseBool(textOf(self._c_node))
13779 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13780 * return _richcmpPyvals(self, other, op)
13784 /* function exit code */
13786 __Pyx_XDECREF(__pyx_t_1);
13787 __Pyx_AddTraceback("lxml.objectify.BoolElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13790 __Pyx_XGIVEREF(__pyx_r);
13791 __Pyx_RefNannyFinishContext();
13795 /* "lxml/objectify.pyx":830
13796 * return _richcmpPyvals(self, other, op)
13798 * def __hash__(self): # <<<<<<<<<<<<<<
13799 * return hash(__parseBool(textOf(self._c_node)))
13803 /* Python wrapper */
13804 static Py_hash_t __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__(PyObject *__pyx_v_self); /*proto*/
13805 static Py_hash_t __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__(PyObject *__pyx_v_self) {
13807 __Pyx_RefNannyDeclarations
13808 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
13809 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13811 /* function exit code */
13812 __Pyx_RefNannyFinishContext();
13816 static Py_hash_t __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13818 __Pyx_RefNannyDeclarations
13819 PyObject *__pyx_t_1 = NULL;
13821 Py_hash_t __pyx_t_3;
13822 int __pyx_lineno = 0;
13823 const char *__pyx_filename = NULL;
13824 int __pyx_clineno = 0;
13825 __Pyx_RefNannySetupContext("__hash__", 0);
13827 /* "lxml/objectify.pyx":831
13829 * def __hash__(self):
13830 * return hash(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13832 * def __str__(self):
13834 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
13835 __Pyx_GOTREF(__pyx_t_1);
13836 __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 831, __pyx_L1_error)
13837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13838 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
13839 __Pyx_GOTREF(__pyx_t_1);
13840 __pyx_t_3 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_hash_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error)
13841 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13842 __pyx_r = __pyx_t_3;
13845 /* "lxml/objectify.pyx":830
13846 * return _richcmpPyvals(self, other, op)
13848 * def __hash__(self): # <<<<<<<<<<<<<<
13849 * return hash(__parseBool(textOf(self._c_node)))
13853 /* function exit code */
13855 __Pyx_XDECREF(__pyx_t_1);
13856 __Pyx_AddTraceback("lxml.objectify.BoolElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13859 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
13860 __Pyx_RefNannyFinishContext();
13864 /* "lxml/objectify.pyx":833
13865 * return hash(__parseBool(textOf(self._c_node)))
13867 * def __str__(self): # <<<<<<<<<<<<<<
13868 * return unicode(__parseBool(textOf(self._c_node)))
13872 /* Python wrapper */
13873 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_9__str__(PyObject *__pyx_v_self); /*proto*/
13874 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_9__str__(PyObject *__pyx_v_self) {
13875 PyObject *__pyx_r = 0;
13876 __Pyx_RefNannyDeclarations
13877 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13878 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_8__str__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13880 /* function exit code */
13881 __Pyx_RefNannyFinishContext();
13885 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_8__str__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13886 PyObject *__pyx_r = NULL;
13887 __Pyx_RefNannyDeclarations
13888 PyObject *__pyx_t_1 = NULL;
13890 PyObject *__pyx_t_3 = NULL;
13891 int __pyx_lineno = 0;
13892 const char *__pyx_filename = NULL;
13893 int __pyx_clineno = 0;
13894 __Pyx_RefNannySetupContext("__str__", 0);
13896 /* "lxml/objectify.pyx":834
13898 * def __str__(self):
13899 * return unicode(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13901 * def __repr__(self):
13903 __Pyx_XDECREF(__pyx_r);
13904 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
13905 __Pyx_GOTREF(__pyx_t_1);
13906 __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 834, __pyx_L1_error)
13907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13908 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
13909 __Pyx_GOTREF(__pyx_t_1);
13910 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error)
13911 __Pyx_GOTREF(__pyx_t_3);
13912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13913 __pyx_r = __pyx_t_3;
13917 /* "lxml/objectify.pyx":833
13918 * return hash(__parseBool(textOf(self._c_node)))
13920 * def __str__(self): # <<<<<<<<<<<<<<
13921 * return unicode(__parseBool(textOf(self._c_node)))
13925 /* function exit code */
13927 __Pyx_XDECREF(__pyx_t_1);
13928 __Pyx_XDECREF(__pyx_t_3);
13929 __Pyx_AddTraceback("lxml.objectify.BoolElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13932 __Pyx_XGIVEREF(__pyx_r);
13933 __Pyx_RefNannyFinishContext();
13937 /* "lxml/objectify.pyx":836
13938 * return unicode(__parseBool(textOf(self._c_node)))
13940 * def __repr__(self): # <<<<<<<<<<<<<<
13941 * return repr(__parseBool(textOf(self._c_node)))
13945 /* Python wrapper */
13946 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_11__repr__(PyObject *__pyx_v_self); /*proto*/
13947 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_11__repr__(PyObject *__pyx_v_self) {
13948 PyObject *__pyx_r = 0;
13949 __Pyx_RefNannyDeclarations
13950 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13951 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13953 /* function exit code */
13954 __Pyx_RefNannyFinishContext();
13958 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13959 PyObject *__pyx_r = NULL;
13960 __Pyx_RefNannyDeclarations
13961 PyObject *__pyx_t_1 = NULL;
13963 PyObject *__pyx_t_3 = NULL;
13964 int __pyx_lineno = 0;
13965 const char *__pyx_filename = NULL;
13966 int __pyx_clineno = 0;
13967 __Pyx_RefNannySetupContext("__repr__", 0);
13969 /* "lxml/objectify.pyx":837
13971 * def __repr__(self):
13972 * return repr(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13976 __Pyx_XDECREF(__pyx_r);
13977 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
13978 __Pyx_GOTREF(__pyx_t_1);
13979 __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 837, __pyx_L1_error)
13980 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13981 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
13982 __Pyx_GOTREF(__pyx_t_1);
13983 __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
13984 __Pyx_GOTREF(__pyx_t_3);
13985 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13986 __pyx_r = __pyx_t_3;
13990 /* "lxml/objectify.pyx":836
13991 * return unicode(__parseBool(textOf(self._c_node)))
13993 * def __repr__(self): # <<<<<<<<<<<<<<
13994 * return repr(__parseBool(textOf(self._c_node)))
13998 /* function exit code */
14000 __Pyx_XDECREF(__pyx_t_1);
14001 __Pyx_XDECREF(__pyx_t_3);
14002 __Pyx_AddTraceback("lxml.objectify.BoolElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14005 __Pyx_XGIVEREF(__pyx_r);
14006 __Pyx_RefNannyFinishContext();
14010 /* "lxml/objectify.pyx":840
14013 * def pyval(self): # <<<<<<<<<<<<<<
14014 * return __parseBool(textOf(self._c_node))
14018 /* Python wrapper */
14019 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
14020 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(PyObject *__pyx_v_self) {
14021 PyObject *__pyx_r = 0;
14022 __Pyx_RefNannyDeclarations
14023 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14024 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
14026 /* function exit code */
14027 __Pyx_RefNannyFinishContext();
14031 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
14032 PyObject *__pyx_r = NULL;
14033 __Pyx_RefNannyDeclarations
14034 PyObject *__pyx_t_1 = NULL;
14036 int __pyx_lineno = 0;
14037 const char *__pyx_filename = NULL;
14038 int __pyx_clineno = 0;
14039 __Pyx_RefNannySetupContext("__get__", 0);
14041 /* "lxml/objectify.pyx":841
14044 * return __parseBool(textOf(self._c_node)) # <<<<<<<<<<<<<<
14046 * def __checkBool(s):
14048 __Pyx_XDECREF(__pyx_r);
14049 __pyx_t_1 = textOf(__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
14050 __Pyx_GOTREF(__pyx_t_1);
14051 __pyx_t_2 = __pyx_f_4lxml_9objectify___parseBool(__pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 841, __pyx_L1_error)
14052 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14053 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
14054 __Pyx_GOTREF(__pyx_t_1);
14055 __pyx_r = __pyx_t_1;
14059 /* "lxml/objectify.pyx":840
14062 * def pyval(self): # <<<<<<<<<<<<<<
14063 * return __parseBool(textOf(self._c_node))
14067 /* function exit code */
14069 __Pyx_XDECREF(__pyx_t_1);
14070 __Pyx_AddTraceback("lxml.objectify.BoolElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14073 __Pyx_XGIVEREF(__pyx_r);
14074 __Pyx_RefNannyFinishContext();
14078 /* "lxml/objectify.pyx":843
14079 * return __parseBool(textOf(self._c_node))
14081 * def __checkBool(s): # <<<<<<<<<<<<<<
14082 * cdef int value = -1
14083 * if s is not None:
14086 /* Python wrapper */
14087 static PyObject *__pyx_pw_4lxml_9objectify_3__checkBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14088 static PyMethodDef __pyx_mdef_4lxml_9objectify_3__checkBool = {"__checkBool", (PyCFunction)__pyx_pw_4lxml_9objectify_3__checkBool, METH_O, 0};
14089 static PyObject *__pyx_pw_4lxml_9objectify_3__checkBool(PyObject *__pyx_self, PyObject *__pyx_v_s) {
14090 PyObject *__pyx_r = 0;
14091 __Pyx_RefNannyDeclarations
14092 __Pyx_RefNannySetupContext("__checkBool (wrapper)", 0);
14093 __pyx_r = __pyx_pf_4lxml_9objectify_2__checkBool(__pyx_self, ((PyObject *)__pyx_v_s));
14095 /* function exit code */
14096 __Pyx_RefNannyFinishContext();
14100 static PyObject *__pyx_pf_4lxml_9objectify_2__checkBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
14102 PyObject *__pyx_r = NULL;
14103 __Pyx_RefNannyDeclarations
14107 int __pyx_lineno = 0;
14108 const char *__pyx_filename = NULL;
14109 int __pyx_clineno = 0;
14110 __Pyx_RefNannySetupContext("__checkBool", 0);
14112 /* "lxml/objectify.pyx":844
14114 * def __checkBool(s):
14115 * cdef int value = -1 # <<<<<<<<<<<<<<
14116 * if s is not None:
14117 * value = __parseBoolAsInt(s)
14119 __pyx_v_value = -1;
14121 /* "lxml/objectify.pyx":845
14122 * def __checkBool(s):
14123 * cdef int value = -1
14124 * if s is not None: # <<<<<<<<<<<<<<
14125 * value = __parseBoolAsInt(s)
14128 __pyx_t_1 = (__pyx_v_s != Py_None);
14129 __pyx_t_2 = (__pyx_t_1 != 0);
14132 /* "lxml/objectify.pyx":846
14133 * cdef int value = -1
14134 * if s is not None:
14135 * value = __parseBoolAsInt(s) # <<<<<<<<<<<<<<
14139 __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == ((int)-2))) __PYX_ERR(0, 846, __pyx_L1_error)
14140 __pyx_v_value = __pyx_t_3;
14142 /* "lxml/objectify.pyx":845
14143 * def __checkBool(s):
14144 * cdef int value = -1
14145 * if s is not None: # <<<<<<<<<<<<<<
14146 * value = __parseBoolAsInt(s)
14151 /* "lxml/objectify.pyx":847
14152 * if s is not None:
14153 * value = __parseBoolAsInt(s)
14154 * if value == -1: # <<<<<<<<<<<<<<
14158 __pyx_t_2 = ((__pyx_v_value == -1L) != 0);
14159 if (unlikely(__pyx_t_2)) {
14161 /* "lxml/objectify.pyx":848
14162 * value = __parseBoolAsInt(s)
14164 * raise ValueError # <<<<<<<<<<<<<<
14166 * cpdef bint __parseBool(s) except -1:
14168 __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
14169 __PYX_ERR(0, 848, __pyx_L1_error)
14171 /* "lxml/objectify.pyx":847
14172 * if s is not None:
14173 * value = __parseBoolAsInt(s)
14174 * if value == -1: # <<<<<<<<<<<<<<
14180 /* "lxml/objectify.pyx":843
14181 * return __parseBool(textOf(self._c_node))
14183 * def __checkBool(s): # <<<<<<<<<<<<<<
14184 * cdef int value = -1
14185 * if s is not None:
14188 /* function exit code */
14189 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14192 __Pyx_AddTraceback("lxml.objectify.__checkBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14195 __Pyx_XGIVEREF(__pyx_r);
14196 __Pyx_RefNannyFinishContext();
14200 /* "lxml/objectify.pyx":850
14203 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
14208 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14209 static int __pyx_f_4lxml_9objectify___parseBool(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch) {
14212 __Pyx_RefNannyDeclarations
14216 PyObject *__pyx_t_4 = NULL;
14217 Py_ssize_t __pyx_t_5;
14219 PyObject *__pyx_t_7 = NULL;
14220 int __pyx_lineno = 0;
14221 const char *__pyx_filename = NULL;
14222 int __pyx_clineno = 0;
14223 __Pyx_RefNannySetupContext("__parseBool", 0);
14225 /* "lxml/objectify.pyx":852
14226 * cpdef bint __parseBool(s) except -1:
14228 * if s is None: # <<<<<<<<<<<<<<
14230 * value = __parseBoolAsInt(s)
14232 __pyx_t_1 = (__pyx_v_s == Py_None);
14233 __pyx_t_2 = (__pyx_t_1 != 0);
14236 /* "lxml/objectify.pyx":853
14239 * return False # <<<<<<<<<<<<<<
14240 * value = __parseBoolAsInt(s)
14246 /* "lxml/objectify.pyx":852
14247 * cpdef bint __parseBool(s) except -1:
14249 * if s is None: # <<<<<<<<<<<<<<
14251 * value = __parseBoolAsInt(s)
14255 /* "lxml/objectify.pyx":854
14258 * value = __parseBoolAsInt(s) # <<<<<<<<<<<<<<
14260 * raise ValueError, f"Invalid boolean value: '{s}'"
14262 __pyx_t_3 = __pyx_f_4lxml_9objectify___parseBoolAsInt(__pyx_v_s); if (unlikely(__pyx_t_3 == ((int)-2))) __PYX_ERR(0, 854, __pyx_L1_error)
14263 __pyx_v_value = __pyx_t_3;
14265 /* "lxml/objectify.pyx":855
14267 * value = __parseBoolAsInt(s)
14268 * if value == -1: # <<<<<<<<<<<<<<
14269 * raise ValueError, f"Invalid boolean value: '{s}'"
14272 __pyx_t_2 = ((__pyx_v_value == -1L) != 0);
14273 if (unlikely(__pyx_t_2)) {
14275 /* "lxml/objectify.pyx":856
14276 * value = __parseBoolAsInt(s)
14278 * raise ValueError, f"Invalid boolean value: '{s}'" # <<<<<<<<<<<<<<
14282 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
14283 __Pyx_GOTREF(__pyx_t_4);
14286 __Pyx_INCREF(__pyx_kp_u_Invalid_boolean_value);
14288 __Pyx_GIVEREF(__pyx_kp_u_Invalid_boolean_value);
14289 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Invalid_boolean_value);
14290 __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_s, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
14291 __Pyx_GOTREF(__pyx_t_7);
14292 __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
14293 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
14294 __Pyx_GIVEREF(__pyx_t_7);
14295 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
14297 __Pyx_INCREF(__pyx_kp_u__4);
14299 __Pyx_GIVEREF(__pyx_kp_u__4);
14300 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__4);
14301 __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
14302 __Pyx_GOTREF(__pyx_t_7);
14303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14304 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_7, 0, 0);
14305 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14306 __PYX_ERR(0, 856, __pyx_L1_error)
14308 /* "lxml/objectify.pyx":855
14310 * value = __parseBoolAsInt(s)
14311 * if value == -1: # <<<<<<<<<<<<<<
14312 * raise ValueError, f"Invalid boolean value: '{s}'"
14317 /* "lxml/objectify.pyx":857
14319 * raise ValueError, f"Invalid boolean value: '{s}'"
14320 * return value # <<<<<<<<<<<<<<
14322 * cdef inline int __parseBoolAsInt(text) except -2:
14324 __pyx_r = __pyx_v_value;
14327 /* "lxml/objectify.pyx":850
14330 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
14335 /* function exit code */
14337 __Pyx_XDECREF(__pyx_t_4);
14338 __Pyx_XDECREF(__pyx_t_7);
14339 __Pyx_AddTraceback("lxml.objectify.__parseBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14342 __Pyx_RefNannyFinishContext();
14346 /* Python wrapper */
14347 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14348 static PyMethodDef __pyx_mdef_4lxml_9objectify_5__parseBool = {"__parseBool", (PyCFunction)__pyx_pw_4lxml_9objectify_5__parseBool, METH_O, 0};
14349 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s) {
14350 PyObject *__pyx_r = 0;
14351 __Pyx_RefNannyDeclarations
14352 __Pyx_RefNannySetupContext("__parseBool (wrapper)", 0);
14353 __pyx_r = __pyx_pf_4lxml_9objectify_4__parseBool(__pyx_self, ((PyObject *)__pyx_v_s));
14355 /* function exit code */
14356 __Pyx_RefNannyFinishContext();
14360 static PyObject *__pyx_pf_4lxml_9objectify_4__parseBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
14361 PyObject *__pyx_r = NULL;
14362 __Pyx_RefNannyDeclarations
14364 PyObject *__pyx_t_2 = NULL;
14365 int __pyx_lineno = 0;
14366 const char *__pyx_filename = NULL;
14367 int __pyx_clineno = 0;
14368 __Pyx_RefNannySetupContext("__parseBool", 0);
14369 __Pyx_XDECREF(__pyx_r);
14370 __pyx_t_1 = __pyx_f_4lxml_9objectify___parseBool(__pyx_v_s, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 850, __pyx_L1_error)
14371 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
14372 __Pyx_GOTREF(__pyx_t_2);
14373 __pyx_r = __pyx_t_2;
14377 /* function exit code */
14379 __Pyx_XDECREF(__pyx_t_2);
14380 __Pyx_AddTraceback("lxml.objectify.__parseBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14383 __Pyx_XGIVEREF(__pyx_r);
14384 __Pyx_RefNannyFinishContext();
14388 /* "lxml/objectify.pyx":859
14391 * cdef inline int __parseBoolAsInt(text) except -2: # <<<<<<<<<<<<<<
14392 * if text == 'false':
14396 static CYTHON_INLINE int __pyx_f_4lxml_9objectify___parseBoolAsInt(PyObject *__pyx_v_text) {
14398 __Pyx_RefNannyDeclarations
14400 int __pyx_lineno = 0;
14401 const char *__pyx_filename = NULL;
14402 int __pyx_clineno = 0;
14403 __Pyx_RefNannySetupContext("__parseBoolAsInt", 0);
14405 /* "lxml/objectify.pyx":860
14407 * cdef inline int __parseBoolAsInt(text) except -2:
14408 * if text == 'false': # <<<<<<<<<<<<<<
14410 * elif text == 'true':
14412 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_text, __pyx_n_s_false, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 860, __pyx_L1_error)
14415 /* "lxml/objectify.pyx":861
14416 * cdef inline int __parseBoolAsInt(text) except -2:
14417 * if text == 'false':
14418 * return 0 # <<<<<<<<<<<<<<
14419 * elif text == 'true':
14425 /* "lxml/objectify.pyx":860
14427 * cdef inline int __parseBoolAsInt(text) except -2:
14428 * if text == 'false': # <<<<<<<<<<<<<<
14430 * elif text == 'true':
14434 /* "lxml/objectify.pyx":862
14435 * if text == 'false':
14437 * elif text == 'true': # <<<<<<<<<<<<<<
14439 * elif text == '0':
14441 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_text, __pyx_n_s_true, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 862, __pyx_L1_error)
14444 /* "lxml/objectify.pyx":863
14446 * elif text == 'true':
14447 * return 1 # <<<<<<<<<<<<<<
14448 * elif text == '0':
14454 /* "lxml/objectify.pyx":862
14455 * if text == 'false':
14457 * elif text == 'true': # <<<<<<<<<<<<<<
14459 * elif text == '0':
14463 /* "lxml/objectify.pyx":864
14464 * elif text == 'true':
14466 * elif text == '0': # <<<<<<<<<<<<<<
14468 * elif text == '1':
14470 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_text, __pyx_kp_s_0, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 864, __pyx_L1_error)
14473 /* "lxml/objectify.pyx":865
14475 * elif text == '0':
14476 * return 0 # <<<<<<<<<<<<<<
14477 * elif text == '1':
14483 /* "lxml/objectify.pyx":864
14484 * elif text == 'true':
14486 * elif text == '0': # <<<<<<<<<<<<<<
14488 * elif text == '1':
14492 /* "lxml/objectify.pyx":866
14493 * elif text == '0':
14495 * elif text == '1': # <<<<<<<<<<<<<<
14499 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_text, __pyx_kp_s_1, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 866, __pyx_L1_error)
14502 /* "lxml/objectify.pyx":867
14504 * elif text == '1':
14505 * return 1 # <<<<<<<<<<<<<<
14512 /* "lxml/objectify.pyx":866
14513 * elif text == '0':
14515 * elif text == '1': # <<<<<<<<<<<<<<
14521 /* "lxml/objectify.pyx":868
14522 * elif text == '1':
14524 * return -1 # <<<<<<<<<<<<<<
14526 * cdef object _parseNumber(NumberElement element):
14531 /* "lxml/objectify.pyx":859
14534 * cdef inline int __parseBoolAsInt(text) except -2: # <<<<<<<<<<<<<<
14535 * if text == 'false':
14539 /* function exit code */
14541 __Pyx_AddTraceback("lxml.objectify.__parseBoolAsInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14544 __Pyx_RefNannyFinishContext();
14548 /* "lxml/objectify.pyx":870
14551 * cdef object _parseNumber(NumberElement element): # <<<<<<<<<<<<<<
14552 * return element._parse_value(textOf(element._c_node))
14556 static PyObject *__pyx_f_4lxml_9objectify__parseNumber(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_element) {
14557 PyObject *__pyx_r = NULL;
14558 __Pyx_RefNannyDeclarations
14559 PyObject *__pyx_t_1 = NULL;
14560 PyObject *__pyx_t_2 = NULL;
14561 PyObject *__pyx_t_3 = NULL;
14562 PyObject *__pyx_t_4 = NULL;
14563 int __pyx_lineno = 0;
14564 const char *__pyx_filename = NULL;
14565 int __pyx_clineno = 0;
14566 __Pyx_RefNannySetupContext("_parseNumber", 0);
14568 /* "lxml/objectify.pyx":871
14570 * cdef object _parseNumber(NumberElement element):
14571 * return element._parse_value(textOf(element._c_node)) # <<<<<<<<<<<<<<
14573 * cdef object _strValueOf(obj):
14575 __Pyx_XDECREF(__pyx_r);
14576 __pyx_t_2 = textOf(__pyx_v_element->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
14577 __Pyx_GOTREF(__pyx_t_2);
14578 __Pyx_INCREF(__pyx_v_element->_parse_value);
14579 __pyx_t_3 = __pyx_v_element->_parse_value; __pyx_t_4 = NULL;
14580 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14581 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
14582 if (likely(__pyx_t_4)) {
14583 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14584 __Pyx_INCREF(__pyx_t_4);
14585 __Pyx_INCREF(function);
14586 __Pyx_DECREF_SET(__pyx_t_3, function);
14589 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
14590 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14591 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14592 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
14593 __Pyx_GOTREF(__pyx_t_1);
14594 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14595 __pyx_r = __pyx_t_1;
14599 /* "lxml/objectify.pyx":870
14602 * cdef object _parseNumber(NumberElement element): # <<<<<<<<<<<<<<
14603 * return element._parse_value(textOf(element._c_node))
14607 /* function exit code */
14609 __Pyx_XDECREF(__pyx_t_1);
14610 __Pyx_XDECREF(__pyx_t_2);
14611 __Pyx_XDECREF(__pyx_t_3);
14612 __Pyx_XDECREF(__pyx_t_4);
14613 __Pyx_AddTraceback("lxml.objectify._parseNumber", __pyx_clineno, __pyx_lineno, __pyx_filename);
14616 __Pyx_XGIVEREF(__pyx_r);
14617 __Pyx_RefNannyFinishContext();
14621 /* "lxml/objectify.pyx":873
14622 * return element._parse_value(textOf(element._c_node))
14624 * cdef object _strValueOf(obj): # <<<<<<<<<<<<<<
14625 * if python._isString(obj):
14629 static PyObject *__pyx_f_4lxml_9objectify__strValueOf(PyObject *__pyx_v_obj) {
14630 PyObject *__pyx_r = NULL;
14631 __Pyx_RefNannyDeclarations
14634 PyObject *__pyx_t_3 = NULL;
14635 PyObject *__pyx_t_4 = NULL;
14636 int __pyx_lineno = 0;
14637 const char *__pyx_filename = NULL;
14638 int __pyx_clineno = 0;
14639 __Pyx_RefNannySetupContext("_strValueOf", 0);
14641 /* "lxml/objectify.pyx":874
14643 * cdef object _strValueOf(obj):
14644 * if python._isString(obj): # <<<<<<<<<<<<<<
14646 * if isinstance(obj, _Element):
14648 __pyx_t_1 = (_isString(__pyx_v_obj) != 0);
14651 /* "lxml/objectify.pyx":875
14652 * cdef object _strValueOf(obj):
14653 * if python._isString(obj):
14654 * return obj # <<<<<<<<<<<<<<
14655 * if isinstance(obj, _Element):
14656 * return textOf((<_Element>obj)._c_node) or u''
14658 __Pyx_XDECREF(__pyx_r);
14659 __Pyx_INCREF(__pyx_v_obj);
14660 __pyx_r = __pyx_v_obj;
14663 /* "lxml/objectify.pyx":874
14665 * cdef object _strValueOf(obj):
14666 * if python._isString(obj): # <<<<<<<<<<<<<<
14668 * if isinstance(obj, _Element):
14672 /* "lxml/objectify.pyx":876
14673 * if python._isString(obj):
14675 * if isinstance(obj, _Element): # <<<<<<<<<<<<<<
14676 * return textOf((<_Element>obj)._c_node) or u''
14679 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
14680 __pyx_t_2 = (__pyx_t_1 != 0);
14683 /* "lxml/objectify.pyx":877
14685 * if isinstance(obj, _Element):
14686 * return textOf((<_Element>obj)._c_node) or u'' # <<<<<<<<<<<<<<
14690 __Pyx_XDECREF(__pyx_r);
14691 __pyx_t_4 = textOf(((struct LxmlElement *)__pyx_v_obj)->_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error)
14692 __Pyx_GOTREF(__pyx_t_4);
14693 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 877, __pyx_L1_error)
14695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14697 __Pyx_INCREF(__pyx_t_4);
14698 __pyx_t_3 = __pyx_t_4;
14699 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14700 goto __pyx_L5_bool_binop_done;
14702 __Pyx_INCREF(__pyx_kp_u_);
14703 __pyx_t_3 = __pyx_kp_u_;
14704 __pyx_L5_bool_binop_done:;
14705 __pyx_r = __pyx_t_3;
14709 /* "lxml/objectify.pyx":876
14710 * if python._isString(obj):
14712 * if isinstance(obj, _Element): # <<<<<<<<<<<<<<
14713 * return textOf((<_Element>obj)._c_node) or u''
14718 /* "lxml/objectify.pyx":878
14719 * if isinstance(obj, _Element):
14720 * return textOf((<_Element>obj)._c_node) or u''
14721 * if obj is None: # <<<<<<<<<<<<<<
14723 * return unicode(obj)
14725 __pyx_t_2 = (__pyx_v_obj == Py_None);
14726 __pyx_t_1 = (__pyx_t_2 != 0);
14729 /* "lxml/objectify.pyx":879
14730 * return textOf((<_Element>obj)._c_node) or u''
14732 * return u'' # <<<<<<<<<<<<<<
14733 * return unicode(obj)
14736 __Pyx_XDECREF(__pyx_r);
14737 __Pyx_INCREF(__pyx_kp_u_);
14738 __pyx_r = __pyx_kp_u_;
14741 /* "lxml/objectify.pyx":878
14742 * if isinstance(obj, _Element):
14743 * return textOf((<_Element>obj)._c_node) or u''
14744 * if obj is None: # <<<<<<<<<<<<<<
14746 * return unicode(obj)
14750 /* "lxml/objectify.pyx":880
14753 * return unicode(obj) # <<<<<<<<<<<<<<
14755 * cdef object _numericValueOf(obj):
14757 __Pyx_XDECREF(__pyx_r);
14758 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error)
14759 __Pyx_GOTREF(__pyx_t_3);
14760 __pyx_r = __pyx_t_3;
14764 /* "lxml/objectify.pyx":873
14765 * return element._parse_value(textOf(element._c_node))
14767 * cdef object _strValueOf(obj): # <<<<<<<<<<<<<<
14768 * if python._isString(obj):
14772 /* function exit code */
14774 __Pyx_XDECREF(__pyx_t_3);
14775 __Pyx_XDECREF(__pyx_t_4);
14776 __Pyx_AddTraceback("lxml.objectify._strValueOf", __pyx_clineno, __pyx_lineno, __pyx_filename);
14779 __Pyx_XGIVEREF(__pyx_r);
14780 __Pyx_RefNannyFinishContext();
14784 /* "lxml/objectify.pyx":882
14785 * return unicode(obj)
14787 * cdef object _numericValueOf(obj): # <<<<<<<<<<<<<<
14788 * if isinstance(obj, NumberElement):
14789 * return _parseNumber(<NumberElement>obj)
14792 static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *__pyx_v_obj) {
14793 PyObject *__pyx_r = NULL;
14794 __Pyx_RefNannyDeclarations
14797 PyObject *__pyx_t_3 = NULL;
14798 PyObject *__pyx_t_4 = NULL;
14799 PyObject *__pyx_t_5 = NULL;
14800 PyObject *__pyx_t_6 = NULL;
14802 int __pyx_lineno = 0;
14803 const char *__pyx_filename = NULL;
14804 int __pyx_clineno = 0;
14805 __Pyx_RefNannySetupContext("_numericValueOf", 0);
14807 /* "lxml/objectify.pyx":883
14809 * cdef object _numericValueOf(obj):
14810 * if isinstance(obj, NumberElement): # <<<<<<<<<<<<<<
14811 * return _parseNumber(<NumberElement>obj)
14814 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_4lxml_9objectify_NumberElement);
14815 __pyx_t_2 = (__pyx_t_1 != 0);
14818 /* "lxml/objectify.pyx":884
14819 * cdef object _numericValueOf(obj):
14820 * if isinstance(obj, NumberElement):
14821 * return _parseNumber(<NumberElement>obj) # <<<<<<<<<<<<<<
14823 * # not always numeric, but Python will raise the right exception
14825 __Pyx_XDECREF(__pyx_r);
14826 __pyx_t_3 = __pyx_f_4lxml_9objectify__parseNumber(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_obj)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
14827 __Pyx_GOTREF(__pyx_t_3);
14828 __pyx_r = __pyx_t_3;
14832 /* "lxml/objectify.pyx":883
14834 * cdef object _numericValueOf(obj):
14835 * if isinstance(obj, NumberElement): # <<<<<<<<<<<<<<
14836 * return _parseNumber(<NumberElement>obj)
14841 /* "lxml/objectify.pyx":885
14842 * if isinstance(obj, NumberElement):
14843 * return _parseNumber(<NumberElement>obj)
14844 * try: # <<<<<<<<<<<<<<
14845 * # not always numeric, but Python will raise the right exception
14849 __Pyx_PyThreadState_declare
14850 __Pyx_PyThreadState_assign
14851 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
14852 __Pyx_XGOTREF(__pyx_t_4);
14853 __Pyx_XGOTREF(__pyx_t_5);
14854 __Pyx_XGOTREF(__pyx_t_6);
14857 /* "lxml/objectify.pyx":887
14859 * # not always numeric, but Python will raise the right exception
14860 * return obj.pyval # <<<<<<<<<<<<<<
14861 * except AttributeError:
14864 __Pyx_XDECREF(__pyx_r);
14865 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_pyval); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L4_error)
14866 __Pyx_GOTREF(__pyx_t_3);
14867 __pyx_r = __pyx_t_3;
14869 goto __pyx_L8_try_return;
14871 /* "lxml/objectify.pyx":885
14872 * if isinstance(obj, NumberElement):
14873 * return _parseNumber(<NumberElement>obj)
14874 * try: # <<<<<<<<<<<<<<
14875 * # not always numeric, but Python will raise the right exception
14880 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14882 /* "lxml/objectify.pyx":888
14883 * # not always numeric, but Python will raise the right exception
14885 * except AttributeError: # <<<<<<<<<<<<<<
14889 __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
14891 __Pyx_ErrRestore(0,0,0);
14892 goto __pyx_L5_exception_handled;
14894 goto __pyx_L6_except_error;
14895 __pyx_L6_except_error:;
14897 /* "lxml/objectify.pyx":885
14898 * if isinstance(obj, NumberElement):
14899 * return _parseNumber(<NumberElement>obj)
14900 * try: # <<<<<<<<<<<<<<
14901 * # not always numeric, but Python will raise the right exception
14904 __Pyx_XGIVEREF(__pyx_t_4);
14905 __Pyx_XGIVEREF(__pyx_t_5);
14906 __Pyx_XGIVEREF(__pyx_t_6);
14907 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14908 goto __pyx_L1_error;
14909 __pyx_L8_try_return:;
14910 __Pyx_XGIVEREF(__pyx_t_4);
14911 __Pyx_XGIVEREF(__pyx_t_5);
14912 __Pyx_XGIVEREF(__pyx_t_6);
14913 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14915 __pyx_L5_exception_handled:;
14916 __Pyx_XGIVEREF(__pyx_t_4);
14917 __Pyx_XGIVEREF(__pyx_t_5);
14918 __Pyx_XGIVEREF(__pyx_t_6);
14919 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14922 /* "lxml/objectify.pyx":890
14923 * except AttributeError:
14925 * return obj # <<<<<<<<<<<<<<
14927 * cdef _richcmpPyvals(left, right, int op):
14929 __Pyx_XDECREF(__pyx_r);
14930 __Pyx_INCREF(__pyx_v_obj);
14931 __pyx_r = __pyx_v_obj;
14934 /* "lxml/objectify.pyx":882
14935 * return unicode(obj)
14937 * cdef object _numericValueOf(obj): # <<<<<<<<<<<<<<
14938 * if isinstance(obj, NumberElement):
14939 * return _parseNumber(<NumberElement>obj)
14942 /* function exit code */
14944 __Pyx_XDECREF(__pyx_t_3);
14945 __Pyx_AddTraceback("lxml.objectify._numericValueOf", __pyx_clineno, __pyx_lineno, __pyx_filename);
14948 __Pyx_XGIVEREF(__pyx_r);
14949 __Pyx_RefNannyFinishContext();
14953 /* "lxml/objectify.pyx":892
14956 * cdef _richcmpPyvals(left, right, int op): # <<<<<<<<<<<<<<
14957 * left = getattr(left, 'pyval', left)
14958 * right = getattr(right, 'pyval', right)
14961 static PyObject *__pyx_f_4lxml_9objectify__richcmpPyvals(PyObject *__pyx_v_left, PyObject *__pyx_v_right, int __pyx_v_op) {
14962 PyObject *__pyx_r = NULL;
14963 __Pyx_RefNannyDeclarations
14964 PyObject *__pyx_t_1 = NULL;
14965 int __pyx_lineno = 0;
14966 const char *__pyx_filename = NULL;
14967 int __pyx_clineno = 0;
14968 __Pyx_RefNannySetupContext("_richcmpPyvals", 0);
14969 __Pyx_INCREF(__pyx_v_left);
14970 __Pyx_INCREF(__pyx_v_right);
14972 /* "lxml/objectify.pyx":893
14974 * cdef _richcmpPyvals(left, right, int op):
14975 * left = getattr(left, 'pyval', left) # <<<<<<<<<<<<<<
14976 * right = getattr(right, 'pyval', right)
14977 * return python.PyObject_RichCompare(left, right, op)
14979 __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_left, __pyx_n_s_pyval, __pyx_v_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error)
14980 __Pyx_GOTREF(__pyx_t_1);
14981 __Pyx_DECREF_SET(__pyx_v_left, __pyx_t_1);
14984 /* "lxml/objectify.pyx":894
14985 * cdef _richcmpPyvals(left, right, int op):
14986 * left = getattr(left, 'pyval', left)
14987 * right = getattr(right, 'pyval', right) # <<<<<<<<<<<<<<
14988 * return python.PyObject_RichCompare(left, right, op)
14991 __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_right, __pyx_n_s_pyval, __pyx_v_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error)
14992 __Pyx_GOTREF(__pyx_t_1);
14993 __Pyx_DECREF_SET(__pyx_v_right, __pyx_t_1);
14996 /* "lxml/objectify.pyx":895
14997 * left = getattr(left, 'pyval', left)
14998 * right = getattr(right, 'pyval', right)
14999 * return python.PyObject_RichCompare(left, right, op) # <<<<<<<<<<<<<<
15003 __Pyx_XDECREF(__pyx_r);
15004 __pyx_t_1 = PyObject_RichCompare(__pyx_v_left, __pyx_v_right, __pyx_v_op); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
15005 __Pyx_GOTREF(__pyx_t_1);
15006 __pyx_r = __pyx_t_1;
15010 /* "lxml/objectify.pyx":892
15013 * cdef _richcmpPyvals(left, right, int op): # <<<<<<<<<<<<<<
15014 * left = getattr(left, 'pyval', left)
15015 * right = getattr(right, 'pyval', right)
15018 /* function exit code */
15020 __Pyx_XDECREF(__pyx_t_1);
15021 __Pyx_AddTraceback("lxml.objectify._richcmpPyvals", __pyx_clineno, __pyx_lineno, __pyx_filename);
15024 __Pyx_XDECREF(__pyx_v_left);
15025 __Pyx_XDECREF(__pyx_v_right);
15026 __Pyx_XGIVEREF(__pyx_r);
15027 __Pyx_RefNannyFinishContext();
15031 /* "lxml/objectify.pyx":926
15032 * cdef object _type
15033 * cdef list _schema_types
15034 * def __init__(self, name, type_check, type_class, stringify=None): # <<<<<<<<<<<<<<
15035 * if isinstance(name, bytes):
15036 * name = (<bytes>name).decode('ascii')
15039 /* Python wrapper */
15040 static int __pyx_pw_4lxml_9objectify_6PyType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15041 static int __pyx_pw_4lxml_9objectify_6PyType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15042 PyObject *__pyx_v_name = 0;
15043 PyObject *__pyx_v_type_check = 0;
15044 PyObject *__pyx_v_type_class = 0;
15045 PyObject *__pyx_v_stringify = 0;
15046 int __pyx_lineno = 0;
15047 const char *__pyx_filename = NULL;
15048 int __pyx_clineno = 0;
15050 __Pyx_RefNannyDeclarations
15051 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
15053 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type_check,&__pyx_n_s_type_class,&__pyx_n_s_stringify,0};
15054 PyObject* values[4] = {0,0,0,0};
15055 values[3] = ((PyObject *)Py_None);
15056 if (unlikely(__pyx_kwds)) {
15057 Py_ssize_t kw_args;
15058 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15059 switch (pos_args) {
15060 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15061 CYTHON_FALLTHROUGH;
15062 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15063 CYTHON_FALLTHROUGH;
15064 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15065 CYTHON_FALLTHROUGH;
15066 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15067 CYTHON_FALLTHROUGH;
15069 default: goto __pyx_L5_argtuple_error;
15071 kw_args = PyDict_Size(__pyx_kwds);
15072 switch (pos_args) {
15074 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
15075 else goto __pyx_L5_argtuple_error;
15076 CYTHON_FALLTHROUGH;
15078 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_check)) != 0)) kw_args--;
15080 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 926, __pyx_L3_error)
15082 CYTHON_FALLTHROUGH;
15084 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_class)) != 0)) kw_args--;
15086 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 926, __pyx_L3_error)
15088 CYTHON_FALLTHROUGH;
15091 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stringify);
15092 if (value) { values[3] = value; kw_args--; }
15095 if (unlikely(kw_args > 0)) {
15096 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 926, __pyx_L3_error)
15099 switch (PyTuple_GET_SIZE(__pyx_args)) {
15100 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15101 CYTHON_FALLTHROUGH;
15102 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15103 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15104 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15106 default: goto __pyx_L5_argtuple_error;
15109 __pyx_v_name = values[0];
15110 __pyx_v_type_check = values[1];
15111 __pyx_v_type_class = values[2];
15112 __pyx_v_stringify = values[3];
15114 goto __pyx_L4_argument_unpacking_done;
15115 __pyx_L5_argtuple_error:;
15116 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 926, __pyx_L3_error)
15118 __Pyx_AddTraceback("lxml.objectify.PyType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15119 __Pyx_RefNannyFinishContext();
15121 __pyx_L4_argument_unpacking_done:;
15122 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType___init__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self), __pyx_v_name, __pyx_v_type_check, __pyx_v_type_class, __pyx_v_stringify);
15124 /* function exit code */
15125 __Pyx_RefNannyFinishContext();
15129 static int __pyx_pf_4lxml_9objectify_6PyType___init__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type_check, PyObject *__pyx_v_type_class, PyObject *__pyx_v_stringify) {
15131 __Pyx_RefNannyDeclarations
15134 PyObject *__pyx_t_3 = NULL;
15136 int __pyx_lineno = 0;
15137 const char *__pyx_filename = NULL;
15138 int __pyx_clineno = 0;
15139 __Pyx_RefNannySetupContext("__init__", 0);
15140 __Pyx_INCREF(__pyx_v_name);
15141 __Pyx_INCREF(__pyx_v_stringify);
15143 /* "lxml/objectify.pyx":927
15144 * cdef list _schema_types
15145 * def __init__(self, name, type_check, type_class, stringify=None):
15146 * if isinstance(name, bytes): # <<<<<<<<<<<<<<
15147 * name = (<bytes>name).decode('ascii')
15148 * elif not isinstance(name, unicode):
15150 __pyx_t_1 = PyBytes_Check(__pyx_v_name);
15151 __pyx_t_2 = (__pyx_t_1 != 0);
15154 /* "lxml/objectify.pyx":928
15155 * def __init__(self, name, type_check, type_class, stringify=None):
15156 * if isinstance(name, bytes):
15157 * name = (<bytes>name).decode('ascii') # <<<<<<<<<<<<<<
15158 * elif not isinstance(name, unicode):
15159 * raise TypeError, u"Type name must be a string"
15161 if (unlikely(__pyx_v_name == Py_None)) {
15162 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
15163 __PYX_ERR(0, 928, __pyx_L1_error)
15165 __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_v_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error)
15166 __Pyx_GOTREF(__pyx_t_3);
15167 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3);
15170 /* "lxml/objectify.pyx":927
15171 * cdef list _schema_types
15172 * def __init__(self, name, type_check, type_class, stringify=None):
15173 * if isinstance(name, bytes): # <<<<<<<<<<<<<<
15174 * name = (<bytes>name).decode('ascii')
15175 * elif not isinstance(name, unicode):
15180 /* "lxml/objectify.pyx":929
15181 * if isinstance(name, bytes):
15182 * name = (<bytes>name).decode('ascii')
15183 * elif not isinstance(name, unicode): # <<<<<<<<<<<<<<
15184 * raise TypeError, u"Type name must be a string"
15185 * if type_check is not None and not callable(type_check):
15187 __pyx_t_2 = PyUnicode_Check(__pyx_v_name);
15188 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
15189 if (unlikely(__pyx_t_1)) {
15191 /* "lxml/objectify.pyx":930
15192 * name = (<bytes>name).decode('ascii')
15193 * elif not isinstance(name, unicode):
15194 * raise TypeError, u"Type name must be a string" # <<<<<<<<<<<<<<
15195 * if type_check is not None and not callable(type_check):
15196 * raise TypeError, u"Type check function must be callable (or None)"
15198 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Type_name_must_be_a_string, 0, 0);
15199 __PYX_ERR(0, 930, __pyx_L1_error)
15201 /* "lxml/objectify.pyx":929
15202 * if isinstance(name, bytes):
15203 * name = (<bytes>name).decode('ascii')
15204 * elif not isinstance(name, unicode): # <<<<<<<<<<<<<<
15205 * raise TypeError, u"Type name must be a string"
15206 * if type_check is not None and not callable(type_check):
15211 /* "lxml/objectify.pyx":931
15212 * elif not isinstance(name, unicode):
15213 * raise TypeError, u"Type name must be a string"
15214 * if type_check is not None and not callable(type_check): # <<<<<<<<<<<<<<
15215 * raise TypeError, u"Type check function must be callable (or None)"
15216 * if name != TREE_PYTYPE_NAME and \
15218 __pyx_t_2 = (__pyx_v_type_check != Py_None);
15219 __pyx_t_4 = (__pyx_t_2 != 0);
15222 __pyx_t_1 = __pyx_t_4;
15223 goto __pyx_L5_bool_binop_done;
15225 __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_type_check); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error)
15226 __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0);
15227 __pyx_t_1 = __pyx_t_2;
15228 __pyx_L5_bool_binop_done:;
15229 if (unlikely(__pyx_t_1)) {
15231 /* "lxml/objectify.pyx":932
15232 * raise TypeError, u"Type name must be a string"
15233 * if type_check is not None and not callable(type_check):
15234 * raise TypeError, u"Type check function must be callable (or None)" # <<<<<<<<<<<<<<
15235 * if name != TREE_PYTYPE_NAME and \
15236 * not issubclass(type_class, ObjectifiedDataElement):
15238 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Type_check_function_must_be_call, 0, 0);
15239 __PYX_ERR(0, 932, __pyx_L1_error)
15241 /* "lxml/objectify.pyx":931
15242 * elif not isinstance(name, unicode):
15243 * raise TypeError, u"Type name must be a string"
15244 * if type_check is not None and not callable(type_check): # <<<<<<<<<<<<<<
15245 * raise TypeError, u"Type check function must be callable (or None)"
15246 * if name != TREE_PYTYPE_NAME and \
15250 /* "lxml/objectify.pyx":933
15251 * if type_check is not None and not callable(type_check):
15252 * raise TypeError, u"Type check function must be callable (or None)"
15253 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15254 * not issubclass(type_class, ObjectifiedDataElement):
15255 * raise TypeError, \
15257 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 933, __pyx_L1_error)
15260 __pyx_t_1 = __pyx_t_2;
15261 goto __pyx_L8_bool_binop_done;
15264 /* "lxml/objectify.pyx":934
15265 * raise TypeError, u"Type check function must be callable (or None)"
15266 * if name != TREE_PYTYPE_NAME and \
15267 * not issubclass(type_class, ObjectifiedDataElement): # <<<<<<<<<<<<<<
15268 * raise TypeError, \
15269 * u"Data classes must inherit from ObjectifiedDataElement"
15271 __pyx_t_2 = PyObject_IsSubclass(__pyx_v_type_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 934, __pyx_L1_error)
15272 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
15273 __pyx_t_1 = __pyx_t_4;
15274 __pyx_L8_bool_binop_done:;
15276 /* "lxml/objectify.pyx":933
15277 * if type_check is not None and not callable(type_check):
15278 * raise TypeError, u"Type check function must be callable (or None)"
15279 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15280 * not issubclass(type_class, ObjectifiedDataElement):
15281 * raise TypeError, \
15283 if (unlikely(__pyx_t_1)) {
15285 /* "lxml/objectify.pyx":935
15286 * if name != TREE_PYTYPE_NAME and \
15287 * not issubclass(type_class, ObjectifiedDataElement):
15288 * raise TypeError, \ # <<<<<<<<<<<<<<
15289 * u"Data classes must inherit from ObjectifiedDataElement"
15292 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Data_classes_must_inherit_from_O, 0, 0);
15293 __PYX_ERR(0, 935, __pyx_L1_error)
15295 /* "lxml/objectify.pyx":933
15296 * if type_check is not None and not callable(type_check):
15297 * raise TypeError, u"Type check function must be callable (or None)"
15298 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15299 * not issubclass(type_class, ObjectifiedDataElement):
15300 * raise TypeError, \
15304 /* "lxml/objectify.pyx":937
15305 * raise TypeError, \
15306 * u"Data classes must inherit from ObjectifiedDataElement"
15307 * self.name = name # <<<<<<<<<<<<<<
15308 * self._type = type_class
15309 * self.type_check = type_check
15311 __Pyx_INCREF(__pyx_v_name);
15312 __Pyx_GIVEREF(__pyx_v_name);
15313 __Pyx_GOTREF(__pyx_v_self->name);
15314 __Pyx_DECREF(__pyx_v_self->name);
15315 __pyx_v_self->name = __pyx_v_name;
15317 /* "lxml/objectify.pyx":938
15318 * u"Data classes must inherit from ObjectifiedDataElement"
15320 * self._type = type_class # <<<<<<<<<<<<<<
15321 * self.type_check = type_check
15322 * if stringify is None:
15324 __Pyx_INCREF(__pyx_v_type_class);
15325 __Pyx_GIVEREF(__pyx_v_type_class);
15326 __Pyx_GOTREF(__pyx_v_self->_type);
15327 __Pyx_DECREF(__pyx_v_self->_type);
15328 __pyx_v_self->_type = __pyx_v_type_class;
15330 /* "lxml/objectify.pyx":939
15332 * self._type = type_class
15333 * self.type_check = type_check # <<<<<<<<<<<<<<
15334 * if stringify is None:
15335 * stringify = unicode
15337 __Pyx_INCREF(__pyx_v_type_check);
15338 __Pyx_GIVEREF(__pyx_v_type_check);
15339 __Pyx_GOTREF(__pyx_v_self->type_check);
15340 __Pyx_DECREF(__pyx_v_self->type_check);
15341 __pyx_v_self->type_check = __pyx_v_type_check;
15343 /* "lxml/objectify.pyx":940
15344 * self._type = type_class
15345 * self.type_check = type_check
15346 * if stringify is None: # <<<<<<<<<<<<<<
15347 * stringify = unicode
15348 * self.stringify = stringify
15350 __pyx_t_1 = (__pyx_v_stringify == Py_None);
15351 __pyx_t_4 = (__pyx_t_1 != 0);
15354 /* "lxml/objectify.pyx":941
15355 * self.type_check = type_check
15356 * if stringify is None:
15357 * stringify = unicode # <<<<<<<<<<<<<<
15358 * self.stringify = stringify
15359 * self._schema_types = []
15361 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
15362 __Pyx_DECREF_SET(__pyx_v_stringify, ((PyObject *)(&PyUnicode_Type)));
15364 /* "lxml/objectify.pyx":940
15365 * self._type = type_class
15366 * self.type_check = type_check
15367 * if stringify is None: # <<<<<<<<<<<<<<
15368 * stringify = unicode
15369 * self.stringify = stringify
15373 /* "lxml/objectify.pyx":942
15374 * if stringify is None:
15375 * stringify = unicode
15376 * self.stringify = stringify # <<<<<<<<<<<<<<
15377 * self._schema_types = []
15380 __Pyx_INCREF(__pyx_v_stringify);
15381 __Pyx_GIVEREF(__pyx_v_stringify);
15382 __Pyx_GOTREF(__pyx_v_self->stringify);
15383 __Pyx_DECREF(__pyx_v_self->stringify);
15384 __pyx_v_self->stringify = __pyx_v_stringify;
15386 /* "lxml/objectify.pyx":943
15387 * stringify = unicode
15388 * self.stringify = stringify
15389 * self._schema_types = [] # <<<<<<<<<<<<<<
15391 * def __repr__(self):
15393 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
15394 __Pyx_GOTREF(__pyx_t_3);
15395 __Pyx_GIVEREF(__pyx_t_3);
15396 __Pyx_GOTREF(__pyx_v_self->_schema_types);
15397 __Pyx_DECREF(__pyx_v_self->_schema_types);
15398 __pyx_v_self->_schema_types = ((PyObject*)__pyx_t_3);
15401 /* "lxml/objectify.pyx":926
15402 * cdef object _type
15403 * cdef list _schema_types
15404 * def __init__(self, name, type_check, type_class, stringify=None): # <<<<<<<<<<<<<<
15405 * if isinstance(name, bytes):
15406 * name = (<bytes>name).decode('ascii')
15409 /* function exit code */
15413 __Pyx_XDECREF(__pyx_t_3);
15414 __Pyx_AddTraceback("lxml.objectify.PyType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15417 __Pyx_XDECREF(__pyx_v_name);
15418 __Pyx_XDECREF(__pyx_v_stringify);
15419 __Pyx_RefNannyFinishContext();
15423 /* "lxml/objectify.pyx":945
15424 * self._schema_types = []
15426 * def __repr__(self): # <<<<<<<<<<<<<<
15427 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15431 /* Python wrapper */
15432 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_3__repr__(PyObject *__pyx_v_self); /*proto*/
15433 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_3__repr__(PyObject *__pyx_v_self) {
15434 PyObject *__pyx_r = 0;
15435 __Pyx_RefNannyDeclarations
15436 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
15437 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_2__repr__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
15439 /* function exit code */
15440 __Pyx_RefNannyFinishContext();
15444 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_2__repr__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
15445 PyObject *__pyx_r = NULL;
15446 __Pyx_RefNannyDeclarations
15447 PyObject *__pyx_t_1 = NULL;
15448 PyObject *__pyx_t_2 = NULL;
15449 int __pyx_lineno = 0;
15450 const char *__pyx_filename = NULL;
15451 int __pyx_clineno = 0;
15452 __Pyx_RefNannySetupContext("__repr__", 0);
15454 /* "lxml/objectify.pyx":946
15456 * def __repr__(self):
15457 * return "PyType(%s, %s)" % (self.name, self._type.__name__) # <<<<<<<<<<<<<<
15459 * def register(self, before=None, after=None):
15461 __Pyx_XDECREF(__pyx_r);
15462 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_type, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
15463 __Pyx_GOTREF(__pyx_t_1);
15464 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
15465 __Pyx_GOTREF(__pyx_t_2);
15466 __Pyx_INCREF(__pyx_v_self->name);
15467 __Pyx_GIVEREF(__pyx_v_self->name);
15468 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name);
15469 __Pyx_GIVEREF(__pyx_t_1);
15470 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
15472 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_PyType_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
15473 __Pyx_GOTREF(__pyx_t_1);
15474 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15475 __pyx_r = __pyx_t_1;
15479 /* "lxml/objectify.pyx":945
15480 * self._schema_types = []
15482 * def __repr__(self): # <<<<<<<<<<<<<<
15483 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15487 /* function exit code */
15489 __Pyx_XDECREF(__pyx_t_1);
15490 __Pyx_XDECREF(__pyx_t_2);
15491 __Pyx_AddTraceback("lxml.objectify.PyType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15494 __Pyx_XGIVEREF(__pyx_r);
15495 __Pyx_RefNannyFinishContext();
15499 /* "lxml/objectify.pyx":948
15500 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15502 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
15503 * u"""register(self, before=None, after=None)
15507 /* Python wrapper */
15508 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_5register(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15509 static char __pyx_doc_4lxml_9objectify_6PyType_4register[] = "register(self, before=None, after=None)\n\n Register the type.\n\n The additional keyword arguments 'before' and 'after' accept a\n sequence of type names that must appear before/after the new type in\n the type list. If any of them is not currently known, it is simply\n ignored. Raises ValueError if the dependencies cannot be fulfilled.\n ";
15510 static PyMethodDef __pyx_mdef_4lxml_9objectify_6PyType_5register = {"register", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_6PyType_5register, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_6PyType_4register};
15511 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_5register(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15512 PyObject *__pyx_v_before = 0;
15513 PyObject *__pyx_v_after = 0;
15514 int __pyx_lineno = 0;
15515 const char *__pyx_filename = NULL;
15516 int __pyx_clineno = 0;
15517 PyObject *__pyx_r = 0;
15518 __Pyx_RefNannyDeclarations
15519 __Pyx_RefNannySetupContext("register (wrapper)", 0);
15521 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_before,&__pyx_n_s_after,0};
15522 PyObject* values[2] = {0,0};
15523 values[0] = ((PyObject *)Py_None);
15524 values[1] = ((PyObject *)Py_None);
15525 if (unlikely(__pyx_kwds)) {
15526 Py_ssize_t kw_args;
15527 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15528 switch (pos_args) {
15529 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15530 CYTHON_FALLTHROUGH;
15531 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15532 CYTHON_FALLTHROUGH;
15534 default: goto __pyx_L5_argtuple_error;
15536 kw_args = PyDict_Size(__pyx_kwds);
15537 switch (pos_args) {
15540 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_before);
15541 if (value) { values[0] = value; kw_args--; }
15543 CYTHON_FALLTHROUGH;
15546 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
15547 if (value) { values[1] = value; kw_args--; }
15550 if (unlikely(kw_args > 0)) {
15551 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
15554 switch (PyTuple_GET_SIZE(__pyx_args)) {
15555 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15556 CYTHON_FALLTHROUGH;
15557 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15558 CYTHON_FALLTHROUGH;
15560 default: goto __pyx_L5_argtuple_error;
15563 __pyx_v_before = values[0];
15564 __pyx_v_after = values[1];
15566 goto __pyx_L4_argument_unpacking_done;
15567 __pyx_L5_argtuple_error:;
15568 __Pyx_RaiseArgtupleInvalid("register", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 948, __pyx_L3_error)
15570 __Pyx_AddTraceback("lxml.objectify.PyType.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
15571 __Pyx_RefNannyFinishContext();
15573 __pyx_L4_argument_unpacking_done:;
15574 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_4register(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self), __pyx_v_before, __pyx_v_after);
15576 /* function exit code */
15577 __Pyx_RefNannyFinishContext();
15581 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4register(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_before, PyObject *__pyx_v_after) {
15582 PyObject *__pyx_v_item = NULL;
15583 PyObject *__pyx_v_entry = NULL;
15584 PyObject *__pyx_v_first_pos = NULL;
15585 PyObject *__pyx_v_last_pos = NULL;
15586 PyObject *__pyx_v_i = NULL;
15587 CYTHON_UNUSED PyObject *__pyx_v_check = NULL;
15588 PyObject *__pyx_v_pytype = NULL;
15589 PyObject *__pyx_v_xs_type = NULL;
15590 PyObject *__pyx_r = NULL;
15591 __Pyx_RefNannyDeclarations
15594 PyObject *__pyx_t_3 = NULL;
15595 Py_ssize_t __pyx_t_4;
15596 PyObject *__pyx_t_5 = NULL;
15597 PyObject *__pyx_t_6 = NULL;
15598 PyObject *__pyx_t_7 = NULL;
15599 PyObject *__pyx_t_8 = NULL;
15600 PyObject *__pyx_t_9 = NULL;
15601 PyObject *(*__pyx_t_10)(PyObject *);
15604 int __pyx_lineno = 0;
15605 const char *__pyx_filename = NULL;
15606 int __pyx_clineno = 0;
15607 __Pyx_RefNannySetupContext("register", 0);
15608 __Pyx_INCREF(__pyx_v_before);
15609 __Pyx_INCREF(__pyx_v_after);
15611 /* "lxml/objectify.pyx":958
15612 * ignored. Raises ValueError if the dependencies cannot be fulfilled.
15614 * if self.name == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
15615 * raise ValueError, u"Cannot register tree type"
15616 * if self.type_check is not None:
15618 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->name, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 958, __pyx_L1_error)
15619 if (unlikely(__pyx_t_1)) {
15621 /* "lxml/objectify.pyx":959
15623 * if self.name == TREE_PYTYPE_NAME:
15624 * raise ValueError, u"Cannot register tree type" # <<<<<<<<<<<<<<
15625 * if self.type_check is not None:
15626 * for item in _TYPE_CHECKS:
15628 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_register_tree_type, 0, 0);
15629 __PYX_ERR(0, 959, __pyx_L1_error)
15631 /* "lxml/objectify.pyx":958
15632 * ignored. Raises ValueError if the dependencies cannot be fulfilled.
15634 * if self.name == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
15635 * raise ValueError, u"Cannot register tree type"
15636 * if self.type_check is not None:
15640 /* "lxml/objectify.pyx":960
15641 * if self.name == TREE_PYTYPE_NAME:
15642 * raise ValueError, u"Cannot register tree type"
15643 * if self.type_check is not None: # <<<<<<<<<<<<<<
15644 * for item in _TYPE_CHECKS:
15645 * if item[0] is self.type_check:
15647 __pyx_t_1 = (__pyx_v_self->type_check != Py_None);
15648 __pyx_t_2 = (__pyx_t_1 != 0);
15651 /* "lxml/objectify.pyx":961
15652 * raise ValueError, u"Cannot register tree type"
15653 * if self.type_check is not None:
15654 * for item in _TYPE_CHECKS: # <<<<<<<<<<<<<<
15655 * if item[0] is self.type_check:
15656 * _TYPE_CHECKS.remove(item)
15658 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
15659 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
15660 __PYX_ERR(0, 961, __pyx_L1_error)
15662 __pyx_t_3 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
15664 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
15665 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15666 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
15668 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 961, __pyx_L1_error)
15669 __Pyx_GOTREF(__pyx_t_5);
15671 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
15674 /* "lxml/objectify.pyx":962
15675 * if self.type_check is not None:
15676 * for item in _TYPE_CHECKS:
15677 * if item[0] is self.type_check: # <<<<<<<<<<<<<<
15678 * _TYPE_CHECKS.remove(item)
15681 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_item, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
15682 __Pyx_GOTREF(__pyx_t_5);
15683 __pyx_t_2 = (__pyx_t_5 == __pyx_v_self->type_check);
15684 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15685 __pyx_t_1 = (__pyx_t_2 != 0);
15688 /* "lxml/objectify.pyx":963
15689 * for item in _TYPE_CHECKS:
15690 * if item[0] is self.type_check:
15691 * _TYPE_CHECKS.remove(item) # <<<<<<<<<<<<<<
15693 * entry = (self.type_check, self)
15695 __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error)
15696 __Pyx_GOTREF(__pyx_t_5);
15697 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15699 /* "lxml/objectify.pyx":964
15700 * if item[0] is self.type_check:
15701 * _TYPE_CHECKS.remove(item)
15702 * break # <<<<<<<<<<<<<<
15703 * entry = (self.type_check, self)
15706 goto __pyx_L6_break;
15708 /* "lxml/objectify.pyx":962
15709 * if self.type_check is not None:
15710 * for item in _TYPE_CHECKS:
15711 * if item[0] is self.type_check: # <<<<<<<<<<<<<<
15712 * _TYPE_CHECKS.remove(item)
15717 /* "lxml/objectify.pyx":961
15718 * raise ValueError, u"Cannot register tree type"
15719 * if self.type_check is not None:
15720 * for item in _TYPE_CHECKS: # <<<<<<<<<<<<<<
15721 * if item[0] is self.type_check:
15722 * _TYPE_CHECKS.remove(item)
15726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15728 /* "lxml/objectify.pyx":965
15729 * _TYPE_CHECKS.remove(item)
15731 * entry = (self.type_check, self) # <<<<<<<<<<<<<<
15735 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error)
15736 __Pyx_GOTREF(__pyx_t_3);
15737 __Pyx_INCREF(__pyx_v_self->type_check);
15738 __Pyx_GIVEREF(__pyx_v_self->type_check);
15739 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->type_check);
15740 __Pyx_INCREF(((PyObject *)__pyx_v_self));
15741 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15742 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
15743 __pyx_v_entry = ((PyObject*)__pyx_t_3);
15746 /* "lxml/objectify.pyx":966
15748 * entry = (self.type_check, self)
15749 * first_pos = 0 # <<<<<<<<<<<<<<
15751 * if before or after:
15753 __Pyx_INCREF(__pyx_int_0);
15754 __pyx_v_first_pos = __pyx_int_0;
15756 /* "lxml/objectify.pyx":967
15757 * entry = (self.type_check, self)
15759 * last_pos = -1 # <<<<<<<<<<<<<<
15760 * if before or after:
15761 * if before is None:
15763 __Pyx_INCREF(__pyx_int_neg_1);
15764 __pyx_v_last_pos = __pyx_int_neg_1;
15766 /* "lxml/objectify.pyx":968
15769 * if before or after: # <<<<<<<<<<<<<<
15770 * if before is None:
15773 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_before); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 968, __pyx_L1_error)
15776 __pyx_t_1 = __pyx_t_2;
15777 goto __pyx_L9_bool_binop_done;
15779 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_after); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 968, __pyx_L1_error)
15780 __pyx_t_1 = __pyx_t_2;
15781 __pyx_L9_bool_binop_done:;
15784 /* "lxml/objectify.pyx":969
15786 * if before or after:
15787 * if before is None: # <<<<<<<<<<<<<<
15789 * elif after is None:
15791 __pyx_t_1 = (__pyx_v_before == Py_None);
15792 __pyx_t_2 = (__pyx_t_1 != 0);
15795 /* "lxml/objectify.pyx":970
15796 * if before or after:
15797 * if before is None:
15798 * before = () # <<<<<<<<<<<<<<
15799 * elif after is None:
15802 __Pyx_INCREF(__pyx_empty_tuple);
15803 __Pyx_DECREF_SET(__pyx_v_before, __pyx_empty_tuple);
15805 /* "lxml/objectify.pyx":969
15807 * if before or after:
15808 * if before is None: # <<<<<<<<<<<<<<
15810 * elif after is None:
15815 /* "lxml/objectify.pyx":971
15816 * if before is None:
15818 * elif after is None: # <<<<<<<<<<<<<<
15820 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15822 __pyx_t_2 = (__pyx_v_after == Py_None);
15823 __pyx_t_1 = (__pyx_t_2 != 0);
15826 /* "lxml/objectify.pyx":972
15828 * elif after is None:
15829 * after = () # <<<<<<<<<<<<<<
15830 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15831 * if last_pos == -1 and pytype.name in before:
15833 __Pyx_INCREF(__pyx_empty_tuple);
15834 __Pyx_DECREF_SET(__pyx_v_after, __pyx_empty_tuple);
15836 /* "lxml/objectify.pyx":971
15837 * if before is None:
15839 * elif after is None: # <<<<<<<<<<<<<<
15841 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15846 /* "lxml/objectify.pyx":973
15847 * elif after is None:
15849 * for i, (check, pytype) in enumerate(_TYPE_CHECKS): # <<<<<<<<<<<<<<
15850 * if last_pos == -1 and pytype.name in before:
15853 __Pyx_INCREF(__pyx_int_0);
15854 __pyx_t_3 = __pyx_int_0;
15855 __pyx_t_5 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
15857 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
15858 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15859 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 973, __pyx_L1_error)
15861 __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __pyx_L1_error)
15862 __Pyx_GOTREF(__pyx_t_6);
15864 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
15865 PyObject* sequence = __pyx_t_6;
15866 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15867 if (unlikely(size != 2)) {
15868 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15869 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15870 __PYX_ERR(0, 973, __pyx_L1_error)
15872 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15873 if (likely(PyTuple_CheckExact(sequence))) {
15874 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
15875 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
15877 __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
15878 __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
15880 __Pyx_INCREF(__pyx_t_7);
15881 __Pyx_INCREF(__pyx_t_8);
15883 __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error)
15884 __Pyx_GOTREF(__pyx_t_7);
15885 __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 973, __pyx_L1_error)
15886 __Pyx_GOTREF(__pyx_t_8);
15888 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15890 Py_ssize_t index = -1;
15891 __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error)
15892 __Pyx_GOTREF(__pyx_t_9);
15893 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15894 __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
15895 index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
15896 __Pyx_GOTREF(__pyx_t_7);
15897 index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed;
15898 __Pyx_GOTREF(__pyx_t_8);
15899 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 973, __pyx_L1_error)
15901 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15902 goto __pyx_L15_unpacking_done;
15903 __pyx_L14_unpacking_failed:;
15904 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15906 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
15907 __PYX_ERR(0, 973, __pyx_L1_error)
15908 __pyx_L15_unpacking_done:;
15910 __Pyx_XDECREF_SET(__pyx_v_check, __pyx_t_7);
15912 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_8);
15914 __Pyx_INCREF(__pyx_t_3);
15915 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
15916 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 973, __pyx_L1_error)
15917 __Pyx_GOTREF(__pyx_t_6);
15918 __Pyx_DECREF(__pyx_t_3);
15919 __pyx_t_3 = __pyx_t_6;
15922 /* "lxml/objectify.pyx":974
15924 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15925 * if last_pos == -1 and pytype.name in before: # <<<<<<<<<<<<<<
15927 * if pytype.name in after:
15929 __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_last_pos, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
15930 __Pyx_GOTREF(__pyx_t_6);
15931 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
15932 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15935 __pyx_t_1 = __pyx_t_2;
15936 goto __pyx_L17_bool_binop_done;
15938 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
15939 __Pyx_GOTREF(__pyx_t_6);
15940 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_v_before, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
15941 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15942 __pyx_t_11 = (__pyx_t_2 != 0);
15943 __pyx_t_1 = __pyx_t_11;
15944 __pyx_L17_bool_binop_done:;
15947 /* "lxml/objectify.pyx":975
15948 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15949 * if last_pos == -1 and pytype.name in before:
15950 * last_pos = i # <<<<<<<<<<<<<<
15951 * if pytype.name in after:
15954 __Pyx_INCREF(__pyx_v_i);
15955 __Pyx_DECREF_SET(__pyx_v_last_pos, __pyx_v_i);
15957 /* "lxml/objectify.pyx":974
15959 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15960 * if last_pos == -1 and pytype.name in before: # <<<<<<<<<<<<<<
15962 * if pytype.name in after:
15966 /* "lxml/objectify.pyx":976
15967 * if last_pos == -1 and pytype.name in before:
15969 * if pytype.name in after: # <<<<<<<<<<<<<<
15971 * if last_pos == -1:
15973 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
15974 __Pyx_GOTREF(__pyx_t_6);
15975 __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_v_after, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
15976 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15977 __pyx_t_11 = (__pyx_t_1 != 0);
15980 /* "lxml/objectify.pyx":977
15982 * if pytype.name in after:
15983 * first_pos = i+1 # <<<<<<<<<<<<<<
15984 * if last_pos == -1:
15985 * _TYPE_CHECKS.append(entry)
15987 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 977, __pyx_L1_error)
15988 __Pyx_GOTREF(__pyx_t_6);
15989 __Pyx_DECREF_SET(__pyx_v_first_pos, __pyx_t_6);
15992 /* "lxml/objectify.pyx":976
15993 * if last_pos == -1 and pytype.name in before:
15995 * if pytype.name in after: # <<<<<<<<<<<<<<
15997 * if last_pos == -1:
16001 /* "lxml/objectify.pyx":973
16002 * elif after is None:
16004 * for i, (check, pytype) in enumerate(_TYPE_CHECKS): # <<<<<<<<<<<<<<
16005 * if last_pos == -1 and pytype.name in before:
16009 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16010 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16012 /* "lxml/objectify.pyx":968
16015 * if before or after: # <<<<<<<<<<<<<<
16016 * if before is None:
16021 /* "lxml/objectify.pyx":978
16022 * if pytype.name in after:
16024 * if last_pos == -1: # <<<<<<<<<<<<<<
16025 * _TYPE_CHECKS.append(entry)
16026 * elif first_pos > last_pos:
16028 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_last_pos, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error)
16029 __Pyx_GOTREF(__pyx_t_3);
16030 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 978, __pyx_L1_error)
16031 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16034 /* "lxml/objectify.pyx":979
16036 * if last_pos == -1:
16037 * _TYPE_CHECKS.append(entry) # <<<<<<<<<<<<<<
16038 * elif first_pos > last_pos:
16039 * raise ValueError, u"inconsistent before/after dependencies"
16041 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
16042 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
16043 __PYX_ERR(0, 979, __pyx_L1_error)
16045 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_v_entry); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 979, __pyx_L1_error)
16047 /* "lxml/objectify.pyx":978
16048 * if pytype.name in after:
16050 * if last_pos == -1: # <<<<<<<<<<<<<<
16051 * _TYPE_CHECKS.append(entry)
16052 * elif first_pos > last_pos:
16057 /* "lxml/objectify.pyx":980
16058 * if last_pos == -1:
16059 * _TYPE_CHECKS.append(entry)
16060 * elif first_pos > last_pos: # <<<<<<<<<<<<<<
16061 * raise ValueError, u"inconsistent before/after dependencies"
16064 __pyx_t_3 = PyObject_RichCompare(__pyx_v_first_pos, __pyx_v_last_pos, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error)
16065 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 980, __pyx_L1_error)
16066 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16067 if (unlikely(__pyx_t_11)) {
16069 /* "lxml/objectify.pyx":981
16070 * _TYPE_CHECKS.append(entry)
16071 * elif first_pos > last_pos:
16072 * raise ValueError, u"inconsistent before/after dependencies" # <<<<<<<<<<<<<<
16074 * _TYPE_CHECKS.insert(last_pos, entry)
16076 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_inconsistent_before_after_depend, 0, 0);
16077 __PYX_ERR(0, 981, __pyx_L1_error)
16079 /* "lxml/objectify.pyx":980
16080 * if last_pos == -1:
16081 * _TYPE_CHECKS.append(entry)
16082 * elif first_pos > last_pos: # <<<<<<<<<<<<<<
16083 * raise ValueError, u"inconsistent before/after dependencies"
16088 /* "lxml/objectify.pyx":983
16089 * raise ValueError, u"inconsistent before/after dependencies"
16091 * _TYPE_CHECKS.insert(last_pos, entry) # <<<<<<<<<<<<<<
16093 * _PYTYPE_DICT[self.name] = self
16096 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
16097 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "insert");
16098 __PYX_ERR(0, 983, __pyx_L1_error)
16100 __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_last_pos); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 983, __pyx_L1_error)
16101 __pyx_t_12 = PyList_Insert(__pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_t_4, __pyx_v_entry); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 983, __pyx_L1_error)
16105 /* "lxml/objectify.pyx":960
16106 * if self.name == TREE_PYTYPE_NAME:
16107 * raise ValueError, u"Cannot register tree type"
16108 * if self.type_check is not None: # <<<<<<<<<<<<<<
16109 * for item in _TYPE_CHECKS:
16110 * if item[0] is self.type_check:
16114 /* "lxml/objectify.pyx":985
16115 * _TYPE_CHECKS.insert(last_pos, entry)
16117 * _PYTYPE_DICT[self.name] = self # <<<<<<<<<<<<<<
16118 * for xs_type in self._schema_types:
16119 * _SCHEMA_TYPE_DICT[xs_type] = self
16121 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16122 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16123 __PYX_ERR(0, 985, __pyx_L1_error)
16125 if (unlikely(PyDict_SetItem(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_self->name, ((PyObject *)__pyx_v_self)) < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
16127 /* "lxml/objectify.pyx":986
16129 * _PYTYPE_DICT[self.name] = self
16130 * for xs_type in self._schema_types: # <<<<<<<<<<<<<<
16131 * _SCHEMA_TYPE_DICT[xs_type] = self
16134 if (unlikely(__pyx_v_self->_schema_types == Py_None)) {
16135 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
16136 __PYX_ERR(0, 986, __pyx_L1_error)
16138 __pyx_t_3 = __pyx_v_self->_schema_types; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
16140 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
16141 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16142 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 986, __pyx_L1_error)
16144 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 986, __pyx_L1_error)
16145 __Pyx_GOTREF(__pyx_t_5);
16147 __Pyx_XDECREF_SET(__pyx_v_xs_type, __pyx_t_5);
16150 /* "lxml/objectify.pyx":987
16151 * _PYTYPE_DICT[self.name] = self
16152 * for xs_type in self._schema_types:
16153 * _SCHEMA_TYPE_DICT[xs_type] = self # <<<<<<<<<<<<<<
16155 * def unregister(self):
16157 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16158 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16159 __PYX_ERR(0, 987, __pyx_L1_error)
16161 if (unlikely(PyDict_SetItem(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_xs_type, ((PyObject *)__pyx_v_self)) < 0)) __PYX_ERR(0, 987, __pyx_L1_error)
16163 /* "lxml/objectify.pyx":986
16165 * _PYTYPE_DICT[self.name] = self
16166 * for xs_type in self._schema_types: # <<<<<<<<<<<<<<
16167 * _SCHEMA_TYPE_DICT[xs_type] = self
16171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16173 /* "lxml/objectify.pyx":948
16174 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
16176 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
16177 * u"""register(self, before=None, after=None)
16181 /* function exit code */
16182 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16185 __Pyx_XDECREF(__pyx_t_3);
16186 __Pyx_XDECREF(__pyx_t_5);
16187 __Pyx_XDECREF(__pyx_t_6);
16188 __Pyx_XDECREF(__pyx_t_7);
16189 __Pyx_XDECREF(__pyx_t_8);
16190 __Pyx_XDECREF(__pyx_t_9);
16191 __Pyx_AddTraceback("lxml.objectify.PyType.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
16194 __Pyx_XDECREF(__pyx_v_item);
16195 __Pyx_XDECREF(__pyx_v_entry);
16196 __Pyx_XDECREF(__pyx_v_first_pos);
16197 __Pyx_XDECREF(__pyx_v_last_pos);
16198 __Pyx_XDECREF(__pyx_v_i);
16199 __Pyx_XDECREF(__pyx_v_check);
16200 __Pyx_XDECREF(__pyx_v_pytype);
16201 __Pyx_XDECREF(__pyx_v_xs_type);
16202 __Pyx_XDECREF(__pyx_v_before);
16203 __Pyx_XDECREF(__pyx_v_after);
16204 __Pyx_XGIVEREF(__pyx_r);
16205 __Pyx_RefNannyFinishContext();
16209 /* "lxml/objectify.pyx":989
16210 * _SCHEMA_TYPE_DICT[xs_type] = self
16212 * def unregister(self): # <<<<<<<<<<<<<<
16213 * u"unregister(self)"
16214 * if _PYTYPE_DICT.get(self.name) is self:
16217 /* Python wrapper */
16218 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_7unregister(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16219 static char __pyx_doc_4lxml_9objectify_6PyType_6unregister[] = "unregister(self)";
16220 static PyMethodDef __pyx_mdef_4lxml_9objectify_6PyType_7unregister = {"unregister", (PyCFunction)__pyx_pw_4lxml_9objectify_6PyType_7unregister, METH_NOARGS, __pyx_doc_4lxml_9objectify_6PyType_6unregister};
16221 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_7unregister(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16222 PyObject *__pyx_r = 0;
16223 __Pyx_RefNannyDeclarations
16224 __Pyx_RefNannySetupContext("unregister (wrapper)", 0);
16225 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_6unregister(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16227 /* function exit code */
16228 __Pyx_RefNannyFinishContext();
16232 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16233 PyObject *__pyx_v_xs_type = NULL;
16234 PyObject *__pyx_v_pytype = NULL;
16235 PyObject *__pyx_r = NULL;
16236 __Pyx_RefNannyDeclarations
16237 PyObject *__pyx_t_1 = NULL;
16240 PyObject *__pyx_t_4 = NULL;
16241 Py_ssize_t __pyx_t_5;
16242 PyObject *__pyx_t_6 = NULL;
16243 PyObject *__pyx_t_7 = NULL;
16244 PyObject *__pyx_t_8 = NULL;
16245 PyObject *(*__pyx_t_9)(PyObject *);
16246 PyObject *__pyx_t_10 = NULL;
16247 PyObject *__pyx_t_11 = NULL;
16248 PyObject *__pyx_t_12 = NULL;
16250 int __pyx_lineno = 0;
16251 const char *__pyx_filename = NULL;
16252 int __pyx_clineno = 0;
16253 __Pyx_RefNannySetupContext("unregister", 0);
16255 /* "lxml/objectify.pyx":991
16256 * def unregister(self):
16257 * u"unregister(self)"
16258 * if _PYTYPE_DICT.get(self.name) is self: # <<<<<<<<<<<<<<
16259 * del _PYTYPE_DICT[self.name]
16260 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16262 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16263 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
16264 __PYX_ERR(0, 991, __pyx_L1_error)
16266 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_self->name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error)
16267 __Pyx_GOTREF(__pyx_t_1);
16268 __pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_v_self));
16269 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16270 __pyx_t_3 = (__pyx_t_2 != 0);
16273 /* "lxml/objectify.pyx":992
16274 * u"unregister(self)"
16275 * if _PYTYPE_DICT.get(self.name) is self:
16276 * del _PYTYPE_DICT[self.name] # <<<<<<<<<<<<<<
16277 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16278 * if pytype is self:
16280 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16281 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16282 __PYX_ERR(0, 992, __pyx_L1_error)
16284 if (unlikely(PyDict_DelItem(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_self->name) < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
16286 /* "lxml/objectify.pyx":991
16287 * def unregister(self):
16288 * u"unregister(self)"
16289 * if _PYTYPE_DICT.get(self.name) is self: # <<<<<<<<<<<<<<
16290 * del _PYTYPE_DICT[self.name]
16291 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16295 /* "lxml/objectify.pyx":993
16296 * if _PYTYPE_DICT.get(self.name) is self:
16297 * del _PYTYPE_DICT[self.name]
16298 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()): # <<<<<<<<<<<<<<
16299 * if pytype is self:
16300 * del _SCHEMA_TYPE_DICT[xs_type]
16302 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16303 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
16304 __PYX_ERR(0, 993, __pyx_L1_error)
16306 __pyx_t_1 = __Pyx_PyDict_Items(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
16307 __Pyx_GOTREF(__pyx_t_1);
16308 __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error)
16309 __Pyx_GOTREF(__pyx_t_4);
16310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16311 __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
16312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16314 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
16315 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16316 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
16318 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error)
16319 __Pyx_GOTREF(__pyx_t_4);
16321 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
16322 PyObject* sequence = __pyx_t_4;
16323 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16324 if (unlikely(size != 2)) {
16325 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16326 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16327 __PYX_ERR(0, 993, __pyx_L1_error)
16329 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16330 if (likely(PyTuple_CheckExact(sequence))) {
16331 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
16332 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
16334 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
16335 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
16337 __Pyx_INCREF(__pyx_t_6);
16338 __Pyx_INCREF(__pyx_t_7);
16340 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L1_error)
16341 __Pyx_GOTREF(__pyx_t_6);
16342 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
16343 __Pyx_GOTREF(__pyx_t_7);
16345 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16347 Py_ssize_t index = -1;
16348 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error)
16349 __Pyx_GOTREF(__pyx_t_8);
16350 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16351 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
16352 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
16353 __Pyx_GOTREF(__pyx_t_6);
16354 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
16355 __Pyx_GOTREF(__pyx_t_7);
16356 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 993, __pyx_L1_error)
16358 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16359 goto __pyx_L7_unpacking_done;
16360 __pyx_L6_unpacking_failed:;
16361 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16363 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
16364 __PYX_ERR(0, 993, __pyx_L1_error)
16365 __pyx_L7_unpacking_done:;
16367 __Pyx_XDECREF_SET(__pyx_v_xs_type, __pyx_t_6);
16369 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_7);
16372 /* "lxml/objectify.pyx":994
16373 * del _PYTYPE_DICT[self.name]
16374 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16375 * if pytype is self: # <<<<<<<<<<<<<<
16376 * del _SCHEMA_TYPE_DICT[xs_type]
16377 * if self.type_check is None:
16379 __pyx_t_3 = (__pyx_v_pytype == ((PyObject *)__pyx_v_self));
16380 __pyx_t_2 = (__pyx_t_3 != 0);
16383 /* "lxml/objectify.pyx":995
16384 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16385 * if pytype is self:
16386 * del _SCHEMA_TYPE_DICT[xs_type] # <<<<<<<<<<<<<<
16387 * if self.type_check is None:
16390 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16391 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16392 __PYX_ERR(0, 995, __pyx_L1_error)
16394 if (unlikely(PyDict_DelItem(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_xs_type) < 0)) __PYX_ERR(0, 995, __pyx_L1_error)
16396 /* "lxml/objectify.pyx":994
16397 * del _PYTYPE_DICT[self.name]
16398 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16399 * if pytype is self: # <<<<<<<<<<<<<<
16400 * del _SCHEMA_TYPE_DICT[xs_type]
16401 * if self.type_check is None:
16405 /* "lxml/objectify.pyx":993
16406 * if _PYTYPE_DICT.get(self.name) is self:
16407 * del _PYTYPE_DICT[self.name]
16408 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()): # <<<<<<<<<<<<<<
16409 * if pytype is self:
16410 * del _SCHEMA_TYPE_DICT[xs_type]
16413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16415 /* "lxml/objectify.pyx":996
16416 * if pytype is self:
16417 * del _SCHEMA_TYPE_DICT[xs_type]
16418 * if self.type_check is None: # <<<<<<<<<<<<<<
16422 __pyx_t_2 = (__pyx_v_self->type_check == Py_None);
16423 __pyx_t_3 = (__pyx_t_2 != 0);
16426 /* "lxml/objectify.pyx":997
16427 * del _SCHEMA_TYPE_DICT[xs_type]
16428 * if self.type_check is None:
16429 * return # <<<<<<<<<<<<<<
16431 * _TYPE_CHECKS.remove( (self.type_check, self) )
16433 __Pyx_XDECREF(__pyx_r);
16434 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16437 /* "lxml/objectify.pyx":996
16438 * if pytype is self:
16439 * del _SCHEMA_TYPE_DICT[xs_type]
16440 * if self.type_check is None: # <<<<<<<<<<<<<<
16446 /* "lxml/objectify.pyx":998
16447 * if self.type_check is None:
16449 * try: # <<<<<<<<<<<<<<
16450 * _TYPE_CHECKS.remove( (self.type_check, self) )
16451 * except ValueError:
16454 __Pyx_PyThreadState_declare
16455 __Pyx_PyThreadState_assign
16456 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
16457 __Pyx_XGOTREF(__pyx_t_10);
16458 __Pyx_XGOTREF(__pyx_t_11);
16459 __Pyx_XGOTREF(__pyx_t_12);
16462 /* "lxml/objectify.pyx":999
16465 * _TYPE_CHECKS.remove( (self.type_check, self) ) # <<<<<<<<<<<<<<
16466 * except ValueError:
16469 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L10_error)
16470 __Pyx_GOTREF(__pyx_t_1);
16471 __Pyx_INCREF(__pyx_v_self->type_check);
16472 __Pyx_GIVEREF(__pyx_v_self->type_check);
16473 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->type_check);
16474 __Pyx_INCREF(((PyObject *)__pyx_v_self));
16475 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16476 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
16477 __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_4lxml_9objectify__TYPE_CHECKS, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L10_error)
16478 __Pyx_GOTREF(__pyx_t_4);
16479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16480 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16482 /* "lxml/objectify.pyx":998
16483 * if self.type_check is None:
16485 * try: # <<<<<<<<<<<<<<
16486 * _TYPE_CHECKS.remove( (self.type_check, self) )
16487 * except ValueError:
16490 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16491 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
16492 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
16493 goto __pyx_L15_try_end;
16495 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16496 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16497 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16498 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16499 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16501 /* "lxml/objectify.pyx":1000
16503 * _TYPE_CHECKS.remove( (self.type_check, self) )
16504 * except ValueError: # <<<<<<<<<<<<<<
16508 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
16510 __Pyx_ErrRestore(0,0,0);
16511 goto __pyx_L11_exception_handled;
16513 goto __pyx_L12_except_error;
16514 __pyx_L12_except_error:;
16516 /* "lxml/objectify.pyx":998
16517 * if self.type_check is None:
16519 * try: # <<<<<<<<<<<<<<
16520 * _TYPE_CHECKS.remove( (self.type_check, self) )
16521 * except ValueError:
16523 __Pyx_XGIVEREF(__pyx_t_10);
16524 __Pyx_XGIVEREF(__pyx_t_11);
16525 __Pyx_XGIVEREF(__pyx_t_12);
16526 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16527 goto __pyx_L1_error;
16528 __pyx_L11_exception_handled:;
16529 __Pyx_XGIVEREF(__pyx_t_10);
16530 __Pyx_XGIVEREF(__pyx_t_11);
16531 __Pyx_XGIVEREF(__pyx_t_12);
16532 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16533 __pyx_L15_try_end:;
16536 /* "lxml/objectify.pyx":989
16537 * _SCHEMA_TYPE_DICT[xs_type] = self
16539 * def unregister(self): # <<<<<<<<<<<<<<
16540 * u"unregister(self)"
16541 * if _PYTYPE_DICT.get(self.name) is self:
16544 /* function exit code */
16545 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16548 __Pyx_XDECREF(__pyx_t_1);
16549 __Pyx_XDECREF(__pyx_t_4);
16550 __Pyx_XDECREF(__pyx_t_6);
16551 __Pyx_XDECREF(__pyx_t_7);
16552 __Pyx_XDECREF(__pyx_t_8);
16553 __Pyx_AddTraceback("lxml.objectify.PyType.unregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
16556 __Pyx_XDECREF(__pyx_v_xs_type);
16557 __Pyx_XDECREF(__pyx_v_pytype);
16558 __Pyx_XGIVEREF(__pyx_r);
16559 __Pyx_RefNannyFinishContext();
16563 /* "lxml/objectify.pyx":1008
16564 * Note that this must be set before registering the type!
16566 * def __get__(self): # <<<<<<<<<<<<<<
16567 * return self._schema_types
16568 * def __set__(self, types):
16571 /* Python wrapper */
16572 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(PyObject *__pyx_v_self); /*proto*/
16573 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(PyObject *__pyx_v_self) {
16574 PyObject *__pyx_r = 0;
16575 __Pyx_RefNannyDeclarations
16576 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16577 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16579 /* function exit code */
16580 __Pyx_RefNannyFinishContext();
16584 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16585 PyObject *__pyx_r = NULL;
16586 __Pyx_RefNannyDeclarations
16587 __Pyx_RefNannySetupContext("__get__", 0);
16589 /* "lxml/objectify.pyx":1009
16591 * def __get__(self):
16592 * return self._schema_types # <<<<<<<<<<<<<<
16593 * def __set__(self, types):
16594 * self._schema_types = list(map(unicode, types))
16596 __Pyx_XDECREF(__pyx_r);
16597 __Pyx_INCREF(__pyx_v_self->_schema_types);
16598 __pyx_r = __pyx_v_self->_schema_types;
16601 /* "lxml/objectify.pyx":1008
16602 * Note that this must be set before registering the type!
16604 * def __get__(self): # <<<<<<<<<<<<<<
16605 * return self._schema_types
16606 * def __set__(self, types):
16609 /* function exit code */
16611 __Pyx_XGIVEREF(__pyx_r);
16612 __Pyx_RefNannyFinishContext();
16616 /* "lxml/objectify.pyx":1010
16617 * def __get__(self):
16618 * return self._schema_types
16619 * def __set__(self, types): # <<<<<<<<<<<<<<
16620 * self._schema_types = list(map(unicode, types))
16624 /* Python wrapper */
16625 static int __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_types); /*proto*/
16626 static int __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
16628 __Pyx_RefNannyDeclarations
16629 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16630 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self), ((PyObject *)__pyx_v_types));
16632 /* function exit code */
16633 __Pyx_RefNannyFinishContext();
16637 static int __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_types) {
16639 __Pyx_RefNannyDeclarations
16640 PyObject *__pyx_t_1 = NULL;
16641 PyObject *__pyx_t_2 = NULL;
16642 int __pyx_lineno = 0;
16643 const char *__pyx_filename = NULL;
16644 int __pyx_clineno = 0;
16645 __Pyx_RefNannySetupContext("__set__", 0);
16647 /* "lxml/objectify.pyx":1011
16648 * return self._schema_types
16649 * def __set__(self, types):
16650 * self._schema_types = list(map(unicode, types)) # <<<<<<<<<<<<<<
16654 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
16655 __Pyx_GOTREF(__pyx_t_1);
16656 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
16657 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
16658 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)));
16659 __Pyx_INCREF(__pyx_v_types);
16660 __Pyx_GIVEREF(__pyx_v_types);
16661 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_types);
16662 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
16663 __Pyx_GOTREF(__pyx_t_2);
16664 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16665 __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
16666 __Pyx_GOTREF(__pyx_t_1);
16667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16668 __Pyx_GIVEREF(__pyx_t_1);
16669 __Pyx_GOTREF(__pyx_v_self->_schema_types);
16670 __Pyx_DECREF(__pyx_v_self->_schema_types);
16671 __pyx_v_self->_schema_types = ((PyObject*)__pyx_t_1);
16674 /* "lxml/objectify.pyx":1010
16675 * def __get__(self):
16676 * return self._schema_types
16677 * def __set__(self, types): # <<<<<<<<<<<<<<
16678 * self._schema_types = list(map(unicode, types))
16682 /* function exit code */
16686 __Pyx_XDECREF(__pyx_t_1);
16687 __Pyx_XDECREF(__pyx_t_2);
16688 __Pyx_AddTraceback("lxml.objectify.PyType.xmlSchemaTypes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16691 __Pyx_RefNannyFinishContext();
16695 /* "lxml/objectify.pyx":921
16696 * matching type will be used.
16698 * cdef readonly object name # <<<<<<<<<<<<<<
16699 * cdef readonly object type_check
16700 * cdef readonly object stringify
16703 /* Python wrapper */
16704 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
16705 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(PyObject *__pyx_v_self) {
16706 PyObject *__pyx_r = 0;
16707 __Pyx_RefNannyDeclarations
16708 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16709 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_4name___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16711 /* function exit code */
16712 __Pyx_RefNannyFinishContext();
16716 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4name___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16717 PyObject *__pyx_r = NULL;
16718 __Pyx_RefNannyDeclarations
16719 __Pyx_RefNannySetupContext("__get__", 0);
16720 __Pyx_XDECREF(__pyx_r);
16721 __Pyx_INCREF(__pyx_v_self->name);
16722 __pyx_r = __pyx_v_self->name;
16725 /* function exit code */
16727 __Pyx_XGIVEREF(__pyx_r);
16728 __Pyx_RefNannyFinishContext();
16732 /* "lxml/objectify.pyx":922
16734 * cdef readonly object name
16735 * cdef readonly object type_check # <<<<<<<<<<<<<<
16736 * cdef readonly object stringify
16737 * cdef object _type
16740 /* Python wrapper */
16741 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(PyObject *__pyx_v_self); /*proto*/
16742 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(PyObject *__pyx_v_self) {
16743 PyObject *__pyx_r = 0;
16744 __Pyx_RefNannyDeclarations
16745 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16746 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16748 /* function exit code */
16749 __Pyx_RefNannyFinishContext();
16753 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16754 PyObject *__pyx_r = NULL;
16755 __Pyx_RefNannyDeclarations
16756 __Pyx_RefNannySetupContext("__get__", 0);
16757 __Pyx_XDECREF(__pyx_r);
16758 __Pyx_INCREF(__pyx_v_self->type_check);
16759 __pyx_r = __pyx_v_self->type_check;
16762 /* function exit code */
16764 __Pyx_XGIVEREF(__pyx_r);
16765 __Pyx_RefNannyFinishContext();
16769 /* "lxml/objectify.pyx":923
16770 * cdef readonly object name
16771 * cdef readonly object type_check
16772 * cdef readonly object stringify # <<<<<<<<<<<<<<
16773 * cdef object _type
16774 * cdef list _schema_types
16777 /* Python wrapper */
16778 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(PyObject *__pyx_v_self); /*proto*/
16779 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(PyObject *__pyx_v_self) {
16780 PyObject *__pyx_r = 0;
16781 __Pyx_RefNannyDeclarations
16782 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16783 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16785 /* function exit code */
16786 __Pyx_RefNannyFinishContext();
16790 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16791 PyObject *__pyx_r = NULL;
16792 __Pyx_RefNannyDeclarations
16793 __Pyx_RefNannySetupContext("__get__", 0);
16794 __Pyx_XDECREF(__pyx_r);
16795 __Pyx_INCREF(__pyx_v_self->stringify);
16796 __pyx_r = __pyx_v_self->stringify;
16799 /* function exit code */
16801 __Pyx_XGIVEREF(__pyx_r);
16802 __Pyx_RefNannyFinishContext();
16806 /* "lxml/objectify.pyx":1018
16807 * cdef list _TYPE_CHECKS = []
16809 * def __lower_bool(b): # <<<<<<<<<<<<<<
16810 * return u"true" if b else u"false"
16814 /* Python wrapper */
16815 static PyObject *__pyx_pw_4lxml_9objectify_7__lower_bool(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/
16816 static PyMethodDef __pyx_mdef_4lxml_9objectify_7__lower_bool = {"__lower_bool", (PyCFunction)__pyx_pw_4lxml_9objectify_7__lower_bool, METH_O, 0};
16817 static PyObject *__pyx_pw_4lxml_9objectify_7__lower_bool(PyObject *__pyx_self, PyObject *__pyx_v_b) {
16818 PyObject *__pyx_r = 0;
16819 __Pyx_RefNannyDeclarations
16820 __Pyx_RefNannySetupContext("__lower_bool (wrapper)", 0);
16821 __pyx_r = __pyx_pf_4lxml_9objectify_6__lower_bool(__pyx_self, ((PyObject *)__pyx_v_b));
16823 /* function exit code */
16824 __Pyx_RefNannyFinishContext();
16828 static PyObject *__pyx_pf_4lxml_9objectify_6__lower_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) {
16829 PyObject *__pyx_r = NULL;
16830 __Pyx_RefNannyDeclarations
16831 PyObject *__pyx_t_1 = NULL;
16833 int __pyx_lineno = 0;
16834 const char *__pyx_filename = NULL;
16835 int __pyx_clineno = 0;
16836 __Pyx_RefNannySetupContext("__lower_bool", 0);
16838 /* "lxml/objectify.pyx":1019
16840 * def __lower_bool(b):
16841 * return u"true" if b else u"false" # <<<<<<<<<<<<<<
16843 * cdef _pytypename(obj):
16845 __Pyx_XDECREF(__pyx_r);
16846 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_b); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1019, __pyx_L1_error)
16848 __Pyx_INCREF(__pyx_n_u_true);
16849 __pyx_t_1 = __pyx_n_u_true;
16851 __Pyx_INCREF(__pyx_n_u_false);
16852 __pyx_t_1 = __pyx_n_u_false;
16854 __pyx_r = __pyx_t_1;
16858 /* "lxml/objectify.pyx":1018
16859 * cdef list _TYPE_CHECKS = []
16861 * def __lower_bool(b): # <<<<<<<<<<<<<<
16862 * return u"true" if b else u"false"
16866 /* function exit code */
16868 __Pyx_XDECREF(__pyx_t_1);
16869 __Pyx_AddTraceback("lxml.objectify.__lower_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
16872 __Pyx_XGIVEREF(__pyx_r);
16873 __Pyx_RefNannyFinishContext();
16877 /* "lxml/objectify.pyx":1021
16878 * return u"true" if b else u"false"
16880 * cdef _pytypename(obj): # <<<<<<<<<<<<<<
16881 * return u"str" if python._isString(obj) else _typename(obj)
16885 static PyObject *__pyx_f_4lxml_9objectify__pytypename(PyObject *__pyx_v_obj) {
16886 PyObject *__pyx_r = NULL;
16887 __Pyx_RefNannyDeclarations
16888 PyObject *__pyx_t_1 = NULL;
16889 PyObject *__pyx_t_2 = NULL;
16890 int __pyx_lineno = 0;
16891 const char *__pyx_filename = NULL;
16892 int __pyx_clineno = 0;
16893 __Pyx_RefNannySetupContext("_pytypename", 0);
16895 /* "lxml/objectify.pyx":1022
16897 * cdef _pytypename(obj):
16898 * return u"str" if python._isString(obj) else _typename(obj) # <<<<<<<<<<<<<<
16900 * def pytypename(obj):
16902 __Pyx_XDECREF(__pyx_r);
16903 if ((_isString(__pyx_v_obj) != 0)) {
16904 __Pyx_INCREF(__pyx_n_u_str);
16905 __pyx_t_1 = __pyx_n_u_str;
16907 __pyx_t_2 = __pyx_f_4lxml_9objectify__typename(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
16908 __Pyx_GOTREF(__pyx_t_2);
16909 __pyx_t_1 = __pyx_t_2;
16912 __pyx_r = __pyx_t_1;
16916 /* "lxml/objectify.pyx":1021
16917 * return u"true" if b else u"false"
16919 * cdef _pytypename(obj): # <<<<<<<<<<<<<<
16920 * return u"str" if python._isString(obj) else _typename(obj)
16924 /* function exit code */
16926 __Pyx_XDECREF(__pyx_t_1);
16927 __Pyx_XDECREF(__pyx_t_2);
16928 __Pyx_AddTraceback("lxml.objectify._pytypename", __pyx_clineno, __pyx_lineno, __pyx_filename);
16931 __Pyx_XGIVEREF(__pyx_r);
16932 __Pyx_RefNannyFinishContext();
16936 /* "lxml/objectify.pyx":1024
16937 * return u"str" if python._isString(obj) else _typename(obj)
16939 * def pytypename(obj): # <<<<<<<<<<<<<<
16940 * u"""pytypename(obj)
16944 /* Python wrapper */
16945 static PyObject *__pyx_pw_4lxml_9objectify_9pytypename(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
16946 static char __pyx_doc_4lxml_9objectify_8pytypename[] = "pytypename(obj)\n\n Find the name of the corresponding PyType for a Python object.\n ";
16947 static PyMethodDef __pyx_mdef_4lxml_9objectify_9pytypename = {"pytypename", (PyCFunction)__pyx_pw_4lxml_9objectify_9pytypename, METH_O, __pyx_doc_4lxml_9objectify_8pytypename};
16948 static PyObject *__pyx_pw_4lxml_9objectify_9pytypename(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16949 PyObject *__pyx_r = 0;
16950 __Pyx_RefNannyDeclarations
16951 __Pyx_RefNannySetupContext("pytypename (wrapper)", 0);
16952 __pyx_r = __pyx_pf_4lxml_9objectify_8pytypename(__pyx_self, ((PyObject *)__pyx_v_obj));
16954 /* function exit code */
16955 __Pyx_RefNannyFinishContext();
16959 static PyObject *__pyx_pf_4lxml_9objectify_8pytypename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16960 PyObject *__pyx_r = NULL;
16961 __Pyx_RefNannyDeclarations
16962 PyObject *__pyx_t_1 = NULL;
16963 int __pyx_lineno = 0;
16964 const char *__pyx_filename = NULL;
16965 int __pyx_clineno = 0;
16966 __Pyx_RefNannySetupContext("pytypename", 0);
16968 /* "lxml/objectify.pyx":1029
16969 * Find the name of the corresponding PyType for a Python object.
16971 * return _pytypename(obj) # <<<<<<<<<<<<<<
16973 * cdef _registerPyTypes():
16975 __Pyx_XDECREF(__pyx_r);
16976 __pyx_t_1 = __pyx_f_4lxml_9objectify__pytypename(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
16977 __Pyx_GOTREF(__pyx_t_1);
16978 __pyx_r = __pyx_t_1;
16982 /* "lxml/objectify.pyx":1024
16983 * return u"str" if python._isString(obj) else _typename(obj)
16985 * def pytypename(obj): # <<<<<<<<<<<<<<
16986 * u"""pytypename(obj)
16990 /* function exit code */
16992 __Pyx_XDECREF(__pyx_t_1);
16993 __Pyx_AddTraceback("lxml.objectify.pytypename", __pyx_clineno, __pyx_lineno, __pyx_filename);
16996 __Pyx_XGIVEREF(__pyx_r);
16997 __Pyx_RefNannyFinishContext();
17001 /* "lxml/objectify.pyx":1031
17002 * return _pytypename(obj)
17004 * cdef _registerPyTypes(): # <<<<<<<<<<<<<<
17005 * pytype = PyType(u'int', int, IntElement)
17006 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17009 static PyObject *__pyx_f_4lxml_9objectify__registerPyTypes(void) {
17010 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_pytype = NULL;
17011 PyObject *__pyx_r = NULL;
17012 __Pyx_RefNannyDeclarations
17013 PyObject *__pyx_t_1 = NULL;
17014 PyObject *__pyx_t_2 = NULL;
17015 PyObject *__pyx_t_3 = NULL;
17016 int __pyx_lineno = 0;
17017 const char *__pyx_filename = NULL;
17018 int __pyx_clineno = 0;
17019 __Pyx_RefNannySetupContext("_registerPyTypes", 0);
17021 /* "lxml/objectify.pyx":1032
17023 * cdef _registerPyTypes():
17024 * pytype = PyType(u'int', int, IntElement) # <<<<<<<<<<<<<<
17025 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17026 * u"unsignedByte", u"nonPositiveInteger",
17028 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
17029 __Pyx_GOTREF(__pyx_t_1);
17030 __Pyx_INCREF(__pyx_n_u_int);
17031 __Pyx_GIVEREF(__pyx_n_u_int);
17032 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_int);
17033 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
17034 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
17035 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyInt_Type)));
17036 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17037 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17038 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17039 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error)
17040 __Pyx_GOTREF(__pyx_t_2);
17041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17042 __pyx_v_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2);
17045 /* "lxml/objectify.pyx":1033
17046 * cdef _registerPyTypes():
17047 * pytype = PyType(u'int', int, IntElement)
17048 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort", # <<<<<<<<<<<<<<
17049 * u"unsignedByte", u"nonPositiveInteger",
17050 * u"negativeInteger", u"long", u"nonNegativeInteger",
17052 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__5) < 0) __PYX_ERR(0, 1033, __pyx_L1_error)
17054 /* "lxml/objectify.pyx":1037
17055 * u"negativeInteger", u"long", u"nonNegativeInteger",
17056 * u"unsignedLong", u"unsignedInt", u"positiveInteger",)
17057 * pytype.register() # <<<<<<<<<<<<<<
17059 * # 'long' type just for backwards compatibility
17061 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
17062 __Pyx_GOTREF(__pyx_t_1);
17064 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
17065 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
17066 if (likely(__pyx_t_3)) {
17067 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
17068 __Pyx_INCREF(__pyx_t_3);
17069 __Pyx_INCREF(function);
17070 __Pyx_DECREF_SET(__pyx_t_1, function);
17073 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
17074 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17075 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
17076 __Pyx_GOTREF(__pyx_t_2);
17077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17078 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17080 /* "lxml/objectify.pyx":1040
17082 * # 'long' type just for backwards compatibility
17083 * pytype = PyType(u'long', None, IntElement) # <<<<<<<<<<<<<<
17084 * pytype.register()
17087 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error)
17088 __Pyx_GOTREF(__pyx_t_2);
17089 __Pyx_INCREF(__pyx_n_u_long);
17090 __Pyx_GIVEREF(__pyx_n_u_long);
17091 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_long);
17092 __Pyx_INCREF(Py_None);
17093 __Pyx_GIVEREF(Py_None);
17094 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17095 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17096 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17097 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17098 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error)
17099 __Pyx_GOTREF(__pyx_t_1);
17100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17101 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
17104 /* "lxml/objectify.pyx":1041
17105 * # 'long' type just for backwards compatibility
17106 * pytype = PyType(u'long', None, IntElement)
17107 * pytype.register() # <<<<<<<<<<<<<<
17109 * pytype = PyType(u'float', float, FloatElement, repr)
17111 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
17112 __Pyx_GOTREF(__pyx_t_2);
17114 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17115 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
17116 if (likely(__pyx_t_3)) {
17117 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17118 __Pyx_INCREF(__pyx_t_3);
17119 __Pyx_INCREF(function);
17120 __Pyx_DECREF_SET(__pyx_t_2, function);
17123 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17124 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17125 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
17126 __Pyx_GOTREF(__pyx_t_1);
17127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17128 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17130 /* "lxml/objectify.pyx":1043
17131 * pytype.register()
17133 * pytype = PyType(u'float', float, FloatElement, repr) # <<<<<<<<<<<<<<
17134 * pytype.xmlSchemaTypes = (u"double", u"float")
17135 * pytype.register()
17137 __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
17138 __Pyx_GOTREF(__pyx_t_1);
17139 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
17140 __Pyx_GOTREF(__pyx_t_2);
17141 __Pyx_INCREF(__pyx_n_u_float);
17142 __Pyx_GIVEREF(__pyx_n_u_float);
17143 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_float);
17144 __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
17145 __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
17146 PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyFloat_Type)));
17147 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17148 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17149 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17150 __Pyx_GIVEREF(__pyx_t_1);
17151 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
17153 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
17154 __Pyx_GOTREF(__pyx_t_1);
17155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17156 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
17159 /* "lxml/objectify.pyx":1044
17161 * pytype = PyType(u'float', float, FloatElement, repr)
17162 * pytype.xmlSchemaTypes = (u"double", u"float") # <<<<<<<<<<<<<<
17163 * pytype.register()
17166 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__6) < 0) __PYX_ERR(0, 1044, __pyx_L1_error)
17168 /* "lxml/objectify.pyx":1045
17169 * pytype = PyType(u'float', float, FloatElement, repr)
17170 * pytype.xmlSchemaTypes = (u"double", u"float")
17171 * pytype.register() # <<<<<<<<<<<<<<
17173 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17175 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
17176 __Pyx_GOTREF(__pyx_t_2);
17178 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17179 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
17180 if (likely(__pyx_t_3)) {
17181 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17182 __Pyx_INCREF(__pyx_t_3);
17183 __Pyx_INCREF(function);
17184 __Pyx_DECREF_SET(__pyx_t_2, function);
17187 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17188 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17189 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
17190 __Pyx_GOTREF(__pyx_t_1);
17191 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17194 /* "lxml/objectify.pyx":1047
17195 * pytype.register()
17197 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool) # <<<<<<<<<<<<<<
17198 * pytype.xmlSchemaTypes = (u"boolean",)
17199 * pytype.register()
17201 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkBool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
17202 __Pyx_GOTREF(__pyx_t_1);
17203 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lower_bool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
17204 __Pyx_GOTREF(__pyx_t_2);
17205 __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error)
17206 __Pyx_GOTREF(__pyx_t_3);
17207 __Pyx_INCREF(__pyx_n_u_bool);
17208 __Pyx_GIVEREF(__pyx_n_u_bool);
17209 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_bool);
17210 __Pyx_GIVEREF(__pyx_t_1);
17211 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
17212 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17213 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17214 PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17215 __Pyx_GIVEREF(__pyx_t_2);
17216 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
17219 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
17220 __Pyx_GOTREF(__pyx_t_2);
17221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17222 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
17225 /* "lxml/objectify.pyx":1048
17227 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17228 * pytype.xmlSchemaTypes = (u"boolean",) # <<<<<<<<<<<<<<
17229 * pytype.register()
17232 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__7) < 0) __PYX_ERR(0, 1048, __pyx_L1_error)
17234 /* "lxml/objectify.pyx":1049
17235 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17236 * pytype.xmlSchemaTypes = (u"boolean",)
17237 * pytype.register() # <<<<<<<<<<<<<<
17239 * pytype = PyType(u'str', None, StringElement)
17241 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error)
17242 __Pyx_GOTREF(__pyx_t_3);
17244 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
17245 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
17246 if (likely(__pyx_t_1)) {
17247 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17248 __Pyx_INCREF(__pyx_t_1);
17249 __Pyx_INCREF(function);
17250 __Pyx_DECREF_SET(__pyx_t_3, function);
17253 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
17254 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17255 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
17256 __Pyx_GOTREF(__pyx_t_2);
17257 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17260 /* "lxml/objectify.pyx":1051
17261 * pytype.register()
17263 * pytype = PyType(u'str', None, StringElement) # <<<<<<<<<<<<<<
17264 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language",
17265 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17267 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
17268 __Pyx_GOTREF(__pyx_t_2);
17269 __Pyx_INCREF(__pyx_n_u_str);
17270 __Pyx_GIVEREF(__pyx_n_u_str);
17271 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_str);
17272 __Pyx_INCREF(Py_None);
17273 __Pyx_GIVEREF(Py_None);
17274 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17275 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17276 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17277 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17278 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
17279 __Pyx_GOTREF(__pyx_t_3);
17280 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17281 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3));
17284 /* "lxml/objectify.pyx":1052
17286 * pytype = PyType(u'str', None, StringElement)
17287 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language", # <<<<<<<<<<<<<<
17288 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17291 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__8) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
17293 /* "lxml/objectify.pyx":1055
17294 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17296 * pytype.register() # <<<<<<<<<<<<<<
17300 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1055, __pyx_L1_error)
17301 __Pyx_GOTREF(__pyx_t_2);
17303 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17304 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
17305 if (likely(__pyx_t_1)) {
17306 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17307 __Pyx_INCREF(__pyx_t_1);
17308 __Pyx_INCREF(function);
17309 __Pyx_DECREF_SET(__pyx_t_2, function);
17312 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17313 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17314 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1055, __pyx_L1_error)
17315 __Pyx_GOTREF(__pyx_t_3);
17316 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17319 /* "lxml/objectify.pyx":1058
17322 * pytype = PyType(u'NoneType', None, NoneElement) # <<<<<<<<<<<<<<
17323 * pytype.register()
17326 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error)
17327 __Pyx_GOTREF(__pyx_t_3);
17328 __Pyx_INCREF(__pyx_n_u_NoneType);
17329 __Pyx_GIVEREF(__pyx_n_u_NoneType);
17330 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_NoneType);
17331 __Pyx_INCREF(Py_None);
17332 __Pyx_GIVEREF(Py_None);
17333 PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
17334 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17335 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17336 PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17337 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
17338 __Pyx_GOTREF(__pyx_t_2);
17339 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17340 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
17343 /* "lxml/objectify.pyx":1059
17345 * pytype = PyType(u'NoneType', None, NoneElement)
17346 * pytype.register() # <<<<<<<<<<<<<<
17348 * # backwards compatibility
17350 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error)
17351 __Pyx_GOTREF(__pyx_t_3);
17353 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
17354 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
17355 if (likely(__pyx_t_1)) {
17356 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17357 __Pyx_INCREF(__pyx_t_1);
17358 __Pyx_INCREF(function);
17359 __Pyx_DECREF_SET(__pyx_t_3, function);
17362 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
17363 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17364 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error)
17365 __Pyx_GOTREF(__pyx_t_2);
17366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17367 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17369 /* "lxml/objectify.pyx":1062
17371 * # backwards compatibility
17372 * pytype = PyType(u'none', None, NoneElement) # <<<<<<<<<<<<<<
17373 * pytype.register()
17376 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17377 __Pyx_GOTREF(__pyx_t_2);
17378 __Pyx_INCREF(__pyx_n_u_none);
17379 __Pyx_GIVEREF(__pyx_n_u_none);
17380 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_none);
17381 __Pyx_INCREF(Py_None);
17382 __Pyx_GIVEREF(Py_None);
17383 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17384 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17385 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17386 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17387 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
17388 __Pyx_GOTREF(__pyx_t_3);
17389 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17390 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3));
17393 /* "lxml/objectify.pyx":1063
17394 * # backwards compatibility
17395 * pytype = PyType(u'none', None, NoneElement)
17396 * pytype.register() # <<<<<<<<<<<<<<
17398 * # non-registered PyType for inner tree elements
17400 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_register); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
17401 __Pyx_GOTREF(__pyx_t_2);
17403 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17404 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
17405 if (likely(__pyx_t_1)) {
17406 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17407 __Pyx_INCREF(__pyx_t_1);
17408 __Pyx_INCREF(function);
17409 __Pyx_DECREF_SET(__pyx_t_2, function);
17412 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17413 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17414 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
17415 __Pyx_GOTREF(__pyx_t_3);
17416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17419 /* "lxml/objectify.pyx":1031
17420 * return _pytypename(obj)
17422 * cdef _registerPyTypes(): # <<<<<<<<<<<<<<
17423 * pytype = PyType(u'int', int, IntElement)
17424 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17427 /* function exit code */
17428 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17431 __Pyx_XDECREF(__pyx_t_1);
17432 __Pyx_XDECREF(__pyx_t_2);
17433 __Pyx_XDECREF(__pyx_t_3);
17434 __Pyx_AddTraceback("lxml.objectify._registerPyTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17437 __Pyx_XDECREF((PyObject *)__pyx_v_pytype);
17438 __Pyx_XGIVEREF(__pyx_r);
17439 __Pyx_RefNannyFinishContext();
17443 /* "lxml/objectify.pyx":1070
17444 * _registerPyTypes()
17446 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
17447 * u"""getRegisteredTypes()
17451 /* Python wrapper */
17452 static PyObject *__pyx_pw_4lxml_9objectify_11getRegisteredTypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17453 static char __pyx_doc_4lxml_9objectify_10getRegisteredTypes[] = "getRegisteredTypes()\n\n Returns a list of the currently registered PyType objects.\n\n To add a new type, retrieve this list and call unregister() for all\n entries. Then add the new type at a suitable position (possibly replacing\n an existing one) and call register() for all entries.\n\n This is necessary if the new type interferes with the type check functions\n of existing ones (normally only int/float/bool) and must the tried before\n other types. To add a type that is not yet parsable by the current type\n check functions, you can simply register() it, which will append it to the\n end of the type list.\n ";
17454 static PyMethodDef __pyx_mdef_4lxml_9objectify_11getRegisteredTypes = {"getRegisteredTypes", (PyCFunction)__pyx_pw_4lxml_9objectify_11getRegisteredTypes, METH_NOARGS, __pyx_doc_4lxml_9objectify_10getRegisteredTypes};
17455 static PyObject *__pyx_pw_4lxml_9objectify_11getRegisteredTypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
17456 PyObject *__pyx_r = 0;
17457 __Pyx_RefNannyDeclarations
17458 __Pyx_RefNannySetupContext("getRegisteredTypes (wrapper)", 0);
17459 __pyx_r = __pyx_pf_4lxml_9objectify_10getRegisteredTypes(__pyx_self);
17461 /* function exit code */
17462 __Pyx_RefNannyFinishContext();
17466 static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED PyObject *__pyx_self) {
17467 PyObject *__pyx_v_types = 0;
17468 PyObject *__pyx_v_known = 0;
17469 CYTHON_UNUSED PyObject *__pyx_v_check = NULL;
17470 PyObject *__pyx_v_pytype = NULL;
17471 PyObject *__pyx_v_name = NULL;
17472 PyObject *__pyx_r = NULL;
17473 __Pyx_RefNannyDeclarations
17474 PyObject *__pyx_t_1 = NULL;
17475 Py_ssize_t __pyx_t_2;
17476 PyObject *__pyx_t_3 = NULL;
17477 PyObject *__pyx_t_4 = NULL;
17478 PyObject *__pyx_t_5 = NULL;
17479 PyObject *__pyx_t_6 = NULL;
17480 PyObject *(*__pyx_t_7)(PyObject *);
17484 PyObject *(*__pyx_t_11)(PyObject *);
17485 int __pyx_lineno = 0;
17486 const char *__pyx_filename = NULL;
17487 int __pyx_clineno = 0;
17488 __Pyx_RefNannySetupContext("getRegisteredTypes", 0);
17490 /* "lxml/objectify.pyx":1085
17491 * end of the type list.
17493 * cdef list types = [] # <<<<<<<<<<<<<<
17494 * cdef set known = set()
17495 * for check, pytype in _TYPE_CHECKS:
17497 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
17498 __Pyx_GOTREF(__pyx_t_1);
17499 __pyx_v_types = ((PyObject*)__pyx_t_1);
17502 /* "lxml/objectify.pyx":1086
17504 * cdef list types = []
17505 * cdef set known = set() # <<<<<<<<<<<<<<
17506 * for check, pytype in _TYPE_CHECKS:
17507 * name = pytype.name
17509 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
17510 __Pyx_GOTREF(__pyx_t_1);
17511 __pyx_v_known = ((PyObject*)__pyx_t_1);
17514 /* "lxml/objectify.pyx":1087
17515 * cdef list types = []
17516 * cdef set known = set()
17517 * for check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17518 * name = pytype.name
17519 * if name not in known:
17521 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
17522 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
17523 __PYX_ERR(0, 1087, __pyx_L1_error)
17525 __pyx_t_1 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
17527 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
17528 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17529 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1087, __pyx_L1_error)
17531 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
17532 __Pyx_GOTREF(__pyx_t_3);
17534 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
17535 PyObject* sequence = __pyx_t_3;
17536 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17537 if (unlikely(size != 2)) {
17538 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17539 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17540 __PYX_ERR(0, 1087, __pyx_L1_error)
17542 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17543 if (likely(PyTuple_CheckExact(sequence))) {
17544 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
17545 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
17547 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
17548 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
17550 __Pyx_INCREF(__pyx_t_4);
17551 __Pyx_INCREF(__pyx_t_5);
17553 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
17554 __Pyx_GOTREF(__pyx_t_4);
17555 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
17556 __Pyx_GOTREF(__pyx_t_5);
17558 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17560 Py_ssize_t index = -1;
17561 __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
17562 __Pyx_GOTREF(__pyx_t_6);
17563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17564 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
17565 index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
17566 __Pyx_GOTREF(__pyx_t_4);
17567 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
17568 __Pyx_GOTREF(__pyx_t_5);
17569 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1087, __pyx_L1_error)
17571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17572 goto __pyx_L6_unpacking_done;
17573 __pyx_L5_unpacking_failed:;
17574 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17576 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17577 __PYX_ERR(0, 1087, __pyx_L1_error)
17578 __pyx_L6_unpacking_done:;
17580 __Pyx_XDECREF_SET(__pyx_v_check, __pyx_t_4);
17582 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_5);
17585 /* "lxml/objectify.pyx":1088
17586 * cdef set known = set()
17587 * for check, pytype in _TYPE_CHECKS:
17588 * name = pytype.name # <<<<<<<<<<<<<<
17589 * if name not in known:
17592 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
17593 __Pyx_GOTREF(__pyx_t_3);
17594 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
17597 /* "lxml/objectify.pyx":1089
17598 * for check, pytype in _TYPE_CHECKS:
17599 * name = pytype.name
17600 * if name not in known: # <<<<<<<<<<<<<<
17602 * types.append(pytype)
17604 __pyx_t_8 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_known, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1089, __pyx_L1_error)
17605 __pyx_t_9 = (__pyx_t_8 != 0);
17608 /* "lxml/objectify.pyx":1090
17609 * name = pytype.name
17610 * if name not in known:
17611 * known.add(name) # <<<<<<<<<<<<<<
17612 * types.append(pytype)
17613 * for pytype in _PYTYPE_DICT.values():
17615 __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1090, __pyx_L1_error)
17617 /* "lxml/objectify.pyx":1091
17618 * if name not in known:
17620 * types.append(pytype) # <<<<<<<<<<<<<<
17621 * for pytype in _PYTYPE_DICT.values():
17622 * name = pytype.name
17624 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1091, __pyx_L1_error)
17626 /* "lxml/objectify.pyx":1089
17627 * for check, pytype in _TYPE_CHECKS:
17628 * name = pytype.name
17629 * if name not in known: # <<<<<<<<<<<<<<
17631 * types.append(pytype)
17635 /* "lxml/objectify.pyx":1087
17636 * cdef list types = []
17637 * cdef set known = set()
17638 * for check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17639 * name = pytype.name
17640 * if name not in known:
17643 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17645 /* "lxml/objectify.pyx":1092
17647 * types.append(pytype)
17648 * for pytype in _PYTYPE_DICT.values(): # <<<<<<<<<<<<<<
17649 * name = pytype.name
17650 * if name not in known:
17652 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
17653 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
17654 __PYX_ERR(0, 1092, __pyx_L1_error)
17656 __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_4lxml_9objectify__PYTYPE_DICT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
17657 __Pyx_GOTREF(__pyx_t_1);
17658 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
17659 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
17662 __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
17663 __Pyx_GOTREF(__pyx_t_3);
17664 __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1092, __pyx_L1_error)
17666 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17668 if (likely(!__pyx_t_11)) {
17669 if (likely(PyList_CheckExact(__pyx_t_3))) {
17670 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
17671 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17672 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
17674 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
17675 __Pyx_GOTREF(__pyx_t_1);
17678 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
17679 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17680 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
17682 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
17683 __Pyx_GOTREF(__pyx_t_1);
17687 __pyx_t_1 = __pyx_t_11(__pyx_t_3);
17688 if (unlikely(!__pyx_t_1)) {
17689 PyObject* exc_type = PyErr_Occurred();
17691 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17692 else __PYX_ERR(0, 1092, __pyx_L1_error)
17696 __Pyx_GOTREF(__pyx_t_1);
17698 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_1);
17701 /* "lxml/objectify.pyx":1093
17702 * types.append(pytype)
17703 * for pytype in _PYTYPE_DICT.values():
17704 * name = pytype.name # <<<<<<<<<<<<<<
17705 * if name not in known:
17708 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pytype, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1093, __pyx_L1_error)
17709 __Pyx_GOTREF(__pyx_t_1);
17710 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
17713 /* "lxml/objectify.pyx":1094
17714 * for pytype in _PYTYPE_DICT.values():
17715 * name = pytype.name
17716 * if name not in known: # <<<<<<<<<<<<<<
17718 * types.append(pytype)
17720 __pyx_t_9 = (__Pyx_PySet_ContainsTF(__pyx_v_name, __pyx_v_known, Py_NE)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1094, __pyx_L1_error)
17721 __pyx_t_8 = (__pyx_t_9 != 0);
17724 /* "lxml/objectify.pyx":1095
17725 * name = pytype.name
17726 * if name not in known:
17727 * known.add(name) # <<<<<<<<<<<<<<
17728 * types.append(pytype)
17731 __pyx_t_10 = PySet_Add(__pyx_v_known, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1095, __pyx_L1_error)
17733 /* "lxml/objectify.pyx":1096
17734 * if name not in known:
17736 * types.append(pytype) # <<<<<<<<<<<<<<
17740 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_types, __pyx_v_pytype); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 1096, __pyx_L1_error)
17742 /* "lxml/objectify.pyx":1094
17743 * for pytype in _PYTYPE_DICT.values():
17744 * name = pytype.name
17745 * if name not in known: # <<<<<<<<<<<<<<
17747 * types.append(pytype)
17751 /* "lxml/objectify.pyx":1092
17753 * types.append(pytype)
17754 * for pytype in _PYTYPE_DICT.values(): # <<<<<<<<<<<<<<
17755 * name = pytype.name
17756 * if name not in known:
17759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17761 /* "lxml/objectify.pyx":1097
17763 * types.append(pytype)
17764 * return types # <<<<<<<<<<<<<<
17766 * cdef PyType _guessPyType(value, PyType defaulttype):
17768 __Pyx_XDECREF(__pyx_r);
17769 __Pyx_INCREF(__pyx_v_types);
17770 __pyx_r = __pyx_v_types;
17773 /* "lxml/objectify.pyx":1070
17774 * _registerPyTypes()
17776 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
17777 * u"""getRegisteredTypes()
17781 /* function exit code */
17783 __Pyx_XDECREF(__pyx_t_1);
17784 __Pyx_XDECREF(__pyx_t_3);
17785 __Pyx_XDECREF(__pyx_t_4);
17786 __Pyx_XDECREF(__pyx_t_5);
17787 __Pyx_XDECREF(__pyx_t_6);
17788 __Pyx_AddTraceback("lxml.objectify.getRegisteredTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17791 __Pyx_XDECREF(__pyx_v_types);
17792 __Pyx_XDECREF(__pyx_v_known);
17793 __Pyx_XDECREF(__pyx_v_check);
17794 __Pyx_XDECREF(__pyx_v_pytype);
17795 __Pyx_XDECREF(__pyx_v_name);
17796 __Pyx_XGIVEREF(__pyx_r);
17797 __Pyx_RefNannyFinishContext();
17801 /* "lxml/objectify.pyx":1099
17804 * cdef PyType _guessPyType(value, PyType defaulttype): # <<<<<<<<<<<<<<
17805 * if value is None:
17809 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__guessPyType(PyObject *__pyx_v_value, struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_defaulttype) {
17810 PyObject *__pyx_v_type_check = NULL;
17811 PyObject *__pyx_v_tested_pytype = NULL;
17812 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_r = NULL;
17813 __Pyx_RefNannyDeclarations
17816 PyObject *__pyx_t_3 = NULL;
17817 Py_ssize_t __pyx_t_4;
17818 PyObject *__pyx_t_5 = NULL;
17819 PyObject *__pyx_t_6 = NULL;
17820 PyObject *__pyx_t_7 = NULL;
17821 PyObject *__pyx_t_8 = NULL;
17822 PyObject *(*__pyx_t_9)(PyObject *);
17823 PyObject *__pyx_t_10 = NULL;
17824 PyObject *__pyx_t_11 = NULL;
17825 PyObject *__pyx_t_12 = NULL;
17827 int __pyx_lineno = 0;
17828 const char *__pyx_filename = NULL;
17829 int __pyx_clineno = 0;
17830 __Pyx_RefNannySetupContext("_guessPyType", 0);
17832 /* "lxml/objectify.pyx":1100
17834 * cdef PyType _guessPyType(value, PyType defaulttype):
17835 * if value is None: # <<<<<<<<<<<<<<
17837 * for type_check, tested_pytype in _TYPE_CHECKS:
17839 __pyx_t_1 = (__pyx_v_value == Py_None);
17840 __pyx_t_2 = (__pyx_t_1 != 0);
17843 /* "lxml/objectify.pyx":1101
17844 * cdef PyType _guessPyType(value, PyType defaulttype):
17845 * if value is None:
17846 * return None # <<<<<<<<<<<<<<
17847 * for type_check, tested_pytype in _TYPE_CHECKS:
17850 __Pyx_XDECREF(((PyObject *)__pyx_r));
17851 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
17854 /* "lxml/objectify.pyx":1100
17856 * cdef PyType _guessPyType(value, PyType defaulttype):
17857 * if value is None: # <<<<<<<<<<<<<<
17859 * for type_check, tested_pytype in _TYPE_CHECKS:
17863 /* "lxml/objectify.pyx":1102
17864 * if value is None:
17866 * for type_check, tested_pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17868 * type_check(value)
17870 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
17871 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
17872 __PYX_ERR(0, 1102, __pyx_L1_error)
17874 __pyx_t_3 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
17876 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
17877 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17878 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1102, __pyx_L1_error)
17880 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error)
17881 __Pyx_GOTREF(__pyx_t_5);
17883 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
17884 PyObject* sequence = __pyx_t_5;
17885 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17886 if (unlikely(size != 2)) {
17887 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17888 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17889 __PYX_ERR(0, 1102, __pyx_L1_error)
17891 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17892 if (likely(PyTuple_CheckExact(sequence))) {
17893 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
17894 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
17896 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
17897 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
17899 __Pyx_INCREF(__pyx_t_6);
17900 __Pyx_INCREF(__pyx_t_7);
17902 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1102, __pyx_L1_error)
17903 __Pyx_GOTREF(__pyx_t_6);
17904 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1102, __pyx_L1_error)
17905 __Pyx_GOTREF(__pyx_t_7);
17907 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17909 Py_ssize_t index = -1;
17910 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error)
17911 __Pyx_GOTREF(__pyx_t_8);
17912 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17913 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
17914 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
17915 __Pyx_GOTREF(__pyx_t_6);
17916 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
17917 __Pyx_GOTREF(__pyx_t_7);
17918 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1102, __pyx_L1_error)
17920 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17921 goto __pyx_L7_unpacking_done;
17922 __pyx_L6_unpacking_failed:;
17923 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17925 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17926 __PYX_ERR(0, 1102, __pyx_L1_error)
17927 __pyx_L7_unpacking_done:;
17929 __Pyx_XDECREF_SET(__pyx_v_type_check, __pyx_t_6);
17931 __Pyx_XDECREF_SET(__pyx_v_tested_pytype, __pyx_t_7);
17934 /* "lxml/objectify.pyx":1103
17936 * for type_check, tested_pytype in _TYPE_CHECKS:
17937 * try: # <<<<<<<<<<<<<<
17938 * type_check(value)
17939 * return <PyType>tested_pytype
17942 __Pyx_PyThreadState_declare
17943 __Pyx_PyThreadState_assign
17944 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
17945 __Pyx_XGOTREF(__pyx_t_10);
17946 __Pyx_XGOTREF(__pyx_t_11);
17947 __Pyx_XGOTREF(__pyx_t_12);
17950 /* "lxml/objectify.pyx":1104
17951 * for type_check, tested_pytype in _TYPE_CHECKS:
17953 * type_check(value) # <<<<<<<<<<<<<<
17954 * return <PyType>tested_pytype
17955 * except IGNORABLE_ERRORS:
17957 __Pyx_INCREF(__pyx_v_type_check);
17958 __pyx_t_7 = __pyx_v_type_check; __pyx_t_6 = NULL;
17959 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
17960 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
17961 if (likely(__pyx_t_6)) {
17962 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
17963 __Pyx_INCREF(__pyx_t_6);
17964 __Pyx_INCREF(function);
17965 __Pyx_DECREF_SET(__pyx_t_7, function);
17968 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
17969 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17970 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L8_error)
17971 __Pyx_GOTREF(__pyx_t_5);
17972 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17973 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17975 /* "lxml/objectify.pyx":1105
17977 * type_check(value)
17978 * return <PyType>tested_pytype # <<<<<<<<<<<<<<
17979 * except IGNORABLE_ERRORS:
17980 * # could not be parsed as the specified type => ignore
17982 __Pyx_XDECREF(((PyObject *)__pyx_r));
17983 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_tested_pytype)));
17984 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_tested_pytype);
17985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17986 goto __pyx_L12_try_return;
17988 /* "lxml/objectify.pyx":1103
17990 * for type_check, tested_pytype in _TYPE_CHECKS:
17991 * try: # <<<<<<<<<<<<<<
17992 * type_check(value)
17993 * return <PyType>tested_pytype
17997 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17998 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17999 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18000 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18002 /* "lxml/objectify.pyx":1106
18003 * type_check(value)
18004 * return <PyType>tested_pytype
18005 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
18006 * # could not be parsed as the specified type => ignore
18009 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
18011 __Pyx_ErrRestore(0,0,0);
18012 goto __pyx_L9_exception_handled;
18014 goto __pyx_L10_except_error;
18015 __pyx_L10_except_error:;
18017 /* "lxml/objectify.pyx":1103
18019 * for type_check, tested_pytype in _TYPE_CHECKS:
18020 * try: # <<<<<<<<<<<<<<
18021 * type_check(value)
18022 * return <PyType>tested_pytype
18024 __Pyx_XGIVEREF(__pyx_t_10);
18025 __Pyx_XGIVEREF(__pyx_t_11);
18026 __Pyx_XGIVEREF(__pyx_t_12);
18027 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18028 goto __pyx_L1_error;
18029 __pyx_L12_try_return:;
18030 __Pyx_XGIVEREF(__pyx_t_10);
18031 __Pyx_XGIVEREF(__pyx_t_11);
18032 __Pyx_XGIVEREF(__pyx_t_12);
18033 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18035 __pyx_L9_exception_handled:;
18036 __Pyx_XGIVEREF(__pyx_t_10);
18037 __Pyx_XGIVEREF(__pyx_t_11);
18038 __Pyx_XGIVEREF(__pyx_t_12);
18039 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18042 /* "lxml/objectify.pyx":1102
18043 * if value is None:
18045 * for type_check, tested_pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18047 * type_check(value)
18050 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18052 /* "lxml/objectify.pyx":1109
18053 * # could not be parsed as the specified type => ignore
18055 * return defaulttype # <<<<<<<<<<<<<<
18057 * cdef object _guessElementClass(tree.xmlNode* c_node):
18059 __Pyx_XDECREF(((PyObject *)__pyx_r));
18060 __Pyx_INCREF(((PyObject *)__pyx_v_defaulttype));
18061 __pyx_r = __pyx_v_defaulttype;
18064 /* "lxml/objectify.pyx":1099
18067 * cdef PyType _guessPyType(value, PyType defaulttype): # <<<<<<<<<<<<<<
18068 * if value is None:
18072 /* function exit code */
18074 __Pyx_XDECREF(__pyx_t_3);
18075 __Pyx_XDECREF(__pyx_t_5);
18076 __Pyx_XDECREF(__pyx_t_6);
18077 __Pyx_XDECREF(__pyx_t_7);
18078 __Pyx_XDECREF(__pyx_t_8);
18079 __Pyx_AddTraceback("lxml.objectify._guessPyType", __pyx_clineno, __pyx_lineno, __pyx_filename);
18082 __Pyx_XDECREF(__pyx_v_type_check);
18083 __Pyx_XDECREF(__pyx_v_tested_pytype);
18084 __Pyx_XGIVEREF((PyObject *)__pyx_r);
18085 __Pyx_RefNannyFinishContext();
18089 /* "lxml/objectify.pyx":1111
18090 * return defaulttype
18092 * cdef object _guessElementClass(tree.xmlNode* c_node): # <<<<<<<<<<<<<<
18093 * value = textOf(c_node)
18094 * if value is None:
18097 static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *__pyx_v_c_node) {
18098 PyObject *__pyx_v_value = NULL;
18099 PyObject *__pyx_v_type_check = NULL;
18100 PyObject *__pyx_v_pytype = NULL;
18101 PyObject *__pyx_r = NULL;
18102 __Pyx_RefNannyDeclarations
18103 PyObject *__pyx_t_1 = NULL;
18106 Py_ssize_t __pyx_t_4;
18107 PyObject *__pyx_t_5 = NULL;
18108 PyObject *__pyx_t_6 = NULL;
18109 PyObject *__pyx_t_7 = NULL;
18110 PyObject *__pyx_t_8 = NULL;
18111 PyObject *(*__pyx_t_9)(PyObject *);
18112 PyObject *__pyx_t_10 = NULL;
18113 PyObject *__pyx_t_11 = NULL;
18114 PyObject *__pyx_t_12 = NULL;
18116 int __pyx_lineno = 0;
18117 const char *__pyx_filename = NULL;
18118 int __pyx_clineno = 0;
18119 __Pyx_RefNannySetupContext("_guessElementClass", 0);
18121 /* "lxml/objectify.pyx":1112
18123 * cdef object _guessElementClass(tree.xmlNode* c_node):
18124 * value = textOf(c_node) # <<<<<<<<<<<<<<
18125 * if value is None:
18128 __pyx_t_1 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
18129 __Pyx_GOTREF(__pyx_t_1);
18130 __pyx_v_value = __pyx_t_1;
18133 /* "lxml/objectify.pyx":1113
18134 * cdef object _guessElementClass(tree.xmlNode* c_node):
18135 * value = textOf(c_node)
18136 * if value is None: # <<<<<<<<<<<<<<
18140 __pyx_t_2 = (__pyx_v_value == Py_None);
18141 __pyx_t_3 = (__pyx_t_2 != 0);
18144 /* "lxml/objectify.pyx":1114
18145 * value = textOf(c_node)
18146 * if value is None:
18147 * return None # <<<<<<<<<<<<<<
18149 * return StringElement
18151 __Pyx_XDECREF(__pyx_r);
18152 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18155 /* "lxml/objectify.pyx":1113
18156 * cdef object _guessElementClass(tree.xmlNode* c_node):
18157 * value = textOf(c_node)
18158 * if value is None: # <<<<<<<<<<<<<<
18164 /* "lxml/objectify.pyx":1115
18165 * if value is None:
18167 * if value == '': # <<<<<<<<<<<<<<
18168 * return StringElement
18171 __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_value, __pyx_kp_s_, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
18174 /* "lxml/objectify.pyx":1116
18177 * return StringElement # <<<<<<<<<<<<<<
18179 * for type_check, pytype in _TYPE_CHECKS:
18181 __Pyx_XDECREF(__pyx_r);
18182 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
18183 __pyx_r = ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement);
18186 /* "lxml/objectify.pyx":1115
18187 * if value is None:
18189 * if value == '': # <<<<<<<<<<<<<<
18190 * return StringElement
18195 /* "lxml/objectify.pyx":1118
18196 * return StringElement
18198 * for type_check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18200 * type_check(value)
18202 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
18203 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
18204 __PYX_ERR(0, 1118, __pyx_L1_error)
18206 __pyx_t_1 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
18208 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
18209 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18210 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1118, __pyx_L1_error)
18212 __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error)
18213 __Pyx_GOTREF(__pyx_t_5);
18215 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
18216 PyObject* sequence = __pyx_t_5;
18217 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18218 if (unlikely(size != 2)) {
18219 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
18220 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18221 __PYX_ERR(0, 1118, __pyx_L1_error)
18223 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18224 if (likely(PyTuple_CheckExact(sequence))) {
18225 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
18226 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
18228 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
18229 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
18231 __Pyx_INCREF(__pyx_t_6);
18232 __Pyx_INCREF(__pyx_t_7);
18234 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1118, __pyx_L1_error)
18235 __Pyx_GOTREF(__pyx_t_6);
18236 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1118, __pyx_L1_error)
18237 __Pyx_GOTREF(__pyx_t_7);
18239 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18241 Py_ssize_t index = -1;
18242 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error)
18243 __Pyx_GOTREF(__pyx_t_8);
18244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18245 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
18246 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
18247 __Pyx_GOTREF(__pyx_t_6);
18248 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
18249 __Pyx_GOTREF(__pyx_t_7);
18250 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
18252 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18253 goto __pyx_L8_unpacking_done;
18254 __pyx_L7_unpacking_failed:;
18255 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18257 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
18258 __PYX_ERR(0, 1118, __pyx_L1_error)
18259 __pyx_L8_unpacking_done:;
18261 __Pyx_XDECREF_SET(__pyx_v_type_check, __pyx_t_6);
18263 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_7);
18266 /* "lxml/objectify.pyx":1119
18268 * for type_check, pytype in _TYPE_CHECKS:
18269 * try: # <<<<<<<<<<<<<<
18270 * type_check(value)
18271 * return (<PyType>pytype)._type
18274 __Pyx_PyThreadState_declare
18275 __Pyx_PyThreadState_assign
18276 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
18277 __Pyx_XGOTREF(__pyx_t_10);
18278 __Pyx_XGOTREF(__pyx_t_11);
18279 __Pyx_XGOTREF(__pyx_t_12);
18282 /* "lxml/objectify.pyx":1120
18283 * for type_check, pytype in _TYPE_CHECKS:
18285 * type_check(value) # <<<<<<<<<<<<<<
18286 * return (<PyType>pytype)._type
18287 * except IGNORABLE_ERRORS:
18289 __Pyx_INCREF(__pyx_v_type_check);
18290 __pyx_t_7 = __pyx_v_type_check; __pyx_t_6 = NULL;
18291 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
18292 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
18293 if (likely(__pyx_t_6)) {
18294 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
18295 __Pyx_INCREF(__pyx_t_6);
18296 __Pyx_INCREF(function);
18297 __Pyx_DECREF_SET(__pyx_t_7, function);
18300 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
18301 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18302 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1120, __pyx_L9_error)
18303 __Pyx_GOTREF(__pyx_t_5);
18304 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18305 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18307 /* "lxml/objectify.pyx":1121
18309 * type_check(value)
18310 * return (<PyType>pytype)._type # <<<<<<<<<<<<<<
18311 * except IGNORABLE_ERRORS:
18314 __Pyx_XDECREF(__pyx_r);
18315 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->_type);
18316 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->_type;
18317 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18318 goto __pyx_L13_try_return;
18320 /* "lxml/objectify.pyx":1119
18322 * for type_check, pytype in _TYPE_CHECKS:
18323 * try: # <<<<<<<<<<<<<<
18324 * type_check(value)
18325 * return (<PyType>pytype)._type
18329 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18330 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18331 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18332 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18334 /* "lxml/objectify.pyx":1122
18335 * type_check(value)
18336 * return (<PyType>pytype)._type
18337 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
18341 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
18343 __Pyx_ErrRestore(0,0,0);
18344 goto __pyx_L10_exception_handled;
18346 goto __pyx_L11_except_error;
18347 __pyx_L11_except_error:;
18349 /* "lxml/objectify.pyx":1119
18351 * for type_check, pytype in _TYPE_CHECKS:
18352 * try: # <<<<<<<<<<<<<<
18353 * type_check(value)
18354 * return (<PyType>pytype)._type
18356 __Pyx_XGIVEREF(__pyx_t_10);
18357 __Pyx_XGIVEREF(__pyx_t_11);
18358 __Pyx_XGIVEREF(__pyx_t_12);
18359 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18360 goto __pyx_L1_error;
18361 __pyx_L13_try_return:;
18362 __Pyx_XGIVEREF(__pyx_t_10);
18363 __Pyx_XGIVEREF(__pyx_t_11);
18364 __Pyx_XGIVEREF(__pyx_t_12);
18365 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18367 __pyx_L10_exception_handled:;
18368 __Pyx_XGIVEREF(__pyx_t_10);
18369 __Pyx_XGIVEREF(__pyx_t_11);
18370 __Pyx_XGIVEREF(__pyx_t_12);
18371 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18374 /* "lxml/objectify.pyx":1118
18375 * return StringElement
18377 * for type_check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18379 * type_check(value)
18382 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18384 /* "lxml/objectify.pyx":1124
18385 * except IGNORABLE_ERRORS:
18387 * return None # <<<<<<<<<<<<<<
18389 * ################################################################################
18391 __Pyx_XDECREF(__pyx_r);
18392 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18395 /* "lxml/objectify.pyx":1111
18396 * return defaulttype
18398 * cdef object _guessElementClass(tree.xmlNode* c_node): # <<<<<<<<<<<<<<
18399 * value = textOf(c_node)
18400 * if value is None:
18403 /* function exit code */
18405 __Pyx_XDECREF(__pyx_t_1);
18406 __Pyx_XDECREF(__pyx_t_5);
18407 __Pyx_XDECREF(__pyx_t_6);
18408 __Pyx_XDECREF(__pyx_t_7);
18409 __Pyx_XDECREF(__pyx_t_8);
18410 __Pyx_AddTraceback("lxml.objectify._guessElementClass", __pyx_clineno, __pyx_lineno, __pyx_filename);
18413 __Pyx_XDECREF(__pyx_v_value);
18414 __Pyx_XDECREF(__pyx_v_type_check);
18415 __Pyx_XDECREF(__pyx_v_pytype);
18416 __Pyx_XGIVEREF(__pyx_r);
18417 __Pyx_RefNannyFinishContext();
18421 /* "lxml/objectify.pyx":1137
18422 * cdef bint _annotate
18424 * def __call__(self, *children, **attrib): # <<<<<<<<<<<<<<
18425 * u"__call__(self, *children, **attrib)"
18426 * cdef _ObjectifyElementMakerCaller elementMaker
18429 /* Python wrapper */
18430 static PyObject *__pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18431 static char __pyx_doc_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__[] = "__call__(self, *children, **attrib)";
18432 #if CYTHON_COMPILING_IN_CPYTHON
18433 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
18435 static PyObject *__pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18436 PyObject *__pyx_v_children = 0;
18437 PyObject *__pyx_v_attrib = 0;
18438 PyObject *__pyx_r = 0;
18439 __Pyx_RefNannyDeclarations
18440 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
18441 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
18442 __pyx_v_attrib = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_attrib)) return NULL;
18443 __Pyx_GOTREF(__pyx_v_attrib);
18444 __Pyx_INCREF(__pyx_args);
18445 __pyx_v_children = __pyx_args;
18446 __pyx_r = __pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__(((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_v_self), __pyx_v_children, __pyx_v_attrib);
18448 /* function exit code */
18449 __Pyx_XDECREF(__pyx_v_children);
18450 __Pyx_XDECREF(__pyx_v_attrib);
18451 __Pyx_RefNannyFinishContext();
18455 static PyObject *__pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__(struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_self, PyObject *__pyx_v_children, PyObject *__pyx_v_attrib) {
18456 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_elementMaker = 0;
18457 struct LxmlElement *__pyx_v_element = 0;
18458 struct LxmlElement *__pyx_v_childElement = 0;
18459 int __pyx_v_has_children;
18460 int __pyx_v_has_string_value;
18461 PyObject *__pyx_v_pytype_name = NULL;
18462 PyObject *__pyx_v_child = NULL;
18463 PyObject *__pyx_v_name = NULL;
18464 PyObject *__pyx_v_value = NULL;
18465 PyObject *__pyx_v_pytype = NULL;
18466 PyObject *__pyx_r = NULL;
18467 __Pyx_RefNannyDeclarations
18470 PyObject *__pyx_t_3 = NULL;
18471 PyObject *__pyx_t_4 = NULL;
18472 PyObject *__pyx_t_5 = NULL;
18474 PyObject *__pyx_t_7 = NULL;
18475 Py_ssize_t __pyx_t_8;
18476 Py_ssize_t __pyx_t_9;
18477 PyObject *(*__pyx_t_10)(PyObject *);
18478 PyObject *__pyx_t_11 = NULL;
18479 PyObject *__pyx_t_12 = NULL;
18480 PyObject *(*__pyx_t_13)(PyObject *);
18481 int __pyx_lineno = 0;
18482 const char *__pyx_filename = NULL;
18483 int __pyx_clineno = 0;
18484 __Pyx_RefNannySetupContext("__call__", 0);
18486 /* "lxml/objectify.pyx":1144
18487 * cdef bint has_children
18488 * cdef bint has_string_value
18489 * if self._element_factory is None: # <<<<<<<<<<<<<<
18490 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18493 __pyx_t_1 = (__pyx_v_self->_element_factory == Py_None);
18494 __pyx_t_2 = (__pyx_t_1 != 0);
18497 /* "lxml/objectify.pyx":1145
18498 * cdef bint has_string_value
18499 * if self._element_factory is None:
18500 * element = _makeElement(self._tag, None, attrib, self._nsmap) # <<<<<<<<<<<<<<
18502 * element = self._element_factory(self._tag, attrib, self._nsmap)
18504 __pyx_t_3 = __pyx_v_self->_tag;
18505 __Pyx_INCREF(__pyx_t_3);
18506 __pyx_t_4 = __pyx_v_self->_nsmap;
18507 __Pyx_INCREF(__pyx_t_4);
18508 __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_9objectify__makeElement(__pyx_t_3, Py_None, __pyx_v_attrib, __pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1145, __pyx_L1_error)
18509 __Pyx_GOTREF(__pyx_t_5);
18510 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18511 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18512 __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18515 /* "lxml/objectify.pyx":1144
18516 * cdef bint has_children
18517 * cdef bint has_string_value
18518 * if self._element_factory is None: # <<<<<<<<<<<<<<
18519 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18525 /* "lxml/objectify.pyx":1147
18526 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18528 * element = self._element_factory(self._tag, attrib, self._nsmap) # <<<<<<<<<<<<<<
18530 * pytype_name = None
18533 __Pyx_INCREF(__pyx_v_self->_element_factory);
18534 __pyx_t_4 = __pyx_v_self->_element_factory; __pyx_t_3 = NULL;
18536 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18537 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18538 if (likely(__pyx_t_3)) {
18539 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18540 __Pyx_INCREF(__pyx_t_3);
18541 __Pyx_INCREF(function);
18542 __Pyx_DECREF_SET(__pyx_t_4, function);
18546 #if CYTHON_FAST_PYCALL
18547 if (PyFunction_Check(__pyx_t_4)) {
18548 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self->_tag, __pyx_v_attrib, __pyx_v_self->_nsmap};
18549 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1147, __pyx_L1_error)
18550 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18551 __Pyx_GOTREF(__pyx_t_5);
18554 #if CYTHON_FAST_PYCCALL
18555 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
18556 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self->_tag, __pyx_v_attrib, __pyx_v_self->_nsmap};
18557 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1147, __pyx_L1_error)
18558 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18559 __Pyx_GOTREF(__pyx_t_5);
18563 __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1147, __pyx_L1_error)
18564 __Pyx_GOTREF(__pyx_t_7);
18566 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
18568 __Pyx_INCREF(__pyx_v_self->_tag);
18569 __Pyx_GIVEREF(__pyx_v_self->_tag);
18570 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_tag);
18571 __Pyx_INCREF(__pyx_v_attrib);
18572 __Pyx_GIVEREF(__pyx_v_attrib);
18573 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_attrib);
18574 __Pyx_INCREF(__pyx_v_self->_nsmap);
18575 __Pyx_GIVEREF(__pyx_v_self->_nsmap);
18576 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_self->_nsmap);
18577 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1147, __pyx_L1_error)
18578 __Pyx_GOTREF(__pyx_t_5);
18579 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18581 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18582 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 1147, __pyx_L1_error)
18583 __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18588 /* "lxml/objectify.pyx":1149
18589 * element = self._element_factory(self._tag, attrib, self._nsmap)
18591 * pytype_name = None # <<<<<<<<<<<<<<
18592 * has_children = False
18593 * has_string_value = False
18595 __Pyx_INCREF(Py_None);
18596 __pyx_v_pytype_name = Py_None;
18598 /* "lxml/objectify.pyx":1150
18600 * pytype_name = None
18601 * has_children = False # <<<<<<<<<<<<<<
18602 * has_string_value = False
18603 * for child in children:
18605 __pyx_v_has_children = 0;
18607 /* "lxml/objectify.pyx":1151
18608 * pytype_name = None
18609 * has_children = False
18610 * has_string_value = False # <<<<<<<<<<<<<<
18611 * for child in children:
18612 * if child is None:
18614 __pyx_v_has_string_value = 0;
18616 /* "lxml/objectify.pyx":1152
18617 * has_children = False
18618 * has_string_value = False
18619 * for child in children: # <<<<<<<<<<<<<<
18620 * if child is None:
18621 * if len(children) == 1:
18623 __pyx_t_5 = __pyx_v_children; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
18625 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
18626 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18627 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1152, __pyx_L1_error)
18629 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error)
18630 __Pyx_GOTREF(__pyx_t_4);
18632 __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
18635 /* "lxml/objectify.pyx":1153
18636 * has_string_value = False
18637 * for child in children:
18638 * if child is None: # <<<<<<<<<<<<<<
18639 * if len(children) == 1:
18640 * cetree.setAttributeValue(
18642 __pyx_t_2 = (__pyx_v_child == Py_None);
18643 __pyx_t_1 = (__pyx_t_2 != 0);
18646 /* "lxml/objectify.pyx":1154
18647 * for child in children:
18648 * if child is None:
18649 * if len(children) == 1: # <<<<<<<<<<<<<<
18650 * cetree.setAttributeValue(
18651 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18653 __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_children); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1154, __pyx_L1_error)
18654 __pyx_t_1 = ((__pyx_t_9 == 1) != 0);
18657 /* "lxml/objectify.pyx":1156
18658 * if len(children) == 1:
18659 * cetree.setAttributeValue(
18660 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true") # <<<<<<<<<<<<<<
18661 * elif python._isString(child):
18662 * _add_text(element, child)
18664 __pyx_t_4 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
18665 __Pyx_INCREF(__pyx_t_4);
18667 /* "lxml/objectify.pyx":1155
18668 * if child is None:
18669 * if len(children) == 1:
18670 * cetree.setAttributeValue( # <<<<<<<<<<<<<<
18671 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18672 * elif python._isString(child):
18674 __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_4, __pyx_n_u_true); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1155, __pyx_L1_error)
18675 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18677 /* "lxml/objectify.pyx":1154
18678 * for child in children:
18679 * if child is None:
18680 * if len(children) == 1: # <<<<<<<<<<<<<<
18681 * cetree.setAttributeValue(
18682 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18686 /* "lxml/objectify.pyx":1153
18687 * has_string_value = False
18688 * for child in children:
18689 * if child is None: # <<<<<<<<<<<<<<
18690 * if len(children) == 1:
18691 * cetree.setAttributeValue(
18696 /* "lxml/objectify.pyx":1157
18697 * cetree.setAttributeValue(
18698 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18699 * elif python._isString(child): # <<<<<<<<<<<<<<
18700 * _add_text(element, child)
18701 * has_string_value = True
18703 __pyx_t_1 = (_isString(__pyx_v_child) != 0);
18706 /* "lxml/objectify.pyx":1158
18707 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18708 * elif python._isString(child):
18709 * _add_text(element, child) # <<<<<<<<<<<<<<
18710 * has_string_value = True
18711 * elif isinstance(child, _Element):
18713 __pyx_t_4 = __pyx_f_4lxml_9objectify__add_text(__pyx_v_element, __pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error)
18714 __Pyx_GOTREF(__pyx_t_4);
18715 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18717 /* "lxml/objectify.pyx":1159
18718 * elif python._isString(child):
18719 * _add_text(element, child)
18720 * has_string_value = True # <<<<<<<<<<<<<<
18721 * elif isinstance(child, _Element):
18722 * cetree.appendChildToElement(element, <_Element>child)
18724 __pyx_v_has_string_value = 1;
18726 /* "lxml/objectify.pyx":1157
18727 * cetree.setAttributeValue(
18728 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18729 * elif python._isString(child): # <<<<<<<<<<<<<<
18730 * _add_text(element, child)
18731 * has_string_value = True
18736 /* "lxml/objectify.pyx":1160
18737 * _add_text(element, child)
18738 * has_string_value = True
18739 * elif isinstance(child, _Element): # <<<<<<<<<<<<<<
18740 * cetree.appendChildToElement(element, <_Element>child)
18741 * has_children = True
18743 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_child, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
18744 __pyx_t_2 = (__pyx_t_1 != 0);
18747 /* "lxml/objectify.pyx":1161
18748 * has_string_value = True
18749 * elif isinstance(child, _Element):
18750 * cetree.appendChildToElement(element, <_Element>child) # <<<<<<<<<<<<<<
18751 * has_children = True
18752 * elif isinstance(child, _ObjectifyElementMakerCaller):
18754 __pyx_t_6 = appendChildToElement(__pyx_v_element, ((struct LxmlElement *)__pyx_v_child)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1161, __pyx_L1_error)
18756 /* "lxml/objectify.pyx":1162
18757 * elif isinstance(child, _Element):
18758 * cetree.appendChildToElement(element, <_Element>child)
18759 * has_children = True # <<<<<<<<<<<<<<
18760 * elif isinstance(child, _ObjectifyElementMakerCaller):
18761 * elementMaker = <_ObjectifyElementMakerCaller>child
18763 __pyx_v_has_children = 1;
18765 /* "lxml/objectify.pyx":1160
18766 * _add_text(element, child)
18767 * has_string_value = True
18768 * elif isinstance(child, _Element): # <<<<<<<<<<<<<<
18769 * cetree.appendChildToElement(element, <_Element>child)
18770 * has_children = True
18775 /* "lxml/objectify.pyx":1163
18776 * cetree.appendChildToElement(element, <_Element>child)
18777 * has_children = True
18778 * elif isinstance(child, _ObjectifyElementMakerCaller): # <<<<<<<<<<<<<<
18779 * elementMaker = <_ObjectifyElementMakerCaller>child
18780 * if elementMaker._element_factory is None:
18782 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_child, __pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller);
18783 __pyx_t_1 = (__pyx_t_2 != 0);
18786 /* "lxml/objectify.pyx":1164
18787 * has_children = True
18788 * elif isinstance(child, _ObjectifyElementMakerCaller):
18789 * elementMaker = <_ObjectifyElementMakerCaller>child # <<<<<<<<<<<<<<
18790 * if elementMaker._element_factory is None:
18791 * cetree.makeSubElement(element, elementMaker._tag,
18793 __pyx_t_4 = __pyx_v_child;
18794 __Pyx_INCREF(__pyx_t_4);
18795 __Pyx_XDECREF_SET(__pyx_v_elementMaker, ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_t_4));
18798 /* "lxml/objectify.pyx":1165
18799 * elif isinstance(child, _ObjectifyElementMakerCaller):
18800 * elementMaker = <_ObjectifyElementMakerCaller>child
18801 * if elementMaker._element_factory is None: # <<<<<<<<<<<<<<
18802 * cetree.makeSubElement(element, elementMaker._tag,
18803 * None, None, None, None)
18805 __pyx_t_1 = (__pyx_v_elementMaker->_element_factory == Py_None);
18806 __pyx_t_2 = (__pyx_t_1 != 0);
18809 /* "lxml/objectify.pyx":1166
18810 * elementMaker = <_ObjectifyElementMakerCaller>child
18811 * if elementMaker._element_factory is None:
18812 * cetree.makeSubElement(element, elementMaker._tag, # <<<<<<<<<<<<<<
18813 * None, None, None, None)
18816 __pyx_t_4 = __pyx_v_elementMaker->_tag;
18817 __Pyx_INCREF(__pyx_t_4);
18819 /* "lxml/objectify.pyx":1167
18820 * if elementMaker._element_factory is None:
18821 * cetree.makeSubElement(element, elementMaker._tag,
18822 * None, None, None, None) # <<<<<<<<<<<<<<
18824 * childElement = elementMaker._element_factory(
18826 __pyx_t_7 = ((PyObject *)makeSubElement(__pyx_v_element, __pyx_t_4, Py_None, Py_None, Py_None, Py_None)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1166, __pyx_L1_error)
18827 __Pyx_GOTREF(__pyx_t_7);
18828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18829 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18831 /* "lxml/objectify.pyx":1165
18832 * elif isinstance(child, _ObjectifyElementMakerCaller):
18833 * elementMaker = <_ObjectifyElementMakerCaller>child
18834 * if elementMaker._element_factory is None: # <<<<<<<<<<<<<<
18835 * cetree.makeSubElement(element, elementMaker._tag,
18836 * None, None, None, None)
18841 /* "lxml/objectify.pyx":1169
18842 * None, None, None, None)
18844 * childElement = elementMaker._element_factory( # <<<<<<<<<<<<<<
18845 * elementMaker._tag)
18846 * cetree.appendChildToElement(element, childElement)
18850 /* "lxml/objectify.pyx":1170
18852 * childElement = elementMaker._element_factory(
18853 * elementMaker._tag) # <<<<<<<<<<<<<<
18854 * cetree.appendChildToElement(element, childElement)
18855 * has_children = True
18857 __Pyx_INCREF(__pyx_v_elementMaker->_element_factory);
18858 __pyx_t_4 = __pyx_v_elementMaker->_element_factory; __pyx_t_3 = NULL;
18859 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18860 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18861 if (likely(__pyx_t_3)) {
18862 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18863 __Pyx_INCREF(__pyx_t_3);
18864 __Pyx_INCREF(function);
18865 __Pyx_DECREF_SET(__pyx_t_4, function);
18868 __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_elementMaker->_tag) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_elementMaker->_tag);
18869 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18870 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1169, __pyx_L1_error)
18871 __Pyx_GOTREF(__pyx_t_7);
18872 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18874 /* "lxml/objectify.pyx":1169
18875 * None, None, None, None)
18877 * childElement = elementMaker._element_factory( # <<<<<<<<<<<<<<
18878 * elementMaker._tag)
18879 * cetree.appendChildToElement(element, childElement)
18881 if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 1169, __pyx_L1_error)
18882 __Pyx_XDECREF_SET(__pyx_v_childElement, ((struct LxmlElement *)__pyx_t_7));
18885 /* "lxml/objectify.pyx":1171
18886 * childElement = elementMaker._element_factory(
18887 * elementMaker._tag)
18888 * cetree.appendChildToElement(element, childElement) # <<<<<<<<<<<<<<
18889 * has_children = True
18890 * elif isinstance(child, dict):
18892 __pyx_t_6 = appendChildToElement(__pyx_v_element, __pyx_v_childElement); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1171, __pyx_L1_error)
18896 /* "lxml/objectify.pyx":1172
18897 * elementMaker._tag)
18898 * cetree.appendChildToElement(element, childElement)
18899 * has_children = True # <<<<<<<<<<<<<<
18900 * elif isinstance(child, dict):
18901 * for name, value in child.items():
18903 __pyx_v_has_children = 1;
18905 /* "lxml/objectify.pyx":1163
18906 * cetree.appendChildToElement(element, <_Element>child)
18907 * has_children = True
18908 * elif isinstance(child, _ObjectifyElementMakerCaller): # <<<<<<<<<<<<<<
18909 * elementMaker = <_ObjectifyElementMakerCaller>child
18910 * if elementMaker._element_factory is None:
18915 /* "lxml/objectify.pyx":1173
18916 * cetree.appendChildToElement(element, childElement)
18917 * has_children = True
18918 * elif isinstance(child, dict): # <<<<<<<<<<<<<<
18919 * for name, value in child.items():
18920 * # keyword arguments in attrib take precedence
18922 __pyx_t_2 = PyDict_Check(__pyx_v_child);
18923 __pyx_t_1 = (__pyx_t_2 != 0);
18926 /* "lxml/objectify.pyx":1174
18927 * has_children = True
18928 * elif isinstance(child, dict):
18929 * for name, value in child.items(): # <<<<<<<<<<<<<<
18930 * # keyword arguments in attrib take precedence
18931 * if name in attrib:
18933 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error)
18934 __Pyx_GOTREF(__pyx_t_4);
18936 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18937 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18938 if (likely(__pyx_t_3)) {
18939 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18940 __Pyx_INCREF(__pyx_t_3);
18941 __Pyx_INCREF(function);
18942 __Pyx_DECREF_SET(__pyx_t_4, function);
18945 __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
18946 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18947 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
18948 __Pyx_GOTREF(__pyx_t_7);
18949 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18950 if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
18951 __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
18954 __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error)
18955 __Pyx_GOTREF(__pyx_t_4);
18956 __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1174, __pyx_L1_error)
18958 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18960 if (likely(!__pyx_t_10)) {
18961 if (likely(PyList_CheckExact(__pyx_t_4))) {
18962 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
18963 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18964 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1174, __pyx_L1_error)
18966 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
18967 __Pyx_GOTREF(__pyx_t_7);
18970 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
18971 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18972 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1174, __pyx_L1_error)
18974 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
18975 __Pyx_GOTREF(__pyx_t_7);
18979 __pyx_t_7 = __pyx_t_10(__pyx_t_4);
18980 if (unlikely(!__pyx_t_7)) {
18981 PyObject* exc_type = PyErr_Occurred();
18983 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18984 else __PYX_ERR(0, 1174, __pyx_L1_error)
18988 __Pyx_GOTREF(__pyx_t_7);
18990 if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
18991 PyObject* sequence = __pyx_t_7;
18992 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18993 if (unlikely(size != 2)) {
18994 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
18995 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18996 __PYX_ERR(0, 1174, __pyx_L1_error)
18998 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18999 if (likely(PyTuple_CheckExact(sequence))) {
19000 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
19001 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
19003 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
19004 __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
19006 __Pyx_INCREF(__pyx_t_3);
19007 __Pyx_INCREF(__pyx_t_11);
19009 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
19010 __Pyx_GOTREF(__pyx_t_3);
19011 __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1174, __pyx_L1_error)
19012 __Pyx_GOTREF(__pyx_t_11);
19014 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19016 Py_ssize_t index = -1;
19017 __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L1_error)
19018 __Pyx_GOTREF(__pyx_t_12);
19019 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19020 __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
19021 index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
19022 __Pyx_GOTREF(__pyx_t_3);
19023 index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L11_unpacking_failed;
19024 __Pyx_GOTREF(__pyx_t_11);
19025 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
19027 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19028 goto __pyx_L12_unpacking_done;
19029 __pyx_L11_unpacking_failed:;
19030 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19032 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
19033 __PYX_ERR(0, 1174, __pyx_L1_error)
19034 __pyx_L12_unpacking_done:;
19036 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
19038 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
19041 /* "lxml/objectify.pyx":1176
19042 * for name, value in child.items():
19043 * # keyword arguments in attrib take precedence
19044 * if name in attrib: # <<<<<<<<<<<<<<
19046 * pytype = _PYTYPE_DICT.get(_typename(value))
19048 __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v_attrib, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1176, __pyx_L1_error)
19049 __pyx_t_2 = (__pyx_t_1 != 0);
19052 /* "lxml/objectify.pyx":1177
19053 * # keyword arguments in attrib take precedence
19054 * if name in attrib:
19055 * continue # <<<<<<<<<<<<<<
19056 * pytype = _PYTYPE_DICT.get(_typename(value))
19057 * if pytype is not None:
19059 goto __pyx_L9_continue;
19061 /* "lxml/objectify.pyx":1176
19062 * for name, value in child.items():
19063 * # keyword arguments in attrib take precedence
19064 * if name in attrib: # <<<<<<<<<<<<<<
19066 * pytype = _PYTYPE_DICT.get(_typename(value))
19070 /* "lxml/objectify.pyx":1178
19071 * if name in attrib:
19073 * pytype = _PYTYPE_DICT.get(_typename(value)) # <<<<<<<<<<<<<<
19074 * if pytype is not None:
19075 * value = (<PyType>pytype).stringify(value)
19077 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
19078 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
19079 __PYX_ERR(0, 1178, __pyx_L1_error)
19081 __pyx_t_7 = __pyx_f_4lxml_9objectify__typename(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error)
19082 __Pyx_GOTREF(__pyx_t_7);
19083 __pyx_t_11 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1178, __pyx_L1_error)
19084 __Pyx_GOTREF(__pyx_t_11);
19085 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19086 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_11);
19089 /* "lxml/objectify.pyx":1179
19091 * pytype = _PYTYPE_DICT.get(_typename(value))
19092 * if pytype is not None: # <<<<<<<<<<<<<<
19093 * value = (<PyType>pytype).stringify(value)
19094 * elif not python._isString(value):
19096 __pyx_t_2 = (__pyx_v_pytype != Py_None);
19097 __pyx_t_1 = (__pyx_t_2 != 0);
19100 /* "lxml/objectify.pyx":1180
19101 * pytype = _PYTYPE_DICT.get(_typename(value))
19102 * if pytype is not None:
19103 * value = (<PyType>pytype).stringify(value) # <<<<<<<<<<<<<<
19104 * elif not python._isString(value):
19105 * value = unicode(value)
19107 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify);
19108 __pyx_t_7 = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify; __pyx_t_3 = NULL;
19109 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
19110 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
19111 if (likely(__pyx_t_3)) {
19112 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19113 __Pyx_INCREF(__pyx_t_3);
19114 __Pyx_INCREF(function);
19115 __Pyx_DECREF_SET(__pyx_t_7, function);
19118 __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
19119 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19120 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L1_error)
19121 __Pyx_GOTREF(__pyx_t_11);
19122 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19123 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
19126 /* "lxml/objectify.pyx":1179
19128 * pytype = _PYTYPE_DICT.get(_typename(value))
19129 * if pytype is not None: # <<<<<<<<<<<<<<
19130 * value = (<PyType>pytype).stringify(value)
19131 * elif not python._isString(value):
19136 /* "lxml/objectify.pyx":1181
19137 * if pytype is not None:
19138 * value = (<PyType>pytype).stringify(value)
19139 * elif not python._isString(value): # <<<<<<<<<<<<<<
19140 * value = unicode(value)
19141 * cetree.setAttributeValue(element, name, value)
19143 __pyx_t_1 = ((!(_isString(__pyx_v_value) != 0)) != 0);
19146 /* "lxml/objectify.pyx":1182
19147 * value = (<PyType>pytype).stringify(value)
19148 * elif not python._isString(value):
19149 * value = unicode(value) # <<<<<<<<<<<<<<
19150 * cetree.setAttributeValue(element, name, value)
19153 __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error)
19154 __Pyx_GOTREF(__pyx_t_11);
19155 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
19158 /* "lxml/objectify.pyx":1181
19159 * if pytype is not None:
19160 * value = (<PyType>pytype).stringify(value)
19161 * elif not python._isString(value): # <<<<<<<<<<<<<<
19162 * value = unicode(value)
19163 * cetree.setAttributeValue(element, name, value)
19168 /* "lxml/objectify.pyx":1183
19169 * elif not python._isString(value):
19170 * value = unicode(value)
19171 * cetree.setAttributeValue(element, name, value) # <<<<<<<<<<<<<<
19173 * if pytype_name is not None:
19175 __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1183, __pyx_L1_error)
19177 /* "lxml/objectify.pyx":1174
19178 * has_children = True
19179 * elif isinstance(child, dict):
19180 * for name, value in child.items(): # <<<<<<<<<<<<<<
19181 * # keyword arguments in attrib take precedence
19182 * if name in attrib:
19184 __pyx_L9_continue:;
19186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19188 /* "lxml/objectify.pyx":1173
19189 * cetree.appendChildToElement(element, childElement)
19190 * has_children = True
19191 * elif isinstance(child, dict): # <<<<<<<<<<<<<<
19192 * for name, value in child.items():
19193 * # keyword arguments in attrib take precedence
19198 /* "lxml/objectify.pyx":1185
19199 * cetree.setAttributeValue(element, name, value)
19201 * if pytype_name is not None: # <<<<<<<<<<<<<<
19202 * # concatenation always makes the result a string
19203 * has_string_value = True
19206 __pyx_t_1 = (__pyx_v_pytype_name != Py_None);
19207 __pyx_t_2 = (__pyx_t_1 != 0);
19210 /* "lxml/objectify.pyx":1187
19211 * if pytype_name is not None:
19212 * # concatenation always makes the result a string
19213 * has_string_value = True # <<<<<<<<<<<<<<
19214 * pytype_name = _typename(child)
19215 * pytype = _PYTYPE_DICT.get(_typename(child))
19217 __pyx_v_has_string_value = 1;
19219 /* "lxml/objectify.pyx":1185
19220 * cetree.setAttributeValue(element, name, value)
19222 * if pytype_name is not None: # <<<<<<<<<<<<<<
19223 * # concatenation always makes the result a string
19224 * has_string_value = True
19228 /* "lxml/objectify.pyx":1188
19229 * # concatenation always makes the result a string
19230 * has_string_value = True
19231 * pytype_name = _typename(child) # <<<<<<<<<<<<<<
19232 * pytype = _PYTYPE_DICT.get(_typename(child))
19233 * if pytype is not None:
19235 __pyx_t_4 = __pyx_f_4lxml_9objectify__typename(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error)
19236 __Pyx_GOTREF(__pyx_t_4);
19237 __Pyx_DECREF_SET(__pyx_v_pytype_name, __pyx_t_4);
19240 /* "lxml/objectify.pyx":1189
19241 * has_string_value = True
19242 * pytype_name = _typename(child)
19243 * pytype = _PYTYPE_DICT.get(_typename(child)) # <<<<<<<<<<<<<<
19244 * if pytype is not None:
19245 * _add_text(element, (<PyType>pytype).stringify(child))
19247 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
19248 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
19249 __PYX_ERR(0, 1189, __pyx_L1_error)
19251 __pyx_t_4 = __pyx_f_4lxml_9objectify__typename(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
19252 __Pyx_GOTREF(__pyx_t_4);
19253 __pyx_t_11 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_t_4, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1189, __pyx_L1_error)
19254 __Pyx_GOTREF(__pyx_t_11);
19255 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19256 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_11);
19259 /* "lxml/objectify.pyx":1190
19260 * pytype_name = _typename(child)
19261 * pytype = _PYTYPE_DICT.get(_typename(child))
19262 * if pytype is not None: # <<<<<<<<<<<<<<
19263 * _add_text(element, (<PyType>pytype).stringify(child))
19266 __pyx_t_2 = (__pyx_v_pytype != Py_None);
19267 __pyx_t_1 = (__pyx_t_2 != 0);
19270 /* "lxml/objectify.pyx":1191
19271 * pytype = _PYTYPE_DICT.get(_typename(child))
19272 * if pytype is not None:
19273 * _add_text(element, (<PyType>pytype).stringify(child)) # <<<<<<<<<<<<<<
19275 * has_string_value = True
19277 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify);
19278 __pyx_t_4 = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify; __pyx_t_7 = NULL;
19279 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
19280 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
19281 if (likely(__pyx_t_7)) {
19282 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19283 __Pyx_INCREF(__pyx_t_7);
19284 __Pyx_INCREF(function);
19285 __Pyx_DECREF_SET(__pyx_t_4, function);
19288 __pyx_t_11 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_child) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_child);
19289 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19290 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1191, __pyx_L1_error)
19291 __Pyx_GOTREF(__pyx_t_11);
19292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19293 __pyx_t_4 = __pyx_f_4lxml_9objectify__add_text(__pyx_v_element, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error)
19294 __Pyx_GOTREF(__pyx_t_4);
19295 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
19296 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19298 /* "lxml/objectify.pyx":1190
19299 * pytype_name = _typename(child)
19300 * pytype = _PYTYPE_DICT.get(_typename(child))
19301 * if pytype is not None: # <<<<<<<<<<<<<<
19302 * _add_text(element, (<PyType>pytype).stringify(child))
19308 /* "lxml/objectify.pyx":1193
19309 * _add_text(element, (<PyType>pytype).stringify(child))
19311 * has_string_value = True # <<<<<<<<<<<<<<
19312 * child = unicode(child)
19313 * _add_text(element, child)
19316 __pyx_v_has_string_value = 1;
19318 /* "lxml/objectify.pyx":1194
19320 * has_string_value = True
19321 * child = unicode(child) # <<<<<<<<<<<<<<
19322 * _add_text(element, child)
19325 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
19326 __Pyx_GOTREF(__pyx_t_4);
19327 __Pyx_DECREF_SET(__pyx_v_child, __pyx_t_4);
19330 /* "lxml/objectify.pyx":1195
19331 * has_string_value = True
19332 * child = unicode(child)
19333 * _add_text(element, child) # <<<<<<<<<<<<<<
19335 * if self._annotate and not has_children:
19337 __pyx_t_4 = __pyx_f_4lxml_9objectify__add_text(__pyx_v_element, __pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1195, __pyx_L1_error)
19338 __Pyx_GOTREF(__pyx_t_4);
19339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19345 /* "lxml/objectify.pyx":1152
19346 * has_children = False
19347 * has_string_value = False
19348 * for child in children: # <<<<<<<<<<<<<<
19349 * if child is None:
19350 * if len(children) == 1:
19353 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19355 /* "lxml/objectify.pyx":1197
19356 * _add_text(element, child)
19358 * if self._annotate and not has_children: # <<<<<<<<<<<<<<
19359 * if has_string_value:
19360 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19362 __pyx_t_2 = (__pyx_v_self->_annotate != 0);
19365 __pyx_t_1 = __pyx_t_2;
19366 goto __pyx_L18_bool_binop_done;
19368 __pyx_t_2 = ((!(__pyx_v_has_children != 0)) != 0);
19369 __pyx_t_1 = __pyx_t_2;
19370 __pyx_L18_bool_binop_done:;
19373 /* "lxml/objectify.pyx":1198
19375 * if self._annotate and not has_children:
19376 * if has_string_value: # <<<<<<<<<<<<<<
19377 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19378 * elif pytype_name is not None:
19380 __pyx_t_1 = (__pyx_v_has_string_value != 0);
19383 /* "lxml/objectify.pyx":1199
19384 * if self._annotate and not has_children:
19385 * if has_string_value:
19386 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str") # <<<<<<<<<<<<<<
19387 * elif pytype_name is not None:
19388 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19390 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
19391 __Pyx_GOTREF(__pyx_t_5);
19392 __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_n_u_str); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1199, __pyx_L1_error)
19393 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19395 /* "lxml/objectify.pyx":1198
19397 * if self._annotate and not has_children:
19398 * if has_string_value: # <<<<<<<<<<<<<<
19399 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19400 * elif pytype_name is not None:
19405 /* "lxml/objectify.pyx":1200
19406 * if has_string_value:
19407 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19408 * elif pytype_name is not None: # <<<<<<<<<<<<<<
19409 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19412 __pyx_t_1 = (__pyx_v_pytype_name != Py_None);
19413 __pyx_t_2 = (__pyx_t_1 != 0);
19416 /* "lxml/objectify.pyx":1201
19417 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19418 * elif pytype_name is not None:
19419 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name) # <<<<<<<<<<<<<<
19423 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __pyx_L1_error)
19424 __Pyx_GOTREF(__pyx_t_5);
19425 __pyx_t_6 = setAttributeValue(__pyx_v_element, __pyx_t_5, __pyx_v_pytype_name); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1201, __pyx_L1_error)
19426 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19428 /* "lxml/objectify.pyx":1200
19429 * if has_string_value:
19430 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19431 * elif pytype_name is not None: # <<<<<<<<<<<<<<
19432 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19438 /* "lxml/objectify.pyx":1197
19439 * _add_text(element, child)
19441 * if self._annotate and not has_children: # <<<<<<<<<<<<<<
19442 * if has_string_value:
19443 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19447 /* "lxml/objectify.pyx":1203
19448 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19450 * return element # <<<<<<<<<<<<<<
19452 * cdef _add_text(_Element elem, text):
19454 __Pyx_XDECREF(__pyx_r);
19455 __Pyx_INCREF(((PyObject *)__pyx_v_element));
19456 __pyx_r = ((PyObject *)__pyx_v_element);
19459 /* "lxml/objectify.pyx":1137
19460 * cdef bint _annotate
19462 * def __call__(self, *children, **attrib): # <<<<<<<<<<<<<<
19463 * u"__call__(self, *children, **attrib)"
19464 * cdef _ObjectifyElementMakerCaller elementMaker
19467 /* function exit code */
19469 __Pyx_XDECREF(__pyx_t_3);
19470 __Pyx_XDECREF(__pyx_t_4);
19471 __Pyx_XDECREF(__pyx_t_5);
19472 __Pyx_XDECREF(__pyx_t_7);
19473 __Pyx_XDECREF(__pyx_t_11);
19474 __Pyx_XDECREF(__pyx_t_12);
19475 __Pyx_AddTraceback("lxml.objectify._ObjectifyElementMakerCaller.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19478 __Pyx_XDECREF((PyObject *)__pyx_v_elementMaker);
19479 __Pyx_XDECREF((PyObject *)__pyx_v_element);
19480 __Pyx_XDECREF((PyObject *)__pyx_v_childElement);
19481 __Pyx_XDECREF(__pyx_v_pytype_name);
19482 __Pyx_XDECREF(__pyx_v_child);
19483 __Pyx_XDECREF(__pyx_v_name);
19484 __Pyx_XDECREF(__pyx_v_value);
19485 __Pyx_XDECREF(__pyx_v_pytype);
19486 __Pyx_XGIVEREF(__pyx_r);
19487 __Pyx_RefNannyFinishContext();
19491 /* "lxml/objectify.pyx":1205
19494 * cdef _add_text(_Element elem, text): # <<<<<<<<<<<<<<
19495 * # add text to the tree in construction, either as element text or
19496 * # tail text, depending on the current tree state
19499 static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *__pyx_v_elem, PyObject *__pyx_v_text) {
19500 xmlNode *__pyx_v_c_child;
19501 PyObject *__pyx_v_old = NULL;
19502 PyObject *__pyx_r = NULL;
19503 __Pyx_RefNannyDeclarations
19505 PyObject *__pyx_t_2 = NULL;
19508 int __pyx_lineno = 0;
19509 const char *__pyx_filename = NULL;
19510 int __pyx_clineno = 0;
19511 __Pyx_RefNannySetupContext("_add_text", 0);
19512 __Pyx_INCREF(__pyx_v_text);
19514 /* "lxml/objectify.pyx":1209
19515 * # tail text, depending on the current tree state
19516 * cdef tree.xmlNode* c_child
19517 * c_child = cetree.findChildBackwards(elem._c_node, 0) # <<<<<<<<<<<<<<
19518 * if c_child is not NULL:
19519 * old = cetree.tailOf(c_child)
19521 __pyx_v_c_child = findChildBackwards(__pyx_v_elem->_c_node, 0);
19523 /* "lxml/objectify.pyx":1210
19524 * cdef tree.xmlNode* c_child
19525 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19526 * if c_child is not NULL: # <<<<<<<<<<<<<<
19527 * old = cetree.tailOf(c_child)
19528 * if old is not None:
19530 __pyx_t_1 = ((__pyx_v_c_child != NULL) != 0);
19533 /* "lxml/objectify.pyx":1211
19534 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19535 * if c_child is not NULL:
19536 * old = cetree.tailOf(c_child) # <<<<<<<<<<<<<<
19537 * if old is not None:
19538 * text = old + text
19540 __pyx_t_2 = tailOf(__pyx_v_c_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
19541 __Pyx_GOTREF(__pyx_t_2);
19542 __pyx_v_old = __pyx_t_2;
19545 /* "lxml/objectify.pyx":1212
19546 * if c_child is not NULL:
19547 * old = cetree.tailOf(c_child)
19548 * if old is not None: # <<<<<<<<<<<<<<
19549 * text = old + text
19550 * cetree.setTailText(c_child, text)
19552 __pyx_t_1 = (__pyx_v_old != Py_None);
19553 __pyx_t_3 = (__pyx_t_1 != 0);
19556 /* "lxml/objectify.pyx":1213
19557 * old = cetree.tailOf(c_child)
19558 * if old is not None:
19559 * text = old + text # <<<<<<<<<<<<<<
19560 * cetree.setTailText(c_child, text)
19563 __pyx_t_2 = PyNumber_Add(__pyx_v_old, __pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
19564 __Pyx_GOTREF(__pyx_t_2);
19565 __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2);
19568 /* "lxml/objectify.pyx":1212
19569 * if c_child is not NULL:
19570 * old = cetree.tailOf(c_child)
19571 * if old is not None: # <<<<<<<<<<<<<<
19572 * text = old + text
19573 * cetree.setTailText(c_child, text)
19577 /* "lxml/objectify.pyx":1214
19578 * if old is not None:
19579 * text = old + text
19580 * cetree.setTailText(c_child, text) # <<<<<<<<<<<<<<
19582 * old = cetree.textOf(elem._c_node)
19584 __pyx_t_4 = setTailText(__pyx_v_c_child, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1214, __pyx_L1_error)
19586 /* "lxml/objectify.pyx":1210
19587 * cdef tree.xmlNode* c_child
19588 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19589 * if c_child is not NULL: # <<<<<<<<<<<<<<
19590 * old = cetree.tailOf(c_child)
19591 * if old is not None:
19596 /* "lxml/objectify.pyx":1216
19597 * cetree.setTailText(c_child, text)
19599 * old = cetree.textOf(elem._c_node) # <<<<<<<<<<<<<<
19600 * if old is not None:
19601 * text = old + text
19604 __pyx_t_2 = textOf(__pyx_v_elem->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error)
19605 __Pyx_GOTREF(__pyx_t_2);
19606 __pyx_v_old = __pyx_t_2;
19609 /* "lxml/objectify.pyx":1217
19611 * old = cetree.textOf(elem._c_node)
19612 * if old is not None: # <<<<<<<<<<<<<<
19613 * text = old + text
19614 * cetree.setNodeText(elem._c_node, text)
19616 __pyx_t_3 = (__pyx_v_old != Py_None);
19617 __pyx_t_1 = (__pyx_t_3 != 0);
19620 /* "lxml/objectify.pyx":1218
19621 * old = cetree.textOf(elem._c_node)
19622 * if old is not None:
19623 * text = old + text # <<<<<<<<<<<<<<
19624 * cetree.setNodeText(elem._c_node, text)
19627 __pyx_t_2 = PyNumber_Add(__pyx_v_old, __pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
19628 __Pyx_GOTREF(__pyx_t_2);
19629 __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2);
19632 /* "lxml/objectify.pyx":1217
19634 * old = cetree.textOf(elem._c_node)
19635 * if old is not None: # <<<<<<<<<<<<<<
19636 * text = old + text
19637 * cetree.setNodeText(elem._c_node, text)
19641 /* "lxml/objectify.pyx":1219
19642 * if old is not None:
19643 * text = old + text
19644 * cetree.setNodeText(elem._c_node, text) # <<<<<<<<<<<<<<
19646 * cdef class ElementMaker:
19648 __pyx_t_4 = setNodeText(__pyx_v_elem->_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1219, __pyx_L1_error)
19652 /* "lxml/objectify.pyx":1205
19655 * cdef _add_text(_Element elem, text): # <<<<<<<<<<<<<<
19656 * # add text to the tree in construction, either as element text or
19657 * # tail text, depending on the current tree state
19660 /* function exit code */
19661 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19664 __Pyx_XDECREF(__pyx_t_2);
19665 __Pyx_AddTraceback("lxml.objectify._add_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
19668 __Pyx_XDECREF(__pyx_v_old);
19669 __Pyx_XDECREF(__pyx_v_text);
19670 __Pyx_XGIVEREF(__pyx_r);
19671 __Pyx_RefNannyFinishContext();
19675 /* "lxml/objectify.pyx":1252
19676 * cdef bint _annotate
19678 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19679 * makeelement=None):
19680 * if nsmap is None:
19683 /* Python wrapper */
19684 static int __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19685 static int __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19686 PyObject *__pyx_v_namespace = 0;
19687 PyObject *__pyx_v_nsmap = 0;
19688 PyObject *__pyx_v_annotate = 0;
19689 PyObject *__pyx_v_makeelement = 0;
19690 int __pyx_lineno = 0;
19691 const char *__pyx_filename = NULL;
19692 int __pyx_clineno = 0;
19694 __Pyx_RefNannyDeclarations
19695 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
19697 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_namespace,&__pyx_n_s_nsmap,&__pyx_n_s_annotate,&__pyx_n_s_makeelement,0};
19698 PyObject* values[4] = {0,0,0,0};
19699 values[0] = ((PyObject *)Py_None);
19700 values[1] = ((PyObject *)Py_None);
19701 values[2] = ((PyObject *)Py_True);
19703 /* "lxml/objectify.pyx":1253
19705 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19706 * makeelement=None): # <<<<<<<<<<<<<<
19707 * if nsmap is None:
19708 * nsmap = _DEFAULT_NSMAP if annotate else {}
19710 values[3] = ((PyObject *)Py_None);
19711 if (unlikely(__pyx_kwds)) {
19712 Py_ssize_t kw_args;
19713 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19714 switch (pos_args) {
19716 default: goto __pyx_L5_argtuple_error;
19718 kw_args = PyDict_Size(__pyx_kwds);
19719 if (kw_args > 0 && likely(kw_args <= 4)) {
19721 for (index = 0; index < 4 && kw_args > 0; index++) {
19722 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
19723 if (value) { values[index] = value; kw_args--; }
19726 if (unlikely(kw_args > 0)) {
19727 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(0, 1252, __pyx_L3_error)
19729 } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
19730 goto __pyx_L5_argtuple_error;
19733 __pyx_v_namespace = values[0];
19734 __pyx_v_nsmap = values[1];
19735 __pyx_v_annotate = values[2];
19736 __pyx_v_makeelement = values[3];
19738 goto __pyx_L4_argument_unpacking_done;
19739 __pyx_L5_argtuple_error:;
19740 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1252, __pyx_L3_error)
19742 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19743 __Pyx_RefNannyFinishContext();
19745 __pyx_L4_argument_unpacking_done:;
19746 __pyx_r = __pyx_pf_4lxml_9objectify_12ElementMaker___init__(((struct __pyx_obj_4lxml_9objectify_ElementMaker *)__pyx_v_self), __pyx_v_namespace, __pyx_v_nsmap, __pyx_v_annotate, __pyx_v_makeelement);
19748 /* "lxml/objectify.pyx":1252
19749 * cdef bint _annotate
19751 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19752 * makeelement=None):
19753 * if nsmap is None:
19756 /* function exit code */
19757 __Pyx_RefNannyFinishContext();
19761 static int __pyx_pf_4lxml_9objectify_12ElementMaker___init__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_namespace, PyObject *__pyx_v_nsmap, PyObject *__pyx_v_annotate, PyObject *__pyx_v_makeelement) {
19763 __Pyx_RefNannyDeclarations
19766 PyObject *__pyx_t_3 = NULL;
19767 PyObject *__pyx_t_4 = NULL;
19768 int __pyx_lineno = 0;
19769 const char *__pyx_filename = NULL;
19770 int __pyx_clineno = 0;
19771 __Pyx_RefNannySetupContext("__init__", 0);
19772 __Pyx_INCREF(__pyx_v_nsmap);
19774 /* "lxml/objectify.pyx":1254
19775 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19776 * makeelement=None):
19777 * if nsmap is None: # <<<<<<<<<<<<<<
19778 * nsmap = _DEFAULT_NSMAP if annotate else {}
19779 * self._nsmap = nsmap
19781 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
19782 __pyx_t_2 = (__pyx_t_1 != 0);
19785 /* "lxml/objectify.pyx":1255
19786 * makeelement=None):
19787 * if nsmap is None:
19788 * nsmap = _DEFAULT_NSMAP if annotate else {} # <<<<<<<<<<<<<<
19789 * self._nsmap = nsmap
19790 * self._namespace = None if namespace is None else u"{%s}" % namespace
19792 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_annotate); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1255, __pyx_L1_error)
19794 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
19795 __pyx_t_3 = __pyx_v_4lxml_9objectify__DEFAULT_NSMAP;
19797 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error)
19798 __Pyx_GOTREF(__pyx_t_4);
19799 __pyx_t_3 = __pyx_t_4;
19802 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_t_3);
19805 /* "lxml/objectify.pyx":1254
19806 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19807 * makeelement=None):
19808 * if nsmap is None: # <<<<<<<<<<<<<<
19809 * nsmap = _DEFAULT_NSMAP if annotate else {}
19810 * self._nsmap = nsmap
19814 /* "lxml/objectify.pyx":1256
19815 * if nsmap is None:
19816 * nsmap = _DEFAULT_NSMAP if annotate else {}
19817 * self._nsmap = nsmap # <<<<<<<<<<<<<<
19818 * self._namespace = None if namespace is None else u"{%s}" % namespace
19819 * self._annotate = annotate
19821 __Pyx_INCREF(__pyx_v_nsmap);
19822 __Pyx_GIVEREF(__pyx_v_nsmap);
19823 __Pyx_GOTREF(__pyx_v_self->_nsmap);
19824 __Pyx_DECREF(__pyx_v_self->_nsmap);
19825 __pyx_v_self->_nsmap = __pyx_v_nsmap;
19827 /* "lxml/objectify.pyx":1257
19828 * nsmap = _DEFAULT_NSMAP if annotate else {}
19829 * self._nsmap = nsmap
19830 * self._namespace = None if namespace is None else u"{%s}" % namespace # <<<<<<<<<<<<<<
19831 * self._annotate = annotate
19832 * if makeelement is not None:
19834 __pyx_t_2 = (__pyx_v_namespace == Py_None);
19835 if ((__pyx_t_2 != 0)) {
19836 __Pyx_INCREF(Py_None);
19837 __pyx_t_3 = Py_None;
19839 __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_2, __pyx_v_namespace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L1_error)
19840 __Pyx_GOTREF(__pyx_t_4);
19841 __pyx_t_3 = __pyx_t_4;
19844 __Pyx_GIVEREF(__pyx_t_3);
19845 __Pyx_GOTREF(__pyx_v_self->_namespace);
19846 __Pyx_DECREF(__pyx_v_self->_namespace);
19847 __pyx_v_self->_namespace = __pyx_t_3;
19850 /* "lxml/objectify.pyx":1258
19851 * self._nsmap = nsmap
19852 * self._namespace = None if namespace is None else u"{%s}" % namespace
19853 * self._annotate = annotate # <<<<<<<<<<<<<<
19854 * if makeelement is not None:
19855 * if not callable(makeelement):
19857 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_annotate); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1258, __pyx_L1_error)
19858 __pyx_v_self->_annotate = __pyx_t_2;
19860 /* "lxml/objectify.pyx":1259
19861 * self._namespace = None if namespace is None else u"{%s}" % namespace
19862 * self._annotate = annotate
19863 * if makeelement is not None: # <<<<<<<<<<<<<<
19864 * if not callable(makeelement):
19867 __pyx_t_2 = (__pyx_v_makeelement != Py_None);
19868 __pyx_t_1 = (__pyx_t_2 != 0);
19871 /* "lxml/objectify.pyx":1260
19872 * self._annotate = annotate
19873 * if makeelement is not None:
19874 * if not callable(makeelement): # <<<<<<<<<<<<<<
19876 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19878 __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1260, __pyx_L1_error)
19879 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19880 if (unlikely(__pyx_t_2)) {
19882 /* "lxml/objectify.pyx":1262
19883 * if not callable(makeelement):
19885 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}") # <<<<<<<<<<<<<<
19886 * self._makeelement = makeelement
19889 __pyx_t_3 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_makeelement)), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L1_error)
19890 __Pyx_GOTREF(__pyx_t_3);
19891 __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_argument_of_makeelement_paramete, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1262, __pyx_L1_error)
19892 __Pyx_GOTREF(__pyx_t_4);
19893 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19895 /* "lxml/objectify.pyx":1261
19896 * if makeelement is not None:
19897 * if not callable(makeelement):
19898 * raise TypeError( # <<<<<<<<<<<<<<
19899 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19900 * self._makeelement = makeelement
19902 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error)
19903 __Pyx_GOTREF(__pyx_t_3);
19904 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19905 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19906 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19907 __PYX_ERR(0, 1261, __pyx_L1_error)
19909 /* "lxml/objectify.pyx":1260
19910 * self._annotate = annotate
19911 * if makeelement is not None:
19912 * if not callable(makeelement): # <<<<<<<<<<<<<<
19914 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19918 /* "lxml/objectify.pyx":1263
19920 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19921 * self._makeelement = makeelement # <<<<<<<<<<<<<<
19923 * self._makeelement = None
19925 __Pyx_INCREF(__pyx_v_makeelement);
19926 __Pyx_GIVEREF(__pyx_v_makeelement);
19927 __Pyx_GOTREF(__pyx_v_self->_makeelement);
19928 __Pyx_DECREF(__pyx_v_self->_makeelement);
19929 __pyx_v_self->_makeelement = __pyx_v_makeelement;
19931 /* "lxml/objectify.pyx":1259
19932 * self._namespace = None if namespace is None else u"{%s}" % namespace
19933 * self._annotate = annotate
19934 * if makeelement is not None: # <<<<<<<<<<<<<<
19935 * if not callable(makeelement):
19941 /* "lxml/objectify.pyx":1265
19942 * self._makeelement = makeelement
19944 * self._makeelement = None # <<<<<<<<<<<<<<
19949 __Pyx_INCREF(Py_None);
19950 __Pyx_GIVEREF(Py_None);
19951 __Pyx_GOTREF(__pyx_v_self->_makeelement);
19952 __Pyx_DECREF(__pyx_v_self->_makeelement);
19953 __pyx_v_self->_makeelement = Py_None;
19957 /* "lxml/objectify.pyx":1266
19959 * self._makeelement = None
19960 * self._cache = {} # <<<<<<<<<<<<<<
19964 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
19965 __Pyx_GOTREF(__pyx_t_3);
19966 __Pyx_GIVEREF(__pyx_t_3);
19967 __Pyx_GOTREF(__pyx_v_self->_cache);
19968 __Pyx_DECREF(__pyx_v_self->_cache);
19969 __pyx_v_self->_cache = ((PyObject*)__pyx_t_3);
19972 /* "lxml/objectify.pyx":1252
19973 * cdef bint _annotate
19975 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19976 * makeelement=None):
19977 * if nsmap is None:
19980 /* function exit code */
19984 __Pyx_XDECREF(__pyx_t_3);
19985 __Pyx_XDECREF(__pyx_t_4);
19986 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19989 __Pyx_XDECREF(__pyx_v_nsmap);
19990 __Pyx_RefNannyFinishContext();
19994 /* "lxml/objectify.pyx":1269
19997 * cdef _build_element_maker(self, tag, bint caching): # <<<<<<<<<<<<<<
19998 * cdef _ObjectifyElementMakerCaller element_maker
19999 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20002 static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag, int __pyx_v_caching) {
20003 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_element_maker = 0;
20004 PyObject *__pyx_r = NULL;
20005 __Pyx_RefNannyDeclarations
20006 PyObject *__pyx_t_1 = NULL;
20010 Py_ssize_t __pyx_t_5;
20012 int __pyx_lineno = 0;
20013 const char *__pyx_filename = NULL;
20014 int __pyx_clineno = 0;
20015 __Pyx_RefNannySetupContext("_build_element_maker", 0);
20017 /* "lxml/objectify.pyx":1271
20018 * cdef _build_element_maker(self, tag, bint caching):
20019 * cdef _ObjectifyElementMakerCaller element_maker
20020 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller) # <<<<<<<<<<<<<<
20021 * if self._namespace is not None and tag[0] != u"{":
20022 * element_maker._tag = self._namespace + tag
20024 __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller(((PyTypeObject *)__pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error)
20025 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20026 __pyx_v_element_maker = ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_t_1);
20029 /* "lxml/objectify.pyx":1272
20030 * cdef _ObjectifyElementMakerCaller element_maker
20031 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20032 * if self._namespace is not None and tag[0] != u"{": # <<<<<<<<<<<<<<
20033 * element_maker._tag = self._namespace + tag
20036 __pyx_t_3 = (__pyx_v_self->_namespace != Py_None);
20037 __pyx_t_4 = (__pyx_t_3 != 0);
20040 __pyx_t_2 = __pyx_t_4;
20041 goto __pyx_L4_bool_binop_done;
20043 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_tag, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error)
20044 __Pyx_GOTREF(__pyx_t_1);
20045 __pyx_t_4 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__9, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1272, __pyx_L1_error)
20046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20047 __pyx_t_2 = __pyx_t_4;
20048 __pyx_L4_bool_binop_done:;
20051 /* "lxml/objectify.pyx":1273
20052 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20053 * if self._namespace is not None and tag[0] != u"{":
20054 * element_maker._tag = self._namespace + tag # <<<<<<<<<<<<<<
20056 * element_maker._tag = tag
20058 __pyx_t_1 = PyNumber_Add(__pyx_v_self->_namespace, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
20059 __Pyx_GOTREF(__pyx_t_1);
20060 __Pyx_GIVEREF(__pyx_t_1);
20061 __Pyx_GOTREF(__pyx_v_element_maker->_tag);
20062 __Pyx_DECREF(__pyx_v_element_maker->_tag);
20063 __pyx_v_element_maker->_tag = __pyx_t_1;
20066 /* "lxml/objectify.pyx":1272
20067 * cdef _ObjectifyElementMakerCaller element_maker
20068 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20069 * if self._namespace is not None and tag[0] != u"{": # <<<<<<<<<<<<<<
20070 * element_maker._tag = self._namespace + tag
20076 /* "lxml/objectify.pyx":1275
20077 * element_maker._tag = self._namespace + tag
20079 * element_maker._tag = tag # <<<<<<<<<<<<<<
20080 * element_maker._nsmap = self._nsmap
20081 * element_maker._annotate = self._annotate
20084 __Pyx_INCREF(__pyx_v_tag);
20085 __Pyx_GIVEREF(__pyx_v_tag);
20086 __Pyx_GOTREF(__pyx_v_element_maker->_tag);
20087 __Pyx_DECREF(__pyx_v_element_maker->_tag);
20088 __pyx_v_element_maker->_tag = __pyx_v_tag;
20092 /* "lxml/objectify.pyx":1276
20094 * element_maker._tag = tag
20095 * element_maker._nsmap = self._nsmap # <<<<<<<<<<<<<<
20096 * element_maker._annotate = self._annotate
20097 * element_maker._element_factory = self._makeelement
20099 __pyx_t_1 = __pyx_v_self->_nsmap;
20100 __Pyx_INCREF(__pyx_t_1);
20101 __Pyx_GIVEREF(__pyx_t_1);
20102 __Pyx_GOTREF(__pyx_v_element_maker->_nsmap);
20103 __Pyx_DECREF(__pyx_v_element_maker->_nsmap);
20104 __pyx_v_element_maker->_nsmap = __pyx_t_1;
20107 /* "lxml/objectify.pyx":1277
20108 * element_maker._tag = tag
20109 * element_maker._nsmap = self._nsmap
20110 * element_maker._annotate = self._annotate # <<<<<<<<<<<<<<
20111 * element_maker._element_factory = self._makeelement
20114 __pyx_t_2 = __pyx_v_self->_annotate;
20115 __pyx_v_element_maker->_annotate = __pyx_t_2;
20117 /* "lxml/objectify.pyx":1278
20118 * element_maker._nsmap = self._nsmap
20119 * element_maker._annotate = self._annotate
20120 * element_maker._element_factory = self._makeelement # <<<<<<<<<<<<<<
20122 * if len(self._cache) > 200:
20124 __pyx_t_1 = __pyx_v_self->_makeelement;
20125 __Pyx_INCREF(__pyx_t_1);
20126 __Pyx_GIVEREF(__pyx_t_1);
20127 __Pyx_GOTREF(__pyx_v_element_maker->_element_factory);
20128 __Pyx_DECREF(__pyx_v_element_maker->_element_factory);
20129 __pyx_v_element_maker->_element_factory = __pyx_t_1;
20132 /* "lxml/objectify.pyx":1279
20133 * element_maker._annotate = self._annotate
20134 * element_maker._element_factory = self._makeelement
20135 * if caching: # <<<<<<<<<<<<<<
20136 * if len(self._cache) > 200:
20137 * self._cache.clear()
20139 __pyx_t_2 = (__pyx_v_caching != 0);
20142 /* "lxml/objectify.pyx":1280
20143 * element_maker._element_factory = self._makeelement
20145 * if len(self._cache) > 200: # <<<<<<<<<<<<<<
20146 * self._cache.clear()
20147 * self._cache[tag] = element_maker
20149 __pyx_t_1 = __pyx_v_self->_cache;
20150 __Pyx_INCREF(__pyx_t_1);
20151 if (unlikely(__pyx_t_1 == Py_None)) {
20152 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20153 __PYX_ERR(0, 1280, __pyx_L1_error)
20155 __pyx_t_5 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1280, __pyx_L1_error)
20156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20157 __pyx_t_2 = ((__pyx_t_5 > 0xC8) != 0);
20160 /* "lxml/objectify.pyx":1281
20162 * if len(self._cache) > 200:
20163 * self._cache.clear() # <<<<<<<<<<<<<<
20164 * self._cache[tag] = element_maker
20165 * return element_maker
20167 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20168 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
20169 __PYX_ERR(0, 1281, __pyx_L1_error)
20171 __pyx_t_6 = __Pyx_PyDict_Clear(__pyx_v_self->_cache); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error)
20173 /* "lxml/objectify.pyx":1280
20174 * element_maker._element_factory = self._makeelement
20176 * if len(self._cache) > 200: # <<<<<<<<<<<<<<
20177 * self._cache.clear()
20178 * self._cache[tag] = element_maker
20182 /* "lxml/objectify.pyx":1282
20183 * if len(self._cache) > 200:
20184 * self._cache.clear()
20185 * self._cache[tag] = element_maker # <<<<<<<<<<<<<<
20186 * return element_maker
20189 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20190 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20191 __PYX_ERR(0, 1282, __pyx_L1_error)
20193 if (unlikely(PyDict_SetItem(__pyx_v_self->_cache, __pyx_v_tag, ((PyObject *)__pyx_v_element_maker)) < 0)) __PYX_ERR(0, 1282, __pyx_L1_error)
20195 /* "lxml/objectify.pyx":1279
20196 * element_maker._annotate = self._annotate
20197 * element_maker._element_factory = self._makeelement
20198 * if caching: # <<<<<<<<<<<<<<
20199 * if len(self._cache) > 200:
20200 * self._cache.clear()
20204 /* "lxml/objectify.pyx":1283
20205 * self._cache.clear()
20206 * self._cache[tag] = element_maker
20207 * return element_maker # <<<<<<<<<<<<<<
20209 * def __getattr__(self, tag):
20211 __Pyx_XDECREF(__pyx_r);
20212 __Pyx_INCREF(((PyObject *)__pyx_v_element_maker));
20213 __pyx_r = ((PyObject *)__pyx_v_element_maker);
20216 /* "lxml/objectify.pyx":1269
20219 * cdef _build_element_maker(self, tag, bint caching): # <<<<<<<<<<<<<<
20220 * cdef _ObjectifyElementMakerCaller element_maker
20221 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20224 /* function exit code */
20226 __Pyx_XDECREF(__pyx_t_1);
20227 __Pyx_AddTraceback("lxml.objectify.ElementMaker._build_element_maker", __pyx_clineno, __pyx_lineno, __pyx_filename);
20230 __Pyx_XDECREF((PyObject *)__pyx_v_element_maker);
20231 __Pyx_XGIVEREF(__pyx_r);
20232 __Pyx_RefNannyFinishContext();
20236 /* "lxml/objectify.pyx":1285
20237 * return element_maker
20239 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
20240 * element_maker = self._cache.get(tag)
20241 * if element_maker is None:
20244 /* Python wrapper */
20245 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
20246 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
20247 PyObject *__pyx_r = 0;
20248 __Pyx_RefNannyDeclarations
20249 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
20250 __pyx_r = __pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(((struct __pyx_obj_4lxml_9objectify_ElementMaker *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
20252 /* function exit code */
20253 __Pyx_RefNannyFinishContext();
20257 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag) {
20258 PyObject *__pyx_v_element_maker = NULL;
20259 PyObject *__pyx_r = NULL;
20260 __Pyx_RefNannyDeclarations
20261 PyObject *__pyx_t_1 = NULL;
20264 PyObject *__pyx_t_4 = NULL;
20265 PyObject *__pyx_t_5 = NULL;
20267 PyObject *__pyx_t_7 = NULL;
20268 int __pyx_lineno = 0;
20269 const char *__pyx_filename = NULL;
20270 int __pyx_clineno = 0;
20271 __Pyx_RefNannySetupContext("__getattr__", 0);
20273 /* "lxml/objectify.pyx":1286
20275 * def __getattr__(self, tag):
20276 * element_maker = self._cache.get(tag) # <<<<<<<<<<<<<<
20277 * if element_maker is None:
20278 * if is_special_method(tag):
20280 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20281 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
20282 __PYX_ERR(0, 1286, __pyx_L1_error)
20284 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_cache, __pyx_v_tag, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1286, __pyx_L1_error)
20285 __Pyx_GOTREF(__pyx_t_1);
20286 __pyx_v_element_maker = __pyx_t_1;
20289 /* "lxml/objectify.pyx":1287
20290 * def __getattr__(self, tag):
20291 * element_maker = self._cache.get(tag)
20292 * if element_maker is None: # <<<<<<<<<<<<<<
20293 * if is_special_method(tag):
20294 * return object.__getattr__(self, tag)
20296 __pyx_t_2 = (__pyx_v_element_maker == Py_None);
20297 __pyx_t_3 = (__pyx_t_2 != 0);
20300 /* "lxml/objectify.pyx":1288
20301 * element_maker = self._cache.get(tag)
20302 * if element_maker is None:
20303 * if is_special_method(tag): # <<<<<<<<<<<<<<
20304 * return object.__getattr__(self, tag)
20305 * return self._build_element_maker(tag, caching=True)
20307 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
20308 __pyx_t_4 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_5 = NULL;
20309 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20310 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20311 if (likely(__pyx_t_5)) {
20312 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20313 __Pyx_INCREF(__pyx_t_5);
20314 __Pyx_INCREF(function);
20315 __Pyx_DECREF_SET(__pyx_t_4, function);
20318 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tag) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tag);
20319 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20320 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
20321 __Pyx_GOTREF(__pyx_t_1);
20322 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20323 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1288, __pyx_L1_error)
20324 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20327 /* "lxml/objectify.pyx":1289
20328 * if element_maker is None:
20329 * if is_special_method(tag):
20330 * return object.__getattr__(self, tag) # <<<<<<<<<<<<<<
20331 * return self._build_element_maker(tag, caching=True)
20332 * return element_maker
20334 __Pyx_XDECREF(__pyx_r);
20335 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1289, __pyx_L1_error)
20336 __Pyx_GOTREF(__pyx_t_4);
20339 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
20340 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20341 if (likely(__pyx_t_5)) {
20342 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20343 __Pyx_INCREF(__pyx_t_5);
20344 __Pyx_INCREF(function);
20345 __Pyx_DECREF_SET(__pyx_t_4, function);
20349 #if CYTHON_FAST_PYCALL
20350 if (PyFunction_Check(__pyx_t_4)) {
20351 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_tag};
20352 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
20353 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20354 __Pyx_GOTREF(__pyx_t_1);
20357 #if CYTHON_FAST_PYCCALL
20358 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
20359 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_tag};
20360 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
20361 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20362 __Pyx_GOTREF(__pyx_t_1);
20366 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1289, __pyx_L1_error)
20367 __Pyx_GOTREF(__pyx_t_7);
20369 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
20371 __Pyx_INCREF(((PyObject *)__pyx_v_self));
20372 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20373 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
20374 __Pyx_INCREF(__pyx_v_tag);
20375 __Pyx_GIVEREF(__pyx_v_tag);
20376 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_tag);
20377 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1289, __pyx_L1_error)
20378 __Pyx_GOTREF(__pyx_t_1);
20379 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20381 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20382 __pyx_r = __pyx_t_1;
20386 /* "lxml/objectify.pyx":1288
20387 * element_maker = self._cache.get(tag)
20388 * if element_maker is None:
20389 * if is_special_method(tag): # <<<<<<<<<<<<<<
20390 * return object.__getattr__(self, tag)
20391 * return self._build_element_maker(tag, caching=True)
20395 /* "lxml/objectify.pyx":1290
20396 * if is_special_method(tag):
20397 * return object.__getattr__(self, tag)
20398 * return self._build_element_maker(tag, caching=True) # <<<<<<<<<<<<<<
20399 * return element_maker
20402 __Pyx_XDECREF(__pyx_r);
20403 __pyx_t_1 = __pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(__pyx_v_self, __pyx_v_tag, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L1_error)
20404 __Pyx_GOTREF(__pyx_t_1);
20405 __pyx_r = __pyx_t_1;
20409 /* "lxml/objectify.pyx":1287
20410 * def __getattr__(self, tag):
20411 * element_maker = self._cache.get(tag)
20412 * if element_maker is None: # <<<<<<<<<<<<<<
20413 * if is_special_method(tag):
20414 * return object.__getattr__(self, tag)
20418 /* "lxml/objectify.pyx":1291
20419 * return object.__getattr__(self, tag)
20420 * return self._build_element_maker(tag, caching=True)
20421 * return element_maker # <<<<<<<<<<<<<<
20423 * def __call__(self, tag, *args, **kwargs):
20425 __Pyx_XDECREF(__pyx_r);
20426 __Pyx_INCREF(__pyx_v_element_maker);
20427 __pyx_r = __pyx_v_element_maker;
20430 /* "lxml/objectify.pyx":1285
20431 * return element_maker
20433 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
20434 * element_maker = self._cache.get(tag)
20435 * if element_maker is None:
20438 /* function exit code */
20440 __Pyx_XDECREF(__pyx_t_1);
20441 __Pyx_XDECREF(__pyx_t_4);
20442 __Pyx_XDECREF(__pyx_t_5);
20443 __Pyx_XDECREF(__pyx_t_7);
20444 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20447 __Pyx_XDECREF(__pyx_v_element_maker);
20448 __Pyx_XGIVEREF(__pyx_r);
20449 __Pyx_RefNannyFinishContext();
20453 /* "lxml/objectify.pyx":1293
20454 * return element_maker
20456 * def __call__(self, tag, *args, **kwargs): # <<<<<<<<<<<<<<
20457 * element_maker = self._cache.get(tag)
20458 * if element_maker is None:
20461 /* Python wrapper */
20462 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20463 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20464 PyObject *__pyx_v_tag = 0;
20465 PyObject *__pyx_v_args = 0;
20466 PyObject *__pyx_v_kwargs = 0;
20467 int __pyx_lineno = 0;
20468 const char *__pyx_filename = NULL;
20469 int __pyx_clineno = 0;
20470 PyObject *__pyx_r = 0;
20471 __Pyx_RefNannyDeclarations
20472 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
20473 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
20474 __Pyx_GOTREF(__pyx_v_kwargs);
20475 if (PyTuple_GET_SIZE(__pyx_args) > 1) {
20476 __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
20477 if (unlikely(!__pyx_v_args)) {
20478 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
20479 __Pyx_RefNannyFinishContext();
20482 __Pyx_GOTREF(__pyx_v_args);
20484 __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
20487 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag,0};
20488 PyObject* values[1] = {0};
20489 if (unlikely(__pyx_kwds)) {
20490 Py_ssize_t kw_args;
20491 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20492 switch (pos_args) {
20494 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20495 CYTHON_FALLTHROUGH;
20498 kw_args = PyDict_Size(__pyx_kwds);
20499 switch (pos_args) {
20501 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
20502 else goto __pyx_L5_argtuple_error;
20504 if (unlikely(kw_args > 0)) {
20505 const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
20506 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) __PYX_ERR(0, 1293, __pyx_L3_error)
20508 } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
20509 goto __pyx_L5_argtuple_error;
20511 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20513 __pyx_v_tag = values[0];
20515 goto __pyx_L4_argument_unpacking_done;
20516 __pyx_L5_argtuple_error:;
20517 __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1293, __pyx_L3_error)
20519 __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
20520 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
20521 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20522 __Pyx_RefNannyFinishContext();
20524 __pyx_L4_argument_unpacking_done:;
20525 __pyx_r = __pyx_pf_4lxml_9objectify_12ElementMaker_4__call__(((struct __pyx_obj_4lxml_9objectify_ElementMaker *)__pyx_v_self), __pyx_v_tag, __pyx_v_args, __pyx_v_kwargs);
20527 /* function exit code */
20528 __Pyx_XDECREF(__pyx_v_args);
20529 __Pyx_XDECREF(__pyx_v_kwargs);
20530 __Pyx_RefNannyFinishContext();
20534 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_4__call__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
20535 PyObject *__pyx_v_element_maker = NULL;
20536 PyObject *__pyx_r = NULL;
20537 __Pyx_RefNannyDeclarations
20538 PyObject *__pyx_t_1 = NULL;
20541 PyObject *__pyx_t_4 = NULL;
20542 PyObject *__pyx_t_5 = NULL;
20543 int __pyx_lineno = 0;
20544 const char *__pyx_filename = NULL;
20545 int __pyx_clineno = 0;
20546 __Pyx_RefNannySetupContext("__call__", 0);
20548 /* "lxml/objectify.pyx":1294
20550 * def __call__(self, tag, *args, **kwargs):
20551 * element_maker = self._cache.get(tag) # <<<<<<<<<<<<<<
20552 * if element_maker is None:
20553 * element_maker = self._build_element_maker(
20555 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20556 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
20557 __PYX_ERR(0, 1294, __pyx_L1_error)
20559 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_cache, __pyx_v_tag, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
20560 __Pyx_GOTREF(__pyx_t_1);
20561 __pyx_v_element_maker = __pyx_t_1;
20564 /* "lxml/objectify.pyx":1295
20565 * def __call__(self, tag, *args, **kwargs):
20566 * element_maker = self._cache.get(tag)
20567 * if element_maker is None: # <<<<<<<<<<<<<<
20568 * element_maker = self._build_element_maker(
20569 * tag, caching=not is_special_method(tag))
20571 __pyx_t_2 = (__pyx_v_element_maker == Py_None);
20572 __pyx_t_3 = (__pyx_t_2 != 0);
20575 /* "lxml/objectify.pyx":1297
20576 * if element_maker is None:
20577 * element_maker = self._build_element_maker(
20578 * tag, caching=not is_special_method(tag)) # <<<<<<<<<<<<<<
20579 * return element_maker(*args, **kwargs)
20582 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
20583 __pyx_t_4 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_5 = NULL;
20584 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20585 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20586 if (likely(__pyx_t_5)) {
20587 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20588 __Pyx_INCREF(__pyx_t_5);
20589 __Pyx_INCREF(function);
20590 __Pyx_DECREF_SET(__pyx_t_4, function);
20593 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_tag) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tag);
20594 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20595 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
20596 __Pyx_GOTREF(__pyx_t_1);
20597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20598 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1297, __pyx_L1_error)
20599 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20601 /* "lxml/objectify.pyx":1296
20602 * element_maker = self._cache.get(tag)
20603 * if element_maker is None:
20604 * element_maker = self._build_element_maker( # <<<<<<<<<<<<<<
20605 * tag, caching=not is_special_method(tag))
20606 * return element_maker(*args, **kwargs)
20608 __pyx_t_1 = __pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(__pyx_v_self, __pyx_v_tag, (!__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error)
20609 __Pyx_GOTREF(__pyx_t_1);
20610 __Pyx_DECREF_SET(__pyx_v_element_maker, __pyx_t_1);
20613 /* "lxml/objectify.pyx":1295
20614 * def __call__(self, tag, *args, **kwargs):
20615 * element_maker = self._cache.get(tag)
20616 * if element_maker is None: # <<<<<<<<<<<<<<
20617 * element_maker = self._build_element_maker(
20618 * tag, caching=not is_special_method(tag))
20622 /* "lxml/objectify.pyx":1298
20623 * element_maker = self._build_element_maker(
20624 * tag, caching=not is_special_method(tag))
20625 * return element_maker(*args, **kwargs) # <<<<<<<<<<<<<<
20627 * ################################################################################
20629 __Pyx_XDECREF(__pyx_r);
20630 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_element_maker, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error)
20631 __Pyx_GOTREF(__pyx_t_1);
20632 __pyx_r = __pyx_t_1;
20636 /* "lxml/objectify.pyx":1293
20637 * return element_maker
20639 * def __call__(self, tag, *args, **kwargs): # <<<<<<<<<<<<<<
20640 * element_maker = self._cache.get(tag)
20641 * if element_maker is None:
20644 /* function exit code */
20646 __Pyx_XDECREF(__pyx_t_1);
20647 __Pyx_XDECREF(__pyx_t_4);
20648 __Pyx_XDECREF(__pyx_t_5);
20649 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20652 __Pyx_XDECREF(__pyx_v_element_maker);
20653 __Pyx_XGIVEREF(__pyx_r);
20654 __Pyx_RefNannyFinishContext();
20658 /* "lxml/objectify.pyx":1305
20659 * cdef bint __RECURSIVE_STR = 0 # default: off
20661 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
20662 * u"""enable_recursive_str(on=True)
20666 /* Python wrapper */
20667 static PyObject *__pyx_pw_4lxml_9objectify_13enable_recursive_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20668 static char __pyx_doc_4lxml_9objectify_12enable_recursive_str[] = "enable_recursive_str(on=True)\n\n Enable a recursively generated tree representation for str(element),\n based on objectify.dump(element).\n ";
20669 static PyMethodDef __pyx_mdef_4lxml_9objectify_13enable_recursive_str = {"enable_recursive_str", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_13enable_recursive_str, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_12enable_recursive_str};
20670 static PyObject *__pyx_pw_4lxml_9objectify_13enable_recursive_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20671 PyObject *__pyx_v_on = 0;
20672 int __pyx_lineno = 0;
20673 const char *__pyx_filename = NULL;
20674 int __pyx_clineno = 0;
20675 PyObject *__pyx_r = 0;
20676 __Pyx_RefNannyDeclarations
20677 __Pyx_RefNannySetupContext("enable_recursive_str (wrapper)", 0);
20679 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0};
20680 PyObject* values[1] = {0};
20681 values[0] = ((PyObject *)((PyObject *)Py_True));
20682 if (unlikely(__pyx_kwds)) {
20683 Py_ssize_t kw_args;
20684 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20685 switch (pos_args) {
20686 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20687 CYTHON_FALLTHROUGH;
20689 default: goto __pyx_L5_argtuple_error;
20691 kw_args = PyDict_Size(__pyx_kwds);
20692 switch (pos_args) {
20695 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on);
20696 if (value) { values[0] = value; kw_args--; }
20699 if (unlikely(kw_args > 0)) {
20700 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "enable_recursive_str") < 0)) __PYX_ERR(0, 1305, __pyx_L3_error)
20703 switch (PyTuple_GET_SIZE(__pyx_args)) {
20704 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20705 CYTHON_FALLTHROUGH;
20707 default: goto __pyx_L5_argtuple_error;
20710 __pyx_v_on = values[0];
20712 goto __pyx_L4_argument_unpacking_done;
20713 __pyx_L5_argtuple_error:;
20714 __Pyx_RaiseArgtupleInvalid("enable_recursive_str", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1305, __pyx_L3_error)
20716 __Pyx_AddTraceback("lxml.objectify.enable_recursive_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
20717 __Pyx_RefNannyFinishContext();
20719 __pyx_L4_argument_unpacking_done:;
20720 __pyx_r = __pyx_pf_4lxml_9objectify_12enable_recursive_str(__pyx_self, __pyx_v_on);
20722 /* function exit code */
20723 __Pyx_RefNannyFinishContext();
20727 static PyObject *__pyx_pf_4lxml_9objectify_12enable_recursive_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) {
20728 PyObject *__pyx_r = NULL;
20729 __Pyx_RefNannyDeclarations
20731 int __pyx_lineno = 0;
20732 const char *__pyx_filename = NULL;
20733 int __pyx_clineno = 0;
20734 __Pyx_RefNannySetupContext("enable_recursive_str", 0);
20736 /* "lxml/objectify.pyx":1312
20738 * global __RECURSIVE_STR
20739 * __RECURSIVE_STR = on # <<<<<<<<<<<<<<
20741 * def dump(_Element element not None):
20743 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L1_error)
20744 __pyx_v_4lxml_9objectify___RECURSIVE_STR = __pyx_t_1;
20746 /* "lxml/objectify.pyx":1305
20747 * cdef bint __RECURSIVE_STR = 0 # default: off
20749 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
20750 * u"""enable_recursive_str(on=True)
20754 /* function exit code */
20755 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20758 __Pyx_AddTraceback("lxml.objectify.enable_recursive_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
20761 __Pyx_XGIVEREF(__pyx_r);
20762 __Pyx_RefNannyFinishContext();
20766 /* "lxml/objectify.pyx":1314
20767 * __RECURSIVE_STR = on
20769 * def dump(_Element element not None): # <<<<<<<<<<<<<<
20770 * u"""dump(_Element element not None)
20774 /* Python wrapper */
20775 static PyObject *__pyx_pw_4lxml_9objectify_15dump(PyObject *__pyx_self, PyObject *__pyx_v_element); /*proto*/
20776 static char __pyx_doc_4lxml_9objectify_14dump[] = "dump(_Element element not None)\n\n Return a recursively generated string representation of an element.\n ";
20777 static PyMethodDef __pyx_mdef_4lxml_9objectify_15dump = {"dump", (PyCFunction)__pyx_pw_4lxml_9objectify_15dump, METH_O, __pyx_doc_4lxml_9objectify_14dump};
20778 static PyObject *__pyx_pw_4lxml_9objectify_15dump(PyObject *__pyx_self, PyObject *__pyx_v_element) {
20779 int __pyx_lineno = 0;
20780 const char *__pyx_filename = NULL;
20781 int __pyx_clineno = 0;
20782 PyObject *__pyx_r = 0;
20783 __Pyx_RefNannyDeclarations
20784 __Pyx_RefNannySetupContext("dump (wrapper)", 0);
20785 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "element", 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
20786 __pyx_r = __pyx_pf_4lxml_9objectify_14dump(__pyx_self, ((struct LxmlElement *)__pyx_v_element));
20788 /* function exit code */
20793 __Pyx_RefNannyFinishContext();
20797 static PyObject *__pyx_pf_4lxml_9objectify_14dump(CYTHON_UNUSED PyObject *__pyx_self, struct LxmlElement *__pyx_v_element) {
20798 PyObject *__pyx_r = NULL;
20799 __Pyx_RefNannyDeclarations
20800 PyObject *__pyx_t_1 = NULL;
20801 int __pyx_lineno = 0;
20802 const char *__pyx_filename = NULL;
20803 int __pyx_clineno = 0;
20804 __Pyx_RefNannySetupContext("dump", 0);
20806 /* "lxml/objectify.pyx":1319
20807 * Return a recursively generated string representation of an element.
20809 * return _dump(element, 0) # <<<<<<<<<<<<<<
20811 * cdef object _dump(_Element element, int indent):
20813 __Pyx_XDECREF(__pyx_r);
20814 __pyx_t_1 = __pyx_f_4lxml_9objectify__dump(__pyx_v_element, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
20815 __Pyx_GOTREF(__pyx_t_1);
20816 __pyx_r = __pyx_t_1;
20820 /* "lxml/objectify.pyx":1314
20821 * __RECURSIVE_STR = on
20823 * def dump(_Element element not None): # <<<<<<<<<<<<<<
20824 * u"""dump(_Element element not None)
20828 /* function exit code */
20830 __Pyx_XDECREF(__pyx_t_1);
20831 __Pyx_AddTraceback("lxml.objectify.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
20834 __Pyx_XGIVEREF(__pyx_r);
20835 __Pyx_RefNannyFinishContext();
20839 /* "lxml/objectify.pyx":1321
20840 * return _dump(element, 0)
20842 * cdef object _dump(_Element element, int indent): # <<<<<<<<<<<<<<
20843 * indentstr = u" " * indent
20844 * if isinstance(element, ObjectifiedDataElement):
20847 static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *__pyx_v_element, int __pyx_v_indent) {
20848 PyObject *__pyx_v_indentstr = NULL;
20849 PyObject *__pyx_v_value = NULL;
20850 PyObject *__pyx_v_result = NULL;
20851 PyObject *__pyx_v_xsi_ns = NULL;
20852 PyObject *__pyx_v_pytype_ns = NULL;
20853 PyObject *__pyx_v_name = NULL;
20854 PyObject *__pyx_v_child = NULL;
20855 PyObject *__pyx_r = NULL;
20856 __Pyx_RefNannyDeclarations
20857 PyObject *__pyx_t_1 = NULL;
20858 PyObject *__pyx_t_2 = NULL;
20861 PyObject *__pyx_t_5 = NULL;
20862 Py_ssize_t __pyx_t_6;
20865 PyObject *__pyx_t_9 = NULL;
20866 PyObject *__pyx_t_10 = NULL;
20867 PyObject *(*__pyx_t_11)(PyObject *);
20869 Py_ssize_t __pyx_t_13;
20870 PyObject *(*__pyx_t_14)(PyObject *);
20871 int __pyx_lineno = 0;
20872 const char *__pyx_filename = NULL;
20873 int __pyx_clineno = 0;
20874 __Pyx_RefNannySetupContext("_dump", 0);
20876 /* "lxml/objectify.pyx":1322
20878 * cdef object _dump(_Element element, int indent):
20879 * indentstr = u" " * indent # <<<<<<<<<<<<<<
20880 * if isinstance(element, ObjectifiedDataElement):
20881 * value = repr(element)
20883 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_indent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
20884 __Pyx_GOTREF(__pyx_t_1);
20885 __pyx_t_2 = PyNumber_Multiply(__pyx_kp_u__10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
20886 __Pyx_GOTREF(__pyx_t_2);
20887 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20888 if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1322, __pyx_L1_error)
20889 __pyx_v_indentstr = ((PyObject*)__pyx_t_2);
20892 /* "lxml/objectify.pyx":1323
20893 * cdef object _dump(_Element element, int indent):
20894 * indentstr = u" " * indent
20895 * if isinstance(element, ObjectifiedDataElement): # <<<<<<<<<<<<<<
20896 * value = repr(element)
20899 __pyx_t_3 = __Pyx_TypeCheck(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
20900 __pyx_t_4 = (__pyx_t_3 != 0);
20903 /* "lxml/objectify.pyx":1324
20904 * indentstr = u" " * indent
20905 * if isinstance(element, ObjectifiedDataElement):
20906 * value = repr(element) # <<<<<<<<<<<<<<
20908 * value = textOf(element._c_node)
20910 __pyx_t_2 = PyObject_Repr(((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
20911 __Pyx_GOTREF(__pyx_t_2);
20912 __pyx_v_value = __pyx_t_2;
20915 /* "lxml/objectify.pyx":1323
20916 * cdef object _dump(_Element element, int indent):
20917 * indentstr = u" " * indent
20918 * if isinstance(element, ObjectifiedDataElement): # <<<<<<<<<<<<<<
20919 * value = repr(element)
20925 /* "lxml/objectify.pyx":1326
20926 * value = repr(element)
20928 * value = textOf(element._c_node) # <<<<<<<<<<<<<<
20929 * if value is not None:
20930 * if not value.strip():
20933 __pyx_t_2 = textOf(__pyx_v_element->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
20934 __Pyx_GOTREF(__pyx_t_2);
20935 __pyx_v_value = __pyx_t_2;
20938 /* "lxml/objectify.pyx":1327
20940 * value = textOf(element._c_node)
20941 * if value is not None: # <<<<<<<<<<<<<<
20942 * if not value.strip():
20945 __pyx_t_4 = (__pyx_v_value != Py_None);
20946 __pyx_t_3 = (__pyx_t_4 != 0);
20949 /* "lxml/objectify.pyx":1328
20950 * value = textOf(element._c_node)
20951 * if value is not None:
20952 * if not value.strip(): # <<<<<<<<<<<<<<
20956 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
20957 __Pyx_GOTREF(__pyx_t_1);
20959 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20960 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20961 if (likely(__pyx_t_5)) {
20962 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20963 __Pyx_INCREF(__pyx_t_5);
20964 __Pyx_INCREF(function);
20965 __Pyx_DECREF_SET(__pyx_t_1, function);
20968 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
20969 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20970 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
20971 __Pyx_GOTREF(__pyx_t_2);
20972 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20973 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1328, __pyx_L1_error)
20974 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20975 __pyx_t_4 = ((!__pyx_t_3) != 0);
20978 /* "lxml/objectify.pyx":1329
20979 * if value is not None:
20980 * if not value.strip():
20981 * value = None # <<<<<<<<<<<<<<
20983 * value = repr(value)
20985 __Pyx_INCREF(Py_None);
20986 __Pyx_DECREF_SET(__pyx_v_value, Py_None);
20988 /* "lxml/objectify.pyx":1328
20989 * value = textOf(element._c_node)
20990 * if value is not None:
20991 * if not value.strip(): # <<<<<<<<<<<<<<
20998 /* "lxml/objectify.pyx":1331
21001 * value = repr(value) # <<<<<<<<<<<<<<
21002 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n"
21003 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21006 __pyx_t_2 = PyObject_Repr(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
21007 __Pyx_GOTREF(__pyx_t_2);
21008 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
21013 /* "lxml/objectify.pyx":1327
21015 * value = textOf(element._c_node)
21016 * if value is not None: # <<<<<<<<<<<<<<
21017 * if not value.strip():
21024 /* "lxml/objectify.pyx":1332
21026 * value = repr(value)
21027 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n" # <<<<<<<<<<<<<<
21028 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21029 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21031 __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1332, __pyx_L1_error)
21032 __Pyx_GOTREF(__pyx_t_2);
21035 __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_indentstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21036 __Pyx_GOTREF(__pyx_t_1);
21037 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
21038 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21039 __Pyx_GIVEREF(__pyx_t_1);
21040 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21042 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21043 __Pyx_GOTREF(__pyx_t_1);
21044 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21045 __Pyx_GOTREF(__pyx_t_5);
21046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21047 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_7;
21048 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21049 __Pyx_GIVEREF(__pyx_t_5);
21050 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
21052 __Pyx_INCREF(__pyx_kp_u__11);
21054 __Pyx_GIVEREF(__pyx_kp_u__11);
21055 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__11);
21056 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21057 __Pyx_GOTREF(__pyx_t_5);
21058 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_7;
21059 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21060 __Pyx_GIVEREF(__pyx_t_5);
21061 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
21063 __Pyx_INCREF(__pyx_kp_u__12);
21065 __Pyx_GIVEREF(__pyx_kp_u__12);
21066 PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__12);
21067 __pyx_t_5 = __pyx_f_4lxml_9objectify__typename(((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21068 __Pyx_GOTREF(__pyx_t_5);
21069 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21070 __Pyx_GOTREF(__pyx_t_1);
21071 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21072 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
21073 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21074 __Pyx_GIVEREF(__pyx_t_1);
21075 PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
21077 __Pyx_INCREF(__pyx_kp_u__13);
21079 __Pyx_GIVEREF(__pyx_kp_u__13);
21080 PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__13);
21081 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21082 __Pyx_GOTREF(__pyx_t_1);
21083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21084 __pyx_v_result = __pyx_t_1;
21087 /* "lxml/objectify.pyx":1333
21088 * value = repr(value)
21089 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n"
21090 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS # <<<<<<<<<<<<<<
21091 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21092 * for name, value in sorted(cetree.iterattributes(element, 3)):
21094 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_2, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
21095 __Pyx_GOTREF(__pyx_t_1);
21096 __pyx_v_xsi_ns = ((PyObject*)__pyx_t_1);
21099 /* "lxml/objectify.pyx":1334
21100 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n"
21101 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21102 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE # <<<<<<<<<<<<<<
21103 * for name, value in sorted(cetree.iterattributes(element, 3)):
21106 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_2, __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1334, __pyx_L1_error)
21107 __Pyx_GOTREF(__pyx_t_1);
21108 __pyx_v_pytype_ns = ((PyObject*)__pyx_t_1);
21111 /* "lxml/objectify.pyx":1335
21112 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21113 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21114 * for name, value in sorted(cetree.iterattributes(element, 3)): # <<<<<<<<<<<<<<
21116 * if name == PYTYPE_ATTRIBUTE:
21118 __pyx_t_2 = iterattributes(__pyx_v_element, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
21119 __Pyx_GOTREF(__pyx_t_2);
21120 __pyx_t_5 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __pyx_L1_error)
21121 __Pyx_GOTREF(__pyx_t_5);
21122 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21123 __pyx_t_1 = ((PyObject*)__pyx_t_5);
21125 __pyx_t_8 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1335, __pyx_L1_error)
21126 if (unlikely(__pyx_t_1 == Py_None)) {
21127 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21128 __PYX_ERR(0, 1335, __pyx_L1_error)
21130 __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
21131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21133 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21134 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21135 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1335, __pyx_L1_error)
21137 __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error)
21138 __Pyx_GOTREF(__pyx_t_1);
21140 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
21141 PyObject* sequence = __pyx_t_1;
21142 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21143 if (unlikely(size != 2)) {
21144 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21145 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21146 __PYX_ERR(0, 1335, __pyx_L1_error)
21148 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21149 if (likely(PyTuple_CheckExact(sequence))) {
21150 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
21151 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
21153 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
21154 __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
21156 __Pyx_INCREF(__pyx_t_2);
21157 __Pyx_INCREF(__pyx_t_9);
21159 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
21160 __Pyx_GOTREF(__pyx_t_2);
21161 __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1335, __pyx_L1_error)
21162 __Pyx_GOTREF(__pyx_t_9);
21164 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21166 Py_ssize_t index = -1;
21167 __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1335, __pyx_L1_error)
21168 __Pyx_GOTREF(__pyx_t_10);
21169 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21170 __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
21171 index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
21172 __Pyx_GOTREF(__pyx_t_2);
21173 index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
21174 __Pyx_GOTREF(__pyx_t_9);
21175 if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1335, __pyx_L1_error)
21177 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21178 goto __pyx_L9_unpacking_done;
21179 __pyx_L8_unpacking_failed:;
21180 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21182 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
21183 __PYX_ERR(0, 1335, __pyx_L1_error)
21184 __pyx_L9_unpacking_done:;
21186 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
21188 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_9);
21191 /* "lxml/objectify.pyx":1336
21192 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21193 * for name, value in sorted(cetree.iterattributes(element, 3)):
21194 * if u'{' in name: # <<<<<<<<<<<<<<
21195 * if name == PYTYPE_ATTRIBUTE:
21196 * if value == TREE_PYTYPE_NAME:
21198 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__9, __pyx_v_name, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1336, __pyx_L1_error)
21199 __pyx_t_3 = (__pyx_t_4 != 0);
21202 /* "lxml/objectify.pyx":1337
21203 * for name, value in sorted(cetree.iterattributes(element, 3)):
21205 * if name == PYTYPE_ATTRIBUTE: # <<<<<<<<<<<<<<
21206 * if value == TREE_PYTYPE_NAME:
21209 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
21210 __Pyx_GOTREF(__pyx_t_1);
21211 __pyx_t_9 = PyObject_RichCompare(__pyx_v_name, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error)
21212 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21213 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error)
21214 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21217 /* "lxml/objectify.pyx":1338
21219 * if name == PYTYPE_ATTRIBUTE:
21220 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
21224 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1338, __pyx_L1_error)
21227 /* "lxml/objectify.pyx":1339
21228 * if name == PYTYPE_ATTRIBUTE:
21229 * if value == TREE_PYTYPE_NAME:
21230 * continue # <<<<<<<<<<<<<<
21232 * name = name.replace(pytype_ns, u'py:')
21234 goto __pyx_L6_continue;
21236 /* "lxml/objectify.pyx":1338
21238 * if name == PYTYPE_ATTRIBUTE:
21239 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
21245 /* "lxml/objectify.pyx":1341
21248 * name = name.replace(pytype_ns, u'py:') # <<<<<<<<<<<<<<
21249 * name = name.replace(xsi_ns, u'xsi:')
21250 * result += f"{indentstr} * {name} = {value!r}\n"
21253 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
21254 __Pyx_GOTREF(__pyx_t_1);
21257 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21258 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
21259 if (likely(__pyx_t_2)) {
21260 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21261 __Pyx_INCREF(__pyx_t_2);
21262 __Pyx_INCREF(function);
21263 __Pyx_DECREF_SET(__pyx_t_1, function);
21267 #if CYTHON_FAST_PYCALL
21268 if (PyFunction_Check(__pyx_t_1)) {
21269 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_pytype_ns, __pyx_kp_u_py};
21270 __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error)
21271 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21272 __Pyx_GOTREF(__pyx_t_9);
21275 #if CYTHON_FAST_PYCCALL
21276 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
21277 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_pytype_ns, __pyx_kp_u_py};
21278 __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error)
21279 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21280 __Pyx_GOTREF(__pyx_t_9);
21284 __pyx_t_10 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1341, __pyx_L1_error)
21285 __Pyx_GOTREF(__pyx_t_10);
21287 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
21289 __Pyx_INCREF(__pyx_v_pytype_ns);
21290 __Pyx_GIVEREF(__pyx_v_pytype_ns);
21291 PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_12, __pyx_v_pytype_ns);
21292 __Pyx_INCREF(__pyx_kp_u_py);
21293 __Pyx_GIVEREF(__pyx_kp_u_py);
21294 PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_12, __pyx_kp_u_py);
21295 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1341, __pyx_L1_error)
21296 __Pyx_GOTREF(__pyx_t_9);
21297 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21300 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9);
21304 /* "lxml/objectify.pyx":1337
21305 * for name, value in sorted(cetree.iterattributes(element, 3)):
21307 * if name == PYTYPE_ATTRIBUTE: # <<<<<<<<<<<<<<
21308 * if value == TREE_PYTYPE_NAME:
21313 /* "lxml/objectify.pyx":1342
21315 * name = name.replace(pytype_ns, u'py:')
21316 * name = name.replace(xsi_ns, u'xsi:') # <<<<<<<<<<<<<<
21317 * result += f"{indentstr} * {name} = {value!r}\n"
21320 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
21321 __Pyx_GOTREF(__pyx_t_1);
21324 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21325 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
21326 if (likely(__pyx_t_10)) {
21327 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21328 __Pyx_INCREF(__pyx_t_10);
21329 __Pyx_INCREF(function);
21330 __Pyx_DECREF_SET(__pyx_t_1, function);
21334 #if CYTHON_FAST_PYCALL
21335 if (PyFunction_Check(__pyx_t_1)) {
21336 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_xsi_ns, __pyx_kp_u_xsi};
21337 __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1342, __pyx_L1_error)
21338 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21339 __Pyx_GOTREF(__pyx_t_9);
21342 #if CYTHON_FAST_PYCCALL
21343 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
21344 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_xsi_ns, __pyx_kp_u_xsi};
21345 __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1342, __pyx_L1_error)
21346 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21347 __Pyx_GOTREF(__pyx_t_9);
21351 __pyx_t_2 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
21352 __Pyx_GOTREF(__pyx_t_2);
21354 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
21356 __Pyx_INCREF(__pyx_v_xsi_ns);
21357 __Pyx_GIVEREF(__pyx_v_xsi_ns);
21358 PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_12, __pyx_v_xsi_ns);
21359 __Pyx_INCREF(__pyx_kp_u_xsi);
21360 __Pyx_GIVEREF(__pyx_kp_u_xsi);
21361 PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_12, __pyx_kp_u_xsi);
21362 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1342, __pyx_L1_error)
21363 __Pyx_GOTREF(__pyx_t_9);
21364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21367 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9);
21370 /* "lxml/objectify.pyx":1336
21371 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21372 * for name, value in sorted(cetree.iterattributes(element, 3)):
21373 * if u'{' in name: # <<<<<<<<<<<<<<
21374 * if name == PYTYPE_ATTRIBUTE:
21375 * if value == TREE_PYTYPE_NAME:
21379 /* "lxml/objectify.pyx":1343
21380 * name = name.replace(pytype_ns, u'py:')
21381 * name = name.replace(xsi_ns, u'xsi:')
21382 * result += f"{indentstr} * {name} = {value!r}\n" # <<<<<<<<<<<<<<
21386 __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error)
21387 __Pyx_GOTREF(__pyx_t_9);
21390 __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_indentstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
21391 __Pyx_GOTREF(__pyx_t_1);
21392 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
21393 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21394 __Pyx_GIVEREF(__pyx_t_1);
21395 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
21397 __Pyx_INCREF(__pyx_kp_u__14);
21399 __Pyx_GIVEREF(__pyx_kp_u__14);
21400 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_kp_u__14);
21401 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
21402 __Pyx_GOTREF(__pyx_t_1);
21403 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
21404 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21405 __Pyx_GIVEREF(__pyx_t_1);
21406 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1);
21408 __Pyx_INCREF(__pyx_kp_u__11);
21410 __Pyx_GIVEREF(__pyx_kp_u__11);
21411 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_kp_u__11);
21412 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_value), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
21413 __Pyx_GOTREF(__pyx_t_1);
21414 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
21415 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21416 __Pyx_GIVEREF(__pyx_t_1);
21417 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_1);
21419 __Pyx_INCREF(__pyx_kp_u__15);
21421 __Pyx_GIVEREF(__pyx_kp_u__15);
21422 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_kp_u__15);
21423 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_9, 6, __pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
21424 __Pyx_GOTREF(__pyx_t_1);
21425 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21426 __pyx_t_9 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error)
21427 __Pyx_GOTREF(__pyx_t_9);
21428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21429 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
21432 /* "lxml/objectify.pyx":1335
21433 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21434 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21435 * for name, value in sorted(cetree.iterattributes(element, 3)): # <<<<<<<<<<<<<<
21437 * if name == PYTYPE_ATTRIBUTE:
21439 __pyx_L6_continue:;
21441 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21443 /* "lxml/objectify.pyx":1345
21444 * result += f"{indentstr} * {name} = {value!r}\n"
21446 * indent += 1 # <<<<<<<<<<<<<<
21447 * for child in element.iterchildren():
21448 * result += _dump(child, indent)
21450 __pyx_v_indent = (__pyx_v_indent + 1);
21452 /* "lxml/objectify.pyx":1346
21455 * for child in element.iterchildren(): # <<<<<<<<<<<<<<
21456 * result += _dump(child, indent)
21459 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_iterchildren); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error)
21460 __Pyx_GOTREF(__pyx_t_9);
21462 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
21463 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
21464 if (likely(__pyx_t_1)) {
21465 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21466 __Pyx_INCREF(__pyx_t_1);
21467 __Pyx_INCREF(function);
21468 __Pyx_DECREF_SET(__pyx_t_9, function);
21471 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
21472 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21473 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
21474 __Pyx_GOTREF(__pyx_t_5);
21475 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21476 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
21477 __pyx_t_9 = __pyx_t_5; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0;
21480 __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error)
21481 __Pyx_GOTREF(__pyx_t_9);
21482 __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1346, __pyx_L1_error)
21484 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21486 if (likely(!__pyx_t_14)) {
21487 if (likely(PyList_CheckExact(__pyx_t_9))) {
21488 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_9)) break;
21489 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21490 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
21492 __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
21493 __Pyx_GOTREF(__pyx_t_5);
21496 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
21497 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21498 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1346, __pyx_L1_error)
21500 __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
21501 __Pyx_GOTREF(__pyx_t_5);
21505 __pyx_t_5 = __pyx_t_14(__pyx_t_9);
21506 if (unlikely(!__pyx_t_5)) {
21507 PyObject* exc_type = PyErr_Occurred();
21509 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21510 else __PYX_ERR(0, 1346, __pyx_L1_error)
21514 __Pyx_GOTREF(__pyx_t_5);
21516 __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_5);
21519 /* "lxml/objectify.pyx":1347
21521 * for child in element.iterchildren():
21522 * result += _dump(child, indent) # <<<<<<<<<<<<<<
21524 * return result[:-1] # strip last '\n'
21526 if (!(likely(((__pyx_v_child) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child, __pyx_ptype_4lxml_8includes_11etreepublic__Element))))) __PYX_ERR(0, 1347, __pyx_L1_error)
21527 __pyx_t_5 = __pyx_f_4lxml_9objectify__dump(((struct LxmlElement *)__pyx_v_child), __pyx_v_indent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error)
21528 __Pyx_GOTREF(__pyx_t_5);
21529 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
21530 __Pyx_GOTREF(__pyx_t_1);
21531 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21532 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
21535 /* "lxml/objectify.pyx":1346
21538 * for child in element.iterchildren(): # <<<<<<<<<<<<<<
21539 * result += _dump(child, indent)
21543 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21545 /* "lxml/objectify.pyx":1348
21546 * for child in element.iterchildren():
21547 * result += _dump(child, indent)
21548 * if indent == 1: # <<<<<<<<<<<<<<
21549 * return result[:-1] # strip last '\n'
21552 __pyx_t_3 = ((__pyx_v_indent == 1) != 0);
21555 /* "lxml/objectify.pyx":1349
21556 * result += _dump(child, indent)
21558 * return result[:-1] # strip last '\n' # <<<<<<<<<<<<<<
21562 __Pyx_XDECREF(__pyx_r);
21563 __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_result, 0, -1L, NULL, NULL, &__pyx_slice__16, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1349, __pyx_L1_error)
21564 __Pyx_GOTREF(__pyx_t_9);
21565 __pyx_r = __pyx_t_9;
21569 /* "lxml/objectify.pyx":1348
21570 * for child in element.iterchildren():
21571 * result += _dump(child, indent)
21572 * if indent == 1: # <<<<<<<<<<<<<<
21573 * return result[:-1] # strip last '\n'
21578 /* "lxml/objectify.pyx":1351
21579 * return result[:-1] # strip last '\n'
21581 * return result # <<<<<<<<<<<<<<
21586 __Pyx_XDECREF(__pyx_r);
21587 __Pyx_INCREF(__pyx_v_result);
21588 __pyx_r = __pyx_v_result;
21592 /* "lxml/objectify.pyx":1321
21593 * return _dump(element, 0)
21595 * cdef object _dump(_Element element, int indent): # <<<<<<<<<<<<<<
21596 * indentstr = u" " * indent
21597 * if isinstance(element, ObjectifiedDataElement):
21600 /* function exit code */
21602 __Pyx_XDECREF(__pyx_t_1);
21603 __Pyx_XDECREF(__pyx_t_2);
21604 __Pyx_XDECREF(__pyx_t_5);
21605 __Pyx_XDECREF(__pyx_t_9);
21606 __Pyx_XDECREF(__pyx_t_10);
21607 __Pyx_AddTraceback("lxml.objectify._dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
21610 __Pyx_XDECREF(__pyx_v_indentstr);
21611 __Pyx_XDECREF(__pyx_v_value);
21612 __Pyx_XDECREF(__pyx_v_result);
21613 __Pyx_XDECREF(__pyx_v_xsi_ns);
21614 __Pyx_XDECREF(__pyx_v_pytype_ns);
21615 __Pyx_XDECREF(__pyx_v_name);
21616 __Pyx_XDECREF(__pyx_v_child);
21617 __Pyx_XGIVEREF(__pyx_r);
21618 __Pyx_RefNannyFinishContext();
21622 /* "lxml/objectify.pyx":1357
21623 * # Pickle support for objectified ElementTree
21625 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
21626 * return etree.ElementTree(fromstring(data))
21630 /* Python wrapper */
21631 static PyObject *__pyx_pw_4lxml_9objectify_17__unpickleElementTree(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
21632 static PyMethodDef __pyx_mdef_4lxml_9objectify_17__unpickleElementTree = {"__unpickleElementTree", (PyCFunction)__pyx_pw_4lxml_9objectify_17__unpickleElementTree, METH_O, 0};
21633 static PyObject *__pyx_pw_4lxml_9objectify_17__unpickleElementTree(PyObject *__pyx_self, PyObject *__pyx_v_data) {
21634 PyObject *__pyx_r = 0;
21635 __Pyx_RefNannyDeclarations
21636 __Pyx_RefNannySetupContext("__unpickleElementTree (wrapper)", 0);
21637 __pyx_r = __pyx_pf_4lxml_9objectify_16__unpickleElementTree(__pyx_self, ((PyObject *)__pyx_v_data));
21639 /* function exit code */
21640 __Pyx_RefNannyFinishContext();
21644 static PyObject *__pyx_pf_4lxml_9objectify_16__unpickleElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
21645 PyObject *__pyx_r = NULL;
21646 __Pyx_RefNannyDeclarations
21647 PyObject *__pyx_t_1 = NULL;
21648 PyObject *__pyx_t_2 = NULL;
21649 PyObject *__pyx_t_3 = NULL;
21650 PyObject *__pyx_t_4 = NULL;
21651 PyObject *__pyx_t_5 = NULL;
21652 int __pyx_lineno = 0;
21653 const char *__pyx_filename = NULL;
21654 int __pyx_clineno = 0;
21655 __Pyx_RefNannySetupContext("__unpickleElementTree", 0);
21657 /* "lxml/objectify.pyx":1358
21659 * def __unpickleElementTree(data):
21660 * return etree.ElementTree(fromstring(data)) # <<<<<<<<<<<<<<
21662 * cdef _setupPickle(elementTreeReduceFunction):
21664 __Pyx_XDECREF(__pyx_r);
21665 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_ElementTree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
21666 __Pyx_GOTREF(__pyx_t_2);
21667 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L1_error)
21668 __Pyx_GOTREF(__pyx_t_4);
21670 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
21671 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
21672 if (likely(__pyx_t_5)) {
21673 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21674 __Pyx_INCREF(__pyx_t_5);
21675 __Pyx_INCREF(function);
21676 __Pyx_DECREF_SET(__pyx_t_4, function);
21679 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_data);
21680 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21681 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
21682 __Pyx_GOTREF(__pyx_t_3);
21683 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21685 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21686 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21687 if (likely(__pyx_t_4)) {
21688 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21689 __Pyx_INCREF(__pyx_t_4);
21690 __Pyx_INCREF(function);
21691 __Pyx_DECREF_SET(__pyx_t_2, function);
21694 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
21695 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21696 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21697 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
21698 __Pyx_GOTREF(__pyx_t_1);
21699 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21700 __pyx_r = __pyx_t_1;
21704 /* "lxml/objectify.pyx":1357
21705 * # Pickle support for objectified ElementTree
21707 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
21708 * return etree.ElementTree(fromstring(data))
21712 /* function exit code */
21714 __Pyx_XDECREF(__pyx_t_1);
21715 __Pyx_XDECREF(__pyx_t_2);
21716 __Pyx_XDECREF(__pyx_t_3);
21717 __Pyx_XDECREF(__pyx_t_4);
21718 __Pyx_XDECREF(__pyx_t_5);
21719 __Pyx_AddTraceback("lxml.objectify.__unpickleElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
21722 __Pyx_XGIVEREF(__pyx_r);
21723 __Pyx_RefNannyFinishContext();
21727 /* "lxml/objectify.pyx":1360
21728 * return etree.ElementTree(fromstring(data))
21730 * cdef _setupPickle(elementTreeReduceFunction): # <<<<<<<<<<<<<<
21731 * if python.IS_PYTHON2:
21732 * import copy_reg as copyreg
21735 static PyObject *__pyx_f_4lxml_9objectify__setupPickle(PyObject *__pyx_v_elementTreeReduceFunction) {
21736 PyObject *__pyx_v_copyreg = NULL;
21737 PyObject *__pyx_r = NULL;
21738 __Pyx_RefNannyDeclarations
21740 PyObject *__pyx_t_2 = NULL;
21741 PyObject *__pyx_t_3 = NULL;
21742 PyObject *__pyx_t_4 = NULL;
21743 PyObject *__pyx_t_5 = NULL;
21744 PyObject *__pyx_t_6 = NULL;
21746 PyObject *__pyx_t_8 = NULL;
21747 int __pyx_lineno = 0;
21748 const char *__pyx_filename = NULL;
21749 int __pyx_clineno = 0;
21750 __Pyx_RefNannySetupContext("_setupPickle", 0);
21752 /* "lxml/objectify.pyx":1361
21754 * cdef _setupPickle(elementTreeReduceFunction):
21755 * if python.IS_PYTHON2: # <<<<<<<<<<<<<<
21756 * import copy_reg as copyreg
21759 __pyx_t_1 = (IS_PYTHON2 != 0);
21762 /* "lxml/objectify.pyx":1362
21763 * cdef _setupPickle(elementTreeReduceFunction):
21764 * if python.IS_PYTHON2:
21765 * import copy_reg as copyreg # <<<<<<<<<<<<<<
21769 __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_reg, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
21770 __Pyx_GOTREF(__pyx_t_2);
21771 __pyx_v_copyreg = __pyx_t_2;
21774 /* "lxml/objectify.pyx":1361
21776 * cdef _setupPickle(elementTreeReduceFunction):
21777 * if python.IS_PYTHON2: # <<<<<<<<<<<<<<
21778 * import copy_reg as copyreg
21784 /* "lxml/objectify.pyx":1364
21785 * import copy_reg as copyreg
21787 * import copyreg # <<<<<<<<<<<<<<
21788 * copyreg.pickle(etree._ElementTree,
21789 * elementTreeReduceFunction, __unpickleElementTree)
21792 __pyx_t_2 = __Pyx_Import(__pyx_n_s_copyreg, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
21793 __Pyx_GOTREF(__pyx_t_2);
21794 __pyx_v_copyreg = __pyx_t_2;
21799 /* "lxml/objectify.pyx":1365
21802 * copyreg.pickle(etree._ElementTree, # <<<<<<<<<<<<<<
21803 * elementTreeReduceFunction, __unpickleElementTree)
21806 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_copyreg, __pyx_n_s_pickle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error)
21807 __Pyx_GOTREF(__pyx_t_3);
21808 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_ElementTree_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1365, __pyx_L1_error)
21809 __Pyx_GOTREF(__pyx_t_4);
21811 /* "lxml/objectify.pyx":1366
21813 * copyreg.pickle(etree._ElementTree,
21814 * elementTreeReduceFunction, __unpickleElementTree) # <<<<<<<<<<<<<<
21816 * def pickleReduceElementTree(obj):
21818 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_unpickleElementTree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
21819 __Pyx_GOTREF(__pyx_t_5);
21822 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
21823 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
21824 if (likely(__pyx_t_6)) {
21825 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21826 __Pyx_INCREF(__pyx_t_6);
21827 __Pyx_INCREF(function);
21828 __Pyx_DECREF_SET(__pyx_t_3, function);
21832 #if CYTHON_FAST_PYCALL
21833 if (PyFunction_Check(__pyx_t_3)) {
21834 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_elementTreeReduceFunction, __pyx_t_5};
21835 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
21836 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21837 __Pyx_GOTREF(__pyx_t_2);
21838 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21839 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21842 #if CYTHON_FAST_PYCCALL
21843 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
21844 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_elementTreeReduceFunction, __pyx_t_5};
21845 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
21846 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21847 __Pyx_GOTREF(__pyx_t_2);
21848 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21849 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21853 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1365, __pyx_L1_error)
21854 __Pyx_GOTREF(__pyx_t_8);
21856 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
21858 __Pyx_GIVEREF(__pyx_t_4);
21859 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
21860 __Pyx_INCREF(__pyx_v_elementTreeReduceFunction);
21861 __Pyx_GIVEREF(__pyx_v_elementTreeReduceFunction);
21862 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_elementTreeReduceFunction);
21863 __Pyx_GIVEREF(__pyx_t_5);
21864 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
21867 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error)
21868 __Pyx_GOTREF(__pyx_t_2);
21869 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21871 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21874 /* "lxml/objectify.pyx":1360
21875 * return etree.ElementTree(fromstring(data))
21877 * cdef _setupPickle(elementTreeReduceFunction): # <<<<<<<<<<<<<<
21878 * if python.IS_PYTHON2:
21879 * import copy_reg as copyreg
21882 /* function exit code */
21883 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21886 __Pyx_XDECREF(__pyx_t_2);
21887 __Pyx_XDECREF(__pyx_t_3);
21888 __Pyx_XDECREF(__pyx_t_4);
21889 __Pyx_XDECREF(__pyx_t_5);
21890 __Pyx_XDECREF(__pyx_t_6);
21891 __Pyx_XDECREF(__pyx_t_8);
21892 __Pyx_AddTraceback("lxml.objectify._setupPickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
21895 __Pyx_XDECREF(__pyx_v_copyreg);
21896 __Pyx_XGIVEREF(__pyx_r);
21897 __Pyx_RefNannyFinishContext();
21901 /* "lxml/objectify.pyx":1368
21902 * elementTreeReduceFunction, __unpickleElementTree)
21904 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
21905 * return __unpickleElementTree, (etree.tostring(obj),)
21909 /* Python wrapper */
21910 static PyObject *__pyx_pw_4lxml_9objectify_19pickleReduceElementTree(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
21911 static PyMethodDef __pyx_mdef_4lxml_9objectify_19pickleReduceElementTree = {"pickleReduceElementTree", (PyCFunction)__pyx_pw_4lxml_9objectify_19pickleReduceElementTree, METH_O, 0};
21912 static PyObject *__pyx_pw_4lxml_9objectify_19pickleReduceElementTree(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
21913 PyObject *__pyx_r = 0;
21914 __Pyx_RefNannyDeclarations
21915 __Pyx_RefNannySetupContext("pickleReduceElementTree (wrapper)", 0);
21916 __pyx_r = __pyx_pf_4lxml_9objectify_18pickleReduceElementTree(__pyx_self, ((PyObject *)__pyx_v_obj));
21918 /* function exit code */
21919 __Pyx_RefNannyFinishContext();
21923 static PyObject *__pyx_pf_4lxml_9objectify_18pickleReduceElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
21924 PyObject *__pyx_r = NULL;
21925 __Pyx_RefNannyDeclarations
21926 PyObject *__pyx_t_1 = NULL;
21927 PyObject *__pyx_t_2 = NULL;
21928 PyObject *__pyx_t_3 = NULL;
21929 PyObject *__pyx_t_4 = NULL;
21930 int __pyx_lineno = 0;
21931 const char *__pyx_filename = NULL;
21932 int __pyx_clineno = 0;
21933 __Pyx_RefNannySetupContext("pickleReduceElementTree", 0);
21935 /* "lxml/objectify.pyx":1369
21937 * def pickleReduceElementTree(obj):
21938 * return __unpickleElementTree, (etree.tostring(obj),) # <<<<<<<<<<<<<<
21940 * _setupPickle(pickleReduceElementTree)
21942 __Pyx_XDECREF(__pyx_r);
21943 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unpickleElementTree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error)
21944 __Pyx_GOTREF(__pyx_t_1);
21945 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_tostring); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
21946 __Pyx_GOTREF(__pyx_t_3);
21948 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
21949 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
21950 if (likely(__pyx_t_4)) {
21951 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21952 __Pyx_INCREF(__pyx_t_4);
21953 __Pyx_INCREF(function);
21954 __Pyx_DECREF_SET(__pyx_t_3, function);
21957 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj);
21958 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21959 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
21960 __Pyx_GOTREF(__pyx_t_2);
21961 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21962 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
21963 __Pyx_GOTREF(__pyx_t_3);
21964 __Pyx_GIVEREF(__pyx_t_2);
21965 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
21967 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
21968 __Pyx_GOTREF(__pyx_t_2);
21969 __Pyx_GIVEREF(__pyx_t_1);
21970 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21971 __Pyx_GIVEREF(__pyx_t_3);
21972 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
21975 __pyx_r = __pyx_t_2;
21979 /* "lxml/objectify.pyx":1368
21980 * elementTreeReduceFunction, __unpickleElementTree)
21982 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
21983 * return __unpickleElementTree, (etree.tostring(obj),)
21987 /* function exit code */
21989 __Pyx_XDECREF(__pyx_t_1);
21990 __Pyx_XDECREF(__pyx_t_2);
21991 __Pyx_XDECREF(__pyx_t_3);
21992 __Pyx_XDECREF(__pyx_t_4);
21993 __Pyx_AddTraceback("lxml.objectify.pickleReduceElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
21996 __Pyx_XGIVEREF(__pyx_r);
21997 __Pyx_RefNannyFinishContext();
22001 /* "lxml/objectify.pyx":1383
22002 * cdef object empty_data_class
22003 * cdef object tree_class
22004 * def __init__(self, tree_class=None, empty_data_class=None): # <<<<<<<<<<<<<<
22005 * u"""Lookup mechanism for objectify.
22009 /* Python wrapper */
22010 static int __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22011 static char __pyx_doc_4lxml_9objectify_27ObjectifyElementClassLookup___init__[] = "Lookup mechanism for objectify.\n\n The default Element classes can be replaced by passing subclasses of\n ObjectifiedElement and ObjectifiedDataElement as keyword arguments.\n 'tree_class' defines inner tree classes (defaults to\n ObjectifiedElement), 'empty_data_class' defines the default class for\n empty data elements (defaults to StringElement).\n ";
22012 #if CYTHON_COMPILING_IN_CPYTHON
22013 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
22015 static int __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22016 PyObject *__pyx_v_tree_class = 0;
22017 PyObject *__pyx_v_empty_data_class = 0;
22018 int __pyx_lineno = 0;
22019 const char *__pyx_filename = NULL;
22020 int __pyx_clineno = 0;
22022 __Pyx_RefNannyDeclarations
22023 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
22025 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree_class,&__pyx_n_s_empty_data_class,0};
22026 PyObject* values[2] = {0,0};
22027 values[0] = ((PyObject *)Py_None);
22028 values[1] = ((PyObject *)Py_None);
22029 if (unlikely(__pyx_kwds)) {
22030 Py_ssize_t kw_args;
22031 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22032 switch (pos_args) {
22033 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22034 CYTHON_FALLTHROUGH;
22035 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22036 CYTHON_FALLTHROUGH;
22038 default: goto __pyx_L5_argtuple_error;
22040 kw_args = PyDict_Size(__pyx_kwds);
22041 switch (pos_args) {
22044 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tree_class);
22045 if (value) { values[0] = value; kw_args--; }
22047 CYTHON_FALLTHROUGH;
22050 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_empty_data_class);
22051 if (value) { values[1] = value; kw_args--; }
22054 if (unlikely(kw_args > 0)) {
22055 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1383, __pyx_L3_error)
22058 switch (PyTuple_GET_SIZE(__pyx_args)) {
22059 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22060 CYTHON_FALLTHROUGH;
22061 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22062 CYTHON_FALLTHROUGH;
22064 default: goto __pyx_L5_argtuple_error;
22067 __pyx_v_tree_class = values[0];
22068 __pyx_v_empty_data_class = values[1];
22070 goto __pyx_L4_argument_unpacking_done;
22071 __pyx_L5_argtuple_error:;
22072 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1383, __pyx_L3_error)
22074 __Pyx_AddTraceback("lxml.objectify.ObjectifyElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22075 __Pyx_RefNannyFinishContext();
22077 __pyx_L4_argument_unpacking_done:;
22078 __pyx_r = __pyx_pf_4lxml_9objectify_27ObjectifyElementClassLookup___init__(((struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)__pyx_v_self), __pyx_v_tree_class, __pyx_v_empty_data_class);
22080 /* function exit code */
22081 __Pyx_RefNannyFinishContext();
22085 static int __pyx_pf_4lxml_9objectify_27ObjectifyElementClassLookup___init__(struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *__pyx_v_self, PyObject *__pyx_v_tree_class, PyObject *__pyx_v_empty_data_class) {
22087 __Pyx_RefNannyDeclarations
22090 __Pyx_RefNannySetupContext("__init__", 0);
22091 __Pyx_INCREF(__pyx_v_tree_class);
22092 __Pyx_INCREF(__pyx_v_empty_data_class);
22094 /* "lxml/objectify.pyx":1392
22095 * empty data elements (defaults to StringElement).
22097 * self._lookup_function = _lookupElementClass # <<<<<<<<<<<<<<
22098 * if tree_class is None:
22099 * tree_class = ObjectifiedElement
22101 __pyx_v_self->__pyx_base._lookup_function = __pyx_f_4lxml_9objectify__lookupElementClass;
22103 /* "lxml/objectify.pyx":1393
22105 * self._lookup_function = _lookupElementClass
22106 * if tree_class is None: # <<<<<<<<<<<<<<
22107 * tree_class = ObjectifiedElement
22108 * self.tree_class = tree_class
22110 __pyx_t_1 = (__pyx_v_tree_class == Py_None);
22111 __pyx_t_2 = (__pyx_t_1 != 0);
22114 /* "lxml/objectify.pyx":1394
22115 * self._lookup_function = _lookupElementClass
22116 * if tree_class is None:
22117 * tree_class = ObjectifiedElement # <<<<<<<<<<<<<<
22118 * self.tree_class = tree_class
22119 * if empty_data_class is None:
22121 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
22122 __Pyx_DECREF_SET(__pyx_v_tree_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
22124 /* "lxml/objectify.pyx":1393
22126 * self._lookup_function = _lookupElementClass
22127 * if tree_class is None: # <<<<<<<<<<<<<<
22128 * tree_class = ObjectifiedElement
22129 * self.tree_class = tree_class
22133 /* "lxml/objectify.pyx":1395
22134 * if tree_class is None:
22135 * tree_class = ObjectifiedElement
22136 * self.tree_class = tree_class # <<<<<<<<<<<<<<
22137 * if empty_data_class is None:
22138 * empty_data_class = StringElement
22140 __Pyx_INCREF(__pyx_v_tree_class);
22141 __Pyx_GIVEREF(__pyx_v_tree_class);
22142 __Pyx_GOTREF(__pyx_v_self->tree_class);
22143 __Pyx_DECREF(__pyx_v_self->tree_class);
22144 __pyx_v_self->tree_class = __pyx_v_tree_class;
22146 /* "lxml/objectify.pyx":1396
22147 * tree_class = ObjectifiedElement
22148 * self.tree_class = tree_class
22149 * if empty_data_class is None: # <<<<<<<<<<<<<<
22150 * empty_data_class = StringElement
22151 * self.empty_data_class = empty_data_class
22153 __pyx_t_2 = (__pyx_v_empty_data_class == Py_None);
22154 __pyx_t_1 = (__pyx_t_2 != 0);
22157 /* "lxml/objectify.pyx":1397
22158 * self.tree_class = tree_class
22159 * if empty_data_class is None:
22160 * empty_data_class = StringElement # <<<<<<<<<<<<<<
22161 * self.empty_data_class = empty_data_class
22164 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
22165 __Pyx_DECREF_SET(__pyx_v_empty_data_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
22167 /* "lxml/objectify.pyx":1396
22168 * tree_class = ObjectifiedElement
22169 * self.tree_class = tree_class
22170 * if empty_data_class is None: # <<<<<<<<<<<<<<
22171 * empty_data_class = StringElement
22172 * self.empty_data_class = empty_data_class
22176 /* "lxml/objectify.pyx":1398
22177 * if empty_data_class is None:
22178 * empty_data_class = StringElement
22179 * self.empty_data_class = empty_data_class # <<<<<<<<<<<<<<
22181 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node):
22183 __Pyx_INCREF(__pyx_v_empty_data_class);
22184 __Pyx_GIVEREF(__pyx_v_empty_data_class);
22185 __Pyx_GOTREF(__pyx_v_self->empty_data_class);
22186 __Pyx_DECREF(__pyx_v_self->empty_data_class);
22187 __pyx_v_self->empty_data_class = __pyx_v_empty_data_class;
22189 /* "lxml/objectify.pyx":1383
22190 * cdef object empty_data_class
22191 * cdef object tree_class
22192 * def __init__(self, tree_class=None, empty_data_class=None): # <<<<<<<<<<<<<<
22193 * u"""Lookup mechanism for objectify.
22197 /* function exit code */
22199 __Pyx_XDECREF(__pyx_v_tree_class);
22200 __Pyx_XDECREF(__pyx_v_empty_data_class);
22201 __Pyx_RefNannyFinishContext();
22205 /* "lxml/objectify.pyx":1400
22206 * self.empty_data_class = empty_data_class
22208 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node): # <<<<<<<<<<<<<<
22209 * cdef ObjectifyElementClassLookup lookup
22210 * lookup = <ObjectifyElementClassLookup>state
22213 static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *__pyx_v_state, CYTHON_UNUSED struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
22214 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *__pyx_v_lookup = 0;
22215 PyObject *__pyx_v_value = NULL;
22216 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
22217 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_schema_type = NULL;
22218 CYTHON_UNUSED PyObject *__pyx_v_prefix = NULL;
22219 PyObject *__pyx_v_el_class = NULL;
22220 PyObject *__pyx_r = NULL;
22221 __Pyx_RefNannyDeclarations
22222 PyObject *__pyx_t_1 = NULL;
22225 PyObject *__pyx_t_4 = NULL;
22227 PyObject *__pyx_t_6 = NULL;
22228 PyObject *__pyx_t_7 = NULL;
22229 PyObject *(*__pyx_t_8)(PyObject *);
22230 int __pyx_lineno = 0;
22231 const char *__pyx_filename = NULL;
22232 int __pyx_clineno = 0;
22233 __Pyx_RefNannySetupContext("_lookupElementClass", 0);
22235 /* "lxml/objectify.pyx":1402
22236 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node):
22237 * cdef ObjectifyElementClassLookup lookup
22238 * lookup = <ObjectifyElementClassLookup>state # <<<<<<<<<<<<<<
22239 * # if element has children => no data class
22240 * if cetree.hasChild(c_node):
22242 __pyx_t_1 = __pyx_v_state;
22243 __Pyx_INCREF(__pyx_t_1);
22244 __pyx_v_lookup = ((struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)__pyx_t_1);
22247 /* "lxml/objectify.pyx":1404
22248 * lookup = <ObjectifyElementClassLookup>state
22249 * # if element has children => no data class
22250 * if cetree.hasChild(c_node): # <<<<<<<<<<<<<<
22251 * return lookup.tree_class
22254 __pyx_t_2 = (hasChild(__pyx_v_c_node) != 0);
22257 /* "lxml/objectify.pyx":1405
22258 * # if element has children => no data class
22259 * if cetree.hasChild(c_node):
22260 * return lookup.tree_class # <<<<<<<<<<<<<<
22262 * # if element is defined as xsi:nil, return NoneElement class
22264 __Pyx_XDECREF(__pyx_r);
22265 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22266 __pyx_r = __pyx_v_lookup->tree_class;
22269 /* "lxml/objectify.pyx":1404
22270 * lookup = <ObjectifyElementClassLookup>state
22271 * # if element has children => no data class
22272 * if cetree.hasChild(c_node): # <<<<<<<<<<<<<<
22273 * return lookup.tree_class
22278 /* "lxml/objectify.pyx":1408
22280 * # if element is defined as xsi:nil, return NoneElement class
22281 * if u"true" == cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22282 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22283 * return NoneElement
22285 __pyx_t_1 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"nil")))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
22286 __Pyx_GOTREF(__pyx_t_1);
22287 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_n_u_true, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1408, __pyx_L1_error)
22288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22291 /* "lxml/objectify.pyx":1410
22292 * if u"true" == cetree.attributeValueFromNsName(
22293 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22294 * return NoneElement # <<<<<<<<<<<<<<
22296 * # check for Python type hint
22298 __Pyx_XDECREF(__pyx_r);
22299 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
22300 __pyx_r = ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement);
22303 /* "lxml/objectify.pyx":1408
22305 * # if element is defined as xsi:nil, return NoneElement class
22306 * if u"true" == cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22307 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22308 * return NoneElement
22312 /* "lxml/objectify.pyx":1413
22314 * # check for Python type hint
22315 * value = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22316 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22317 * if value is not None:
22319 __pyx_t_1 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1413, __pyx_L1_error)
22320 __Pyx_GOTREF(__pyx_t_1);
22321 __pyx_v_value = __pyx_t_1;
22324 /* "lxml/objectify.pyx":1415
22325 * value = cetree.attributeValueFromNsName(
22326 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22327 * if value is not None: # <<<<<<<<<<<<<<
22328 * if value == TREE_PYTYPE_NAME:
22329 * return lookup.tree_class
22331 __pyx_t_2 = (__pyx_v_value != Py_None);
22332 __pyx_t_3 = (__pyx_t_2 != 0);
22335 /* "lxml/objectify.pyx":1416
22336 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22337 * if value is not None:
22338 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
22339 * return lookup.tree_class
22340 * py_type = <PyType>_PYTYPE_DICT.get(value)
22342 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_value, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1416, __pyx_L1_error)
22345 /* "lxml/objectify.pyx":1417
22346 * if value is not None:
22347 * if value == TREE_PYTYPE_NAME:
22348 * return lookup.tree_class # <<<<<<<<<<<<<<
22349 * py_type = <PyType>_PYTYPE_DICT.get(value)
22350 * if py_type is not None:
22352 __Pyx_XDECREF(__pyx_r);
22353 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22354 __pyx_r = __pyx_v_lookup->tree_class;
22357 /* "lxml/objectify.pyx":1416
22358 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22359 * if value is not None:
22360 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
22361 * return lookup.tree_class
22362 * py_type = <PyType>_PYTYPE_DICT.get(value)
22366 /* "lxml/objectify.pyx":1418
22367 * if value == TREE_PYTYPE_NAME:
22368 * return lookup.tree_class
22369 * py_type = <PyType>_PYTYPE_DICT.get(value) # <<<<<<<<<<<<<<
22370 * if py_type is not None:
22371 * return py_type._type
22373 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
22374 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22375 __PYX_ERR(0, 1418, __pyx_L1_error)
22377 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
22378 __Pyx_GOTREF(__pyx_t_1);
22379 __pyx_t_4 = __pyx_t_1;
22380 __Pyx_INCREF(__pyx_t_4);
22381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22382 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
22385 /* "lxml/objectify.pyx":1419
22386 * return lookup.tree_class
22387 * py_type = <PyType>_PYTYPE_DICT.get(value)
22388 * if py_type is not None: # <<<<<<<<<<<<<<
22389 * return py_type._type
22390 * # unknown 'pyval' => try to figure it out ourself, just go on
22392 __pyx_t_3 = (((PyObject *)__pyx_v_py_type) != Py_None);
22393 __pyx_t_2 = (__pyx_t_3 != 0);
22396 /* "lxml/objectify.pyx":1420
22397 * py_type = <PyType>_PYTYPE_DICT.get(value)
22398 * if py_type is not None:
22399 * return py_type._type # <<<<<<<<<<<<<<
22400 * # unknown 'pyval' => try to figure it out ourself, just go on
22403 __Pyx_XDECREF(__pyx_r);
22404 __Pyx_INCREF(__pyx_v_py_type->_type);
22405 __pyx_r = __pyx_v_py_type->_type;
22408 /* "lxml/objectify.pyx":1419
22409 * return lookup.tree_class
22410 * py_type = <PyType>_PYTYPE_DICT.get(value)
22411 * if py_type is not None: # <<<<<<<<<<<<<<
22412 * return py_type._type
22413 * # unknown 'pyval' => try to figure it out ourself, just go on
22417 /* "lxml/objectify.pyx":1415
22418 * value = cetree.attributeValueFromNsName(
22419 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22420 * if value is not None: # <<<<<<<<<<<<<<
22421 * if value == TREE_PYTYPE_NAME:
22422 * return lookup.tree_class
22426 /* "lxml/objectify.pyx":1424
22428 * # check for XML Schema type hint
22429 * value = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22430 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22433 __pyx_t_4 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"type")))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1424, __pyx_L1_error)
22434 __Pyx_GOTREF(__pyx_t_4);
22435 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
22438 /* "lxml/objectify.pyx":1427
22439 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22441 * if value is not None: # <<<<<<<<<<<<<<
22442 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22443 * if schema_type is None and u':' in value:
22445 __pyx_t_2 = (__pyx_v_value != Py_None);
22446 __pyx_t_3 = (__pyx_t_2 != 0);
22449 /* "lxml/objectify.pyx":1428
22451 * if value is not None:
22452 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value) # <<<<<<<<<<<<<<
22453 * if schema_type is None and u':' in value:
22454 * prefix, value = value.split(u':', 1)
22456 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
22457 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22458 __PYX_ERR(0, 1428, __pyx_L1_error)
22460 __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1428, __pyx_L1_error)
22461 __Pyx_GOTREF(__pyx_t_4);
22462 __pyx_t_1 = __pyx_t_4;
22463 __Pyx_INCREF(__pyx_t_1);
22464 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22465 __pyx_v_schema_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1);
22468 /* "lxml/objectify.pyx":1429
22469 * if value is not None:
22470 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22471 * if schema_type is None and u':' in value: # <<<<<<<<<<<<<<
22472 * prefix, value = value.split(u':', 1)
22473 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22475 __pyx_t_2 = (((PyObject *)__pyx_v_schema_type) == Py_None);
22476 __pyx_t_5 = (__pyx_t_2 != 0);
22479 __pyx_t_3 = __pyx_t_5;
22480 goto __pyx_L10_bool_binop_done;
22482 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1429, __pyx_L1_error)
22483 __pyx_t_2 = (__pyx_t_5 != 0);
22484 __pyx_t_3 = __pyx_t_2;
22485 __pyx_L10_bool_binop_done:;
22488 /* "lxml/objectify.pyx":1430
22489 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22490 * if schema_type is None and u':' in value:
22491 * prefix, value = value.split(u':', 1) # <<<<<<<<<<<<<<
22492 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22493 * if schema_type is not None:
22495 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
22496 __Pyx_GOTREF(__pyx_t_1);
22497 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error)
22498 __Pyx_GOTREF(__pyx_t_4);
22499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22500 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
22501 PyObject* sequence = __pyx_t_4;
22502 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22503 if (unlikely(size != 2)) {
22504 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22505 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22506 __PYX_ERR(0, 1430, __pyx_L1_error)
22508 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22509 if (likely(PyTuple_CheckExact(sequence))) {
22510 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
22511 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
22513 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
22514 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
22516 __Pyx_INCREF(__pyx_t_1);
22517 __Pyx_INCREF(__pyx_t_6);
22519 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
22520 __Pyx_GOTREF(__pyx_t_1);
22521 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1430, __pyx_L1_error)
22522 __Pyx_GOTREF(__pyx_t_6);
22524 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22526 Py_ssize_t index = -1;
22527 __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1430, __pyx_L1_error)
22528 __Pyx_GOTREF(__pyx_t_7);
22529 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22530 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
22531 index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
22532 __Pyx_GOTREF(__pyx_t_1);
22533 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed;
22534 __Pyx_GOTREF(__pyx_t_6);
22535 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1430, __pyx_L1_error)
22537 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22538 goto __pyx_L13_unpacking_done;
22539 __pyx_L12_unpacking_failed:;
22540 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22542 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
22543 __PYX_ERR(0, 1430, __pyx_L1_error)
22544 __pyx_L13_unpacking_done:;
22546 __pyx_v_prefix = __pyx_t_1;
22548 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
22551 /* "lxml/objectify.pyx":1431
22552 * if schema_type is None and u':' in value:
22553 * prefix, value = value.split(u':', 1)
22554 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value) # <<<<<<<<<<<<<<
22555 * if schema_type is not None:
22556 * return schema_type._type
22558 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
22559 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22560 __PYX_ERR(0, 1431, __pyx_L1_error)
22562 __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_value, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error)
22563 __Pyx_GOTREF(__pyx_t_4);
22564 __pyx_t_6 = __pyx_t_4;
22565 __Pyx_INCREF(__pyx_t_6);
22566 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22567 __Pyx_DECREF_SET(__pyx_v_schema_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
22570 /* "lxml/objectify.pyx":1429
22571 * if value is not None:
22572 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22573 * if schema_type is None and u':' in value: # <<<<<<<<<<<<<<
22574 * prefix, value = value.split(u':', 1)
22575 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22579 /* "lxml/objectify.pyx":1432
22580 * prefix, value = value.split(u':', 1)
22581 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22582 * if schema_type is not None: # <<<<<<<<<<<<<<
22583 * return schema_type._type
22586 __pyx_t_3 = (((PyObject *)__pyx_v_schema_type) != Py_None);
22587 __pyx_t_2 = (__pyx_t_3 != 0);
22590 /* "lxml/objectify.pyx":1433
22591 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22592 * if schema_type is not None:
22593 * return schema_type._type # <<<<<<<<<<<<<<
22595 * # otherwise determine class based on text content type
22597 __Pyx_XDECREF(__pyx_r);
22598 __Pyx_INCREF(__pyx_v_schema_type->_type);
22599 __pyx_r = __pyx_v_schema_type->_type;
22602 /* "lxml/objectify.pyx":1432
22603 * prefix, value = value.split(u':', 1)
22604 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22605 * if schema_type is not None: # <<<<<<<<<<<<<<
22606 * return schema_type._type
22611 /* "lxml/objectify.pyx":1427
22612 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22614 * if value is not None: # <<<<<<<<<<<<<<
22615 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22616 * if schema_type is None and u':' in value:
22620 /* "lxml/objectify.pyx":1436
22622 * # otherwise determine class based on text content type
22623 * el_class = _guessElementClass(c_node) # <<<<<<<<<<<<<<
22624 * if el_class is not None:
22627 __pyx_t_6 = __pyx_f_4lxml_9objectify__guessElementClass(__pyx_v_c_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error)
22628 __Pyx_GOTREF(__pyx_t_6);
22629 __pyx_v_el_class = __pyx_t_6;
22632 /* "lxml/objectify.pyx":1437
22633 * # otherwise determine class based on text content type
22634 * el_class = _guessElementClass(c_node)
22635 * if el_class is not None: # <<<<<<<<<<<<<<
22639 __pyx_t_2 = (__pyx_v_el_class != Py_None);
22640 __pyx_t_3 = (__pyx_t_2 != 0);
22643 /* "lxml/objectify.pyx":1438
22644 * el_class = _guessElementClass(c_node)
22645 * if el_class is not None:
22646 * return el_class # <<<<<<<<<<<<<<
22648 * # if element is a root node => default to tree node
22650 __Pyx_XDECREF(__pyx_r);
22651 __Pyx_INCREF(__pyx_v_el_class);
22652 __pyx_r = __pyx_v_el_class;
22655 /* "lxml/objectify.pyx":1437
22656 * # otherwise determine class based on text content type
22657 * el_class = _guessElementClass(c_node)
22658 * if el_class is not None: # <<<<<<<<<<<<<<
22664 /* "lxml/objectify.pyx":1441
22666 * # if element is a root node => default to tree node
22667 * if c_node.parent is NULL or not tree._isElement(c_node.parent): # <<<<<<<<<<<<<<
22668 * return lookup.tree_class
22671 __pyx_t_2 = ((__pyx_v_c_node->parent == NULL) != 0);
22674 __pyx_t_3 = __pyx_t_2;
22675 goto __pyx_L17_bool_binop_done;
22677 __pyx_t_2 = ((!(_isElement(__pyx_v_c_node->parent) != 0)) != 0);
22678 __pyx_t_3 = __pyx_t_2;
22679 __pyx_L17_bool_binop_done:;
22682 /* "lxml/objectify.pyx":1442
22683 * # if element is a root node => default to tree node
22684 * if c_node.parent is NULL or not tree._isElement(c_node.parent):
22685 * return lookup.tree_class # <<<<<<<<<<<<<<
22687 * return lookup.empty_data_class
22689 __Pyx_XDECREF(__pyx_r);
22690 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22691 __pyx_r = __pyx_v_lookup->tree_class;
22694 /* "lxml/objectify.pyx":1441
22696 * # if element is a root node => default to tree node
22697 * if c_node.parent is NULL or not tree._isElement(c_node.parent): # <<<<<<<<<<<<<<
22698 * return lookup.tree_class
22703 /* "lxml/objectify.pyx":1444
22704 * return lookup.tree_class
22706 * return lookup.empty_data_class # <<<<<<<<<<<<<<
22710 __Pyx_XDECREF(__pyx_r);
22711 __Pyx_INCREF(__pyx_v_lookup->empty_data_class);
22712 __pyx_r = __pyx_v_lookup->empty_data_class;
22715 /* "lxml/objectify.pyx":1400
22716 * self.empty_data_class = empty_data_class
22718 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node): # <<<<<<<<<<<<<<
22719 * cdef ObjectifyElementClassLookup lookup
22720 * lookup = <ObjectifyElementClassLookup>state
22723 /* function exit code */
22725 __Pyx_XDECREF(__pyx_t_1);
22726 __Pyx_XDECREF(__pyx_t_4);
22727 __Pyx_XDECREF(__pyx_t_6);
22728 __Pyx_XDECREF(__pyx_t_7);
22729 __Pyx_AddTraceback("lxml.objectify._lookupElementClass", __pyx_clineno, __pyx_lineno, __pyx_filename);
22732 __Pyx_XDECREF((PyObject *)__pyx_v_lookup);
22733 __Pyx_XDECREF(__pyx_v_value);
22734 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
22735 __Pyx_XDECREF((PyObject *)__pyx_v_schema_type);
22736 __Pyx_XDECREF(__pyx_v_prefix);
22737 __Pyx_XDECREF(__pyx_v_el_class);
22738 __Pyx_XGIVEREF(__pyx_r);
22739 __Pyx_RefNannyFinishContext();
22743 /* "lxml/objectify.pyx":1450
22744 * # Type annotations
22746 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype): # <<<<<<<<<<<<<<
22747 * if pytype is None:
22751 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__check_type(xmlNode *__pyx_v_c_node, struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_pytype) {
22752 PyObject *__pyx_v_value = NULL;
22753 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_r = NULL;
22754 __Pyx_RefNannyDeclarations
22757 PyObject *__pyx_t_3 = NULL;
22758 PyObject *__pyx_t_4 = NULL;
22759 PyObject *__pyx_t_5 = NULL;
22760 PyObject *__pyx_t_6 = NULL;
22761 PyObject *__pyx_t_7 = NULL;
22762 PyObject *__pyx_t_8 = NULL;
22764 int __pyx_lineno = 0;
22765 const char *__pyx_filename = NULL;
22766 int __pyx_clineno = 0;
22767 __Pyx_RefNannySetupContext("_check_type", 0);
22769 /* "lxml/objectify.pyx":1451
22771 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22772 * if pytype is None: # <<<<<<<<<<<<<<
22774 * value = textOf(c_node)
22776 __pyx_t_1 = (((PyObject *)__pyx_v_pytype) == Py_None);
22777 __pyx_t_2 = (__pyx_t_1 != 0);
22780 /* "lxml/objectify.pyx":1452
22781 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22782 * if pytype is None:
22783 * return None # <<<<<<<<<<<<<<
22784 * value = textOf(c_node)
22787 __Pyx_XDECREF(((PyObject *)__pyx_r));
22788 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
22791 /* "lxml/objectify.pyx":1451
22793 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22794 * if pytype is None: # <<<<<<<<<<<<<<
22796 * value = textOf(c_node)
22800 /* "lxml/objectify.pyx":1453
22801 * if pytype is None:
22803 * value = textOf(c_node) # <<<<<<<<<<<<<<
22805 * pytype.type_check(value)
22807 __pyx_t_3 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
22808 __Pyx_GOTREF(__pyx_t_3);
22809 __pyx_v_value = __pyx_t_3;
22812 /* "lxml/objectify.pyx":1454
22814 * value = textOf(c_node)
22815 * try: # <<<<<<<<<<<<<<
22816 * pytype.type_check(value)
22820 __Pyx_PyThreadState_declare
22821 __Pyx_PyThreadState_assign
22822 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
22823 __Pyx_XGOTREF(__pyx_t_4);
22824 __Pyx_XGOTREF(__pyx_t_5);
22825 __Pyx_XGOTREF(__pyx_t_6);
22828 /* "lxml/objectify.pyx":1455
22829 * value = textOf(c_node)
22831 * pytype.type_check(value) # <<<<<<<<<<<<<<
22833 * except IGNORABLE_ERRORS:
22835 __Pyx_INCREF(__pyx_v_pytype->type_check);
22836 __pyx_t_7 = __pyx_v_pytype->type_check; __pyx_t_8 = NULL;
22837 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22838 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22839 if (likely(__pyx_t_8)) {
22840 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22841 __Pyx_INCREF(__pyx_t_8);
22842 __Pyx_INCREF(function);
22843 __Pyx_DECREF_SET(__pyx_t_7, function);
22846 __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
22847 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22848 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L4_error)
22849 __Pyx_GOTREF(__pyx_t_3);
22850 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22851 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22853 /* "lxml/objectify.pyx":1456
22855 * pytype.type_check(value)
22856 * return pytype # <<<<<<<<<<<<<<
22857 * except IGNORABLE_ERRORS:
22858 * # could not be parsed as the specified type => ignore
22860 __Pyx_XDECREF(((PyObject *)__pyx_r));
22861 __Pyx_INCREF(((PyObject *)__pyx_v_pytype));
22862 __pyx_r = __pyx_v_pytype;
22863 goto __pyx_L8_try_return;
22865 /* "lxml/objectify.pyx":1454
22867 * value = textOf(c_node)
22868 * try: # <<<<<<<<<<<<<<
22869 * pytype.type_check(value)
22874 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22875 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22876 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22878 /* "lxml/objectify.pyx":1457
22879 * pytype.type_check(value)
22881 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
22882 * # could not be parsed as the specified type => ignore
22885 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
22887 __Pyx_ErrRestore(0,0,0);
22888 goto __pyx_L5_exception_handled;
22890 goto __pyx_L6_except_error;
22891 __pyx_L6_except_error:;
22893 /* "lxml/objectify.pyx":1454
22895 * value = textOf(c_node)
22896 * try: # <<<<<<<<<<<<<<
22897 * pytype.type_check(value)
22900 __Pyx_XGIVEREF(__pyx_t_4);
22901 __Pyx_XGIVEREF(__pyx_t_5);
22902 __Pyx_XGIVEREF(__pyx_t_6);
22903 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22904 goto __pyx_L1_error;
22905 __pyx_L8_try_return:;
22906 __Pyx_XGIVEREF(__pyx_t_4);
22907 __Pyx_XGIVEREF(__pyx_t_5);
22908 __Pyx_XGIVEREF(__pyx_t_6);
22909 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22911 __pyx_L5_exception_handled:;
22912 __Pyx_XGIVEREF(__pyx_t_4);
22913 __Pyx_XGIVEREF(__pyx_t_5);
22914 __Pyx_XGIVEREF(__pyx_t_6);
22915 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22918 /* "lxml/objectify.pyx":1460
22919 * # could not be parsed as the specified type => ignore
22921 * return None # <<<<<<<<<<<<<<
22923 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False,
22925 __Pyx_XDECREF(((PyObject *)__pyx_r));
22926 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
22929 /* "lxml/objectify.pyx":1450
22930 * # Type annotations
22932 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype): # <<<<<<<<<<<<<<
22933 * if pytype is None:
22937 /* function exit code */
22939 __Pyx_XDECREF(__pyx_t_3);
22940 __Pyx_XDECREF(__pyx_t_7);
22941 __Pyx_XDECREF(__pyx_t_8);
22942 __Pyx_AddTraceback("lxml.objectify._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
22945 __Pyx_XDECREF(__pyx_v_value);
22946 __Pyx_XGIVEREF((PyObject *)__pyx_r);
22947 __Pyx_RefNannyFinishContext();
22951 /* "lxml/objectify.pyx":1462
22954 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
22955 * empty_pytype=None):
22956 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
22959 /* Python wrapper */
22960 static PyObject *__pyx_pw_4lxml_9objectify_21pyannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22961 static char __pyx_doc_4lxml_9objectify_20pyannotate[] = "pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)\n\n Recursively annotates the elements of an XML tree with 'pytype'\n attributes.\n\n If the 'ignore_old' keyword argument is True (the default), current 'pytype'\n attributes will be ignored and replaced. Otherwise, they will be checked\n and only replaced if they no longer fit the current text value.\n\n Setting the keyword argument ``ignore_xsi`` to True makes the function\n additionally ignore existing ``xsi:type`` annotations. The default is to\n use them as a type hint.\n\n The default annotation of empty elements can be set with the\n ``empty_pytype`` keyword argument. The default is not to annotate empty\n elements. Pass 'str', for example, to make string values the default.\n ";
22962 static PyMethodDef __pyx_mdef_4lxml_9objectify_21pyannotate = {"pyannotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_21pyannotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_20pyannotate};
22963 static PyObject *__pyx_pw_4lxml_9objectify_21pyannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22964 PyObject *__pyx_v_element_or_tree = 0;
22965 PyObject *__pyx_v_ignore_old = 0;
22966 PyObject *__pyx_v_ignore_xsi = 0;
22967 PyObject *__pyx_v_empty_pytype = 0;
22968 int __pyx_lineno = 0;
22969 const char *__pyx_filename = NULL;
22970 int __pyx_clineno = 0;
22971 PyObject *__pyx_r = 0;
22972 __Pyx_RefNannyDeclarations
22973 __Pyx_RefNannySetupContext("pyannotate (wrapper)", 0);
22975 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_element_or_tree,&__pyx_n_s_ignore_old,&__pyx_n_s_ignore_xsi,&__pyx_n_s_empty_pytype,0};
22976 PyObject* values[4] = {0,0,0,0};
22977 values[1] = ((PyObject *)((PyObject *)Py_False));
22978 values[2] = ((PyObject *)((PyObject *)Py_False));
22980 /* "lxml/objectify.pyx":1463
22982 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False,
22983 * empty_pytype=None): # <<<<<<<<<<<<<<
22984 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
22987 values[3] = ((PyObject *)((PyObject *)Py_None));
22988 if (unlikely(__pyx_kwds)) {
22989 Py_ssize_t kw_args;
22990 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22991 switch (pos_args) {
22992 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22993 CYTHON_FALLTHROUGH;
22995 default: goto __pyx_L5_argtuple_error;
22997 kw_args = PyDict_Size(__pyx_kwds);
22998 switch (pos_args) {
23000 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23001 else goto __pyx_L5_argtuple_error;
23003 if (kw_args > 0 && likely(kw_args <= 3)) {
23005 for (index = 1; index < 4 && kw_args > 0; index++) {
23006 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23007 if (value) { values[index] = value; kw_args--; }
23010 if (unlikely(kw_args > 0)) {
23011 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pyannotate") < 0)) __PYX_ERR(0, 1462, __pyx_L3_error)
23013 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23014 goto __pyx_L5_argtuple_error;
23016 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23018 __pyx_v_element_or_tree = values[0];
23019 __pyx_v_ignore_old = values[1];
23020 __pyx_v_ignore_xsi = values[2];
23021 __pyx_v_empty_pytype = values[3];
23023 goto __pyx_L4_argument_unpacking_done;
23024 __pyx_L5_argtuple_error:;
23025 __Pyx_RaiseArgtupleInvalid("pyannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1462, __pyx_L3_error)
23027 __Pyx_AddTraceback("lxml.objectify.pyannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23028 __Pyx_RefNannyFinishContext();
23030 __pyx_L4_argument_unpacking_done:;
23031 __pyx_r = __pyx_pf_4lxml_9objectify_20pyannotate(__pyx_self, __pyx_v_element_or_tree, __pyx_v_ignore_old, __pyx_v_ignore_xsi, __pyx_v_empty_pytype);
23033 /* "lxml/objectify.pyx":1462
23036 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
23037 * empty_pytype=None):
23038 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
23041 /* function exit code */
23042 __Pyx_RefNannyFinishContext();
23046 static PyObject *__pyx_pf_4lxml_9objectify_20pyannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_xsi, PyObject *__pyx_v_empty_pytype) {
23047 struct LxmlElement *__pyx_v_element = 0;
23048 PyObject *__pyx_r = NULL;
23049 __Pyx_RefNannyDeclarations
23050 PyObject *__pyx_t_1 = NULL;
23053 int __pyx_lineno = 0;
23054 const char *__pyx_filename = NULL;
23055 int __pyx_clineno = 0;
23056 __Pyx_RefNannySetupContext("pyannotate", 0);
23058 /* "lxml/objectify.pyx":1482
23060 * cdef _Element element
23061 * element = cetree.rootNodeOrRaise(element_or_tree) # <<<<<<<<<<<<<<
23062 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23065 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
23066 __Pyx_GOTREF(__pyx_t_1);
23067 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23070 /* "lxml/objectify.pyx":1483
23071 * cdef _Element element
23072 * element = cetree.rootNodeOrRaise(element_or_tree)
23073 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype) # <<<<<<<<<<<<<<
23075 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False,
23077 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_xsi); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1483, __pyx_L1_error)
23078 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_old); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1483, __pyx_L1_error)
23079 __pyx_t_1 = __pyx_f_4lxml_9objectify__annotate(__pyx_v_element, 0, 1, __pyx_t_2, __pyx_t_3, Py_None, __pyx_v_empty_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error)
23080 __Pyx_GOTREF(__pyx_t_1);
23081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23083 /* "lxml/objectify.pyx":1462
23086 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
23087 * empty_pytype=None):
23088 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
23091 /* function exit code */
23092 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23095 __Pyx_XDECREF(__pyx_t_1);
23096 __Pyx_AddTraceback("lxml.objectify.pyannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23099 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23100 __Pyx_XGIVEREF(__pyx_r);
23101 __Pyx_RefNannyFinishContext();
23105 /* "lxml/objectify.pyx":1485
23106 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23108 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23109 * empty_type=None):
23110 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23113 /* Python wrapper */
23114 static PyObject *__pyx_pw_4lxml_9objectify_23xsiannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23115 static char __pyx_doc_4lxml_9objectify_22xsiannotate[] = "xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)\n\n Recursively annotates the elements of an XML tree with 'xsi:type'\n attributes.\n\n If the 'ignore_old' keyword argument is True (the default), current\n 'xsi:type' attributes will be ignored and replaced. Otherwise, they will be\n checked and only replaced if they no longer fit the current text value.\n\n Note that the mapping from Python types to XSI types is usually ambiguous.\n Currently, only the first XSI type name in the corresponding PyType\n definition will be used for annotation. Thus, you should consider naming\n the widest type first if you define additional types.\n\n Setting the keyword argument ``ignore_pytype`` to True makes the function\n additionally ignore existing ``pytype`` annotations. The default is to\n use them as a type hint.\n\n The default annotation of empty elements can be set with the\n ``empty_type`` keyword argument. The default is not to annotate empty\n elements. Pass 'string', for example, to make string values the default.\n ";
23116 static PyMethodDef __pyx_mdef_4lxml_9objectify_23xsiannotate = {"xsiannotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_23xsiannotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_22xsiannotate};
23117 static PyObject *__pyx_pw_4lxml_9objectify_23xsiannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23118 PyObject *__pyx_v_element_or_tree = 0;
23119 PyObject *__pyx_v_ignore_old = 0;
23120 PyObject *__pyx_v_ignore_pytype = 0;
23121 PyObject *__pyx_v_empty_type = 0;
23122 int __pyx_lineno = 0;
23123 const char *__pyx_filename = NULL;
23124 int __pyx_clineno = 0;
23125 PyObject *__pyx_r = 0;
23126 __Pyx_RefNannyDeclarations
23127 __Pyx_RefNannySetupContext("xsiannotate (wrapper)", 0);
23129 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_element_or_tree,&__pyx_n_s_ignore_old,&__pyx_n_s_ignore_pytype,&__pyx_n_s_empty_type,0};
23130 PyObject* values[4] = {0,0,0,0};
23131 values[1] = ((PyObject *)((PyObject *)Py_False));
23132 values[2] = ((PyObject *)((PyObject *)Py_False));
23134 /* "lxml/objectify.pyx":1486
23136 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False,
23137 * empty_type=None): # <<<<<<<<<<<<<<
23138 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23141 values[3] = ((PyObject *)((PyObject *)Py_None));
23142 if (unlikely(__pyx_kwds)) {
23143 Py_ssize_t kw_args;
23144 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23145 switch (pos_args) {
23146 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23147 CYTHON_FALLTHROUGH;
23149 default: goto __pyx_L5_argtuple_error;
23151 kw_args = PyDict_Size(__pyx_kwds);
23152 switch (pos_args) {
23154 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23155 else goto __pyx_L5_argtuple_error;
23157 if (kw_args > 0 && likely(kw_args <= 3)) {
23159 for (index = 1; index < 4 && kw_args > 0; index++) {
23160 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23161 if (value) { values[index] = value; kw_args--; }
23164 if (unlikely(kw_args > 0)) {
23165 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsiannotate") < 0)) __PYX_ERR(0, 1485, __pyx_L3_error)
23167 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23168 goto __pyx_L5_argtuple_error;
23170 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23172 __pyx_v_element_or_tree = values[0];
23173 __pyx_v_ignore_old = values[1];
23174 __pyx_v_ignore_pytype = values[2];
23175 __pyx_v_empty_type = values[3];
23177 goto __pyx_L4_argument_unpacking_done;
23178 __pyx_L5_argtuple_error:;
23179 __Pyx_RaiseArgtupleInvalid("xsiannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1485, __pyx_L3_error)
23181 __Pyx_AddTraceback("lxml.objectify.xsiannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23182 __Pyx_RefNannyFinishContext();
23184 __pyx_L4_argument_unpacking_done:;
23185 __pyx_r = __pyx_pf_4lxml_9objectify_22xsiannotate(__pyx_self, __pyx_v_element_or_tree, __pyx_v_ignore_old, __pyx_v_ignore_pytype, __pyx_v_empty_type);
23187 /* "lxml/objectify.pyx":1485
23188 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23190 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23191 * empty_type=None):
23192 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23195 /* function exit code */
23196 __Pyx_RefNannyFinishContext();
23200 static PyObject *__pyx_pf_4lxml_9objectify_22xsiannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_pytype, PyObject *__pyx_v_empty_type) {
23201 struct LxmlElement *__pyx_v_element = 0;
23202 PyObject *__pyx_r = NULL;
23203 __Pyx_RefNannyDeclarations
23204 PyObject *__pyx_t_1 = NULL;
23207 int __pyx_lineno = 0;
23208 const char *__pyx_filename = NULL;
23209 int __pyx_clineno = 0;
23210 __Pyx_RefNannySetupContext("xsiannotate", 0);
23212 /* "lxml/objectify.pyx":1510
23214 * cdef _Element element
23215 * element = cetree.rootNodeOrRaise(element_or_tree) # <<<<<<<<<<<<<<
23216 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23219 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
23220 __Pyx_GOTREF(__pyx_t_1);
23221 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23224 /* "lxml/objectify.pyx":1511
23225 * cdef _Element element
23226 * element = cetree.rootNodeOrRaise(element_or_tree)
23227 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None) # <<<<<<<<<<<<<<
23229 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False,
23231 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_old); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)
23232 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_pytype); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)
23233 __pyx_t_1 = __pyx_f_4lxml_9objectify__annotate(__pyx_v_element, 1, 0, __pyx_t_2, __pyx_t_3, __pyx_v_empty_type, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
23234 __Pyx_GOTREF(__pyx_t_1);
23235 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23237 /* "lxml/objectify.pyx":1485
23238 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23240 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23241 * empty_type=None):
23242 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23245 /* function exit code */
23246 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23249 __Pyx_XDECREF(__pyx_t_1);
23250 __Pyx_AddTraceback("lxml.objectify.xsiannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23253 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23254 __Pyx_XGIVEREF(__pyx_r);
23255 __Pyx_RefNannyFinishContext();
23259 /* "lxml/objectify.pyx":1513
23260 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23262 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23263 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23264 * annotate_pytype=1):
23267 /* Python wrapper */
23268 static PyObject *__pyx_pw_4lxml_9objectify_25annotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23269 static char __pyx_doc_4lxml_9objectify_24annotate[] = "annotate(element_or_tree, ignore_old=True, ignore_xsi=False, empty_pytype=None, empty_type=None, annotate_xsi=0, annotate_pytype=1)\n\n Recursively annotates the elements of an XML tree with 'xsi:type'\n and/or 'py:pytype' attributes.\n\n If the 'ignore_old' keyword argument is True (the default), current\n 'py:pytype' attributes will be ignored for the type annotation. Set to False\n if you want reuse existing 'py:pytype' information (iff appropriate for the\n element text value).\n\n If the 'ignore_xsi' keyword argument is False (the default), existing\n 'xsi:type' attributes will be used for the type annotation, if they fit the\n element text values. \n \n Note that the mapping from Python types to XSI types is usually ambiguous.\n Currently, only the first XSI type name in the corresponding PyType\n definition will be used for annotation. Thus, you should consider naming\n the widest type first if you define additional types.\n\n The default 'py:pytype' annotation of empty elements can be set with the\n ``empty_pytype`` keyword argument. Pass 'str', for example, to make\n string values the default.\n\n The default 'xsi:type' annotation of empty elements can be set with the\n ``empty_type`` keyword argument. The default is not to annotate empty\n elements. Pass 'string', for example, to make string values the default.\n\n The keyword arguments 'annotate_xsi' (default: 0) and 'annotate_pytype'\n (default: 1) control which kind(s) of annotation to use. \n ";
23270 static PyMethodDef __pyx_mdef_4lxml_9objectify_25annotate = {"annotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_25annotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_24annotate};
23271 static PyObject *__pyx_pw_4lxml_9objectify_25annotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23272 PyObject *__pyx_v_element_or_tree = 0;
23273 PyObject *__pyx_v_ignore_old = 0;
23274 PyObject *__pyx_v_ignore_xsi = 0;
23275 PyObject *__pyx_v_empty_pytype = 0;
23276 PyObject *__pyx_v_empty_type = 0;
23277 PyObject *__pyx_v_annotate_xsi = 0;
23278 PyObject *__pyx_v_annotate_pytype = 0;
23279 int __pyx_lineno = 0;
23280 const char *__pyx_filename = NULL;
23281 int __pyx_clineno = 0;
23282 PyObject *__pyx_r = 0;
23283 __Pyx_RefNannyDeclarations
23284 __Pyx_RefNannySetupContext("annotate (wrapper)", 0);
23286 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_element_or_tree,&__pyx_n_s_ignore_old,&__pyx_n_s_ignore_xsi,&__pyx_n_s_empty_pytype,&__pyx_n_s_empty_type,&__pyx_n_s_annotate_xsi,&__pyx_n_s_annotate_pytype,0};
23287 PyObject* values[7] = {0,0,0,0,0,0,0};
23288 values[1] = ((PyObject *)((PyObject *)Py_True));
23289 values[2] = ((PyObject *)((PyObject *)Py_False));
23291 /* "lxml/objectify.pyx":1514
23293 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False,
23294 * empty_pytype=None, empty_type=None, annotate_xsi=0, # <<<<<<<<<<<<<<
23295 * annotate_pytype=1):
23296 * u"""annotate(element_or_tree, ignore_old=True, ignore_xsi=False, empty_pytype=None, empty_type=None, annotate_xsi=0, annotate_pytype=1)
23298 values[3] = ((PyObject *)((PyObject *)Py_None));
23299 values[4] = ((PyObject *)((PyObject *)Py_None));
23300 values[5] = ((PyObject *)((PyObject *)__pyx_int_0));
23301 values[6] = ((PyObject *)((PyObject *)__pyx_int_1));
23302 if (unlikely(__pyx_kwds)) {
23303 Py_ssize_t kw_args;
23304 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23305 switch (pos_args) {
23306 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23307 CYTHON_FALLTHROUGH;
23309 default: goto __pyx_L5_argtuple_error;
23311 kw_args = PyDict_Size(__pyx_kwds);
23312 switch (pos_args) {
23314 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23315 else goto __pyx_L5_argtuple_error;
23317 if (kw_args > 0 && likely(kw_args <= 6)) {
23319 for (index = 1; index < 7 && kw_args > 0; index++) {
23320 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23321 if (value) { values[index] = value; kw_args--; }
23324 if (unlikely(kw_args > 0)) {
23325 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "annotate") < 0)) __PYX_ERR(0, 1513, __pyx_L3_error)
23327 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23328 goto __pyx_L5_argtuple_error;
23330 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23332 __pyx_v_element_or_tree = values[0];
23333 __pyx_v_ignore_old = values[1];
23334 __pyx_v_ignore_xsi = values[2];
23335 __pyx_v_empty_pytype = values[3];
23336 __pyx_v_empty_type = values[4];
23337 __pyx_v_annotate_xsi = values[5];
23338 __pyx_v_annotate_pytype = values[6];
23340 goto __pyx_L4_argument_unpacking_done;
23341 __pyx_L5_argtuple_error:;
23342 __Pyx_RaiseArgtupleInvalid("annotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1513, __pyx_L3_error)
23344 __Pyx_AddTraceback("lxml.objectify.annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23345 __Pyx_RefNannyFinishContext();
23347 __pyx_L4_argument_unpacking_done:;
23348 __pyx_r = __pyx_pf_4lxml_9objectify_24annotate(__pyx_self, __pyx_v_element_or_tree, __pyx_v_ignore_old, __pyx_v_ignore_xsi, __pyx_v_empty_pytype, __pyx_v_empty_type, __pyx_v_annotate_xsi, __pyx_v_annotate_pytype);
23350 /* "lxml/objectify.pyx":1513
23351 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23353 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23354 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23355 * annotate_pytype=1):
23358 /* function exit code */
23359 __Pyx_RefNannyFinishContext();
23363 static PyObject *__pyx_pf_4lxml_9objectify_24annotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, PyObject *__pyx_v_ignore_old, PyObject *__pyx_v_ignore_xsi, PyObject *__pyx_v_empty_pytype, PyObject *__pyx_v_empty_type, PyObject *__pyx_v_annotate_xsi, PyObject *__pyx_v_annotate_pytype) {
23364 struct LxmlElement *__pyx_v_element = 0;
23365 PyObject *__pyx_r = NULL;
23366 __Pyx_RefNannyDeclarations
23367 PyObject *__pyx_t_1 = NULL;
23372 int __pyx_lineno = 0;
23373 const char *__pyx_filename = NULL;
23374 int __pyx_clineno = 0;
23375 __Pyx_RefNannySetupContext("annotate", 0);
23377 /* "lxml/objectify.pyx":1547
23379 * cdef _Element element
23380 * element = cetree.rootNodeOrRaise(element_or_tree) # <<<<<<<<<<<<<<
23381 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi,
23382 * ignore_old, empty_type, empty_pytype)
23384 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error)
23385 __Pyx_GOTREF(__pyx_t_1);
23386 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23389 /* "lxml/objectify.pyx":1548
23390 * cdef _Element element
23391 * element = cetree.rootNodeOrRaise(element_or_tree)
23392 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi, # <<<<<<<<<<<<<<
23393 * ignore_old, empty_type, empty_pytype)
23396 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_annotate_xsi); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
23397 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_annotate_pytype); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
23398 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_xsi); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
23400 /* "lxml/objectify.pyx":1549
23401 * element = cetree.rootNodeOrRaise(element_or_tree)
23402 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi,
23403 * ignore_old, empty_type, empty_pytype) # <<<<<<<<<<<<<<
23407 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_old); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1549, __pyx_L1_error)
23409 /* "lxml/objectify.pyx":1548
23410 * cdef _Element element
23411 * element = cetree.rootNodeOrRaise(element_or_tree)
23412 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi, # <<<<<<<<<<<<<<
23413 * ignore_old, empty_type, empty_pytype)
23416 __pyx_t_1 = __pyx_f_4lxml_9objectify__annotate(__pyx_v_element, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_empty_type, __pyx_v_empty_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
23417 __Pyx_GOTREF(__pyx_t_1);
23418 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23420 /* "lxml/objectify.pyx":1513
23421 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23423 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23424 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23425 * annotate_pytype=1):
23428 /* function exit code */
23429 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23432 __Pyx_XDECREF(__pyx_t_1);
23433 __Pyx_AddTraceback("lxml.objectify.annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23436 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23437 __Pyx_XGIVEREF(__pyx_r);
23438 __Pyx_RefNannyFinishContext();
23442 /* "lxml/objectify.pyx":1552
23445 * cdef _annotate(_Element element, bint annotate_xsi, bint annotate_pytype, # <<<<<<<<<<<<<<
23446 * bint ignore_xsi, bint ignore_pytype,
23447 * empty_type_name, empty_pytype_name):
23450 static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *__pyx_v_element, int __pyx_v_annotate_xsi, int __pyx_v_annotate_pytype, int __pyx_v_ignore_xsi, int __pyx_v_ignore_pytype, PyObject *__pyx_v_empty_type_name, PyObject *__pyx_v_empty_pytype_name) {
23451 struct LxmlDocument *__pyx_v_doc = 0;
23452 xmlNode *__pyx_v_c_node;
23453 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_empty_pytype = 0;
23454 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_StrType = 0;
23455 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_NoneType = 0;
23456 PyObject *__pyx_r = NULL;
23457 __Pyx_RefNannyDeclarations
23460 PyObject *__pyx_t_3 = NULL;
23461 PyObject *__pyx_t_4 = NULL;
23462 xmlNode *__pyx_t_5;
23464 int __pyx_lineno = 0;
23465 const char *__pyx_filename = NULL;
23466 int __pyx_clineno = 0;
23467 __Pyx_RefNannySetupContext("_annotate", 0);
23468 __Pyx_INCREF(__pyx_v_empty_type_name);
23469 __Pyx_INCREF(__pyx_v_empty_pytype_name);
23471 /* "lxml/objectify.pyx":1559
23472 * cdef PyType empty_pytype, StrType, NoneType
23474 * if not annotate_xsi and not annotate_pytype: # <<<<<<<<<<<<<<
23478 __pyx_t_2 = ((!(__pyx_v_annotate_xsi != 0)) != 0);
23481 __pyx_t_1 = __pyx_t_2;
23482 goto __pyx_L4_bool_binop_done;
23484 __pyx_t_2 = ((!(__pyx_v_annotate_pytype != 0)) != 0);
23485 __pyx_t_1 = __pyx_t_2;
23486 __pyx_L4_bool_binop_done:;
23489 /* "lxml/objectify.pyx":1560
23491 * if not annotate_xsi and not annotate_pytype:
23492 * return # <<<<<<<<<<<<<<
23494 * if empty_type_name is not None:
23496 __Pyx_XDECREF(__pyx_r);
23497 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23500 /* "lxml/objectify.pyx":1559
23501 * cdef PyType empty_pytype, StrType, NoneType
23503 * if not annotate_xsi and not annotate_pytype: # <<<<<<<<<<<<<<
23509 /* "lxml/objectify.pyx":1562
23512 * if empty_type_name is not None: # <<<<<<<<<<<<<<
23513 * if isinstance(empty_type_name, bytes):
23514 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23516 __pyx_t_1 = (__pyx_v_empty_type_name != Py_None);
23517 __pyx_t_2 = (__pyx_t_1 != 0);
23520 /* "lxml/objectify.pyx":1563
23522 * if empty_type_name is not None:
23523 * if isinstance(empty_type_name, bytes): # <<<<<<<<<<<<<<
23524 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23525 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23527 __pyx_t_2 = PyBytes_Check(__pyx_v_empty_type_name);
23528 __pyx_t_1 = (__pyx_t_2 != 0);
23531 /* "lxml/objectify.pyx":1564
23532 * if empty_type_name is not None:
23533 * if isinstance(empty_type_name, bytes):
23534 * empty_type_name = (<bytes>empty_type_name).decode("ascii") # <<<<<<<<<<<<<<
23535 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23536 * elif empty_pytype_name is not None:
23538 if (unlikely(__pyx_v_empty_type_name == Py_None)) {
23539 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
23540 __PYX_ERR(0, 1564, __pyx_L1_error)
23542 __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_v_empty_type_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1564, __pyx_L1_error)
23543 __Pyx_GOTREF(__pyx_t_3);
23544 __Pyx_DECREF_SET(__pyx_v_empty_type_name, __pyx_t_3);
23547 /* "lxml/objectify.pyx":1563
23549 * if empty_type_name is not None:
23550 * if isinstance(empty_type_name, bytes): # <<<<<<<<<<<<<<
23551 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23552 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23556 /* "lxml/objectify.pyx":1565
23557 * if isinstance(empty_type_name, bytes):
23558 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23559 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name) # <<<<<<<<<<<<<<
23560 * elif empty_pytype_name is not None:
23561 * if isinstance(empty_pytype_name, bytes):
23563 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
23564 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23565 __PYX_ERR(0, 1565, __pyx_L1_error)
23567 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_empty_type_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1565, __pyx_L1_error)
23568 __Pyx_GOTREF(__pyx_t_3);
23569 __pyx_t_4 = __pyx_t_3;
23570 __Pyx_INCREF(__pyx_t_4);
23571 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23572 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
23575 /* "lxml/objectify.pyx":1562
23578 * if empty_type_name is not None: # <<<<<<<<<<<<<<
23579 * if isinstance(empty_type_name, bytes):
23580 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23585 /* "lxml/objectify.pyx":1566
23586 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23587 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23588 * elif empty_pytype_name is not None: # <<<<<<<<<<<<<<
23589 * if isinstance(empty_pytype_name, bytes):
23590 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23592 __pyx_t_1 = (__pyx_v_empty_pytype_name != Py_None);
23593 __pyx_t_2 = (__pyx_t_1 != 0);
23596 /* "lxml/objectify.pyx":1567
23597 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23598 * elif empty_pytype_name is not None:
23599 * if isinstance(empty_pytype_name, bytes): # <<<<<<<<<<<<<<
23600 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23601 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23603 __pyx_t_2 = PyBytes_Check(__pyx_v_empty_pytype_name);
23604 __pyx_t_1 = (__pyx_t_2 != 0);
23607 /* "lxml/objectify.pyx":1568
23608 * elif empty_pytype_name is not None:
23609 * if isinstance(empty_pytype_name, bytes):
23610 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii") # <<<<<<<<<<<<<<
23611 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23614 if (unlikely(__pyx_v_empty_pytype_name == Py_None)) {
23615 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
23616 __PYX_ERR(0, 1568, __pyx_L1_error)
23618 __pyx_t_4 = __Pyx_decode_bytes(((PyObject*)__pyx_v_empty_pytype_name), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __pyx_L1_error)
23619 __Pyx_GOTREF(__pyx_t_4);
23620 __Pyx_DECREF_SET(__pyx_v_empty_pytype_name, __pyx_t_4);
23623 /* "lxml/objectify.pyx":1567
23624 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23625 * elif empty_pytype_name is not None:
23626 * if isinstance(empty_pytype_name, bytes): # <<<<<<<<<<<<<<
23627 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23628 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23632 /* "lxml/objectify.pyx":1569
23633 * if isinstance(empty_pytype_name, bytes):
23634 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23635 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name) # <<<<<<<<<<<<<<
23637 * empty_pytype = None
23639 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23640 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23641 __PYX_ERR(0, 1569, __pyx_L1_error)
23643 __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_empty_pytype_name, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1569, __pyx_L1_error)
23644 __Pyx_GOTREF(__pyx_t_4);
23645 __pyx_t_3 = __pyx_t_4;
23646 __Pyx_INCREF(__pyx_t_3);
23647 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23648 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
23651 /* "lxml/objectify.pyx":1566
23652 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23653 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23654 * elif empty_pytype_name is not None: # <<<<<<<<<<<<<<
23655 * if isinstance(empty_pytype_name, bytes):
23656 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23661 /* "lxml/objectify.pyx":1571
23662 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23664 * empty_pytype = None # <<<<<<<<<<<<<<
23666 * StrType = <PyType>_PYTYPE_DICT.get(u'str')
23669 __Pyx_INCREF(Py_None);
23670 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None);
23674 /* "lxml/objectify.pyx":1573
23675 * empty_pytype = None
23677 * StrType = <PyType>_PYTYPE_DICT.get(u'str') # <<<<<<<<<<<<<<
23678 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType')
23681 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23682 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23683 __PYX_ERR(0, 1573, __pyx_L1_error)
23685 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_n_u_str, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error)
23686 __Pyx_GOTREF(__pyx_t_3);
23687 __pyx_t_4 = __pyx_t_3;
23688 __Pyx_INCREF(__pyx_t_4);
23689 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23690 __pyx_v_StrType = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
23693 /* "lxml/objectify.pyx":1574
23695 * StrType = <PyType>_PYTYPE_DICT.get(u'str')
23696 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType') # <<<<<<<<<<<<<<
23698 * doc = element._doc
23700 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23701 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23702 __PYX_ERR(0, 1574, __pyx_L1_error)
23704 __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_n_u_NoneType, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L1_error)
23705 __Pyx_GOTREF(__pyx_t_4);
23706 __pyx_t_3 = __pyx_t_4;
23707 __Pyx_INCREF(__pyx_t_3);
23708 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23709 __pyx_v_NoneType = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
23712 /* "lxml/objectify.pyx":1576
23713 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType')
23715 * doc = element._doc # <<<<<<<<<<<<<<
23716 * c_node = element._c_node
23717 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23719 __pyx_t_3 = ((PyObject *)__pyx_v_element->_doc);
23720 __Pyx_INCREF(__pyx_t_3);
23721 __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
23724 /* "lxml/objectify.pyx":1577
23726 * doc = element._doc
23727 * c_node = element._c_node # <<<<<<<<<<<<<<
23728 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23729 * if c_node.type == tree.XML_ELEMENT_NODE:
23731 __pyx_t_5 = __pyx_v_element->_c_node;
23732 __pyx_v_c_node = __pyx_t_5;
23734 /* "lxml/objectify.pyx":1578
23735 * doc = element._doc
23736 * c_node = element._c_node
23737 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1) # <<<<<<<<<<<<<<
23738 * if c_node.type == tree.XML_ELEMENT_NODE:
23739 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23741 BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node, __pyx_v_c_node, 1);
23743 /* "lxml/objectify.pyx":1579
23744 * c_node = element._c_node
23745 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23746 * if c_node.type == tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
23747 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23748 * ignore_xsi, ignore_pytype,
23750 __pyx_t_1 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
23753 /* "lxml/objectify.pyx":1580
23754 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23755 * if c_node.type == tree.XML_ELEMENT_NODE:
23756 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype, # <<<<<<<<<<<<<<
23757 * ignore_xsi, ignore_pytype,
23758 * empty_type_name, empty_pytype, StrType, NoneType)
23760 __pyx_t_6 = __pyx_f_4lxml_9objectify__annotate_element(__pyx_v_c_node, __pyx_v_doc, __pyx_v_annotate_xsi, __pyx_v_annotate_pytype, __pyx_v_ignore_xsi, __pyx_v_ignore_pytype, __pyx_v_empty_type_name, __pyx_v_empty_pytype, __pyx_v_StrType, __pyx_v_NoneType); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1580, __pyx_L1_error)
23762 /* "lxml/objectify.pyx":1579
23763 * c_node = element._c_node
23764 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23765 * if c_node.type == tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
23766 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23767 * ignore_xsi, ignore_pytype,
23771 /* "lxml/objectify.pyx":1583
23772 * ignore_xsi, ignore_pytype,
23773 * empty_type_name, empty_pytype, StrType, NoneType)
23774 * tree.END_FOR_EACH_ELEMENT_FROM(c_node) # <<<<<<<<<<<<<<
23776 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc,
23778 END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
23780 /* "lxml/objectify.pyx":1552
23783 * cdef _annotate(_Element element, bint annotate_xsi, bint annotate_pytype, # <<<<<<<<<<<<<<
23784 * bint ignore_xsi, bint ignore_pytype,
23785 * empty_type_name, empty_pytype_name):
23788 /* function exit code */
23789 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23792 __Pyx_XDECREF(__pyx_t_3);
23793 __Pyx_XDECREF(__pyx_t_4);
23794 __Pyx_AddTraceback("lxml.objectify._annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23797 __Pyx_XDECREF((PyObject *)__pyx_v_doc);
23798 __Pyx_XDECREF((PyObject *)__pyx_v_empty_pytype);
23799 __Pyx_XDECREF((PyObject *)__pyx_v_StrType);
23800 __Pyx_XDECREF((PyObject *)__pyx_v_NoneType);
23801 __Pyx_XDECREF(__pyx_v_empty_type_name);
23802 __Pyx_XDECREF(__pyx_v_empty_pytype_name);
23803 __Pyx_XGIVEREF(__pyx_r);
23804 __Pyx_RefNannyFinishContext();
23808 /* "lxml/objectify.pyx":1585
23809 * tree.END_FOR_EACH_ELEMENT_FROM(c_node)
23811 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc, # <<<<<<<<<<<<<<
23812 * bint annotate_xsi, bint annotate_pytype,
23813 * bint ignore_xsi, bint ignore_pytype,
23816 static int __pyx_f_4lxml_9objectify__annotate_element(xmlNode *__pyx_v_c_node, struct LxmlDocument *__pyx_v_doc, int __pyx_v_annotate_xsi, int __pyx_v_annotate_pytype, int __pyx_v_ignore_xsi, int __pyx_v_ignore_pytype, PyObject *__pyx_v_empty_type_name, struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_empty_pytype, struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_StrType, struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_NoneType) {
23817 xmlNs *__pyx_v_c_ns;
23818 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_pytype = 0;
23819 PyObject *__pyx_v_typename = NULL;
23820 long __pyx_v_istree;
23821 PyObject *__pyx_v_prefix = NULL;
23822 PyObject *__pyx_v_old_pytypename = NULL;
23823 PyObject *__pyx_v_typename_utf8 = NULL;
23824 PyObject *__pyx_v_name = NULL;
23825 PyObject *__pyx_v_pytype_name = NULL;
23827 __Pyx_RefNannyDeclarations
23828 PyObject *__pyx_t_1 = NULL;
23832 PyObject *__pyx_t_5 = NULL;
23833 PyObject *__pyx_t_6 = NULL;
23834 PyObject *__pyx_t_7 = NULL;
23835 PyObject *(*__pyx_t_8)(PyObject *);
23836 int __pyx_lineno = 0;
23837 const char *__pyx_filename = NULL;
23838 int __pyx_clineno = 0;
23839 __Pyx_RefNannySetupContext("_annotate_element", 0);
23841 /* "lxml/objectify.pyx":1591
23842 * PyType StrType, PyType NoneType) except -1:
23843 * cdef tree.xmlNs* c_ns
23844 * cdef PyType pytype = None # <<<<<<<<<<<<<<
23848 __Pyx_INCREF(Py_None);
23849 __pyx_v_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None);
23851 /* "lxml/objectify.pyx":1592
23852 * cdef tree.xmlNs* c_ns
23853 * cdef PyType pytype = None
23854 * typename = None # <<<<<<<<<<<<<<
23858 __Pyx_INCREF(Py_None);
23859 __pyx_v_typename = Py_None;
23861 /* "lxml/objectify.pyx":1593
23862 * cdef PyType pytype = None
23864 * istree = 0 # <<<<<<<<<<<<<<
23866 * # if element is defined as xsi:nil, represent it as None
23868 __pyx_v_istree = 0;
23870 /* "lxml/objectify.pyx":1596
23872 * # if element is defined as xsi:nil, represent it as None
23873 * if cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23874 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23875 * pytype = NoneType
23877 __pyx_t_1 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"nil")))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1596, __pyx_L1_error)
23878 __Pyx_GOTREF(__pyx_t_1);
23879 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_true, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1597, __pyx_L1_error)
23880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23883 /* "lxml/objectify.pyx":1598
23884 * if cetree.attributeValueFromNsName(
23885 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23886 * pytype = NoneType # <<<<<<<<<<<<<<
23888 * if pytype is None and not ignore_xsi:
23890 __Pyx_INCREF(((PyObject *)__pyx_v_NoneType));
23891 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_NoneType);
23893 /* "lxml/objectify.pyx":1596
23895 * # if element is defined as xsi:nil, represent it as None
23896 * if cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23897 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23898 * pytype = NoneType
23902 /* "lxml/objectify.pyx":1600
23903 * pytype = NoneType
23905 * if pytype is None and not ignore_xsi: # <<<<<<<<<<<<<<
23906 * # check that old xsi type value is valid
23907 * typename = cetree.attributeValueFromNsName(
23909 __pyx_t_3 = (((PyObject *)__pyx_v_pytype) == Py_None);
23910 __pyx_t_4 = (__pyx_t_3 != 0);
23913 __pyx_t_2 = __pyx_t_4;
23914 goto __pyx_L5_bool_binop_done;
23916 __pyx_t_4 = ((!(__pyx_v_ignore_xsi != 0)) != 0);
23917 __pyx_t_2 = __pyx_t_4;
23918 __pyx_L5_bool_binop_done:;
23921 /* "lxml/objectify.pyx":1602
23922 * if pytype is None and not ignore_xsi:
23923 * # check that old xsi type value is valid
23924 * typename = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23925 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23926 * if typename is not None:
23928 __pyx_t_1 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"type")))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error)
23929 __Pyx_GOTREF(__pyx_t_1);
23930 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_1);
23933 /* "lxml/objectify.pyx":1604
23934 * typename = cetree.attributeValueFromNsName(
23935 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23936 * if typename is not None: # <<<<<<<<<<<<<<
23937 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23938 * if pytype is None and u':' in typename:
23940 __pyx_t_2 = (__pyx_v_typename != Py_None);
23941 __pyx_t_4 = (__pyx_t_2 != 0);
23944 /* "lxml/objectify.pyx":1605
23945 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23946 * if typename is not None:
23947 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename) # <<<<<<<<<<<<<<
23948 * if pytype is None and u':' in typename:
23949 * prefix, typename = typename.split(u':', 1)
23951 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
23952 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23953 __PYX_ERR(0, 1605, __pyx_L1_error)
23955 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_typename, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1605, __pyx_L1_error)
23956 __Pyx_GOTREF(__pyx_t_1);
23957 __pyx_t_5 = __pyx_t_1;
23958 __Pyx_INCREF(__pyx_t_5);
23959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23960 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_5));
23963 /* "lxml/objectify.pyx":1606
23964 * if typename is not None:
23965 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23966 * if pytype is None and u':' in typename: # <<<<<<<<<<<<<<
23967 * prefix, typename = typename.split(u':', 1)
23968 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23970 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) == Py_None);
23971 __pyx_t_3 = (__pyx_t_2 != 0);
23974 __pyx_t_4 = __pyx_t_3;
23975 goto __pyx_L9_bool_binop_done;
23977 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_v_typename, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1606, __pyx_L1_error)
23978 __pyx_t_2 = (__pyx_t_3 != 0);
23979 __pyx_t_4 = __pyx_t_2;
23980 __pyx_L9_bool_binop_done:;
23983 /* "lxml/objectify.pyx":1607
23984 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23985 * if pytype is None and u':' in typename:
23986 * prefix, typename = typename.split(u':', 1) # <<<<<<<<<<<<<<
23987 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23988 * if pytype is not None and pytype is not StrType:
23990 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_typename, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1607, __pyx_L1_error)
23991 __Pyx_GOTREF(__pyx_t_5);
23992 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1607, __pyx_L1_error)
23993 __Pyx_GOTREF(__pyx_t_1);
23994 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23995 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
23996 PyObject* sequence = __pyx_t_1;
23997 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23998 if (unlikely(size != 2)) {
23999 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24000 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24001 __PYX_ERR(0, 1607, __pyx_L1_error)
24003 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24004 if (likely(PyTuple_CheckExact(sequence))) {
24005 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
24006 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
24008 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
24009 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
24011 __Pyx_INCREF(__pyx_t_5);
24012 __Pyx_INCREF(__pyx_t_6);
24014 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1607, __pyx_L1_error)
24015 __Pyx_GOTREF(__pyx_t_5);
24016 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1607, __pyx_L1_error)
24017 __Pyx_GOTREF(__pyx_t_6);
24019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24021 Py_ssize_t index = -1;
24022 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1607, __pyx_L1_error)
24023 __Pyx_GOTREF(__pyx_t_7);
24024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24025 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
24026 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
24027 __Pyx_GOTREF(__pyx_t_5);
24028 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
24029 __Pyx_GOTREF(__pyx_t_6);
24030 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
24032 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24033 goto __pyx_L12_unpacking_done;
24034 __pyx_L11_unpacking_failed:;
24035 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24037 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
24038 __PYX_ERR(0, 1607, __pyx_L1_error)
24039 __pyx_L12_unpacking_done:;
24041 __pyx_v_prefix = __pyx_t_5;
24043 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24046 /* "lxml/objectify.pyx":1608
24047 * if pytype is None and u':' in typename:
24048 * prefix, typename = typename.split(u':', 1)
24049 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename) # <<<<<<<<<<<<<<
24050 * if pytype is not None and pytype is not StrType:
24051 * # StrType does not have a typecheck but is the default
24053 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
24054 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
24055 __PYX_ERR(0, 1608, __pyx_L1_error)
24057 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_typename, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
24058 __Pyx_GOTREF(__pyx_t_1);
24059 __pyx_t_6 = __pyx_t_1;
24060 __Pyx_INCREF(__pyx_t_6);
24061 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24062 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24065 /* "lxml/objectify.pyx":1606
24066 * if typename is not None:
24067 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24068 * if pytype is None and u':' in typename: # <<<<<<<<<<<<<<
24069 * prefix, typename = typename.split(u':', 1)
24070 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24074 /* "lxml/objectify.pyx":1609
24075 * prefix, typename = typename.split(u':', 1)
24076 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24077 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24078 * # StrType does not have a typecheck but is the default
24079 * # anyway, so just accept it if given as type
24081 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24082 __pyx_t_3 = (__pyx_t_2 != 0);
24085 __pyx_t_4 = __pyx_t_3;
24086 goto __pyx_L14_bool_binop_done;
24088 __pyx_t_3 = (__pyx_v_pytype != __pyx_v_StrType);
24089 __pyx_t_2 = (__pyx_t_3 != 0);
24090 __pyx_t_4 = __pyx_t_2;
24091 __pyx_L14_bool_binop_done:;
24094 /* "lxml/objectify.pyx":1613
24095 * # anyway, so just accept it if given as type
24097 * pytype = _check_type(c_node, pytype) # <<<<<<<<<<<<<<
24098 * if pytype is None:
24101 __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_9objectify__check_type(__pyx_v_c_node, __pyx_v_pytype)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1613, __pyx_L1_error)
24102 __Pyx_GOTREF(__pyx_t_6);
24103 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24106 /* "lxml/objectify.pyx":1614
24108 * pytype = _check_type(c_node, pytype)
24109 * if pytype is None: # <<<<<<<<<<<<<<
24113 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
24114 __pyx_t_2 = (__pyx_t_4 != 0);
24117 /* "lxml/objectify.pyx":1615
24118 * pytype = _check_type(c_node, pytype)
24119 * if pytype is None:
24120 * typename = None # <<<<<<<<<<<<<<
24122 * if pytype is None and not ignore_pytype:
24124 __Pyx_INCREF(Py_None);
24125 __Pyx_DECREF_SET(__pyx_v_typename, Py_None);
24127 /* "lxml/objectify.pyx":1614
24129 * pytype = _check_type(c_node, pytype)
24130 * if pytype is None: # <<<<<<<<<<<<<<
24136 /* "lxml/objectify.pyx":1609
24137 * prefix, typename = typename.split(u':', 1)
24138 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24139 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24140 * # StrType does not have a typecheck but is the default
24141 * # anyway, so just accept it if given as type
24145 /* "lxml/objectify.pyx":1604
24146 * typename = cetree.attributeValueFromNsName(
24147 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24148 * if typename is not None: # <<<<<<<<<<<<<<
24149 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24150 * if pytype is None and u':' in typename:
24154 /* "lxml/objectify.pyx":1600
24155 * pytype = NoneType
24157 * if pytype is None and not ignore_xsi: # <<<<<<<<<<<<<<
24158 * # check that old xsi type value is valid
24159 * typename = cetree.attributeValueFromNsName(
24163 /* "lxml/objectify.pyx":1617
24166 * if pytype is None and not ignore_pytype: # <<<<<<<<<<<<<<
24167 * # check that old pytype value is valid
24168 * old_pytypename = cetree.attributeValueFromNsName(
24170 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
24171 __pyx_t_3 = (__pyx_t_4 != 0);
24174 __pyx_t_2 = __pyx_t_3;
24175 goto __pyx_L18_bool_binop_done;
24177 __pyx_t_3 = ((!(__pyx_v_ignore_pytype != 0)) != 0);
24178 __pyx_t_2 = __pyx_t_3;
24179 __pyx_L18_bool_binop_done:;
24182 /* "lxml/objectify.pyx":1619
24183 * if pytype is None and not ignore_pytype:
24184 * # check that old pytype value is valid
24185 * old_pytypename = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
24186 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24187 * if old_pytypename is not None:
24189 __pyx_t_6 = attributeValueFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1619, __pyx_L1_error)
24190 __Pyx_GOTREF(__pyx_t_6);
24191 __pyx_v_old_pytypename = __pyx_t_6;
24194 /* "lxml/objectify.pyx":1621
24195 * old_pytypename = cetree.attributeValueFromNsName(
24196 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24197 * if old_pytypename is not None: # <<<<<<<<<<<<<<
24198 * if old_pytypename == TREE_PYTYPE_NAME:
24199 * if not cetree.hasChild(c_node):
24201 __pyx_t_2 = (__pyx_v_old_pytypename != Py_None);
24202 __pyx_t_3 = (__pyx_t_2 != 0);
24205 /* "lxml/objectify.pyx":1622
24206 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24207 * if old_pytypename is not None:
24208 * if old_pytypename == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
24209 * if not cetree.hasChild(c_node):
24210 * # only case where we should keep it,
24212 __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_old_pytypename, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1622, __pyx_L1_error)
24215 /* "lxml/objectify.pyx":1623
24216 * if old_pytypename is not None:
24217 * if old_pytypename == TREE_PYTYPE_NAME:
24218 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24219 * # only case where we should keep it,
24220 * # everything else is clear enough
24222 __pyx_t_3 = ((!(hasChild(__pyx_v_c_node) != 0)) != 0);
24225 /* "lxml/objectify.pyx":1626
24226 * # only case where we should keep it,
24227 * # everything else is clear enough
24228 * pytype = TREE_PYTYPE # <<<<<<<<<<<<<<
24230 * if old_pytypename == 'none':
24232 __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_9objectify_TREE_PYTYPE));
24233 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_4lxml_9objectify_TREE_PYTYPE);
24235 /* "lxml/objectify.pyx":1623
24236 * if old_pytypename is not None:
24237 * if old_pytypename == TREE_PYTYPE_NAME:
24238 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24239 * # only case where we should keep it,
24240 * # everything else is clear enough
24244 /* "lxml/objectify.pyx":1622
24245 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24246 * if old_pytypename is not None:
24247 * if old_pytypename == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
24248 * if not cetree.hasChild(c_node):
24249 * # only case where we should keep it,
24254 /* "lxml/objectify.pyx":1628
24255 * pytype = TREE_PYTYPE
24257 * if old_pytypename == 'none': # <<<<<<<<<<<<<<
24258 * # transition from lxml 1.x
24259 * old_pytypename = "NoneType"
24262 __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_old_pytypename, __pyx_n_s_none, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1628, __pyx_L1_error)
24265 /* "lxml/objectify.pyx":1630
24266 * if old_pytypename == 'none':
24267 * # transition from lxml 1.x
24268 * old_pytypename = "NoneType" # <<<<<<<<<<<<<<
24269 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24270 * if pytype is not None and pytype is not StrType:
24272 __Pyx_INCREF(__pyx_n_s_NoneType);
24273 __Pyx_DECREF_SET(__pyx_v_old_pytypename, __pyx_n_s_NoneType);
24275 /* "lxml/objectify.pyx":1628
24276 * pytype = TREE_PYTYPE
24278 * if old_pytypename == 'none': # <<<<<<<<<<<<<<
24279 * # transition from lxml 1.x
24280 * old_pytypename = "NoneType"
24284 /* "lxml/objectify.pyx":1631
24285 * # transition from lxml 1.x
24286 * old_pytypename = "NoneType"
24287 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename) # <<<<<<<<<<<<<<
24288 * if pytype is not None and pytype is not StrType:
24289 * # StrType does not have a typecheck but is the
24291 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
24292 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
24293 __PYX_ERR(0, 1631, __pyx_L1_error)
24295 __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_old_pytypename, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1631, __pyx_L1_error)
24296 __Pyx_GOTREF(__pyx_t_6);
24297 __pyx_t_1 = __pyx_t_6;
24298 __Pyx_INCREF(__pyx_t_1);
24299 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24300 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
24303 /* "lxml/objectify.pyx":1632
24304 * old_pytypename = "NoneType"
24305 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24306 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24307 * # StrType does not have a typecheck but is the
24308 * # default anyway, so just accept it if given as
24310 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24311 __pyx_t_4 = (__pyx_t_2 != 0);
24314 __pyx_t_3 = __pyx_t_4;
24315 goto __pyx_L25_bool_binop_done;
24317 __pyx_t_4 = (__pyx_v_pytype != __pyx_v_StrType);
24318 __pyx_t_2 = (__pyx_t_4 != 0);
24319 __pyx_t_3 = __pyx_t_2;
24320 __pyx_L25_bool_binop_done:;
24323 /* "lxml/objectify.pyx":1636
24324 * # default anyway, so just accept it if given as
24325 * # type information
24326 * pytype = _check_type(c_node, pytype) # <<<<<<<<<<<<<<
24328 * if pytype is None:
24330 __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_9objectify__check_type(__pyx_v_c_node, __pyx_v_pytype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error)
24331 __Pyx_GOTREF(__pyx_t_1);
24332 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
24335 /* "lxml/objectify.pyx":1632
24336 * old_pytypename = "NoneType"
24337 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24338 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24339 * # StrType does not have a typecheck but is the
24340 * # default anyway, so just accept it if given as
24346 /* "lxml/objectify.pyx":1621
24347 * old_pytypename = cetree.attributeValueFromNsName(
24348 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24349 * if old_pytypename is not None: # <<<<<<<<<<<<<<
24350 * if old_pytypename == TREE_PYTYPE_NAME:
24351 * if not cetree.hasChild(c_node):
24355 /* "lxml/objectify.pyx":1617
24358 * if pytype is None and not ignore_pytype: # <<<<<<<<<<<<<<
24359 * # check that old pytype value is valid
24360 * old_pytypename = cetree.attributeValueFromNsName(
24364 /* "lxml/objectify.pyx":1638
24365 * pytype = _check_type(c_node, pytype)
24367 * if pytype is None: # <<<<<<<<<<<<<<
24368 * # try to guess type
24369 * if not cetree.hasChild(c_node):
24371 __pyx_t_3 = (((PyObject *)__pyx_v_pytype) == Py_None);
24372 __pyx_t_2 = (__pyx_t_3 != 0);
24375 /* "lxml/objectify.pyx":1640
24376 * if pytype is None:
24377 * # try to guess type
24378 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24379 * # element has no children => data class
24380 * pytype = _guessPyType(textOf(c_node), StrType)
24382 __pyx_t_2 = ((!(hasChild(__pyx_v_c_node) != 0)) != 0);
24385 /* "lxml/objectify.pyx":1642
24386 * if not cetree.hasChild(c_node):
24387 * # element has no children => data class
24388 * pytype = _guessPyType(textOf(c_node), StrType) # <<<<<<<<<<<<<<
24392 __pyx_t_1 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error)
24393 __Pyx_GOTREF(__pyx_t_1);
24394 __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_9objectify__guessPyType(__pyx_t_1, __pyx_v_StrType)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1642, __pyx_L1_error)
24395 __Pyx_GOTREF(__pyx_t_6);
24396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24397 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24400 /* "lxml/objectify.pyx":1640
24401 * if pytype is None:
24402 * # try to guess type
24403 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24404 * # element has no children => data class
24405 * pytype = _guessPyType(textOf(c_node), StrType)
24410 /* "lxml/objectify.pyx":1644
24411 * pytype = _guessPyType(textOf(c_node), StrType)
24413 * istree = 1 # <<<<<<<<<<<<<<
24415 * if pytype is None:
24418 __pyx_v_istree = 1;
24422 /* "lxml/objectify.pyx":1638
24423 * pytype = _check_type(c_node, pytype)
24425 * if pytype is None: # <<<<<<<<<<<<<<
24426 * # try to guess type
24427 * if not cetree.hasChild(c_node):
24431 /* "lxml/objectify.pyx":1646
24434 * if pytype is None: # <<<<<<<<<<<<<<
24435 * # use default type for empty elements
24436 * if cetree.hasText(c_node):
24438 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) == Py_None);
24439 __pyx_t_3 = (__pyx_t_2 != 0);
24442 /* "lxml/objectify.pyx":1648
24443 * if pytype is None:
24444 * # use default type for empty elements
24445 * if cetree.hasText(c_node): # <<<<<<<<<<<<<<
24449 __pyx_t_3 = (hasText(__pyx_v_c_node) != 0);
24452 /* "lxml/objectify.pyx":1649
24453 * # use default type for empty elements
24454 * if cetree.hasText(c_node):
24455 * pytype = StrType # <<<<<<<<<<<<<<
24457 * pytype = empty_pytype
24459 __Pyx_INCREF(((PyObject *)__pyx_v_StrType));
24460 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_StrType);
24462 /* "lxml/objectify.pyx":1648
24463 * if pytype is None:
24464 * # use default type for empty elements
24465 * if cetree.hasText(c_node): # <<<<<<<<<<<<<<
24472 /* "lxml/objectify.pyx":1651
24475 * pytype = empty_pytype # <<<<<<<<<<<<<<
24476 * if typename is None:
24477 * typename = empty_type_name
24480 __Pyx_INCREF(((PyObject *)__pyx_v_empty_pytype));
24481 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_empty_pytype);
24483 /* "lxml/objectify.pyx":1652
24485 * pytype = empty_pytype
24486 * if typename is None: # <<<<<<<<<<<<<<
24487 * typename = empty_type_name
24490 __pyx_t_3 = (__pyx_v_typename == Py_None);
24491 __pyx_t_2 = (__pyx_t_3 != 0);
24494 /* "lxml/objectify.pyx":1653
24495 * pytype = empty_pytype
24496 * if typename is None:
24497 * typename = empty_type_name # <<<<<<<<<<<<<<
24499 * if pytype is not None:
24501 __Pyx_INCREF(__pyx_v_empty_type_name);
24502 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_v_empty_type_name);
24504 /* "lxml/objectify.pyx":1652
24506 * pytype = empty_pytype
24507 * if typename is None: # <<<<<<<<<<<<<<
24508 * typename = empty_type_name
24515 /* "lxml/objectify.pyx":1646
24518 * if pytype is None: # <<<<<<<<<<<<<<
24519 * # use default type for empty elements
24520 * if cetree.hasText(c_node):
24524 /* "lxml/objectify.pyx":1655
24525 * typename = empty_type_name
24527 * if pytype is not None: # <<<<<<<<<<<<<<
24528 * if typename is None:
24531 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24532 __pyx_t_3 = (__pyx_t_2 != 0);
24535 /* "lxml/objectify.pyx":1656
24537 * if pytype is not None:
24538 * if typename is None: # <<<<<<<<<<<<<<
24540 * if pytype._schema_types:
24542 __pyx_t_3 = (__pyx_v_typename == Py_None);
24543 __pyx_t_2 = (__pyx_t_3 != 0);
24546 /* "lxml/objectify.pyx":1657
24547 * if pytype is not None:
24548 * if typename is None:
24549 * if not istree: # <<<<<<<<<<<<<<
24550 * if pytype._schema_types:
24551 * # pytype->xsi:type is a 1:n mapping
24553 __pyx_t_2 = ((!(__pyx_v_istree != 0)) != 0);
24556 /* "lxml/objectify.pyx":1658
24557 * if typename is None:
24559 * if pytype._schema_types: # <<<<<<<<<<<<<<
24560 * # pytype->xsi:type is a 1:n mapping
24561 * # simply take the first
24563 __pyx_t_2 = (__pyx_v_pytype->_schema_types != Py_None)&&(PyList_GET_SIZE(__pyx_v_pytype->_schema_types) != 0);
24566 /* "lxml/objectify.pyx":1661
24567 * # pytype->xsi:type is a 1:n mapping
24568 * # simply take the first
24569 * typename = pytype._schema_types[0] # <<<<<<<<<<<<<<
24570 * elif typename not in pytype._schema_types:
24571 * typename = pytype._schema_types[0]
24573 if (unlikely(__pyx_v_pytype->_schema_types == Py_None)) {
24574 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24575 __PYX_ERR(0, 1661, __pyx_L1_error)
24577 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_pytype->_schema_types, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1661, __pyx_L1_error)
24578 __Pyx_GOTREF(__pyx_t_6);
24579 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24582 /* "lxml/objectify.pyx":1658
24583 * if typename is None:
24585 * if pytype._schema_types: # <<<<<<<<<<<<<<
24586 * # pytype->xsi:type is a 1:n mapping
24587 * # simply take the first
24591 /* "lxml/objectify.pyx":1657
24592 * if pytype is not None:
24593 * if typename is None:
24594 * if not istree: # <<<<<<<<<<<<<<
24595 * if pytype._schema_types:
24596 * # pytype->xsi:type is a 1:n mapping
24600 /* "lxml/objectify.pyx":1656
24602 * if pytype is not None:
24603 * if typename is None: # <<<<<<<<<<<<<<
24605 * if pytype._schema_types:
24610 /* "lxml/objectify.pyx":1662
24611 * # simply take the first
24612 * typename = pytype._schema_types[0]
24613 * elif typename not in pytype._schema_types: # <<<<<<<<<<<<<<
24614 * typename = pytype._schema_types[0]
24617 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_typename, __pyx_v_pytype->_schema_types, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1662, __pyx_L1_error)
24618 __pyx_t_3 = (__pyx_t_2 != 0);
24621 /* "lxml/objectify.pyx":1663
24622 * typename = pytype._schema_types[0]
24623 * elif typename not in pytype._schema_types:
24624 * typename = pytype._schema_types[0] # <<<<<<<<<<<<<<
24628 if (unlikely(__pyx_v_pytype->_schema_types == Py_None)) {
24629 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24630 __PYX_ERR(0, 1663, __pyx_L1_error)
24632 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_pytype->_schema_types, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1663, __pyx_L1_error)
24633 __Pyx_GOTREF(__pyx_t_6);
24634 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24637 /* "lxml/objectify.pyx":1662
24638 * # simply take the first
24639 * typename = pytype._schema_types[0]
24640 * elif typename not in pytype._schema_types: # <<<<<<<<<<<<<<
24641 * typename = pytype._schema_types[0]
24647 /* "lxml/objectify.pyx":1655
24648 * typename = empty_type_name
24650 * if pytype is not None: # <<<<<<<<<<<<<<
24651 * if typename is None:
24656 /* "lxml/objectify.pyx":1665
24657 * typename = pytype._schema_types[0]
24659 * if annotate_xsi: # <<<<<<<<<<<<<<
24660 * if typename is None or istree:
24661 * cetree.delAttributeFromNsName(
24663 __pyx_t_3 = (__pyx_v_annotate_xsi != 0);
24666 /* "lxml/objectify.pyx":1666
24669 * if typename is None or istree: # <<<<<<<<<<<<<<
24670 * cetree.delAttributeFromNsName(
24671 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24673 __pyx_t_2 = (__pyx_v_typename == Py_None);
24674 __pyx_t_4 = (__pyx_t_2 != 0);
24677 __pyx_t_3 = __pyx_t_4;
24678 goto __pyx_L38_bool_binop_done;
24680 __pyx_t_4 = (__pyx_v_istree != 0);
24681 __pyx_t_3 = __pyx_t_4;
24682 __pyx_L38_bool_binop_done:;
24685 /* "lxml/objectify.pyx":1667
24687 * if typename is None or istree:
24688 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
24689 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24692 (void)(delAttributeFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"type")))));
24694 /* "lxml/objectify.pyx":1666
24697 * if typename is None or istree: # <<<<<<<<<<<<<<
24698 * cetree.delAttributeFromNsName(
24699 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24704 /* "lxml/objectify.pyx":1671
24706 * # update or create attribute
24707 * typename_utf8 = cetree.utf8(typename) # <<<<<<<<<<<<<<
24708 * c_ns = cetree.findOrBuildNodeNsPrefix(
24709 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24712 __pyx_t_6 = utf8(__pyx_v_typename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1671, __pyx_L1_error)
24713 __Pyx_GOTREF(__pyx_t_6);
24714 __pyx_v_typename_utf8 = __pyx_t_6;
24717 /* "lxml/objectify.pyx":1672
24718 * # update or create attribute
24719 * typename_utf8 = cetree.utf8(typename)
24720 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
24721 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24722 * if c_ns is not NULL:
24724 __pyx_v_c_ns = findOrBuildNodeNsPrefix(__pyx_v_doc, __pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_NS, ((unsigned char *)((unsigned char *)((char const *)"xsd"))));
24726 /* "lxml/objectify.pyx":1674
24727 * c_ns = cetree.findOrBuildNodeNsPrefix(
24728 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24729 * if c_ns is not NULL: # <<<<<<<<<<<<<<
24730 * if b':' in typename_utf8:
24731 * prefix, name = typename_utf8.split(b':', 1)
24733 __pyx_t_3 = ((__pyx_v_c_ns != NULL) != 0);
24736 /* "lxml/objectify.pyx":1675
24737 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24738 * if c_ns is not NULL:
24739 * if b':' in typename_utf8: # <<<<<<<<<<<<<<
24740 * prefix, name = typename_utf8.split(b':', 1)
24741 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24743 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__17, __pyx_v_typename_utf8, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1675, __pyx_L1_error)
24744 __pyx_t_4 = (__pyx_t_3 != 0);
24747 /* "lxml/objectify.pyx":1676
24748 * if c_ns is not NULL:
24749 * if b':' in typename_utf8:
24750 * prefix, name = typename_utf8.split(b':', 1) # <<<<<<<<<<<<<<
24751 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24752 * typename_utf8 = name
24754 __pyx_t_6 = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyBytes_Type_split, __pyx_v_typename_utf8, __pyx_kp_b__17, __pyx_int_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1676, __pyx_L1_error)
24755 __Pyx_GOTREF(__pyx_t_6);
24756 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
24757 PyObject* sequence = __pyx_t_6;
24758 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24759 if (unlikely(size != 2)) {
24760 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24761 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24762 __PYX_ERR(0, 1676, __pyx_L1_error)
24764 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24765 if (likely(PyTuple_CheckExact(sequence))) {
24766 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
24767 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
24769 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
24770 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
24772 __Pyx_INCREF(__pyx_t_1);
24773 __Pyx_INCREF(__pyx_t_5);
24775 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
24776 __Pyx_GOTREF(__pyx_t_1);
24777 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L1_error)
24778 __Pyx_GOTREF(__pyx_t_5);
24780 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24782 Py_ssize_t index = -1;
24783 __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1676, __pyx_L1_error)
24784 __Pyx_GOTREF(__pyx_t_7);
24785 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24786 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
24787 index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L42_unpacking_failed;
24788 __Pyx_GOTREF(__pyx_t_1);
24789 index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L42_unpacking_failed;
24790 __Pyx_GOTREF(__pyx_t_5);
24791 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
24793 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24794 goto __pyx_L43_unpacking_done;
24795 __pyx_L42_unpacking_failed:;
24796 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24798 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
24799 __PYX_ERR(0, 1676, __pyx_L1_error)
24800 __pyx_L43_unpacking_done:;
24802 __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_1);
24804 __pyx_v_name = __pyx_t_5;
24807 /* "lxml/objectify.pyx":1677
24808 * if b':' in typename_utf8:
24809 * prefix, name = typename_utf8.split(b':', 1)
24810 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0': # <<<<<<<<<<<<<<
24811 * typename_utf8 = name
24812 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24814 __pyx_t_3 = ((__pyx_v_c_ns->prefix == NULL) != 0);
24817 __pyx_t_4 = __pyx_t_3;
24818 goto __pyx_L45_bool_binop_done;
24820 __pyx_t_3 = (((__pyx_v_c_ns->prefix[0]) == '\x00') != 0);
24821 __pyx_t_4 = __pyx_t_3;
24822 __pyx_L45_bool_binop_done:;
24825 /* "lxml/objectify.pyx":1678
24826 * prefix, name = typename_utf8.split(b':', 1)
24827 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24828 * typename_utf8 = name # <<<<<<<<<<<<<<
24829 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24830 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24832 __Pyx_INCREF(__pyx_v_name);
24833 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_v_name);
24835 /* "lxml/objectify.pyx":1677
24836 * if b':' in typename_utf8:
24837 * prefix, name = typename_utf8.split(b':', 1)
24838 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0': # <<<<<<<<<<<<<<
24839 * typename_utf8 = name
24840 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24845 /* "lxml/objectify.pyx":1679
24846 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24847 * typename_utf8 = name
24848 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0: # <<<<<<<<<<<<<<
24849 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24850 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24852 __pyx_t_4 = ((xmlStrcmp((const xmlChar*)PyBytes_AS_STRING(__pyx_v_prefix), __pyx_v_c_ns->prefix) != 0) != 0);
24855 /* "lxml/objectify.pyx":1680
24856 * typename_utf8 = name
24857 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24858 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name # <<<<<<<<<<<<<<
24859 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24860 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24862 __pyx_t_6 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_ns->prefix)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L1_error)
24863 __Pyx_GOTREF(__pyx_t_6);
24864 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1680, __pyx_L1_error)
24865 __Pyx_GOTREF(__pyx_t_5);
24866 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24867 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L1_error)
24868 __Pyx_GOTREF(__pyx_t_6);
24869 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24870 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_t_6);
24873 /* "lxml/objectify.pyx":1679
24874 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24875 * typename_utf8 = name
24876 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0: # <<<<<<<<<<<<<<
24877 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24878 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24883 /* "lxml/objectify.pyx":1675
24884 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24885 * if c_ns is not NULL:
24886 * if b':' in typename_utf8: # <<<<<<<<<<<<<<
24887 * prefix, name = typename_utf8.split(b':', 1)
24888 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24893 /* "lxml/objectify.pyx":1681
24894 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24895 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24896 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0': # <<<<<<<<<<<<<<
24897 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24898 * c_ns = cetree.findOrBuildNodeNsPrefix(
24900 __pyx_t_3 = ((__pyx_v_c_ns->prefix != NULL) != 0);
24903 __pyx_t_4 = __pyx_t_3;
24904 goto __pyx_L47_bool_binop_done;
24906 __pyx_t_3 = (((__pyx_v_c_ns->prefix[0]) != '\x00') != 0);
24907 __pyx_t_4 = __pyx_t_3;
24908 __pyx_L47_bool_binop_done:;
24911 /* "lxml/objectify.pyx":1682
24912 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24913 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24914 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8 # <<<<<<<<<<<<<<
24915 * c_ns = cetree.findOrBuildNodeNsPrefix(
24916 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24918 __pyx_t_6 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_ns->prefix)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error)
24919 __Pyx_GOTREF(__pyx_t_6);
24920 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error)
24921 __Pyx_GOTREF(__pyx_t_5);
24922 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24923 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_typename_utf8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error)
24924 __Pyx_GOTREF(__pyx_t_6);
24925 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24926 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_t_6);
24929 /* "lxml/objectify.pyx":1681
24930 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24931 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24932 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0': # <<<<<<<<<<<<<<
24933 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24934 * c_ns = cetree.findOrBuildNodeNsPrefix(
24939 /* "lxml/objectify.pyx":1674
24940 * c_ns = cetree.findOrBuildNodeNsPrefix(
24941 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24942 * if c_ns is not NULL: # <<<<<<<<<<<<<<
24943 * if b':' in typename_utf8:
24944 * prefix, name = typename_utf8.split(b':', 1)
24948 /* "lxml/objectify.pyx":1683
24949 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24950 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24951 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
24952 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24953 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
24955 __pyx_v_c_ns = findOrBuildNodeNsPrefix(__pyx_v_doc, __pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"xsi"))));
24957 /* "lxml/objectify.pyx":1685
24958 * c_ns = cetree.findOrBuildNodeNsPrefix(
24959 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24960 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8)) # <<<<<<<<<<<<<<
24962 * if annotate_pytype:
24964 (void)(xmlSetNsProp(__pyx_v_c_node, __pyx_v_c_ns, ((unsigned char *)((unsigned char *)((char const *)"type"))), (const xmlChar*)PyBytes_AS_STRING(__pyx_v_typename_utf8)));
24968 /* "lxml/objectify.pyx":1665
24969 * typename = pytype._schema_types[0]
24971 * if annotate_xsi: # <<<<<<<<<<<<<<
24972 * if typename is None or istree:
24973 * cetree.delAttributeFromNsName(
24977 /* "lxml/objectify.pyx":1687
24978 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
24980 * if annotate_pytype: # <<<<<<<<<<<<<<
24981 * if pytype is None:
24982 * # delete attribute if it exists
24984 __pyx_t_4 = (__pyx_v_annotate_pytype != 0);
24987 /* "lxml/objectify.pyx":1688
24989 * if annotate_pytype:
24990 * if pytype is None: # <<<<<<<<<<<<<<
24991 * # delete attribute if it exists
24992 * cetree.delAttributeFromNsName(
24994 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
24995 __pyx_t_3 = (__pyx_t_4 != 0);
24998 /* "lxml/objectify.pyx":1690
24999 * if pytype is None:
25000 * # delete attribute if it exists
25001 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
25002 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
25005 (void)(delAttributeFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME));
25007 /* "lxml/objectify.pyx":1688
25009 * if annotate_pytype:
25010 * if pytype is None: # <<<<<<<<<<<<<<
25011 * # delete attribute if it exists
25012 * cetree.delAttributeFromNsName(
25017 /* "lxml/objectify.pyx":1694
25019 * # update or create attribute
25020 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
25021 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25022 * pytype_name = cetree.utf8(pytype.name)
25026 /* "lxml/objectify.pyx":1695
25027 * # update or create attribute
25028 * c_ns = cetree.findOrBuildNodeNsPrefix(
25029 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py') # <<<<<<<<<<<<<<
25030 * pytype_name = cetree.utf8(pytype.name)
25031 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25033 __pyx_v_c_ns = findOrBuildNodeNsPrefix(__pyx_v_doc, __pyx_v_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, ((unsigned char *)((unsigned char *)((char const *)"py"))));
25035 /* "lxml/objectify.pyx":1696
25036 * c_ns = cetree.findOrBuildNodeNsPrefix(
25037 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25038 * pytype_name = cetree.utf8(pytype.name) # <<<<<<<<<<<<<<
25039 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25040 * _xcstr(pytype_name))
25042 __pyx_t_6 = __pyx_v_pytype->name;
25043 __Pyx_INCREF(__pyx_t_6);
25044 __pyx_t_5 = utf8(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1696, __pyx_L1_error)
25045 __Pyx_GOTREF(__pyx_t_5);
25046 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25047 __pyx_v_pytype_name = ((PyObject*)__pyx_t_5);
25050 /* "lxml/objectify.pyx":1697
25051 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25052 * pytype_name = cetree.utf8(pytype.name)
25053 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME, # <<<<<<<<<<<<<<
25054 * _xcstr(pytype_name))
25055 * if pytype is NoneType:
25057 (void)(xmlSetNsProp(__pyx_v_c_node, __pyx_v_c_ns, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_pytype_name)));
25059 /* "lxml/objectify.pyx":1699
25060 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25061 * _xcstr(pytype_name))
25062 * if pytype is NoneType: # <<<<<<<<<<<<<<
25063 * c_ns = cetree.findOrBuildNodeNsPrefix(
25064 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25066 __pyx_t_3 = (__pyx_v_pytype == __pyx_v_NoneType);
25067 __pyx_t_4 = (__pyx_t_3 != 0);
25070 /* "lxml/objectify.pyx":1700
25071 * _xcstr(pytype_name))
25072 * if pytype is NoneType:
25073 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
25074 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25075 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true")
25077 __pyx_v_c_ns = findOrBuildNodeNsPrefix(__pyx_v_doc, __pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"xsi"))));
25079 /* "lxml/objectify.pyx":1702
25080 * c_ns = cetree.findOrBuildNodeNsPrefix(
25081 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25082 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true") # <<<<<<<<<<<<<<
25086 (void)(xmlSetNsProp(__pyx_v_c_node, __pyx_v_c_ns, ((unsigned char *)((unsigned char *)((char const *)"nil"))), ((unsigned char *)((unsigned char *)((char const *)"true")))));
25088 /* "lxml/objectify.pyx":1699
25089 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25090 * _xcstr(pytype_name))
25091 * if pytype is NoneType: # <<<<<<<<<<<<<<
25092 * c_ns = cetree.findOrBuildNodeNsPrefix(
25093 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25099 /* "lxml/objectify.pyx":1687
25100 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
25102 * if annotate_pytype: # <<<<<<<<<<<<<<
25103 * if pytype is None:
25104 * # delete attribute if it exists
25108 /* "lxml/objectify.pyx":1704
25109 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true")
25111 * return 0 # <<<<<<<<<<<<<<
25113 * cdef object _strip_attributes = etree.strip_attributes
25118 /* "lxml/objectify.pyx":1585
25119 * tree.END_FOR_EACH_ELEMENT_FROM(c_node)
25121 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc, # <<<<<<<<<<<<<<
25122 * bint annotate_xsi, bint annotate_pytype,
25123 * bint ignore_xsi, bint ignore_pytype,
25126 /* function exit code */
25128 __Pyx_XDECREF(__pyx_t_1);
25129 __Pyx_XDECREF(__pyx_t_5);
25130 __Pyx_XDECREF(__pyx_t_6);
25131 __Pyx_XDECREF(__pyx_t_7);
25132 __Pyx_AddTraceback("lxml.objectify._annotate_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
25135 __Pyx_XDECREF((PyObject *)__pyx_v_pytype);
25136 __Pyx_XDECREF(__pyx_v_typename);
25137 __Pyx_XDECREF(__pyx_v_prefix);
25138 __Pyx_XDECREF(__pyx_v_old_pytypename);
25139 __Pyx_XDECREF(__pyx_v_typename_utf8);
25140 __Pyx_XDECREF(__pyx_v_name);
25141 __Pyx_XDECREF(__pyx_v_pytype_name);
25142 __Pyx_RefNannyFinishContext();
25146 /* "lxml/objectify.pyx":1709
25147 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25149 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25150 * bint xsi_nil=False, bint cleanup_namespaces=False):
25151 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25154 /* Python wrapper */
25155 static PyObject *__pyx_pw_4lxml_9objectify_27deannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25156 static char __pyx_doc_4lxml_9objectify_26deannotate[] = "deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)\n\n Recursively de-annotate the elements of an XML tree by removing 'py:pytype'\n and/or 'xsi:type' attributes and/or 'xsi:nil' attributes.\n\n If the 'pytype' keyword argument is True (the default), 'py:pytype'\n attributes will be removed. If the 'xsi' keyword argument is True (the \n default), 'xsi:type' attributes will be removed.\n If the 'xsi_nil' keyword argument is True (default: False), 'xsi:nil'\n attributes will be removed.\n\n Note that this does not touch the namespace declarations by\n default. If you want to remove unused namespace declarations from\n the tree, pass the option ``cleanup_namespaces=True``.\n ";
25157 static PyMethodDef __pyx_mdef_4lxml_9objectify_27deannotate = {"deannotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_27deannotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_26deannotate};
25158 static PyObject *__pyx_pw_4lxml_9objectify_27deannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25159 PyObject *__pyx_v_element_or_tree = 0;
25160 int __pyx_v_pytype;
25162 int __pyx_v_xsi_nil;
25163 int __pyx_v_cleanup_namespaces;
25164 int __pyx_lineno = 0;
25165 const char *__pyx_filename = NULL;
25166 int __pyx_clineno = 0;
25167 PyObject *__pyx_r = 0;
25168 __Pyx_RefNannyDeclarations
25169 __Pyx_RefNannySetupContext("deannotate (wrapper)", 0);
25171 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_element_or_tree,&__pyx_n_s_pytype,&__pyx_n_s_xsi_2,&__pyx_n_s_xsi_nil,&__pyx_n_s_cleanup_namespaces,0};
25172 PyObject* values[5] = {0,0,0,0,0};
25173 if (unlikely(__pyx_kwds)) {
25174 Py_ssize_t kw_args;
25175 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25176 switch (pos_args) {
25177 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25178 CYTHON_FALLTHROUGH;
25180 default: goto __pyx_L5_argtuple_error;
25182 kw_args = PyDict_Size(__pyx_kwds);
25183 switch (pos_args) {
25185 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
25186 else goto __pyx_L5_argtuple_error;
25188 if (kw_args > 0 && likely(kw_args <= 4)) {
25190 for (index = 1; index < 5 && kw_args > 0; index++) {
25191 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
25192 if (value) { values[index] = value; kw_args--; }
25195 if (unlikely(kw_args > 0)) {
25196 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deannotate") < 0)) __PYX_ERR(0, 1709, __pyx_L3_error)
25198 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
25199 goto __pyx_L5_argtuple_error;
25201 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25203 __pyx_v_element_or_tree = values[0];
25205 __pyx_v_pytype = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
25207 __pyx_v_pytype = ((int)((int)1));
25210 __pyx_v_xsi = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_xsi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
25212 __pyx_v_xsi = ((int)((int)1));
25215 __pyx_v_xsi_nil = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_xsi_nil == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L3_error)
25218 /* "lxml/objectify.pyx":1710
25220 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
25221 * bint xsi_nil=False, bint cleanup_namespaces=False): # <<<<<<<<<<<<<<
25222 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25225 __pyx_v_xsi_nil = ((int)((int)0));
25228 __pyx_v_cleanup_namespaces = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_cleanup_namespaces == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L3_error)
25230 __pyx_v_cleanup_namespaces = ((int)((int)0));
25233 goto __pyx_L4_argument_unpacking_done;
25234 __pyx_L5_argtuple_error:;
25235 __Pyx_RaiseArgtupleInvalid("deannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1709, __pyx_L3_error)
25237 __Pyx_AddTraceback("lxml.objectify.deannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
25238 __Pyx_RefNannyFinishContext();
25240 __pyx_L4_argument_unpacking_done:;
25241 __pyx_r = __pyx_pf_4lxml_9objectify_26deannotate(__pyx_self, __pyx_v_element_or_tree, __pyx_v_pytype, __pyx_v_xsi, __pyx_v_xsi_nil, __pyx_v_cleanup_namespaces);
25243 /* "lxml/objectify.pyx":1709
25244 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25246 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25247 * bint xsi_nil=False, bint cleanup_namespaces=False):
25248 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25251 /* function exit code */
25252 __Pyx_RefNannyFinishContext();
25256 static PyObject *__pyx_pf_4lxml_9objectify_26deannotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_element_or_tree, int __pyx_v_pytype, int __pyx_v_xsi, int __pyx_v_xsi_nil, int __pyx_v_cleanup_namespaces) {
25257 PyObject *__pyx_v_attribute_names = 0;
25258 PyObject *__pyx_r = NULL;
25259 __Pyx_RefNannyDeclarations
25260 PyObject *__pyx_t_1 = NULL;
25263 PyObject *__pyx_t_4 = NULL;
25264 PyObject *__pyx_t_5 = NULL;
25265 int __pyx_lineno = 0;
25266 const char *__pyx_filename = NULL;
25267 int __pyx_clineno = 0;
25268 __Pyx_RefNannySetupContext("deannotate", 0);
25270 /* "lxml/objectify.pyx":1726
25271 * the tree, pass the option ``cleanup_namespaces=True``.
25273 * cdef list attribute_names = [] # <<<<<<<<<<<<<<
25277 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __pyx_L1_error)
25278 __Pyx_GOTREF(__pyx_t_1);
25279 __pyx_v_attribute_names = ((PyObject*)__pyx_t_1);
25282 /* "lxml/objectify.pyx":1728
25283 * cdef list attribute_names = []
25285 * if pytype: # <<<<<<<<<<<<<<
25286 * attribute_names.append(PYTYPE_ATTRIBUTE)
25289 __pyx_t_2 = (__pyx_v_pytype != 0);
25292 /* "lxml/objectify.pyx":1729
25295 * attribute_names.append(PYTYPE_ATTRIBUTE) # <<<<<<<<<<<<<<
25297 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25299 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1729, __pyx_L1_error)
25300 __Pyx_GOTREF(__pyx_t_1);
25301 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1729, __pyx_L1_error)
25302 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25304 /* "lxml/objectify.pyx":1728
25305 * cdef list attribute_names = []
25307 * if pytype: # <<<<<<<<<<<<<<
25308 * attribute_names.append(PYTYPE_ATTRIBUTE)
25313 /* "lxml/objectify.pyx":1730
25315 * attribute_names.append(PYTYPE_ATTRIBUTE)
25316 * if xsi: # <<<<<<<<<<<<<<
25317 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25320 __pyx_t_2 = (__pyx_v_xsi != 0);
25323 /* "lxml/objectify.pyx":1731
25324 * attribute_names.append(PYTYPE_ATTRIBUTE)
25326 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR) # <<<<<<<<<<<<<<
25328 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25330 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR;
25331 __Pyx_INCREF(__pyx_t_1);
25332 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1731, __pyx_L1_error)
25333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25335 /* "lxml/objectify.pyx":1730
25337 * attribute_names.append(PYTYPE_ATTRIBUTE)
25338 * if xsi: # <<<<<<<<<<<<<<
25339 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25344 /* "lxml/objectify.pyx":1732
25346 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25347 * if xsi_nil: # <<<<<<<<<<<<<<
25348 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25351 __pyx_t_2 = (__pyx_v_xsi_nil != 0);
25354 /* "lxml/objectify.pyx":1733
25355 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25357 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR) # <<<<<<<<<<<<<<
25359 * _strip_attributes(element_or_tree, *attribute_names)
25361 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
25362 __Pyx_INCREF(__pyx_t_1);
25363 __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_attribute_names, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1733, __pyx_L1_error)
25364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25366 /* "lxml/objectify.pyx":1732
25368 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25369 * if xsi_nil: # <<<<<<<<<<<<<<
25370 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25375 /* "lxml/objectify.pyx":1735
25376 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25378 * _strip_attributes(element_or_tree, *attribute_names) # <<<<<<<<<<<<<<
25379 * if cleanup_namespaces:
25380 * _cleanup_namespaces(element_or_tree)
25382 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
25383 __Pyx_GOTREF(__pyx_t_1);
25384 __Pyx_INCREF(__pyx_v_element_or_tree);
25385 __Pyx_GIVEREF(__pyx_v_element_or_tree);
25386 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_element_or_tree);
25387 __pyx_t_4 = PySequence_Tuple(__pyx_v_attribute_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1735, __pyx_L1_error)
25388 __Pyx_GOTREF(__pyx_t_4);
25389 __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1735, __pyx_L1_error)
25390 __Pyx_GOTREF(__pyx_t_5);
25391 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25393 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__strip_attributes, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1735, __pyx_L1_error)
25394 __Pyx_GOTREF(__pyx_t_4);
25395 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25396 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25398 /* "lxml/objectify.pyx":1736
25400 * _strip_attributes(element_or_tree, *attribute_names)
25401 * if cleanup_namespaces: # <<<<<<<<<<<<<<
25402 * _cleanup_namespaces(element_or_tree)
25405 __pyx_t_2 = (__pyx_v_cleanup_namespaces != 0);
25408 /* "lxml/objectify.pyx":1737
25409 * _strip_attributes(element_or_tree, *attribute_names)
25410 * if cleanup_namespaces:
25411 * _cleanup_namespaces(element_or_tree) # <<<<<<<<<<<<<<
25413 * ################################################################################
25415 __Pyx_INCREF(__pyx_v_4lxml_9objectify__cleanup_namespaces);
25416 __pyx_t_5 = __pyx_v_4lxml_9objectify__cleanup_namespaces; __pyx_t_1 = NULL;
25417 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
25418 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
25419 if (likely(__pyx_t_1)) {
25420 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
25421 __Pyx_INCREF(__pyx_t_1);
25422 __Pyx_INCREF(function);
25423 __Pyx_DECREF_SET(__pyx_t_5, function);
25426 __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_element_or_tree) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_element_or_tree);
25427 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25428 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1737, __pyx_L1_error)
25429 __Pyx_GOTREF(__pyx_t_4);
25430 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25431 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25433 /* "lxml/objectify.pyx":1736
25435 * _strip_attributes(element_or_tree, *attribute_names)
25436 * if cleanup_namespaces: # <<<<<<<<<<<<<<
25437 * _cleanup_namespaces(element_or_tree)
25442 /* "lxml/objectify.pyx":1709
25443 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25445 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25446 * bint xsi_nil=False, bint cleanup_namespaces=False):
25447 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25450 /* function exit code */
25451 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25454 __Pyx_XDECREF(__pyx_t_1);
25455 __Pyx_XDECREF(__pyx_t_4);
25456 __Pyx_XDECREF(__pyx_t_5);
25457 __Pyx_AddTraceback("lxml.objectify.deannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
25460 __Pyx_XDECREF(__pyx_v_attribute_names);
25461 __Pyx_XGIVEREF(__pyx_r);
25462 __Pyx_RefNannyFinishContext();
25466 /* "lxml/objectify.pyx":1749
25467 * objectify_parser = __DEFAULT_PARSER
25469 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
25470 * u"""set_default_parser(new_parser = None)
25474 /* Python wrapper */
25475 static PyObject *__pyx_pw_4lxml_9objectify_29set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25476 static char __pyx_doc_4lxml_9objectify_28set_default_parser[] = "set_default_parser(new_parser = None)\n\n Replace the default parser used by objectify's Element() and\n fromstring() functions.\n\n The new parser must be an etree.XMLParser.\n\n Call without arguments to reset to the original parser.\n ";
25477 static PyMethodDef __pyx_mdef_4lxml_9objectify_29set_default_parser = {"set_default_parser", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_29set_default_parser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_28set_default_parser};
25478 static PyObject *__pyx_pw_4lxml_9objectify_29set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25479 PyObject *__pyx_v_new_parser = 0;
25480 int __pyx_lineno = 0;
25481 const char *__pyx_filename = NULL;
25482 int __pyx_clineno = 0;
25483 PyObject *__pyx_r = 0;
25484 __Pyx_RefNannyDeclarations
25485 __Pyx_RefNannySetupContext("set_default_parser (wrapper)", 0);
25487 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_parser,0};
25488 PyObject* values[1] = {0};
25489 values[0] = ((PyObject *)((PyObject *)Py_None));
25490 if (unlikely(__pyx_kwds)) {
25491 Py_ssize_t kw_args;
25492 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25493 switch (pos_args) {
25494 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25495 CYTHON_FALLTHROUGH;
25497 default: goto __pyx_L5_argtuple_error;
25499 kw_args = PyDict_Size(__pyx_kwds);
25500 switch (pos_args) {
25503 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_parser);
25504 if (value) { values[0] = value; kw_args--; }
25507 if (unlikely(kw_args > 0)) {
25508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_default_parser") < 0)) __PYX_ERR(0, 1749, __pyx_L3_error)
25511 switch (PyTuple_GET_SIZE(__pyx_args)) {
25512 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25513 CYTHON_FALLTHROUGH;
25515 default: goto __pyx_L5_argtuple_error;
25518 __pyx_v_new_parser = values[0];
25520 goto __pyx_L4_argument_unpacking_done;
25521 __pyx_L5_argtuple_error:;
25522 __Pyx_RaiseArgtupleInvalid("set_default_parser", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1749, __pyx_L3_error)
25524 __Pyx_AddTraceback("lxml.objectify.set_default_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25525 __Pyx_RefNannyFinishContext();
25527 __pyx_L4_argument_unpacking_done:;
25528 __pyx_r = __pyx_pf_4lxml_9objectify_28set_default_parser(__pyx_self, __pyx_v_new_parser);
25530 /* function exit code */
25531 __Pyx_RefNannyFinishContext();
25535 static PyObject *__pyx_pf_4lxml_9objectify_28set_default_parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_new_parser) {
25536 PyObject *__pyx_r = NULL;
25537 __Pyx_RefNannyDeclarations
25540 PyObject *__pyx_t_3 = NULL;
25541 int __pyx_lineno = 0;
25542 const char *__pyx_filename = NULL;
25543 int __pyx_clineno = 0;
25544 __Pyx_RefNannySetupContext("set_default_parser", 0);
25546 /* "lxml/objectify.pyx":1760
25548 * global objectify_parser
25549 * if new_parser is None: # <<<<<<<<<<<<<<
25550 * objectify_parser = __DEFAULT_PARSER
25551 * elif isinstance(new_parser, etree.XMLParser):
25553 __pyx_t_1 = (__pyx_v_new_parser == Py_None);
25554 __pyx_t_2 = (__pyx_t_1 != 0);
25557 /* "lxml/objectify.pyx":1761
25558 * global objectify_parser
25559 * if new_parser is None:
25560 * objectify_parser = __DEFAULT_PARSER # <<<<<<<<<<<<<<
25561 * elif isinstance(new_parser, etree.XMLParser):
25562 * objectify_parser = new_parser
25564 __Pyx_INCREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25565 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
25566 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25567 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25569 /* "lxml/objectify.pyx":1760
25571 * global objectify_parser
25572 * if new_parser is None: # <<<<<<<<<<<<<<
25573 * objectify_parser = __DEFAULT_PARSER
25574 * elif isinstance(new_parser, etree.XMLParser):
25579 /* "lxml/objectify.pyx":1762
25580 * if new_parser is None:
25581 * objectify_parser = __DEFAULT_PARSER
25582 * elif isinstance(new_parser, etree.XMLParser): # <<<<<<<<<<<<<<
25583 * objectify_parser = new_parser
25586 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_XMLParser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1762, __pyx_L1_error)
25587 __Pyx_GOTREF(__pyx_t_3);
25588 __pyx_t_2 = PyObject_IsInstance(__pyx_v_new_parser, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1762, __pyx_L1_error)
25589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25590 __pyx_t_1 = (__pyx_t_2 != 0);
25591 if (likely(__pyx_t_1)) {
25593 /* "lxml/objectify.pyx":1763
25594 * objectify_parser = __DEFAULT_PARSER
25595 * elif isinstance(new_parser, etree.XMLParser):
25596 * objectify_parser = new_parser # <<<<<<<<<<<<<<
25598 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25600 __Pyx_INCREF(__pyx_v_new_parser);
25601 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
25602 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_new_parser);
25603 __Pyx_GIVEREF(__pyx_v_new_parser);
25605 /* "lxml/objectify.pyx":1762
25606 * if new_parser is None:
25607 * objectify_parser = __DEFAULT_PARSER
25608 * elif isinstance(new_parser, etree.XMLParser): # <<<<<<<<<<<<<<
25609 * objectify_parser = new_parser
25615 /* "lxml/objectify.pyx":1765
25616 * objectify_parser = new_parser
25618 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser" # <<<<<<<<<<<<<<
25620 * def makeparser(**kw):
25623 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_parser_must_inherit_from_lxml_et, 0, 0);
25624 __PYX_ERR(0, 1765, __pyx_L1_error)
25628 /* "lxml/objectify.pyx":1749
25629 * objectify_parser = __DEFAULT_PARSER
25631 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
25632 * u"""set_default_parser(new_parser = None)
25636 /* function exit code */
25637 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25640 __Pyx_XDECREF(__pyx_t_3);
25641 __Pyx_AddTraceback("lxml.objectify.set_default_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25644 __Pyx_XGIVEREF(__pyx_r);
25645 __Pyx_RefNannyFinishContext();
25649 /* "lxml/objectify.pyx":1767
25650 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25652 * def makeparser(**kw): # <<<<<<<<<<<<<<
25653 * u"""makeparser(remove_blank_text=True, **kw)
25657 /* Python wrapper */
25658 static PyObject *__pyx_pw_4lxml_9objectify_31makeparser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25659 static char __pyx_doc_4lxml_9objectify_30makeparser[] = "makeparser(remove_blank_text=True, **kw)\n\n Create a new XML parser for objectify trees.\n\n You can pass all keyword arguments that are supported by\n ``etree.XMLParser()``. Note that this parser defaults to removing\n blank text. You can disable this by passing the\n ``remove_blank_text`` boolean keyword option yourself.\n ";
25660 static PyMethodDef __pyx_mdef_4lxml_9objectify_31makeparser = {"makeparser", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_31makeparser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_30makeparser};
25661 static PyObject *__pyx_pw_4lxml_9objectify_31makeparser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25662 PyObject *__pyx_v_kw = 0;
25663 PyObject *__pyx_r = 0;
25664 __Pyx_RefNannyDeclarations
25665 __Pyx_RefNannySetupContext("makeparser (wrapper)", 0);
25666 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
25667 __Pyx_RaiseArgtupleInvalid("makeparser", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
25668 if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "makeparser", 1))) return NULL;
25669 __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
25670 __Pyx_GOTREF(__pyx_v_kw);
25671 __pyx_r = __pyx_pf_4lxml_9objectify_30makeparser(__pyx_self, __pyx_v_kw);
25673 /* function exit code */
25674 __Pyx_XDECREF(__pyx_v_kw);
25675 __Pyx_RefNannyFinishContext();
25679 static PyObject *__pyx_pf_4lxml_9objectify_30makeparser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kw) {
25680 PyObject *__pyx_v_parser = NULL;
25681 PyObject *__pyx_r = NULL;
25682 __Pyx_RefNannyDeclarations
25685 PyObject *__pyx_t_3 = NULL;
25686 PyObject *__pyx_t_4 = NULL;
25687 PyObject *__pyx_t_5 = NULL;
25688 PyObject *__pyx_t_6 = NULL;
25689 int __pyx_lineno = 0;
25690 const char *__pyx_filename = NULL;
25691 int __pyx_clineno = 0;
25692 __Pyx_RefNannySetupContext("makeparser", 0);
25694 /* "lxml/objectify.pyx":1777
25695 * ``remove_blank_text`` boolean keyword option yourself.
25697 * if 'remove_blank_text' not in kw: # <<<<<<<<<<<<<<
25698 * kw['remove_blank_text'] = True
25699 * parser = etree.XMLParser(**kw)
25701 __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_remove_blank_text, __pyx_v_kw, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1777, __pyx_L1_error)
25702 __pyx_t_2 = (__pyx_t_1 != 0);
25705 /* "lxml/objectify.pyx":1778
25707 * if 'remove_blank_text' not in kw:
25708 * kw['remove_blank_text'] = True # <<<<<<<<<<<<<<
25709 * parser = etree.XMLParser(**kw)
25710 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25712 if (unlikely(PyDict_SetItem(__pyx_v_kw, __pyx_n_s_remove_blank_text, Py_True) < 0)) __PYX_ERR(0, 1778, __pyx_L1_error)
25714 /* "lxml/objectify.pyx":1777
25715 * ``remove_blank_text`` boolean keyword option yourself.
25717 * if 'remove_blank_text' not in kw: # <<<<<<<<<<<<<<
25718 * kw['remove_blank_text'] = True
25719 * parser = etree.XMLParser(**kw)
25723 /* "lxml/objectify.pyx":1779
25724 * if 'remove_blank_text' not in kw:
25725 * kw['remove_blank_text'] = True
25726 * parser = etree.XMLParser(**kw) # <<<<<<<<<<<<<<
25727 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25730 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_XMLParser); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
25731 __Pyx_GOTREF(__pyx_t_3);
25732 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_v_kw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1779, __pyx_L1_error)
25733 __Pyx_GOTREF(__pyx_t_4);
25734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25735 __pyx_v_parser = __pyx_t_4;
25738 /* "lxml/objectify.pyx":1780
25739 * kw['remove_blank_text'] = True
25740 * parser = etree.XMLParser(**kw)
25741 * parser.set_element_class_lookup( ObjectifyElementClassLookup() ) # <<<<<<<<<<<<<<
25745 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1780, __pyx_L1_error)
25746 __Pyx_GOTREF(__pyx_t_3);
25747 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1780, __pyx_L1_error)
25748 __Pyx_GOTREF(__pyx_t_5);
25750 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
25751 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
25752 if (likely(__pyx_t_6)) {
25753 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25754 __Pyx_INCREF(__pyx_t_6);
25755 __Pyx_INCREF(function);
25756 __Pyx_DECREF_SET(__pyx_t_3, function);
25759 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
25760 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25761 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25762 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1780, __pyx_L1_error)
25763 __Pyx_GOTREF(__pyx_t_4);
25764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25765 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25767 /* "lxml/objectify.pyx":1781
25768 * parser = etree.XMLParser(**kw)
25769 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25770 * return parser # <<<<<<<<<<<<<<
25772 * cdef _Element _makeElement(tag, text, attrib, nsmap):
25774 __Pyx_XDECREF(__pyx_r);
25775 __Pyx_INCREF(__pyx_v_parser);
25776 __pyx_r = __pyx_v_parser;
25779 /* "lxml/objectify.pyx":1767
25780 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25782 * def makeparser(**kw): # <<<<<<<<<<<<<<
25783 * u"""makeparser(remove_blank_text=True, **kw)
25787 /* function exit code */
25789 __Pyx_XDECREF(__pyx_t_3);
25790 __Pyx_XDECREF(__pyx_t_4);
25791 __Pyx_XDECREF(__pyx_t_5);
25792 __Pyx_XDECREF(__pyx_t_6);
25793 __Pyx_AddTraceback("lxml.objectify.makeparser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25796 __Pyx_XDECREF(__pyx_v_parser);
25797 __Pyx_XGIVEREF(__pyx_r);
25798 __Pyx_RefNannyFinishContext();
25802 /* "lxml/objectify.pyx":1783
25805 * cdef _Element _makeElement(tag, text, attrib, nsmap): # <<<<<<<<<<<<<<
25806 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap)
25810 static struct LxmlElement *__pyx_f_4lxml_9objectify__makeElement(PyObject *__pyx_v_tag, PyObject *__pyx_v_text, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
25811 struct LxmlElement *__pyx_r = NULL;
25812 __Pyx_RefNannyDeclarations
25813 PyObject *__pyx_t_1 = NULL;
25814 PyObject *__pyx_t_2 = NULL;
25815 int __pyx_lineno = 0;
25816 const char *__pyx_filename = NULL;
25817 int __pyx_clineno = 0;
25818 __Pyx_RefNannySetupContext("_makeElement", 0);
25820 /* "lxml/objectify.pyx":1784
25822 * cdef _Element _makeElement(tag, text, attrib, nsmap):
25823 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap) # <<<<<<<<<<<<<<
25825 * ################################################################################
25827 __Pyx_XDECREF(((PyObject *)__pyx_r));
25828 __pyx_t_1 = __pyx_v_4lxml_9objectify_objectify_parser;
25829 __Pyx_INCREF(__pyx_t_1);
25830 __pyx_t_2 = ((PyObject *)makeElement(__pyx_v_tag, ((struct LxmlDocument *)Py_None), __pyx_t_1, __pyx_v_text, Py_None, __pyx_v_attrib, __pyx_v_nsmap)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1784, __pyx_L1_error)
25831 __Pyx_GOTREF(__pyx_t_2);
25832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25833 __pyx_r = ((struct LxmlElement *)__pyx_t_2);
25837 /* "lxml/objectify.pyx":1783
25840 * cdef _Element _makeElement(tag, text, attrib, nsmap): # <<<<<<<<<<<<<<
25841 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap)
25845 /* function exit code */
25847 __Pyx_XDECREF(__pyx_t_1);
25848 __Pyx_XDECREF(__pyx_t_2);
25849 __Pyx_AddTraceback("lxml.objectify._makeElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
25852 __Pyx_XGIVEREF((PyObject *)__pyx_r);
25853 __Pyx_RefNannyFinishContext();
25857 /* "lxml/objectify.pyx":1794
25858 * SubElement = etree.SubElement
25860 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
25861 * u"""fromstring(xml, parser=None, base_url=None)
25865 /* Python wrapper */
25866 static PyObject *__pyx_pw_4lxml_9objectify_33fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25867 static char __pyx_doc_4lxml_9objectify_32fromstring[] = "fromstring(xml, parser=None, base_url=None)\n\n Objectify specific version of the lxml.etree fromstring() function\n that uses the objectify parser.\n\n You can pass a different parser as second argument.\n\n The ``base_url`` keyword argument allows to set the original base URL of\n the document to support relative Paths when looking up external entities\n (DTD, XInclude, ...).\n ";
25868 static PyMethodDef __pyx_mdef_4lxml_9objectify_33fromstring = {"fromstring", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_33fromstring, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_32fromstring};
25869 static PyObject *__pyx_pw_4lxml_9objectify_33fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25870 PyObject *__pyx_v_xml = 0;
25871 PyObject *__pyx_v_parser = 0;
25872 PyObject *__pyx_v_base_url = 0;
25873 int __pyx_lineno = 0;
25874 const char *__pyx_filename = NULL;
25875 int __pyx_clineno = 0;
25876 PyObject *__pyx_r = 0;
25877 __Pyx_RefNannyDeclarations
25878 __Pyx_RefNannySetupContext("fromstring (wrapper)", 0);
25880 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xml,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
25881 PyObject* values[3] = {0,0,0};
25882 values[1] = ((PyObject *)((PyObject *)Py_None));
25883 values[2] = ((PyObject *)((PyObject *)Py_None));
25884 if (unlikely(__pyx_kwds)) {
25885 Py_ssize_t kw_args;
25886 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25887 switch (pos_args) {
25888 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25889 CYTHON_FALLTHROUGH;
25890 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25891 CYTHON_FALLTHROUGH;
25893 default: goto __pyx_L5_argtuple_error;
25895 kw_args = PyDict_Size(__pyx_kwds);
25896 switch (pos_args) {
25898 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xml)) != 0)) kw_args--;
25899 else goto __pyx_L5_argtuple_error;
25900 CYTHON_FALLTHROUGH;
25903 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
25904 if (value) { values[1] = value; kw_args--; }
25907 if (kw_args == 1) {
25908 const Py_ssize_t index = 2;
25909 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
25910 if (value) { values[index] = value; kw_args--; }
25912 if (unlikely(kw_args > 0)) {
25913 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstring") < 0)) __PYX_ERR(0, 1794, __pyx_L3_error)
25916 switch (PyTuple_GET_SIZE(__pyx_args)) {
25917 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25918 CYTHON_FALLTHROUGH;
25919 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25921 default: goto __pyx_L5_argtuple_error;
25924 __pyx_v_xml = values[0];
25925 __pyx_v_parser = values[1];
25926 __pyx_v_base_url = values[2];
25928 goto __pyx_L4_argument_unpacking_done;
25929 __pyx_L5_argtuple_error:;
25930 __Pyx_RaiseArgtupleInvalid("fromstring", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1794, __pyx_L3_error)
25932 __Pyx_AddTraceback("lxml.objectify.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
25933 __Pyx_RefNannyFinishContext();
25935 __pyx_L4_argument_unpacking_done:;
25936 __pyx_r = __pyx_pf_4lxml_9objectify_32fromstring(__pyx_self, __pyx_v_xml, __pyx_v_parser, __pyx_v_base_url);
25938 /* function exit code */
25939 __Pyx_RefNannyFinishContext();
25943 static PyObject *__pyx_pf_4lxml_9objectify_32fromstring(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xml, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url) {
25944 PyObject *__pyx_r = NULL;
25945 __Pyx_RefNannyDeclarations
25948 PyObject *__pyx_t_3 = NULL;
25949 PyObject *__pyx_t_4 = NULL;
25950 PyObject *__pyx_t_5 = NULL;
25951 int __pyx_lineno = 0;
25952 const char *__pyx_filename = NULL;
25953 int __pyx_clineno = 0;
25954 __Pyx_RefNannySetupContext("fromstring", 0);
25955 __Pyx_INCREF(__pyx_v_parser);
25957 /* "lxml/objectify.pyx":1806
25958 * (DTD, XInclude, ...).
25960 * if parser is None: # <<<<<<<<<<<<<<
25961 * parser = objectify_parser
25962 * return _fromstring(xml, parser, base_url=base_url)
25964 __pyx_t_1 = (__pyx_v_parser == Py_None);
25965 __pyx_t_2 = (__pyx_t_1 != 0);
25968 /* "lxml/objectify.pyx":1807
25970 * if parser is None:
25971 * parser = objectify_parser # <<<<<<<<<<<<<<
25972 * return _fromstring(xml, parser, base_url=base_url)
25975 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
25976 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
25978 /* "lxml/objectify.pyx":1806
25979 * (DTD, XInclude, ...).
25981 * if parser is None: # <<<<<<<<<<<<<<
25982 * parser = objectify_parser
25983 * return _fromstring(xml, parser, base_url=base_url)
25987 /* "lxml/objectify.pyx":1808
25988 * if parser is None:
25989 * parser = objectify_parser
25990 * return _fromstring(xml, parser, base_url=base_url) # <<<<<<<<<<<<<<
25992 * def XML(xml, parser=None, *, base_url=None):
25994 __Pyx_XDECREF(__pyx_r);
25995 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
25996 __Pyx_GOTREF(__pyx_t_3);
25997 __Pyx_INCREF(__pyx_v_xml);
25998 __Pyx_GIVEREF(__pyx_v_xml);
25999 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xml);
26000 __Pyx_INCREF(__pyx_v_parser);
26001 __Pyx_GIVEREF(__pyx_v_parser);
26002 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26003 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error)
26004 __Pyx_GOTREF(__pyx_t_4);
26005 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1808, __pyx_L1_error)
26006 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1808, __pyx_L1_error)
26007 __Pyx_GOTREF(__pyx_t_5);
26008 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26009 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26010 __pyx_r = __pyx_t_5;
26014 /* "lxml/objectify.pyx":1794
26015 * SubElement = etree.SubElement
26017 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26018 * u"""fromstring(xml, parser=None, base_url=None)
26022 /* function exit code */
26024 __Pyx_XDECREF(__pyx_t_3);
26025 __Pyx_XDECREF(__pyx_t_4);
26026 __Pyx_XDECREF(__pyx_t_5);
26027 __Pyx_AddTraceback("lxml.objectify.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
26030 __Pyx_XDECREF(__pyx_v_parser);
26031 __Pyx_XGIVEREF(__pyx_r);
26032 __Pyx_RefNannyFinishContext();
26036 /* "lxml/objectify.pyx":1810
26037 * return _fromstring(xml, parser, base_url=base_url)
26039 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26040 * u"""XML(xml, parser=None, base_url=None)
26044 /* Python wrapper */
26045 static PyObject *__pyx_pw_4lxml_9objectify_35XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26046 static char __pyx_doc_4lxml_9objectify_34XML[] = "XML(xml, parser=None, base_url=None)\n\n Objectify specific version of the lxml.etree XML() literal factory\n that uses the objectify parser.\n\n You can pass a different parser as second argument.\n\n The ``base_url`` keyword argument allows to set the original base URL of\n the document to support relative Paths when looking up external entities\n (DTD, XInclude, ...).\n ";
26047 static PyMethodDef __pyx_mdef_4lxml_9objectify_35XML = {"XML", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_35XML, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_34XML};
26048 static PyObject *__pyx_pw_4lxml_9objectify_35XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26049 PyObject *__pyx_v_xml = 0;
26050 PyObject *__pyx_v_parser = 0;
26051 PyObject *__pyx_v_base_url = 0;
26052 int __pyx_lineno = 0;
26053 const char *__pyx_filename = NULL;
26054 int __pyx_clineno = 0;
26055 PyObject *__pyx_r = 0;
26056 __Pyx_RefNannyDeclarations
26057 __Pyx_RefNannySetupContext("XML (wrapper)", 0);
26059 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xml,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
26060 PyObject* values[3] = {0,0,0};
26061 values[1] = ((PyObject *)((PyObject *)Py_None));
26062 values[2] = ((PyObject *)((PyObject *)Py_None));
26063 if (unlikely(__pyx_kwds)) {
26064 Py_ssize_t kw_args;
26065 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26066 switch (pos_args) {
26067 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26068 CYTHON_FALLTHROUGH;
26069 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26070 CYTHON_FALLTHROUGH;
26072 default: goto __pyx_L5_argtuple_error;
26074 kw_args = PyDict_Size(__pyx_kwds);
26075 switch (pos_args) {
26077 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xml)) != 0)) kw_args--;
26078 else goto __pyx_L5_argtuple_error;
26079 CYTHON_FALLTHROUGH;
26082 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
26083 if (value) { values[1] = value; kw_args--; }
26086 if (kw_args == 1) {
26087 const Py_ssize_t index = 2;
26088 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26089 if (value) { values[index] = value; kw_args--; }
26091 if (unlikely(kw_args > 0)) {
26092 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "XML") < 0)) __PYX_ERR(0, 1810, __pyx_L3_error)
26095 switch (PyTuple_GET_SIZE(__pyx_args)) {
26096 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26097 CYTHON_FALLTHROUGH;
26098 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26100 default: goto __pyx_L5_argtuple_error;
26103 __pyx_v_xml = values[0];
26104 __pyx_v_parser = values[1];
26105 __pyx_v_base_url = values[2];
26107 goto __pyx_L4_argument_unpacking_done;
26108 __pyx_L5_argtuple_error:;
26109 __Pyx_RaiseArgtupleInvalid("XML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1810, __pyx_L3_error)
26111 __Pyx_AddTraceback("lxml.objectify.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
26112 __Pyx_RefNannyFinishContext();
26114 __pyx_L4_argument_unpacking_done:;
26115 __pyx_r = __pyx_pf_4lxml_9objectify_34XML(__pyx_self, __pyx_v_xml, __pyx_v_parser, __pyx_v_base_url);
26117 /* function exit code */
26118 __Pyx_RefNannyFinishContext();
26122 static PyObject *__pyx_pf_4lxml_9objectify_34XML(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xml, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url) {
26123 PyObject *__pyx_r = NULL;
26124 __Pyx_RefNannyDeclarations
26127 PyObject *__pyx_t_3 = NULL;
26128 PyObject *__pyx_t_4 = NULL;
26129 PyObject *__pyx_t_5 = NULL;
26130 int __pyx_lineno = 0;
26131 const char *__pyx_filename = NULL;
26132 int __pyx_clineno = 0;
26133 __Pyx_RefNannySetupContext("XML", 0);
26134 __Pyx_INCREF(__pyx_v_parser);
26136 /* "lxml/objectify.pyx":1822
26137 * (DTD, XInclude, ...).
26139 * if parser is None: # <<<<<<<<<<<<<<
26140 * parser = objectify_parser
26141 * return _fromstring(xml, parser, base_url=base_url)
26143 __pyx_t_1 = (__pyx_v_parser == Py_None);
26144 __pyx_t_2 = (__pyx_t_1 != 0);
26147 /* "lxml/objectify.pyx":1823
26149 * if parser is None:
26150 * parser = objectify_parser # <<<<<<<<<<<<<<
26151 * return _fromstring(xml, parser, base_url=base_url)
26154 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
26155 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
26157 /* "lxml/objectify.pyx":1822
26158 * (DTD, XInclude, ...).
26160 * if parser is None: # <<<<<<<<<<<<<<
26161 * parser = objectify_parser
26162 * return _fromstring(xml, parser, base_url=base_url)
26166 /* "lxml/objectify.pyx":1824
26167 * if parser is None:
26168 * parser = objectify_parser
26169 * return _fromstring(xml, parser, base_url=base_url) # <<<<<<<<<<<<<<
26171 * cdef object _parse
26173 __Pyx_XDECREF(__pyx_r);
26174 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1824, __pyx_L1_error)
26175 __Pyx_GOTREF(__pyx_t_3);
26176 __Pyx_INCREF(__pyx_v_xml);
26177 __Pyx_GIVEREF(__pyx_v_xml);
26178 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xml);
26179 __Pyx_INCREF(__pyx_v_parser);
26180 __Pyx_GIVEREF(__pyx_v_parser);
26181 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26182 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L1_error)
26183 __Pyx_GOTREF(__pyx_t_4);
26184 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
26185 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1824, __pyx_L1_error)
26186 __Pyx_GOTREF(__pyx_t_5);
26187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26188 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26189 __pyx_r = __pyx_t_5;
26193 /* "lxml/objectify.pyx":1810
26194 * return _fromstring(xml, parser, base_url=base_url)
26196 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26197 * u"""XML(xml, parser=None, base_url=None)
26201 /* function exit code */
26203 __Pyx_XDECREF(__pyx_t_3);
26204 __Pyx_XDECREF(__pyx_t_4);
26205 __Pyx_XDECREF(__pyx_t_5);
26206 __Pyx_AddTraceback("lxml.objectify.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
26209 __Pyx_XDECREF(__pyx_v_parser);
26210 __Pyx_XGIVEREF(__pyx_r);
26211 __Pyx_RefNannyFinishContext();
26215 /* "lxml/objectify.pyx":1829
26216 * _parse = etree.parse
26218 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26219 * u"""parse(f, parser=None, base_url=None)
26223 /* Python wrapper */
26224 static PyObject *__pyx_pw_4lxml_9objectify_37parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26225 static char __pyx_doc_4lxml_9objectify_36parse[] = "parse(f, parser=None, base_url=None)\n\n Parse a file or file-like object with the objectify parser.\n\n You can pass a different parser as second argument.\n\n The ``base_url`` keyword allows setting a URL for the document\n when parsing from a file-like object. This is needed when looking\n up external entities (DTD, XInclude, ...) with relative paths.\n ";
26226 static PyMethodDef __pyx_mdef_4lxml_9objectify_37parse = {"parse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_37parse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_36parse};
26227 static PyObject *__pyx_pw_4lxml_9objectify_37parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26228 PyObject *__pyx_v_f = 0;
26229 PyObject *__pyx_v_parser = 0;
26230 PyObject *__pyx_v_base_url = 0;
26231 int __pyx_lineno = 0;
26232 const char *__pyx_filename = NULL;
26233 int __pyx_clineno = 0;
26234 PyObject *__pyx_r = 0;
26235 __Pyx_RefNannyDeclarations
26236 __Pyx_RefNannySetupContext("parse (wrapper)", 0);
26238 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
26239 PyObject* values[3] = {0,0,0};
26240 values[1] = ((PyObject *)((PyObject *)Py_None));
26241 values[2] = ((PyObject *)((PyObject *)Py_None));
26242 if (unlikely(__pyx_kwds)) {
26243 Py_ssize_t kw_args;
26244 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26245 switch (pos_args) {
26246 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26247 CYTHON_FALLTHROUGH;
26248 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26249 CYTHON_FALLTHROUGH;
26251 default: goto __pyx_L5_argtuple_error;
26253 kw_args = PyDict_Size(__pyx_kwds);
26254 switch (pos_args) {
26256 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
26257 else goto __pyx_L5_argtuple_error;
26258 CYTHON_FALLTHROUGH;
26261 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
26262 if (value) { values[1] = value; kw_args--; }
26265 if (kw_args == 1) {
26266 const Py_ssize_t index = 2;
26267 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26268 if (value) { values[index] = value; kw_args--; }
26270 if (unlikely(kw_args > 0)) {
26271 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 1829, __pyx_L3_error)
26274 switch (PyTuple_GET_SIZE(__pyx_args)) {
26275 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26276 CYTHON_FALLTHROUGH;
26277 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26279 default: goto __pyx_L5_argtuple_error;
26282 __pyx_v_f = values[0];
26283 __pyx_v_parser = values[1];
26284 __pyx_v_base_url = values[2];
26286 goto __pyx_L4_argument_unpacking_done;
26287 __pyx_L5_argtuple_error:;
26288 __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1829, __pyx_L3_error)
26290 __Pyx_AddTraceback("lxml.objectify.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
26291 __Pyx_RefNannyFinishContext();
26293 __pyx_L4_argument_unpacking_done:;
26294 __pyx_r = __pyx_pf_4lxml_9objectify_36parse(__pyx_self, __pyx_v_f, __pyx_v_parser, __pyx_v_base_url);
26296 /* function exit code */
26297 __Pyx_RefNannyFinishContext();
26301 static PyObject *__pyx_pf_4lxml_9objectify_36parse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_parser, PyObject *__pyx_v_base_url) {
26302 PyObject *__pyx_r = NULL;
26303 __Pyx_RefNannyDeclarations
26306 PyObject *__pyx_t_3 = NULL;
26307 PyObject *__pyx_t_4 = NULL;
26308 PyObject *__pyx_t_5 = NULL;
26309 int __pyx_lineno = 0;
26310 const char *__pyx_filename = NULL;
26311 int __pyx_clineno = 0;
26312 __Pyx_RefNannySetupContext("parse", 0);
26313 __Pyx_INCREF(__pyx_v_parser);
26315 /* "lxml/objectify.pyx":1840
26316 * up external entities (DTD, XInclude, ...) with relative paths.
26318 * if parser is None: # <<<<<<<<<<<<<<
26319 * parser = objectify_parser
26320 * return _parse(f, parser, base_url=base_url)
26322 __pyx_t_1 = (__pyx_v_parser == Py_None);
26323 __pyx_t_2 = (__pyx_t_1 != 0);
26326 /* "lxml/objectify.pyx":1841
26328 * if parser is None:
26329 * parser = objectify_parser # <<<<<<<<<<<<<<
26330 * return _parse(f, parser, base_url=base_url)
26333 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
26334 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
26336 /* "lxml/objectify.pyx":1840
26337 * up external entities (DTD, XInclude, ...) with relative paths.
26339 * if parser is None: # <<<<<<<<<<<<<<
26340 * parser = objectify_parser
26341 * return _parse(f, parser, base_url=base_url)
26345 /* "lxml/objectify.pyx":1842
26346 * if parser is None:
26347 * parser = objectify_parser
26348 * return _parse(f, parser, base_url=base_url) # <<<<<<<<<<<<<<
26350 * cdef dict _DEFAULT_NSMAP = {
26352 __Pyx_XDECREF(__pyx_r);
26353 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1842, __pyx_L1_error)
26354 __Pyx_GOTREF(__pyx_t_3);
26355 __Pyx_INCREF(__pyx_v_f);
26356 __Pyx_GIVEREF(__pyx_v_f);
26357 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
26358 __Pyx_INCREF(__pyx_v_parser);
26359 __Pyx_GIVEREF(__pyx_v_parser);
26360 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26361 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __pyx_L1_error)
26362 __Pyx_GOTREF(__pyx_t_4);
26363 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
26364 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_4lxml_9objectify__parse, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1842, __pyx_L1_error)
26365 __Pyx_GOTREF(__pyx_t_5);
26366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26367 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26368 __pyx_r = __pyx_t_5;
26372 /* "lxml/objectify.pyx":1829
26373 * _parse = etree.parse
26375 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26376 * u"""parse(f, parser=None, base_url=None)
26380 /* function exit code */
26382 __Pyx_XDECREF(__pyx_t_3);
26383 __Pyx_XDECREF(__pyx_t_4);
26384 __Pyx_XDECREF(__pyx_t_5);
26385 __Pyx_AddTraceback("lxml.objectify.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
26388 __Pyx_XDECREF(__pyx_v_parser);
26389 __Pyx_XGIVEREF(__pyx_r);
26390 __Pyx_RefNannyFinishContext();
26394 /* "lxml/objectify.pyx":1852
26395 * E = ElementMaker()
26397 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
26398 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
26402 /* Python wrapper */
26403 static PyObject *__pyx_pw_4lxml_9objectify_39Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26404 static char __pyx_doc_4lxml_9objectify_38Element[] = "Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)\n\n Objectify specific version of the lxml.etree Element() factory that\n always creates a structural (tree) element.\n\n NOTE: requires parser based element class lookup activated in lxml.etree!\n ";
26405 static PyMethodDef __pyx_mdef_4lxml_9objectify_39Element = {"Element", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_39Element, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_38Element};
26406 static PyObject *__pyx_pw_4lxml_9objectify_39Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26407 PyObject *__pyx_v__tag = 0;
26408 PyObject *__pyx_v_attrib = 0;
26409 PyObject *__pyx_v_nsmap = 0;
26410 PyObject *__pyx_v__pytype = 0;
26411 PyObject *__pyx_v__attributes = 0;
26412 int __pyx_lineno = 0;
26413 const char *__pyx_filename = NULL;
26414 int __pyx_clineno = 0;
26415 PyObject *__pyx_r = 0;
26416 __Pyx_RefNannyDeclarations
26417 __Pyx_RefNannySetupContext("Element (wrapper)", 0);
26418 __pyx_v__attributes = PyDict_New(); if (unlikely(!__pyx_v__attributes)) return NULL;
26419 __Pyx_GOTREF(__pyx_v__attributes);
26421 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag_2,&__pyx_n_s_attrib,&__pyx_n_s_nsmap,&__pyx_n_s_pytype_2,0};
26422 PyObject* values[4] = {0,0,0,0};
26423 values[1] = ((PyObject *)((PyObject *)Py_None));
26424 values[2] = ((PyObject *)((PyObject *)Py_None));
26425 values[3] = ((PyObject *)((PyObject *)Py_None));
26426 if (unlikely(__pyx_kwds)) {
26427 Py_ssize_t kw_args;
26428 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26429 switch (pos_args) {
26430 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26431 CYTHON_FALLTHROUGH;
26432 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26433 CYTHON_FALLTHROUGH;
26434 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26435 CYTHON_FALLTHROUGH;
26437 default: goto __pyx_L5_argtuple_error;
26439 kw_args = PyDict_Size(__pyx_kwds);
26440 switch (pos_args) {
26442 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag_2)) != 0)) kw_args--;
26443 else goto __pyx_L5_argtuple_error;
26444 CYTHON_FALLTHROUGH;
26447 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrib);
26448 if (value) { values[1] = value; kw_args--; }
26450 CYTHON_FALLTHROUGH;
26453 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsmap);
26454 if (value) { values[2] = value; kw_args--; }
26457 if (kw_args == 1) {
26458 const Py_ssize_t index = 3;
26459 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26460 if (value) { values[index] = value; kw_args--; }
26462 if (unlikely(kw_args > 0)) {
26463 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__attributes, values, pos_args, "Element") < 0)) __PYX_ERR(0, 1852, __pyx_L3_error)
26466 switch (PyTuple_GET_SIZE(__pyx_args)) {
26467 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26468 CYTHON_FALLTHROUGH;
26469 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26470 CYTHON_FALLTHROUGH;
26471 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26473 default: goto __pyx_L5_argtuple_error;
26476 __pyx_v__tag = values[0];
26477 __pyx_v_attrib = values[1];
26478 __pyx_v_nsmap = values[2];
26479 __pyx_v__pytype = values[3];
26481 goto __pyx_L4_argument_unpacking_done;
26482 __pyx_L5_argtuple_error:;
26483 __Pyx_RaiseArgtupleInvalid("Element", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1852, __pyx_L3_error)
26485 __Pyx_DECREF(__pyx_v__attributes); __pyx_v__attributes = 0;
26486 __Pyx_AddTraceback("lxml.objectify.Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
26487 __Pyx_RefNannyFinishContext();
26489 __pyx_L4_argument_unpacking_done:;
26490 __pyx_r = __pyx_pf_4lxml_9objectify_38Element(__pyx_self, __pyx_v__tag, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__pytype, __pyx_v__attributes);
26492 /* function exit code */
26493 __Pyx_XDECREF(__pyx_v__attributes);
26494 __Pyx_RefNannyFinishContext();
26498 static PyObject *__pyx_pf_4lxml_9objectify_38Element(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v__pytype, PyObject *__pyx_v__attributes) {
26499 PyObject *__pyx_r = NULL;
26500 __Pyx_RefNannyDeclarations
26503 PyObject *__pyx_t_3 = NULL;
26504 PyObject *__pyx_t_4 = NULL;
26505 PyObject *__pyx_t_5 = NULL;
26506 int __pyx_lineno = 0;
26507 const char *__pyx_filename = NULL;
26508 int __pyx_clineno = 0;
26509 __Pyx_RefNannySetupContext("Element", 0);
26510 __Pyx_INCREF(__pyx_v_attrib);
26511 __Pyx_INCREF(__pyx_v_nsmap);
26512 __Pyx_INCREF(__pyx_v__pytype);
26513 __Pyx_INCREF(__pyx_v__attributes);
26515 /* "lxml/objectify.pyx":1860
26516 * NOTE: requires parser based element class lookup activated in lxml.etree!
26518 * if attrib is not None: # <<<<<<<<<<<<<<
26520 * attrib = dict(attrib)
26522 __pyx_t_1 = (__pyx_v_attrib != Py_None);
26523 __pyx_t_2 = (__pyx_t_1 != 0);
26526 /* "lxml/objectify.pyx":1861
26528 * if attrib is not None:
26529 * if _attributes: # <<<<<<<<<<<<<<
26530 * attrib = dict(attrib)
26531 * attrib.update(_attributes)
26533 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1861, __pyx_L1_error)
26536 /* "lxml/objectify.pyx":1862
26537 * if attrib is not None:
26539 * attrib = dict(attrib) # <<<<<<<<<<<<<<
26540 * attrib.update(_attributes)
26541 * _attributes = attrib
26543 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_attrib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1862, __pyx_L1_error)
26544 __Pyx_GOTREF(__pyx_t_3);
26545 __Pyx_DECREF_SET(__pyx_v_attrib, __pyx_t_3);
26548 /* "lxml/objectify.pyx":1863
26550 * attrib = dict(attrib)
26551 * attrib.update(_attributes) # <<<<<<<<<<<<<<
26552 * _attributes = attrib
26553 * if _pytype is None:
26555 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1863, __pyx_L1_error)
26556 __Pyx_GOTREF(__pyx_t_4);
26558 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
26559 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
26560 if (likely(__pyx_t_5)) {
26561 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
26562 __Pyx_INCREF(__pyx_t_5);
26563 __Pyx_INCREF(function);
26564 __Pyx_DECREF_SET(__pyx_t_4, function);
26567 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v__attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v__attributes);
26568 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26569 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error)
26570 __Pyx_GOTREF(__pyx_t_3);
26571 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26574 /* "lxml/objectify.pyx":1861
26576 * if attrib is not None:
26577 * if _attributes: # <<<<<<<<<<<<<<
26578 * attrib = dict(attrib)
26579 * attrib.update(_attributes)
26583 /* "lxml/objectify.pyx":1864
26584 * attrib = dict(attrib)
26585 * attrib.update(_attributes)
26586 * _attributes = attrib # <<<<<<<<<<<<<<
26587 * if _pytype is None:
26588 * _pytype = TREE_PYTYPE_NAME
26590 __Pyx_INCREF(__pyx_v_attrib);
26591 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_attrib);
26593 /* "lxml/objectify.pyx":1860
26594 * NOTE: requires parser based element class lookup activated in lxml.etree!
26596 * if attrib is not None: # <<<<<<<<<<<<<<
26598 * attrib = dict(attrib)
26602 /* "lxml/objectify.pyx":1865
26603 * attrib.update(_attributes)
26604 * _attributes = attrib
26605 * if _pytype is None: # <<<<<<<<<<<<<<
26606 * _pytype = TREE_PYTYPE_NAME
26607 * if nsmap is None:
26609 __pyx_t_2 = (__pyx_v__pytype == Py_None);
26610 __pyx_t_1 = (__pyx_t_2 != 0);
26613 /* "lxml/objectify.pyx":1866
26614 * _attributes = attrib
26615 * if _pytype is None:
26616 * _pytype = TREE_PYTYPE_NAME # <<<<<<<<<<<<<<
26617 * if nsmap is None:
26618 * nsmap = _DEFAULT_NSMAP
26620 __Pyx_INCREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
26621 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
26623 /* "lxml/objectify.pyx":1865
26624 * attrib.update(_attributes)
26625 * _attributes = attrib
26626 * if _pytype is None: # <<<<<<<<<<<<<<
26627 * _pytype = TREE_PYTYPE_NAME
26628 * if nsmap is None:
26632 /* "lxml/objectify.pyx":1867
26633 * if _pytype is None:
26634 * _pytype = TREE_PYTYPE_NAME
26635 * if nsmap is None: # <<<<<<<<<<<<<<
26636 * nsmap = _DEFAULT_NSMAP
26637 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26639 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
26640 __pyx_t_2 = (__pyx_t_1 != 0);
26643 /* "lxml/objectify.pyx":1868
26644 * _pytype = TREE_PYTYPE_NAME
26645 * if nsmap is None:
26646 * nsmap = _DEFAULT_NSMAP # <<<<<<<<<<<<<<
26647 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26648 * return _makeElement(_tag, None, _attributes, nsmap)
26650 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26651 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26653 /* "lxml/objectify.pyx":1867
26654 * if _pytype is None:
26655 * _pytype = TREE_PYTYPE_NAME
26656 * if nsmap is None: # <<<<<<<<<<<<<<
26657 * nsmap = _DEFAULT_NSMAP
26658 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26662 /* "lxml/objectify.pyx":1869
26663 * if nsmap is None:
26664 * nsmap = _DEFAULT_NSMAP
26665 * _attributes[PYTYPE_ATTRIBUTE] = _pytype # <<<<<<<<<<<<<<
26666 * return _makeElement(_tag, None, _attributes, nsmap)
26669 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __pyx_L1_error)
26670 __Pyx_GOTREF(__pyx_t_3);
26671 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_t_3, __pyx_v__pytype) < 0)) __PYX_ERR(0, 1869, __pyx_L1_error)
26672 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26674 /* "lxml/objectify.pyx":1870
26675 * nsmap = _DEFAULT_NSMAP
26676 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26677 * return _makeElement(_tag, None, _attributes, nsmap) # <<<<<<<<<<<<<<
26679 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None,
26681 __Pyx_XDECREF(__pyx_r);
26682 __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_9objectify__makeElement(__pyx_v__tag, Py_None, __pyx_v__attributes, __pyx_v_nsmap)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1870, __pyx_L1_error)
26683 __Pyx_GOTREF(__pyx_t_3);
26684 __pyx_r = __pyx_t_3;
26688 /* "lxml/objectify.pyx":1852
26689 * E = ElementMaker()
26691 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
26692 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
26696 /* function exit code */
26698 __Pyx_XDECREF(__pyx_t_3);
26699 __Pyx_XDECREF(__pyx_t_4);
26700 __Pyx_XDECREF(__pyx_t_5);
26701 __Pyx_AddTraceback("lxml.objectify.Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
26704 __Pyx_XDECREF(__pyx_v__attributes);
26705 __Pyx_XDECREF(__pyx_v_attrib);
26706 __Pyx_XDECREF(__pyx_v_nsmap);
26707 __Pyx_XDECREF(__pyx_v__pytype);
26708 __Pyx_XGIVEREF(__pyx_r);
26709 __Pyx_RefNannyFinishContext();
26713 /* "lxml/objectify.pyx":1872
26714 * return _makeElement(_tag, None, _attributes, nsmap)
26716 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
26718 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
26721 /* Python wrapper */
26722 static PyObject *__pyx_pw_4lxml_9objectify_41DataElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26723 static char __pyx_doc_4lxml_9objectify_40DataElement[] = "DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)\n\n Create a new element from a Python value and XML attributes taken from\n keyword arguments or a dictionary passed as second argument.\n\n Automatically adds a 'pytype' attribute for the Python type of the value,\n if the type can be identified. If '_pytype' or '_xsi' are among the\n keyword arguments, they will be used instead.\n\n If the _value argument is an ObjectifiedDataElement instance, its py:pytype,\n xsi:type and other attributes and nsmap are reused unless they are redefined\n in attrib and/or keyword arguments.\n ";
26724 static PyMethodDef __pyx_mdef_4lxml_9objectify_41DataElement = {"DataElement", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_41DataElement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_40DataElement};
26725 static PyObject *__pyx_pw_4lxml_9objectify_41DataElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26726 PyObject *__pyx_v__value = 0;
26727 PyObject *__pyx_v_attrib = 0;
26728 PyObject *__pyx_v_nsmap = 0;
26729 PyObject *__pyx_v__pytype = 0;
26730 PyObject *__pyx_v__xsi = 0;
26731 PyObject *__pyx_v__attributes = 0;
26732 int __pyx_lineno = 0;
26733 const char *__pyx_filename = NULL;
26734 int __pyx_clineno = 0;
26735 PyObject *__pyx_r = 0;
26736 __Pyx_RefNannyDeclarations
26737 __Pyx_RefNannySetupContext("DataElement (wrapper)", 0);
26738 __pyx_v__attributes = PyDict_New(); if (unlikely(!__pyx_v__attributes)) return NULL;
26739 __Pyx_GOTREF(__pyx_v__attributes);
26741 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value_2,&__pyx_n_s_attrib,&__pyx_n_s_nsmap,&__pyx_n_s_pytype_2,&__pyx_n_s_xsi_3,0};
26742 PyObject* values[5] = {0,0,0,0,0};
26743 values[1] = ((PyObject *)((PyObject *)Py_None));
26744 values[2] = ((PyObject *)((PyObject *)Py_None));
26745 values[3] = ((PyObject *)((PyObject *)Py_None));
26746 values[4] = ((PyObject *)((PyObject *)Py_None));
26747 if (unlikely(__pyx_kwds)) {
26748 Py_ssize_t kw_args;
26749 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26750 switch (pos_args) {
26751 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26752 CYTHON_FALLTHROUGH;
26753 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26754 CYTHON_FALLTHROUGH;
26755 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26756 CYTHON_FALLTHROUGH;
26758 default: goto __pyx_L5_argtuple_error;
26760 kw_args = PyDict_Size(__pyx_kwds);
26761 switch (pos_args) {
26763 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_2)) != 0)) kw_args--;
26764 else goto __pyx_L5_argtuple_error;
26765 CYTHON_FALLTHROUGH;
26768 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrib);
26769 if (value) { values[1] = value; kw_args--; }
26771 CYTHON_FALLTHROUGH;
26774 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsmap);
26775 if (value) { values[2] = value; kw_args--; }
26778 if (kw_args > 0 && (kw_args <= 2)) {
26780 for (index = 3; index < 5 && kw_args > 0; index++) {
26781 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26782 if (value) { values[index] = value; kw_args--; }
26785 if (unlikely(kw_args > 0)) {
26786 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__attributes, values, pos_args, "DataElement") < 0)) __PYX_ERR(0, 1872, __pyx_L3_error)
26789 switch (PyTuple_GET_SIZE(__pyx_args)) {
26790 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26791 CYTHON_FALLTHROUGH;
26792 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26793 CYTHON_FALLTHROUGH;
26794 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26796 default: goto __pyx_L5_argtuple_error;
26799 __pyx_v__value = values[0];
26800 __pyx_v_attrib = values[1];
26801 __pyx_v_nsmap = values[2];
26802 __pyx_v__pytype = values[3];
26803 __pyx_v__xsi = values[4];
26805 goto __pyx_L4_argument_unpacking_done;
26806 __pyx_L5_argtuple_error:;
26807 __Pyx_RaiseArgtupleInvalid("DataElement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1872, __pyx_L3_error)
26809 __Pyx_DECREF(__pyx_v__attributes); __pyx_v__attributes = 0;
26810 __Pyx_AddTraceback("lxml.objectify.DataElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
26811 __Pyx_RefNannyFinishContext();
26813 __pyx_L4_argument_unpacking_done:;
26814 __pyx_r = __pyx_pf_4lxml_9objectify_40DataElement(__pyx_self, __pyx_v__value, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__pytype, __pyx_v__xsi, __pyx_v__attributes);
26816 /* function exit code */
26817 __Pyx_XDECREF(__pyx_v__attributes);
26818 __Pyx_RefNannyFinishContext();
26822 static PyObject *__pyx_pf_4lxml_9objectify_40DataElement(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v__value, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v__pytype, PyObject *__pyx_v__xsi, PyObject *__pyx_v__attributes) {
26823 PyObject *__pyx_v_temp = NULL;
26824 PyObject *__pyx_v_prefix = NULL;
26825 PyObject *__pyx_v_name = NULL;
26826 PyObject *__pyx_v_ns = NULL;
26827 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
26828 PyObject *__pyx_v_strval = NULL;
26829 PyObject *__pyx_v_stringify = NULL;
26830 PyObject *__pyx_r = NULL;
26831 __Pyx_RefNannyDeclarations
26835 PyObject *__pyx_t_4 = NULL;
26836 PyObject *__pyx_t_5 = NULL;
26837 PyObject *__pyx_t_6 = NULL;
26838 PyObject *__pyx_t_7 = NULL;
26839 PyObject *(*__pyx_t_8)(PyObject *);
26840 Py_ssize_t __pyx_t_9;
26841 PyObject *(*__pyx_t_10)(PyObject *);
26842 PyObject *__pyx_t_11 = NULL;
26843 int __pyx_lineno = 0;
26844 const char *__pyx_filename = NULL;
26845 int __pyx_clineno = 0;
26846 __Pyx_RefNannySetupContext("DataElement", 0);
26847 __Pyx_INCREF(__pyx_v_attrib);
26848 __Pyx_INCREF(__pyx_v_nsmap);
26849 __Pyx_INCREF(__pyx_v__pytype);
26850 __Pyx_INCREF(__pyx_v__xsi);
26851 __Pyx_INCREF(__pyx_v__attributes);
26853 /* "lxml/objectify.pyx":1887
26854 * in attrib and/or keyword arguments.
26856 * if nsmap is None: # <<<<<<<<<<<<<<
26857 * nsmap = _DEFAULT_NSMAP
26858 * if attrib is not None and attrib:
26860 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
26861 __pyx_t_2 = (__pyx_t_1 != 0);
26864 /* "lxml/objectify.pyx":1888
26866 * if nsmap is None:
26867 * nsmap = _DEFAULT_NSMAP # <<<<<<<<<<<<<<
26868 * if attrib is not None and attrib:
26871 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26872 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26874 /* "lxml/objectify.pyx":1887
26875 * in attrib and/or keyword arguments.
26877 * if nsmap is None: # <<<<<<<<<<<<<<
26878 * nsmap = _DEFAULT_NSMAP
26879 * if attrib is not None and attrib:
26883 /* "lxml/objectify.pyx":1889
26884 * if nsmap is None:
26885 * nsmap = _DEFAULT_NSMAP
26886 * if attrib is not None and attrib: # <<<<<<<<<<<<<<
26888 * attrib = dict(attrib)
26890 __pyx_t_1 = (__pyx_v_attrib != Py_None);
26891 __pyx_t_3 = (__pyx_t_1 != 0);
26894 __pyx_t_2 = __pyx_t_3;
26895 goto __pyx_L5_bool_binop_done;
26897 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1889, __pyx_L1_error)
26898 __pyx_t_2 = __pyx_t_3;
26899 __pyx_L5_bool_binop_done:;
26902 /* "lxml/objectify.pyx":1890
26903 * nsmap = _DEFAULT_NSMAP
26904 * if attrib is not None and attrib:
26905 * if _attributes: # <<<<<<<<<<<<<<
26906 * attrib = dict(attrib)
26907 * attrib.update(_attributes)
26909 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1890, __pyx_L1_error)
26912 /* "lxml/objectify.pyx":1891
26913 * if attrib is not None and attrib:
26915 * attrib = dict(attrib) # <<<<<<<<<<<<<<
26916 * attrib.update(_attributes)
26917 * _attributes = attrib
26919 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L1_error)
26920 __Pyx_GOTREF(__pyx_t_4);
26921 __Pyx_DECREF_SET(__pyx_v_attrib, __pyx_t_4);
26924 /* "lxml/objectify.pyx":1892
26926 * attrib = dict(attrib)
26927 * attrib.update(_attributes) # <<<<<<<<<<<<<<
26928 * _attributes = attrib
26929 * if isinstance(_value, ObjectifiedElement):
26931 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1892, __pyx_L1_error)
26932 __Pyx_GOTREF(__pyx_t_5);
26934 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
26935 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
26936 if (likely(__pyx_t_6)) {
26937 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
26938 __Pyx_INCREF(__pyx_t_6);
26939 __Pyx_INCREF(function);
26940 __Pyx_DECREF_SET(__pyx_t_5, function);
26943 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v__attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v__attributes);
26944 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26945 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error)
26946 __Pyx_GOTREF(__pyx_t_4);
26947 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26948 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26950 /* "lxml/objectify.pyx":1890
26951 * nsmap = _DEFAULT_NSMAP
26952 * if attrib is not None and attrib:
26953 * if _attributes: # <<<<<<<<<<<<<<
26954 * attrib = dict(attrib)
26955 * attrib.update(_attributes)
26959 /* "lxml/objectify.pyx":1893
26960 * attrib = dict(attrib)
26961 * attrib.update(_attributes)
26962 * _attributes = attrib # <<<<<<<<<<<<<<
26963 * if isinstance(_value, ObjectifiedElement):
26964 * if _pytype is None:
26966 __Pyx_INCREF(__pyx_v_attrib);
26967 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_attrib);
26969 /* "lxml/objectify.pyx":1889
26970 * if nsmap is None:
26971 * nsmap = _DEFAULT_NSMAP
26972 * if attrib is not None and attrib: # <<<<<<<<<<<<<<
26974 * attrib = dict(attrib)
26978 /* "lxml/objectify.pyx":1894
26979 * attrib.update(_attributes)
26980 * _attributes = attrib
26981 * if isinstance(_value, ObjectifiedElement): # <<<<<<<<<<<<<<
26982 * if _pytype is None:
26983 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
26985 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__value, __pyx_ptype_4lxml_9objectify_ObjectifiedElement);
26986 __pyx_t_3 = (__pyx_t_2 != 0);
26989 /* "lxml/objectify.pyx":1895
26990 * _attributes = attrib
26991 * if isinstance(_value, ObjectifiedElement):
26992 * if _pytype is None: # <<<<<<<<<<<<<<
26993 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
26994 * # special case: no change!
26996 __pyx_t_3 = (__pyx_v__pytype == Py_None);
26997 __pyx_t_2 = (__pyx_t_3 != 0);
27000 /* "lxml/objectify.pyx":1896
27001 * if isinstance(_value, ObjectifiedElement):
27002 * if _pytype is None:
27003 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27004 * # special case: no change!
27005 * return _value.__copy__()
27007 __pyx_t_3 = (__pyx_v__xsi == Py_None);
27008 __pyx_t_1 = (__pyx_t_3 != 0);
27011 __pyx_t_2 = __pyx_t_1;
27012 goto __pyx_L11_bool_binop_done;
27014 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1896, __pyx_L1_error)
27015 __pyx_t_3 = ((!__pyx_t_1) != 0);
27018 __pyx_t_2 = __pyx_t_3;
27019 goto __pyx_L11_bool_binop_done;
27021 __pyx_t_3 = (__pyx_v_nsmap == __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
27022 __pyx_t_1 = (__pyx_t_3 != 0);
27023 __pyx_t_2 = __pyx_t_1;
27024 __pyx_L11_bool_binop_done:;
27027 /* "lxml/objectify.pyx":1898
27028 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27029 * # special case: no change!
27030 * return _value.__copy__() # <<<<<<<<<<<<<<
27031 * if isinstance(_value, ObjectifiedDataElement):
27032 * # reuse existing nsmap unless redefined in nsmap parameter
27034 __Pyx_XDECREF(__pyx_r);
27035 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__value, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1898, __pyx_L1_error)
27036 __Pyx_GOTREF(__pyx_t_5);
27038 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27039 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27040 if (likely(__pyx_t_6)) {
27041 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27042 __Pyx_INCREF(__pyx_t_6);
27043 __Pyx_INCREF(function);
27044 __Pyx_DECREF_SET(__pyx_t_5, function);
27047 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
27048 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27049 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1898, __pyx_L1_error)
27050 __Pyx_GOTREF(__pyx_t_4);
27051 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27052 __pyx_r = __pyx_t_4;
27056 /* "lxml/objectify.pyx":1896
27057 * if isinstance(_value, ObjectifiedElement):
27058 * if _pytype is None:
27059 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27060 * # special case: no change!
27061 * return _value.__copy__()
27065 /* "lxml/objectify.pyx":1895
27066 * _attributes = attrib
27067 * if isinstance(_value, ObjectifiedElement):
27068 * if _pytype is None: # <<<<<<<<<<<<<<
27069 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27070 * # special case: no change!
27074 /* "lxml/objectify.pyx":1894
27075 * attrib.update(_attributes)
27076 * _attributes = attrib
27077 * if isinstance(_value, ObjectifiedElement): # <<<<<<<<<<<<<<
27078 * if _pytype is None:
27079 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27083 /* "lxml/objectify.pyx":1899
27084 * # special case: no change!
27085 * return _value.__copy__()
27086 * if isinstance(_value, ObjectifiedDataElement): # <<<<<<<<<<<<<<
27087 * # reuse existing nsmap unless redefined in nsmap parameter
27088 * temp = _value.nsmap
27090 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__value, __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
27091 __pyx_t_1 = (__pyx_t_2 != 0);
27094 /* "lxml/objectify.pyx":1901
27095 * if isinstance(_value, ObjectifiedDataElement):
27096 * # reuse existing nsmap unless redefined in nsmap parameter
27097 * temp = _value.nsmap # <<<<<<<<<<<<<<
27098 * if temp is not None and temp:
27099 * temp = dict(temp)
27101 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__value, __pyx_n_s_nsmap); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L1_error)
27102 __Pyx_GOTREF(__pyx_t_4);
27103 __pyx_v_temp = __pyx_t_4;
27106 /* "lxml/objectify.pyx":1902
27107 * # reuse existing nsmap unless redefined in nsmap parameter
27108 * temp = _value.nsmap
27109 * if temp is not None and temp: # <<<<<<<<<<<<<<
27110 * temp = dict(temp)
27111 * temp.update(nsmap)
27113 __pyx_t_2 = (__pyx_v_temp != Py_None);
27114 __pyx_t_3 = (__pyx_t_2 != 0);
27117 __pyx_t_1 = __pyx_t_3;
27118 goto __pyx_L16_bool_binop_done;
27120 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_temp); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1902, __pyx_L1_error)
27121 __pyx_t_1 = __pyx_t_3;
27122 __pyx_L16_bool_binop_done:;
27125 /* "lxml/objectify.pyx":1903
27126 * temp = _value.nsmap
27127 * if temp is not None and temp:
27128 * temp = dict(temp) # <<<<<<<<<<<<<<
27129 * temp.update(nsmap)
27132 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_temp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error)
27133 __Pyx_GOTREF(__pyx_t_4);
27134 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27137 /* "lxml/objectify.pyx":1904
27138 * if temp is not None and temp:
27139 * temp = dict(temp)
27140 * temp.update(nsmap) # <<<<<<<<<<<<<<
27142 * # reuse existing attributes unless redefined in attrib/_attributes
27144 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1904, __pyx_L1_error)
27145 __Pyx_GOTREF(__pyx_t_5);
27147 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27148 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27149 if (likely(__pyx_t_6)) {
27150 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27151 __Pyx_INCREF(__pyx_t_6);
27152 __Pyx_INCREF(function);
27153 __Pyx_DECREF_SET(__pyx_t_5, function);
27156 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_nsmap) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_nsmap);
27157 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27158 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L1_error)
27159 __Pyx_GOTREF(__pyx_t_4);
27160 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27161 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27163 /* "lxml/objectify.pyx":1905
27164 * temp = dict(temp)
27165 * temp.update(nsmap)
27166 * nsmap = temp # <<<<<<<<<<<<<<
27167 * # reuse existing attributes unless redefined in attrib/_attributes
27168 * temp = _value.attrib
27170 __Pyx_INCREF(__pyx_v_temp);
27171 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_temp);
27173 /* "lxml/objectify.pyx":1902
27174 * # reuse existing nsmap unless redefined in nsmap parameter
27175 * temp = _value.nsmap
27176 * if temp is not None and temp: # <<<<<<<<<<<<<<
27177 * temp = dict(temp)
27178 * temp.update(nsmap)
27182 /* "lxml/objectify.pyx":1907
27184 * # reuse existing attributes unless redefined in attrib/_attributes
27185 * temp = _value.attrib # <<<<<<<<<<<<<<
27186 * if temp is not None and temp:
27187 * temp = dict(temp)
27189 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__value, __pyx_n_s_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1907, __pyx_L1_error)
27190 __Pyx_GOTREF(__pyx_t_4);
27191 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27194 /* "lxml/objectify.pyx":1908
27195 * # reuse existing attributes unless redefined in attrib/_attributes
27196 * temp = _value.attrib
27197 * if temp is not None and temp: # <<<<<<<<<<<<<<
27198 * temp = dict(temp)
27199 * temp.update(_attributes)
27201 __pyx_t_3 = (__pyx_v_temp != Py_None);
27202 __pyx_t_2 = (__pyx_t_3 != 0);
27205 __pyx_t_1 = __pyx_t_2;
27206 goto __pyx_L19_bool_binop_done;
27208 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_temp); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1908, __pyx_L1_error)
27209 __pyx_t_1 = __pyx_t_2;
27210 __pyx_L19_bool_binop_done:;
27213 /* "lxml/objectify.pyx":1909
27214 * temp = _value.attrib
27215 * if temp is not None and temp:
27216 * temp = dict(temp) # <<<<<<<<<<<<<<
27217 * temp.update(_attributes)
27218 * _attributes = temp
27220 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_temp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1909, __pyx_L1_error)
27221 __Pyx_GOTREF(__pyx_t_4);
27222 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27225 /* "lxml/objectify.pyx":1910
27226 * if temp is not None and temp:
27227 * temp = dict(temp)
27228 * temp.update(_attributes) # <<<<<<<<<<<<<<
27229 * _attributes = temp
27230 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27232 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_temp, __pyx_n_s_update); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1910, __pyx_L1_error)
27233 __Pyx_GOTREF(__pyx_t_5);
27235 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27236 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27237 if (likely(__pyx_t_6)) {
27238 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27239 __Pyx_INCREF(__pyx_t_6);
27240 __Pyx_INCREF(function);
27241 __Pyx_DECREF_SET(__pyx_t_5, function);
27244 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v__attributes) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v__attributes);
27245 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27246 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1910, __pyx_L1_error)
27247 __Pyx_GOTREF(__pyx_t_4);
27248 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27251 /* "lxml/objectify.pyx":1911
27252 * temp = dict(temp)
27253 * temp.update(_attributes)
27254 * _attributes = temp # <<<<<<<<<<<<<<
27255 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27258 __Pyx_INCREF(__pyx_v_temp);
27259 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_temp);
27261 /* "lxml/objectify.pyx":1908
27262 * # reuse existing attributes unless redefined in attrib/_attributes
27263 * temp = _value.attrib
27264 * if temp is not None and temp: # <<<<<<<<<<<<<<
27265 * temp = dict(temp)
27266 * temp.update(_attributes)
27270 /* "lxml/objectify.pyx":1914
27271 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27273 * if _xsi is None and _pytype is None: # <<<<<<<<<<<<<<
27274 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27275 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27277 __pyx_t_2 = (__pyx_v__xsi == Py_None);
27278 __pyx_t_3 = (__pyx_t_2 != 0);
27281 __pyx_t_1 = __pyx_t_3;
27282 goto __pyx_L22_bool_binop_done;
27284 __pyx_t_3 = (__pyx_v__pytype == Py_None);
27285 __pyx_t_2 = (__pyx_t_3 != 0);
27286 __pyx_t_1 = __pyx_t_2;
27287 __pyx_L22_bool_binop_done:;
27290 /* "lxml/objectify.pyx":1915
27292 * if _xsi is None and _pytype is None:
27293 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) # <<<<<<<<<<<<<<
27294 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27297 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__attributes, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1915, __pyx_L1_error)
27298 __Pyx_GOTREF(__pyx_t_5);
27300 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27301 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27302 if (likely(__pyx_t_6)) {
27303 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27304 __Pyx_INCREF(__pyx_t_6);
27305 __Pyx_INCREF(function);
27306 __Pyx_DECREF_SET(__pyx_t_5, function);
27309 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR);
27310 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27311 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
27312 __Pyx_GOTREF(__pyx_t_4);
27313 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27314 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_4);
27317 /* "lxml/objectify.pyx":1916
27318 * if _xsi is None and _pytype is None:
27319 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27320 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE) # <<<<<<<<<<<<<<
27322 * if _xsi is not None:
27324 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v__attributes, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1916, __pyx_L1_error)
27325 __Pyx_GOTREF(__pyx_t_5);
27326 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1916, __pyx_L1_error)
27327 __Pyx_GOTREF(__pyx_t_6);
27329 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27330 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
27331 if (likely(__pyx_t_7)) {
27332 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27333 __Pyx_INCREF(__pyx_t_7);
27334 __Pyx_INCREF(function);
27335 __Pyx_DECREF_SET(__pyx_t_5, function);
27338 __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
27339 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27340 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27341 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1916, __pyx_L1_error)
27342 __Pyx_GOTREF(__pyx_t_4);
27343 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27344 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_4);
27347 /* "lxml/objectify.pyx":1914
27348 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27350 * if _xsi is None and _pytype is None: # <<<<<<<<<<<<<<
27351 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27352 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27356 /* "lxml/objectify.pyx":1899
27357 * # special case: no change!
27358 * return _value.__copy__()
27359 * if isinstance(_value, ObjectifiedDataElement): # <<<<<<<<<<<<<<
27360 * # reuse existing nsmap unless redefined in nsmap parameter
27361 * temp = _value.nsmap
27365 /* "lxml/objectify.pyx":1918
27366 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27368 * if _xsi is not None: # <<<<<<<<<<<<<<
27370 * prefix, name = _xsi.split(u':', 1)
27372 __pyx_t_1 = (__pyx_v__xsi != Py_None);
27373 __pyx_t_2 = (__pyx_t_1 != 0);
27376 /* "lxml/objectify.pyx":1919
27378 * if _xsi is not None:
27379 * if u':' in _xsi: # <<<<<<<<<<<<<<
27380 * prefix, name = _xsi.split(u':', 1)
27381 * ns = nsmap.get(prefix)
27383 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_v__xsi, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1919, __pyx_L1_error)
27384 __pyx_t_1 = (__pyx_t_2 != 0);
27387 /* "lxml/objectify.pyx":1920
27388 * if _xsi is not None:
27390 * prefix, name = _xsi.split(u':', 1) # <<<<<<<<<<<<<<
27391 * ns = nsmap.get(prefix)
27392 * if ns != XML_SCHEMA_NS:
27394 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v__xsi, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L1_error)
27395 __Pyx_GOTREF(__pyx_t_4);
27396 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1920, __pyx_L1_error)
27397 __Pyx_GOTREF(__pyx_t_5);
27398 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27399 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
27400 PyObject* sequence = __pyx_t_5;
27401 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27402 if (unlikely(size != 2)) {
27403 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27404 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
27405 __PYX_ERR(0, 1920, __pyx_L1_error)
27407 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27408 if (likely(PyTuple_CheckExact(sequence))) {
27409 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
27410 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
27412 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
27413 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
27415 __Pyx_INCREF(__pyx_t_4);
27416 __Pyx_INCREF(__pyx_t_6);
27418 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L1_error)
27419 __Pyx_GOTREF(__pyx_t_4);
27420 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1920, __pyx_L1_error)
27421 __Pyx_GOTREF(__pyx_t_6);
27423 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27425 Py_ssize_t index = -1;
27426 __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1920, __pyx_L1_error)
27427 __Pyx_GOTREF(__pyx_t_7);
27428 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27429 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
27430 index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed;
27431 __Pyx_GOTREF(__pyx_t_4);
27432 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L26_unpacking_failed;
27433 __Pyx_GOTREF(__pyx_t_6);
27434 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1920, __pyx_L1_error)
27436 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27437 goto __pyx_L27_unpacking_done;
27438 __pyx_L26_unpacking_failed:;
27439 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27441 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
27442 __PYX_ERR(0, 1920, __pyx_L1_error)
27443 __pyx_L27_unpacking_done:;
27445 __pyx_v_prefix = __pyx_t_4;
27447 __pyx_v_name = __pyx_t_6;
27450 /* "lxml/objectify.pyx":1921
27452 * prefix, name = _xsi.split(u':', 1)
27453 * ns = nsmap.get(prefix) # <<<<<<<<<<<<<<
27454 * if ns != XML_SCHEMA_NS:
27455 * raise ValueError, u"XSD types require the XSD namespace"
27457 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1921, __pyx_L1_error)
27458 __Pyx_GOTREF(__pyx_t_6);
27460 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
27461 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
27462 if (likely(__pyx_t_4)) {
27463 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27464 __Pyx_INCREF(__pyx_t_4);
27465 __Pyx_INCREF(function);
27466 __Pyx_DECREF_SET(__pyx_t_6, function);
27469 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_prefix) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_prefix);
27470 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27471 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1921, __pyx_L1_error)
27472 __Pyx_GOTREF(__pyx_t_5);
27473 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27474 __pyx_v_ns = __pyx_t_5;
27477 /* "lxml/objectify.pyx":1922
27478 * prefix, name = _xsi.split(u':', 1)
27479 * ns = nsmap.get(prefix)
27480 * if ns != XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27481 * raise ValueError, u"XSD types require the XSD namespace"
27482 * elif nsmap is _DEFAULT_NSMAP:
27484 __pyx_t_5 = PyObject_RichCompare(__pyx_v_ns, __pyx_v_4lxml_9objectify_XML_SCHEMA_NS, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1922, __pyx_L1_error)
27485 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1922, __pyx_L1_error)
27486 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27487 if (unlikely(__pyx_t_1)) {
27489 /* "lxml/objectify.pyx":1923
27490 * ns = nsmap.get(prefix)
27491 * if ns != XML_SCHEMA_NS:
27492 * raise ValueError, u"XSD types require the XSD namespace" # <<<<<<<<<<<<<<
27493 * elif nsmap is _DEFAULT_NSMAP:
27496 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_XSD_types_require_the_XSD_namesp, 0, 0);
27497 __PYX_ERR(0, 1923, __pyx_L1_error)
27499 /* "lxml/objectify.pyx":1922
27500 * prefix, name = _xsi.split(u':', 1)
27501 * ns = nsmap.get(prefix)
27502 * if ns != XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27503 * raise ValueError, u"XSD types require the XSD namespace"
27504 * elif nsmap is _DEFAULT_NSMAP:
27508 /* "lxml/objectify.pyx":1919
27510 * if _xsi is not None:
27511 * if u':' in _xsi: # <<<<<<<<<<<<<<
27512 * prefix, name = _xsi.split(u':', 1)
27513 * ns = nsmap.get(prefix)
27518 /* "lxml/objectify.pyx":1924
27519 * if ns != XML_SCHEMA_NS:
27520 * raise ValueError, u"XSD types require the XSD namespace"
27521 * elif nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27523 * _xsi = u'xsd:' + _xsi
27525 __pyx_t_1 = (__pyx_v_nsmap == __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
27526 __pyx_t_2 = (__pyx_t_1 != 0);
27529 /* "lxml/objectify.pyx":1925
27530 * raise ValueError, u"XSD types require the XSD namespace"
27531 * elif nsmap is _DEFAULT_NSMAP:
27532 * name = _xsi # <<<<<<<<<<<<<<
27533 * _xsi = u'xsd:' + _xsi
27536 __Pyx_INCREF(__pyx_v__xsi);
27537 __pyx_v_name = __pyx_v__xsi;
27539 /* "lxml/objectify.pyx":1926
27540 * elif nsmap is _DEFAULT_NSMAP:
27542 * _xsi = u'xsd:' + _xsi # <<<<<<<<<<<<<<
27546 __pyx_t_5 = PyNumber_Add(__pyx_kp_u_xsd, __pyx_v__xsi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1926, __pyx_L1_error)
27547 __Pyx_GOTREF(__pyx_t_5);
27548 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_5);
27551 /* "lxml/objectify.pyx":1924
27552 * if ns != XML_SCHEMA_NS:
27553 * raise ValueError, u"XSD types require the XSD namespace"
27554 * elif nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27556 * _xsi = u'xsd:' + _xsi
27561 /* "lxml/objectify.pyx":1928
27562 * _xsi = u'xsd:' + _xsi
27564 * name = _xsi # <<<<<<<<<<<<<<
27565 * for prefix, ns in nsmap.items():
27566 * if ns == XML_SCHEMA_NS:
27569 __Pyx_INCREF(__pyx_v__xsi);
27570 __pyx_v_name = __pyx_v__xsi;
27572 /* "lxml/objectify.pyx":1929
27575 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27576 * if ns == XML_SCHEMA_NS:
27577 * if prefix is not None and prefix:
27579 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1929, __pyx_L1_error)
27580 __Pyx_GOTREF(__pyx_t_6);
27582 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
27583 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
27584 if (likely(__pyx_t_4)) {
27585 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27586 __Pyx_INCREF(__pyx_t_4);
27587 __Pyx_INCREF(function);
27588 __Pyx_DECREF_SET(__pyx_t_6, function);
27591 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
27592 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27593 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L1_error)
27594 __Pyx_GOTREF(__pyx_t_5);
27595 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27596 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
27597 __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
27600 __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1929, __pyx_L1_error)
27601 __Pyx_GOTREF(__pyx_t_6);
27602 __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1929, __pyx_L1_error)
27604 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27606 if (likely(!__pyx_t_10)) {
27607 if (likely(PyList_CheckExact(__pyx_t_6))) {
27608 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
27609 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27610 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1929, __pyx_L1_error)
27612 __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L1_error)
27613 __Pyx_GOTREF(__pyx_t_5);
27616 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
27617 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27618 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1929, __pyx_L1_error)
27620 __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L1_error)
27621 __Pyx_GOTREF(__pyx_t_5);
27625 __pyx_t_5 = __pyx_t_10(__pyx_t_6);
27626 if (unlikely(!__pyx_t_5)) {
27627 PyObject* exc_type = PyErr_Occurred();
27629 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27630 else __PYX_ERR(0, 1929, __pyx_L1_error)
27634 __Pyx_GOTREF(__pyx_t_5);
27636 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
27637 PyObject* sequence = __pyx_t_5;
27638 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27639 if (unlikely(size != 2)) {
27640 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27641 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
27642 __PYX_ERR(0, 1929, __pyx_L1_error)
27644 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27645 if (likely(PyTuple_CheckExact(sequence))) {
27646 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
27647 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
27649 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
27650 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
27652 __Pyx_INCREF(__pyx_t_4);
27653 __Pyx_INCREF(__pyx_t_7);
27655 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1929, __pyx_L1_error)
27656 __Pyx_GOTREF(__pyx_t_4);
27657 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1929, __pyx_L1_error)
27658 __Pyx_GOTREF(__pyx_t_7);
27660 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27662 Py_ssize_t index = -1;
27663 __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1929, __pyx_L1_error)
27664 __Pyx_GOTREF(__pyx_t_11);
27665 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27666 __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
27667 index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L31_unpacking_failed;
27668 __Pyx_GOTREF(__pyx_t_4);
27669 index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L31_unpacking_failed;
27670 __Pyx_GOTREF(__pyx_t_7);
27671 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)
27673 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27674 goto __pyx_L32_unpacking_done;
27675 __pyx_L31_unpacking_failed:;
27676 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27678 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
27679 __PYX_ERR(0, 1929, __pyx_L1_error)
27680 __pyx_L32_unpacking_done:;
27682 __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_4);
27684 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
27687 /* "lxml/objectify.pyx":1930
27689 * for prefix, ns in nsmap.items():
27690 * if ns == XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27691 * if prefix is not None and prefix:
27692 * _xsi = prefix + u':' + _xsi
27694 __pyx_t_5 = PyObject_RichCompare(__pyx_v_ns, __pyx_v_4lxml_9objectify_XML_SCHEMA_NS, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1930, __pyx_L1_error)
27695 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1930, __pyx_L1_error)
27696 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27699 /* "lxml/objectify.pyx":1931
27700 * for prefix, ns in nsmap.items():
27701 * if ns == XML_SCHEMA_NS:
27702 * if prefix is not None and prefix: # <<<<<<<<<<<<<<
27703 * _xsi = prefix + u':' + _xsi
27706 __pyx_t_1 = (__pyx_v_prefix != Py_None);
27707 __pyx_t_3 = (__pyx_t_1 != 0);
27710 __pyx_t_2 = __pyx_t_3;
27711 goto __pyx_L35_bool_binop_done;
27713 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1931, __pyx_L1_error)
27714 __pyx_t_2 = __pyx_t_3;
27715 __pyx_L35_bool_binop_done:;
27718 /* "lxml/objectify.pyx":1932
27719 * if ns == XML_SCHEMA_NS:
27720 * if prefix is not None and prefix:
27721 * _xsi = prefix + u':' + _xsi # <<<<<<<<<<<<<<
27725 __pyx_t_5 = PyNumber_Add(__pyx_v_prefix, __pyx_kp_u__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1932, __pyx_L1_error)
27726 __Pyx_GOTREF(__pyx_t_5);
27727 __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v__xsi); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
27728 __Pyx_GOTREF(__pyx_t_7);
27729 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27730 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_7);
27733 /* "lxml/objectify.pyx":1931
27734 * for prefix, ns in nsmap.items():
27735 * if ns == XML_SCHEMA_NS:
27736 * if prefix is not None and prefix: # <<<<<<<<<<<<<<
27737 * _xsi = prefix + u':' + _xsi
27742 /* "lxml/objectify.pyx":1933
27743 * if prefix is not None and prefix:
27744 * _xsi = prefix + u':' + _xsi
27745 * break # <<<<<<<<<<<<<<
27747 * raise ValueError, u"XSD types require the XSD namespace"
27749 goto __pyx_L30_break;
27751 /* "lxml/objectify.pyx":1930
27753 * for prefix, ns in nsmap.items():
27754 * if ns == XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27755 * if prefix is not None and prefix:
27756 * _xsi = prefix + u':' + _xsi
27760 /* "lxml/objectify.pyx":1929
27763 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27764 * if ns == XML_SCHEMA_NS:
27765 * if prefix is not None and prefix:
27770 /* "lxml/objectify.pyx":1935
27773 * raise ValueError, u"XSD types require the XSD namespace" # <<<<<<<<<<<<<<
27774 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27775 * if _pytype is None:
27777 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_XSD_types_require_the_XSD_namesp, 0, 0);
27778 __PYX_ERR(0, 1935, __pyx_L1_error)
27781 /* "lxml/objectify.pyx":1929
27784 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27785 * if ns == XML_SCHEMA_NS:
27786 * if prefix is not None and prefix:
27789 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27793 /* "lxml/objectify.pyx":1936
27795 * raise ValueError, u"XSD types require the XSD namespace"
27796 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi # <<<<<<<<<<<<<<
27797 * if _pytype is None:
27798 * # allow using unregistered or even wrong xsi:type names
27800 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR, __pyx_v__xsi) < 0)) __PYX_ERR(0, 1936, __pyx_L1_error)
27802 /* "lxml/objectify.pyx":1937
27803 * raise ValueError, u"XSD types require the XSD namespace"
27804 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27805 * if _pytype is None: # <<<<<<<<<<<<<<
27806 * # allow using unregistered or even wrong xsi:type names
27807 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27809 __pyx_t_2 = (__pyx_v__pytype == Py_None);
27810 __pyx_t_3 = (__pyx_t_2 != 0);
27813 /* "lxml/objectify.pyx":1939
27814 * if _pytype is None:
27815 * # allow using unregistered or even wrong xsi:type names
27816 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi) # <<<<<<<<<<<<<<
27817 * if py_type is None:
27818 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27820 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
27821 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
27822 __PYX_ERR(0, 1939, __pyx_L1_error)
27824 __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v__xsi, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1939, __pyx_L1_error)
27825 __Pyx_GOTREF(__pyx_t_6);
27826 __pyx_t_7 = __pyx_t_6;
27827 __Pyx_INCREF(__pyx_t_7);
27828 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27829 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_7);
27832 /* "lxml/objectify.pyx":1940
27833 * # allow using unregistered or even wrong xsi:type names
27834 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27835 * if py_type is None: # <<<<<<<<<<<<<<
27836 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27837 * if py_type is not None:
27839 __pyx_t_3 = (((PyObject *)__pyx_v_py_type) == Py_None);
27840 __pyx_t_2 = (__pyx_t_3 != 0);
27843 /* "lxml/objectify.pyx":1941
27844 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27845 * if py_type is None:
27846 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name) # <<<<<<<<<<<<<<
27847 * if py_type is not None:
27848 * _pytype = py_type.name
27850 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
27851 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
27852 __PYX_ERR(0, 1941, __pyx_L1_error)
27854 __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_name, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error)
27855 __Pyx_GOTREF(__pyx_t_7);
27856 __pyx_t_6 = __pyx_t_7;
27857 __Pyx_INCREF(__pyx_t_6);
27858 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27859 __Pyx_DECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
27862 /* "lxml/objectify.pyx":1940
27863 * # allow using unregistered or even wrong xsi:type names
27864 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27865 * if py_type is None: # <<<<<<<<<<<<<<
27866 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27867 * if py_type is not None:
27871 /* "lxml/objectify.pyx":1942
27872 * if py_type is None:
27873 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27874 * if py_type is not None: # <<<<<<<<<<<<<<
27875 * _pytype = py_type.name
27878 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
27879 __pyx_t_3 = (__pyx_t_2 != 0);
27882 /* "lxml/objectify.pyx":1943
27883 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27884 * if py_type is not None:
27885 * _pytype = py_type.name # <<<<<<<<<<<<<<
27887 * if _pytype is None:
27889 __pyx_t_6 = __pyx_v_py_type->name;
27890 __Pyx_INCREF(__pyx_t_6);
27891 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
27894 /* "lxml/objectify.pyx":1942
27895 * if py_type is None:
27896 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27897 * if py_type is not None: # <<<<<<<<<<<<<<
27898 * _pytype = py_type.name
27903 /* "lxml/objectify.pyx":1937
27904 * raise ValueError, u"XSD types require the XSD namespace"
27905 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27906 * if _pytype is None: # <<<<<<<<<<<<<<
27907 * # allow using unregistered or even wrong xsi:type names
27908 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27912 /* "lxml/objectify.pyx":1918
27913 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27915 * if _xsi is not None: # <<<<<<<<<<<<<<
27917 * prefix, name = _xsi.split(u':', 1)
27921 /* "lxml/objectify.pyx":1945
27922 * _pytype = py_type.name
27924 * if _pytype is None: # <<<<<<<<<<<<<<
27925 * _pytype = _pytypename(_value)
27928 __pyx_t_3 = (__pyx_v__pytype == Py_None);
27929 __pyx_t_2 = (__pyx_t_3 != 0);
27932 /* "lxml/objectify.pyx":1946
27934 * if _pytype is None:
27935 * _pytype = _pytypename(_value) # <<<<<<<<<<<<<<
27937 * if _value is None and _pytype != u"str":
27939 __pyx_t_6 = __pyx_f_4lxml_9objectify__pytypename(__pyx_v__value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1946, __pyx_L1_error)
27940 __Pyx_GOTREF(__pyx_t_6);
27941 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
27944 /* "lxml/objectify.pyx":1945
27945 * _pytype = py_type.name
27947 * if _pytype is None: # <<<<<<<<<<<<<<
27948 * _pytype = _pytypename(_value)
27953 /* "lxml/objectify.pyx":1948
27954 * _pytype = _pytypename(_value)
27956 * if _value is None and _pytype != u"str": # <<<<<<<<<<<<<<
27957 * _pytype = _pytype or u"NoneType"
27960 __pyx_t_3 = (__pyx_v__value == Py_None);
27961 __pyx_t_1 = (__pyx_t_3 != 0);
27964 __pyx_t_2 = __pyx_t_1;
27965 goto __pyx_L43_bool_binop_done;
27967 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v__pytype, __pyx_n_u_str, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1948, __pyx_L1_error)
27968 __pyx_t_2 = __pyx_t_1;
27969 __pyx_L43_bool_binop_done:;
27972 /* "lxml/objectify.pyx":1949
27974 * if _value is None and _pytype != u"str":
27975 * _pytype = _pytype or u"NoneType" # <<<<<<<<<<<<<<
27977 * elif python._isString(_value):
27979 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__pytype); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1949, __pyx_L1_error)
27982 __Pyx_INCREF(__pyx_v__pytype);
27983 __pyx_t_6 = __pyx_v__pytype;
27984 goto __pyx_L45_bool_binop_done;
27986 __Pyx_INCREF(__pyx_n_u_NoneType);
27987 __pyx_t_6 = __pyx_n_u_NoneType;
27988 __pyx_L45_bool_binop_done:;
27989 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
27992 /* "lxml/objectify.pyx":1950
27993 * if _value is None and _pytype != u"str":
27994 * _pytype = _pytype or u"NoneType"
27995 * strval = None # <<<<<<<<<<<<<<
27996 * elif python._isString(_value):
27999 __Pyx_INCREF(Py_None);
28000 __pyx_v_strval = Py_None;
28002 /* "lxml/objectify.pyx":1948
28003 * _pytype = _pytypename(_value)
28005 * if _value is None and _pytype != u"str": # <<<<<<<<<<<<<<
28006 * _pytype = _pytype or u"NoneType"
28012 /* "lxml/objectify.pyx":1951
28013 * _pytype = _pytype or u"NoneType"
28015 * elif python._isString(_value): # <<<<<<<<<<<<<<
28017 * elif isinstance(_value, bool):
28019 __pyx_t_2 = (_isString(__pyx_v__value) != 0);
28022 /* "lxml/objectify.pyx":1952
28024 * elif python._isString(_value):
28025 * strval = _value # <<<<<<<<<<<<<<
28026 * elif isinstance(_value, bool):
28029 __Pyx_INCREF(__pyx_v__value);
28030 __pyx_v_strval = __pyx_v__value;
28032 /* "lxml/objectify.pyx":1951
28033 * _pytype = _pytype or u"NoneType"
28035 * elif python._isString(_value): # <<<<<<<<<<<<<<
28037 * elif isinstance(_value, bool):
28042 /* "lxml/objectify.pyx":1953
28043 * elif python._isString(_value):
28045 * elif isinstance(_value, bool): # <<<<<<<<<<<<<<
28049 __pyx_t_6 = ((PyObject*)&PyBool_Type);
28050 __Pyx_INCREF(__pyx_t_6);
28051 __pyx_t_2 = PyObject_IsInstance(__pyx_v__value, __pyx_t_6); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1953, __pyx_L1_error)
28052 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28053 __pyx_t_1 = (__pyx_t_2 != 0);
28056 /* "lxml/objectify.pyx":1954
28058 * elif isinstance(_value, bool):
28059 * if _value: # <<<<<<<<<<<<<<
28063 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v__value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1954, __pyx_L1_error)
28066 /* "lxml/objectify.pyx":1955
28067 * elif isinstance(_value, bool):
28069 * strval = u"true" # <<<<<<<<<<<<<<
28071 * strval = u"false"
28073 __Pyx_INCREF(__pyx_n_u_true);
28074 __pyx_v_strval = __pyx_n_u_true;
28076 /* "lxml/objectify.pyx":1954
28078 * elif isinstance(_value, bool):
28079 * if _value: # <<<<<<<<<<<<<<
28086 /* "lxml/objectify.pyx":1957
28089 * strval = u"false" # <<<<<<<<<<<<<<
28091 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28094 __Pyx_INCREF(__pyx_n_u_false);
28095 __pyx_v_strval = __pyx_n_u_false;
28099 /* "lxml/objectify.pyx":1953
28100 * elif python._isString(_value):
28102 * elif isinstance(_value, bool): # <<<<<<<<<<<<<<
28109 /* "lxml/objectify.pyx":1959
28110 * strval = u"false"
28112 * py_type = <PyType>_PYTYPE_DICT.get(_pytype) # <<<<<<<<<<<<<<
28113 * stringify = unicode if py_type is None else py_type.stringify
28114 * strval = stringify(_value)
28117 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
28118 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
28119 __PYX_ERR(0, 1959, __pyx_L1_error)
28121 __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v__pytype, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1959, __pyx_L1_error)
28122 __Pyx_GOTREF(__pyx_t_6);
28123 __pyx_t_7 = __pyx_t_6;
28124 __Pyx_INCREF(__pyx_t_7);
28125 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28126 __Pyx_XDECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_7));
28129 /* "lxml/objectify.pyx":1960
28131 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28132 * stringify = unicode if py_type is None else py_type.stringify # <<<<<<<<<<<<<<
28133 * strval = stringify(_value)
28136 __pyx_t_1 = (((PyObject *)__pyx_v_py_type) == Py_None);
28137 if ((__pyx_t_1 != 0)) {
28138 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
28139 __pyx_t_7 = ((PyObject *)(&PyUnicode_Type));
28141 __Pyx_INCREF(__pyx_v_py_type->stringify);
28142 __pyx_t_7 = __pyx_v_py_type->stringify;
28144 __pyx_v_stringify = __pyx_t_7;
28147 /* "lxml/objectify.pyx":1961
28148 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28149 * stringify = unicode if py_type is None else py_type.stringify
28150 * strval = stringify(_value) # <<<<<<<<<<<<<<
28152 * if _pytype is not None:
28154 __Pyx_INCREF(__pyx_v_stringify);
28155 __pyx_t_6 = __pyx_v_stringify; __pyx_t_5 = NULL;
28156 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
28157 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
28158 if (likely(__pyx_t_5)) {
28159 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
28160 __Pyx_INCREF(__pyx_t_5);
28161 __Pyx_INCREF(function);
28162 __Pyx_DECREF_SET(__pyx_t_6, function);
28165 __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v__value) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v__value);
28166 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28167 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1961, __pyx_L1_error)
28168 __Pyx_GOTREF(__pyx_t_7);
28169 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28170 __pyx_v_strval = __pyx_t_7;
28175 /* "lxml/objectify.pyx":1963
28176 * strval = stringify(_value)
28178 * if _pytype is not None: # <<<<<<<<<<<<<<
28179 * if _pytype == u"NoneType" or _pytype == u"none":
28182 __pyx_t_1 = (__pyx_v__pytype != Py_None);
28183 __pyx_t_2 = (__pyx_t_1 != 0);
28186 /* "lxml/objectify.pyx":1964
28188 * if _pytype is not None:
28189 * if _pytype == u"NoneType" or _pytype == u"none": # <<<<<<<<<<<<<<
28191 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28193 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v__pytype, __pyx_n_u_NoneType, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1964, __pyx_L1_error)
28196 __pyx_t_2 = __pyx_t_1;
28197 goto __pyx_L50_bool_binop_done;
28199 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v__pytype, __pyx_n_u_none, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1964, __pyx_L1_error)
28200 __pyx_t_2 = __pyx_t_1;
28201 __pyx_L50_bool_binop_done:;
28204 /* "lxml/objectify.pyx":1965
28205 * if _pytype is not None:
28206 * if _pytype == u"NoneType" or _pytype == u"none":
28207 * strval = None # <<<<<<<<<<<<<<
28208 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28211 __Pyx_INCREF(Py_None);
28212 __Pyx_DECREF_SET(__pyx_v_strval, Py_None);
28214 /* "lxml/objectify.pyx":1966
28215 * if _pytype == u"NoneType" or _pytype == u"none":
28217 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true" # <<<<<<<<<<<<<<
28219 * # check if type information from arguments is valid
28221 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR, __pyx_n_u_true) < 0)) __PYX_ERR(0, 1966, __pyx_L1_error)
28223 /* "lxml/objectify.pyx":1964
28225 * if _pytype is not None:
28226 * if _pytype == u"NoneType" or _pytype == u"none": # <<<<<<<<<<<<<<
28228 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28233 /* "lxml/objectify.pyx":1969
28235 * # check if type information from arguments is valid
28236 * py_type = <PyType>_PYTYPE_DICT.get(_pytype) # <<<<<<<<<<<<<<
28237 * if py_type is not None:
28238 * if py_type.type_check is not None:
28241 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
28242 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
28243 __PYX_ERR(0, 1969, __pyx_L1_error)
28245 __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v__pytype, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1969, __pyx_L1_error)
28246 __Pyx_GOTREF(__pyx_t_7);
28247 __pyx_t_6 = __pyx_t_7;
28248 __Pyx_INCREF(__pyx_t_6);
28249 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28250 __Pyx_XDECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
28253 /* "lxml/objectify.pyx":1970
28254 * # check if type information from arguments is valid
28255 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28256 * if py_type is not None: # <<<<<<<<<<<<<<
28257 * if py_type.type_check is not None:
28258 * py_type.type_check(strval)
28260 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
28261 __pyx_t_1 = (__pyx_t_2 != 0);
28264 /* "lxml/objectify.pyx":1971
28265 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28266 * if py_type is not None:
28267 * if py_type.type_check is not None: # <<<<<<<<<<<<<<
28268 * py_type.type_check(strval)
28269 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28271 __pyx_t_1 = (__pyx_v_py_type->type_check != Py_None);
28272 __pyx_t_2 = (__pyx_t_1 != 0);
28275 /* "lxml/objectify.pyx":1972
28276 * if py_type is not None:
28277 * if py_type.type_check is not None:
28278 * py_type.type_check(strval) # <<<<<<<<<<<<<<
28279 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28282 __Pyx_INCREF(__pyx_v_py_type->type_check);
28283 __pyx_t_7 = __pyx_v_py_type->type_check; __pyx_t_5 = NULL;
28284 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
28285 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
28286 if (likely(__pyx_t_5)) {
28287 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
28288 __Pyx_INCREF(__pyx_t_5);
28289 __Pyx_INCREF(function);
28290 __Pyx_DECREF_SET(__pyx_t_7, function);
28293 __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_5, __pyx_v_strval) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_strval);
28294 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28295 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1972, __pyx_L1_error)
28296 __Pyx_GOTREF(__pyx_t_6);
28297 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28298 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28300 /* "lxml/objectify.pyx":1971
28301 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28302 * if py_type is not None:
28303 * if py_type.type_check is not None: # <<<<<<<<<<<<<<
28304 * py_type.type_check(strval)
28305 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28309 /* "lxml/objectify.pyx":1973
28310 * if py_type.type_check is not None:
28311 * py_type.type_check(strval)
28312 * _attributes[PYTYPE_ATTRIBUTE] = _pytype # <<<<<<<<<<<<<<
28314 * return _makeElement(u"value", strval, _attributes, nsmap)
28316 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1973, __pyx_L1_error)
28317 __Pyx_GOTREF(__pyx_t_6);
28318 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_t_6, __pyx_v__pytype) < 0)) __PYX_ERR(0, 1973, __pyx_L1_error)
28319 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28321 /* "lxml/objectify.pyx":1970
28322 * # check if type information from arguments is valid
28323 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28324 * if py_type is not None: # <<<<<<<<<<<<<<
28325 * if py_type.type_check is not None:
28326 * py_type.type_check(strval)
28332 /* "lxml/objectify.pyx":1963
28333 * strval = stringify(_value)
28335 * if _pytype is not None: # <<<<<<<<<<<<<<
28336 * if _pytype == u"NoneType" or _pytype == u"none":
28341 /* "lxml/objectify.pyx":1975
28342 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28344 * return _makeElement(u"value", strval, _attributes, nsmap) # <<<<<<<<<<<<<<
28348 __Pyx_XDECREF(__pyx_r);
28349 __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_9objectify__makeElement(__pyx_n_u_value, __pyx_v_strval, __pyx_v__attributes, __pyx_v_nsmap)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1975, __pyx_L1_error)
28350 __Pyx_GOTREF(__pyx_t_6);
28351 __pyx_r = __pyx_t_6;
28355 /* "lxml/objectify.pyx":1872
28356 * return _makeElement(_tag, None, _attributes, nsmap)
28358 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
28360 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
28363 /* function exit code */
28365 __Pyx_XDECREF(__pyx_t_4);
28366 __Pyx_XDECREF(__pyx_t_5);
28367 __Pyx_XDECREF(__pyx_t_6);
28368 __Pyx_XDECREF(__pyx_t_7);
28369 __Pyx_XDECREF(__pyx_t_11);
28370 __Pyx_AddTraceback("lxml.objectify.DataElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
28373 __Pyx_XDECREF(__pyx_v__attributes);
28374 __Pyx_XDECREF(__pyx_v_temp);
28375 __Pyx_XDECREF(__pyx_v_prefix);
28376 __Pyx_XDECREF(__pyx_v_name);
28377 __Pyx_XDECREF(__pyx_v_ns);
28378 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
28379 __Pyx_XDECREF(__pyx_v_strval);
28380 __Pyx_XDECREF(__pyx_v_stringify);
28381 __Pyx_XDECREF(__pyx_v_attrib);
28382 __Pyx_XDECREF(__pyx_v_nsmap);
28383 __Pyx_XDECREF(__pyx_v__pytype);
28384 __Pyx_XDECREF(__pyx_v__xsi);
28385 __Pyx_XGIVEREF(__pyx_r);
28386 __Pyx_RefNannyFinishContext();
28390 /* "src/lxml/objectpath.pxi":24
28391 * cdef _ObjectPath* _c_path
28392 * cdef Py_ssize_t _path_len
28393 * def __init__(self, path): # <<<<<<<<<<<<<<
28394 * if python._isString(path):
28395 * self._path = _parse_object_path_string(path)
28398 /* Python wrapper */
28399 static int __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28400 static int __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28401 PyObject *__pyx_v_path = 0;
28402 int __pyx_lineno = 0;
28403 const char *__pyx_filename = NULL;
28404 int __pyx_clineno = 0;
28406 __Pyx_RefNannyDeclarations
28407 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
28409 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0};
28410 PyObject* values[1] = {0};
28411 if (unlikely(__pyx_kwds)) {
28412 Py_ssize_t kw_args;
28413 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28414 switch (pos_args) {
28415 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28416 CYTHON_FALLTHROUGH;
28418 default: goto __pyx_L5_argtuple_error;
28420 kw_args = PyDict_Size(__pyx_kwds);
28421 switch (pos_args) {
28423 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
28424 else goto __pyx_L5_argtuple_error;
28426 if (unlikely(kw_args > 0)) {
28427 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 24, __pyx_L3_error)
28429 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
28430 goto __pyx_L5_argtuple_error;
28432 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28434 __pyx_v_path = values[0];
28436 goto __pyx_L4_argument_unpacking_done;
28437 __pyx_L5_argtuple_error:;
28438 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 24, __pyx_L3_error)
28440 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28441 __Pyx_RefNannyFinishContext();
28443 __pyx_L4_argument_unpacking_done:;
28444 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath___init__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_path);
28446 /* function exit code */
28447 __Pyx_RefNannyFinishContext();
28451 static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, PyObject *__pyx_v_path) {
28453 __Pyx_RefNannyDeclarations
28455 PyObject *__pyx_t_2 = NULL;
28456 Py_ssize_t __pyx_t_3;
28457 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_t_4;
28458 int __pyx_lineno = 0;
28459 const char *__pyx_filename = NULL;
28460 int __pyx_clineno = 0;
28461 __Pyx_RefNannySetupContext("__init__", 0);
28463 /* "src/lxml/objectpath.pxi":25
28464 * cdef Py_ssize_t _path_len
28465 * def __init__(self, path):
28466 * if python._isString(path): # <<<<<<<<<<<<<<
28467 * self._path = _parse_object_path_string(path)
28468 * self._path_str = path
28470 __pyx_t_1 = (_isString(__pyx_v_path) != 0);
28473 /* "src/lxml/objectpath.pxi":26
28474 * def __init__(self, path):
28475 * if python._isString(path):
28476 * self._path = _parse_object_path_string(path) # <<<<<<<<<<<<<<
28477 * self._path_str = path
28480 __pyx_t_2 = __pyx_f_4lxml_9objectify__parse_object_path_string(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error)
28481 __Pyx_GOTREF(__pyx_t_2);
28482 __Pyx_GIVEREF(__pyx_t_2);
28483 __Pyx_GOTREF(__pyx_v_self->_path);
28484 __Pyx_DECREF(__pyx_v_self->_path);
28485 __pyx_v_self->_path = ((PyObject*)__pyx_t_2);
28488 /* "src/lxml/objectpath.pxi":27
28489 * if python._isString(path):
28490 * self._path = _parse_object_path_string(path)
28491 * self._path_str = path # <<<<<<<<<<<<<<
28493 * self._path = _parse_object_path_list(path)
28495 __Pyx_INCREF(__pyx_v_path);
28496 __Pyx_GIVEREF(__pyx_v_path);
28497 __Pyx_GOTREF(__pyx_v_self->_path_str);
28498 __Pyx_DECREF(__pyx_v_self->_path_str);
28499 __pyx_v_self->_path_str = __pyx_v_path;
28501 /* "src/lxml/objectpath.pxi":25
28502 * cdef Py_ssize_t _path_len
28503 * def __init__(self, path):
28504 * if python._isString(path): # <<<<<<<<<<<<<<
28505 * self._path = _parse_object_path_string(path)
28506 * self._path_str = path
28511 /* "src/lxml/objectpath.pxi":29
28512 * self._path_str = path
28514 * self._path = _parse_object_path_list(path) # <<<<<<<<<<<<<<
28515 * self._path_str = u'.'.join(path)
28516 * self._path_len = len(self._path)
28519 __pyx_t_2 = __pyx_f_4lxml_9objectify__parse_object_path_list(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error)
28520 __Pyx_GOTREF(__pyx_t_2);
28521 __Pyx_GIVEREF(__pyx_t_2);
28522 __Pyx_GOTREF(__pyx_v_self->_path);
28523 __Pyx_DECREF(__pyx_v_self->_path);
28524 __pyx_v_self->_path = ((PyObject*)__pyx_t_2);
28527 /* "src/lxml/objectpath.pxi":30
28529 * self._path = _parse_object_path_list(path)
28530 * self._path_str = u'.'.join(path) # <<<<<<<<<<<<<<
28531 * self._path_len = len(self._path)
28532 * self._c_path = _build_object_path_segments(self._path)
28534 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error)
28535 __Pyx_GOTREF(__pyx_t_2);
28536 __Pyx_GIVEREF(__pyx_t_2);
28537 __Pyx_GOTREF(__pyx_v_self->_path_str);
28538 __Pyx_DECREF(__pyx_v_self->_path_str);
28539 __pyx_v_self->_path_str = __pyx_t_2;
28544 /* "src/lxml/objectpath.pxi":31
28545 * self._path = _parse_object_path_list(path)
28546 * self._path_str = u'.'.join(path)
28547 * self._path_len = len(self._path) # <<<<<<<<<<<<<<
28548 * self._c_path = _build_object_path_segments(self._path)
28549 * self.find = self.__call__
28551 __pyx_t_2 = __pyx_v_self->_path;
28552 __Pyx_INCREF(__pyx_t_2);
28553 if (unlikely(__pyx_t_2 == Py_None)) {
28554 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
28555 __PYX_ERR(1, 31, __pyx_L1_error)
28557 __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 31, __pyx_L1_error)
28558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28559 __pyx_v_self->_path_len = __pyx_t_3;
28561 /* "src/lxml/objectpath.pxi":32
28562 * self._path_str = u'.'.join(path)
28563 * self._path_len = len(self._path)
28564 * self._c_path = _build_object_path_segments(self._path) # <<<<<<<<<<<<<<
28565 * self.find = self.__call__
28568 __pyx_t_2 = __pyx_v_self->_path;
28569 __Pyx_INCREF(__pyx_t_2);
28570 __pyx_t_4 = __pyx_f_4lxml_9objectify__build_object_path_segments(((PyObject*)__pyx_t_2)); if (unlikely(__pyx_t_4 == ((__pyx_t_4lxml_9objectify__ObjectPath *)NULL))) __PYX_ERR(1, 32, __pyx_L1_error)
28571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28572 __pyx_v_self->_c_path = __pyx_t_4;
28574 /* "src/lxml/objectpath.pxi":33
28575 * self._path_len = len(self._path)
28576 * self._c_path = _build_object_path_segments(self._path)
28577 * self.find = self.__call__ # <<<<<<<<<<<<<<
28579 * def __dealloc__(self):
28581 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_call); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error)
28582 __Pyx_GOTREF(__pyx_t_2);
28583 __Pyx_GIVEREF(__pyx_t_2);
28584 __Pyx_GOTREF(__pyx_v_self->find);
28585 __Pyx_DECREF(__pyx_v_self->find);
28586 __pyx_v_self->find = __pyx_t_2;
28589 /* "src/lxml/objectpath.pxi":24
28590 * cdef _ObjectPath* _c_path
28591 * cdef Py_ssize_t _path_len
28592 * def __init__(self, path): # <<<<<<<<<<<<<<
28593 * if python._isString(path):
28594 * self._path = _parse_object_path_string(path)
28597 /* function exit code */
28601 __Pyx_XDECREF(__pyx_t_2);
28602 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28605 __Pyx_RefNannyFinishContext();
28609 /* "src/lxml/objectpath.pxi":35
28610 * self.find = self.__call__
28612 * def __dealloc__(self): # <<<<<<<<<<<<<<
28613 * if self._c_path is not NULL:
28614 * python.lxml_free(self._c_path)
28617 /* Python wrapper */
28618 static void __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
28619 static void __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(PyObject *__pyx_v_self) {
28620 __Pyx_RefNannyDeclarations
28621 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
28622 __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
28624 /* function exit code */
28625 __Pyx_RefNannyFinishContext();
28628 static void __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
28629 __Pyx_RefNannyDeclarations
28631 __Pyx_RefNannySetupContext("__dealloc__", 0);
28633 /* "src/lxml/objectpath.pxi":36
28635 * def __dealloc__(self):
28636 * if self._c_path is not NULL: # <<<<<<<<<<<<<<
28637 * python.lxml_free(self._c_path)
28640 __pyx_t_1 = ((__pyx_v_self->_c_path != NULL) != 0);
28643 /* "src/lxml/objectpath.pxi":37
28644 * def __dealloc__(self):
28645 * if self._c_path is not NULL:
28646 * python.lxml_free(self._c_path) # <<<<<<<<<<<<<<
28648 * def __str__(self):
28650 lxml_free(__pyx_v_self->_c_path);
28652 /* "src/lxml/objectpath.pxi":36
28654 * def __dealloc__(self):
28655 * if self._c_path is not NULL: # <<<<<<<<<<<<<<
28656 * python.lxml_free(self._c_path)
28661 /* "src/lxml/objectpath.pxi":35
28662 * self.find = self.__call__
28664 * def __dealloc__(self): # <<<<<<<<<<<<<<
28665 * if self._c_path is not NULL:
28666 * python.lxml_free(self._c_path)
28669 /* function exit code */
28670 __Pyx_RefNannyFinishContext();
28673 /* "src/lxml/objectpath.pxi":39
28674 * python.lxml_free(self._c_path)
28676 * def __str__(self): # <<<<<<<<<<<<<<
28677 * return self._path_str
28681 /* Python wrapper */
28682 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_5__str__(PyObject *__pyx_v_self); /*proto*/
28683 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_5__str__(PyObject *__pyx_v_self) {
28684 PyObject *__pyx_r = 0;
28685 __Pyx_RefNannyDeclarations
28686 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
28687 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
28689 /* function exit code */
28690 __Pyx_RefNannyFinishContext();
28694 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
28695 PyObject *__pyx_r = NULL;
28696 __Pyx_RefNannyDeclarations
28697 __Pyx_RefNannySetupContext("__str__", 0);
28699 /* "src/lxml/objectpath.pxi":40
28701 * def __str__(self):
28702 * return self._path_str # <<<<<<<<<<<<<<
28704 * def __call__(self, _Element root not None, *_default):
28706 __Pyx_XDECREF(__pyx_r);
28707 __Pyx_INCREF(__pyx_v_self->_path_str);
28708 __pyx_r = __pyx_v_self->_path_str;
28711 /* "src/lxml/objectpath.pxi":39
28712 * python.lxml_free(self._c_path)
28714 * def __str__(self): # <<<<<<<<<<<<<<
28715 * return self._path_str
28719 /* function exit code */
28721 __Pyx_XGIVEREF(__pyx_r);
28722 __Pyx_RefNannyFinishContext();
28726 /* "src/lxml/objectpath.pxi":42
28727 * return self._path_str
28729 * def __call__(self, _Element root not None, *_default): # <<<<<<<<<<<<<<
28730 * u"""Follow the attribute path in the object structure and return the
28731 * target attribute value.
28734 /* Python wrapper */
28735 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28736 static char __pyx_doc_4lxml_9objectify_10ObjectPath_6__call__[] = "Follow the attribute path in the object structure and return the\n target attribute value.\n\n If it it not found, either returns a default value (if one was passed\n as second argument) or raises AttributeError.\n ";
28737 #if CYTHON_COMPILING_IN_CPYTHON
28738 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__;
28740 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28741 struct LxmlElement *__pyx_v_root = 0;
28742 PyObject *__pyx_v__default = 0;
28743 int __pyx_lineno = 0;
28744 const char *__pyx_filename = NULL;
28745 int __pyx_clineno = 0;
28746 PyObject *__pyx_r = 0;
28747 __Pyx_RefNannyDeclarations
28748 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
28749 if (PyTuple_GET_SIZE(__pyx_args) > 1) {
28750 __pyx_v__default = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
28751 if (unlikely(!__pyx_v__default)) {
28752 __Pyx_RefNannyFinishContext();
28755 __Pyx_GOTREF(__pyx_v__default);
28757 __pyx_v__default = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
28760 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,0};
28761 PyObject* values[1] = {0};
28762 if (unlikely(__pyx_kwds)) {
28763 Py_ssize_t kw_args;
28764 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28765 switch (pos_args) {
28767 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28768 CYTHON_FALLTHROUGH;
28771 kw_args = PyDict_Size(__pyx_kwds);
28772 switch (pos_args) {
28774 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
28775 else goto __pyx_L5_argtuple_error;
28777 if (unlikely(kw_args > 0)) {
28778 const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
28779 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__call__") < 0)) __PYX_ERR(1, 42, __pyx_L3_error)
28781 } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
28782 goto __pyx_L5_argtuple_error;
28784 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28786 __pyx_v_root = ((struct LxmlElement *)values[0]);
28788 goto __pyx_L4_argument_unpacking_done;
28789 __pyx_L5_argtuple_error:;
28790 __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 42, __pyx_L3_error)
28792 __Pyx_DECREF(__pyx_v__default); __pyx_v__default = 0;
28793 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28794 __Pyx_RefNannyFinishContext();
28796 __pyx_L4_argument_unpacking_done:;
28797 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 42, __pyx_L1_error)
28798 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_6__call__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v__default);
28800 /* function exit code */
28805 __Pyx_XDECREF(__pyx_v__default);
28806 __Pyx_RefNannyFinishContext();
28810 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_6__call__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v__default) {
28811 PyObject *__pyx_v_default = NULL;
28812 PyObject *__pyx_r = NULL;
28813 __Pyx_RefNannyDeclarations
28815 Py_ssize_t __pyx_t_2;
28816 PyObject *__pyx_t_3 = NULL;
28817 int __pyx_lineno = 0;
28818 const char *__pyx_filename = NULL;
28819 int __pyx_clineno = 0;
28820 __Pyx_RefNannySetupContext("__call__", 0);
28822 /* "src/lxml/objectpath.pxi":49
28823 * as second argument) or raises AttributeError.
28825 * if _default: # <<<<<<<<<<<<<<
28826 * if len(_default) > 1:
28827 * raise TypeError, u"invalid number of arguments: needs one or two"
28829 __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v__default) != 0);
28832 /* "src/lxml/objectpath.pxi":50
28835 * if len(_default) > 1: # <<<<<<<<<<<<<<
28836 * raise TypeError, u"invalid number of arguments: needs one or two"
28837 * default = _default[0]
28839 __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v__default); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 50, __pyx_L1_error)
28840 __pyx_t_1 = ((__pyx_t_2 > 1) != 0);
28841 if (unlikely(__pyx_t_1)) {
28843 /* "src/lxml/objectpath.pxi":51
28845 * if len(_default) > 1:
28846 * raise TypeError, u"invalid number of arguments: needs one or two" # <<<<<<<<<<<<<<
28847 * default = _default[0]
28850 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_number_of_arguments_need, 0, 0);
28851 __PYX_ERR(1, 51, __pyx_L1_error)
28853 /* "src/lxml/objectpath.pxi":50
28856 * if len(_default) > 1: # <<<<<<<<<<<<<<
28857 * raise TypeError, u"invalid number of arguments: needs one or two"
28858 * default = _default[0]
28862 /* "src/lxml/objectpath.pxi":52
28863 * if len(_default) > 1:
28864 * raise TypeError, u"invalid number of arguments: needs one or two"
28865 * default = _default[0] # <<<<<<<<<<<<<<
28867 * default = _NO_DEFAULT
28869 __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v__default, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
28870 __Pyx_GOTREF(__pyx_t_3);
28871 __pyx_v_default = __pyx_t_3;
28874 /* "src/lxml/objectpath.pxi":49
28875 * as second argument) or raises AttributeError.
28877 * if _default: # <<<<<<<<<<<<<<
28878 * if len(_default) > 1:
28879 * raise TypeError, u"invalid number of arguments: needs one or two"
28884 /* "src/lxml/objectpath.pxi":54
28885 * default = _default[0]
28887 * default = _NO_DEFAULT # <<<<<<<<<<<<<<
28888 * return _find_object_path(root, self._c_path, self._path_len, default)
28892 __Pyx_INCREF(__pyx_v_4lxml_9objectify__NO_DEFAULT);
28893 __pyx_v_default = __pyx_v_4lxml_9objectify__NO_DEFAULT;
28897 /* "src/lxml/objectpath.pxi":55
28899 * default = _NO_DEFAULT
28900 * return _find_object_path(root, self._c_path, self._path_len, default) # <<<<<<<<<<<<<<
28902 * def hasattr(self, _Element root not None):
28904 __Pyx_XDECREF(__pyx_r);
28905 __pyx_t_3 = __pyx_f_4lxml_9objectify__find_object_path(__pyx_v_root, __pyx_v_self->_c_path, __pyx_v_self->_path_len, __pyx_v_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 55, __pyx_L1_error)
28906 __Pyx_GOTREF(__pyx_t_3);
28907 __pyx_r = __pyx_t_3;
28911 /* "src/lxml/objectpath.pxi":42
28912 * return self._path_str
28914 * def __call__(self, _Element root not None, *_default): # <<<<<<<<<<<<<<
28915 * u"""Follow the attribute path in the object structure and return the
28916 * target attribute value.
28919 /* function exit code */
28921 __Pyx_XDECREF(__pyx_t_3);
28922 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28925 __Pyx_XDECREF(__pyx_v_default);
28926 __Pyx_XGIVEREF(__pyx_r);
28927 __Pyx_RefNannyFinishContext();
28931 /* "src/lxml/objectpath.pxi":57
28932 * return _find_object_path(root, self._c_path, self._path_len, default)
28934 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
28935 * u"hasattr(self, root)"
28939 /* Python wrapper */
28940 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr(PyObject *__pyx_v_self, PyObject *__pyx_v_root); /*proto*/
28941 static char __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr[] = "hasattr(self, root)";
28942 static PyMethodDef __pyx_mdef_4lxml_9objectify_10ObjectPath_9hasattr = {"hasattr", (PyCFunction)__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr, METH_O, __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr};
28943 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr(PyObject *__pyx_v_self, PyObject *__pyx_v_root) {
28944 int __pyx_lineno = 0;
28945 const char *__pyx_filename = NULL;
28946 int __pyx_clineno = 0;
28947 PyObject *__pyx_r = 0;
28948 __Pyx_RefNannyDeclarations
28949 __Pyx_RefNannySetupContext("hasattr (wrapper)", 0);
28950 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 57, __pyx_L1_error)
28951 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_root));
28953 /* function exit code */
28958 __Pyx_RefNannyFinishContext();
28962 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root) {
28963 PyObject *__pyx_r = NULL;
28964 __Pyx_RefNannyDeclarations
28965 PyObject *__pyx_t_1 = NULL;
28966 PyObject *__pyx_t_2 = NULL;
28967 PyObject *__pyx_t_3 = NULL;
28968 PyObject *__pyx_t_4 = NULL;
28969 PyObject *__pyx_t_5 = NULL;
28971 PyObject *__pyx_t_7 = NULL;
28972 int __pyx_lineno = 0;
28973 const char *__pyx_filename = NULL;
28974 int __pyx_clineno = 0;
28975 __Pyx_RefNannySetupContext("hasattr", 0);
28977 /* "src/lxml/objectpath.pxi":59
28978 * def hasattr(self, _Element root not None):
28979 * u"hasattr(self, root)"
28980 * try: # <<<<<<<<<<<<<<
28981 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
28982 * except AttributeError:
28985 __Pyx_PyThreadState_declare
28986 __Pyx_PyThreadState_assign
28987 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28988 __Pyx_XGOTREF(__pyx_t_1);
28989 __Pyx_XGOTREF(__pyx_t_2);
28990 __Pyx_XGOTREF(__pyx_t_3);
28993 /* "src/lxml/objectpath.pxi":60
28994 * u"hasattr(self, root)"
28996 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT) # <<<<<<<<<<<<<<
28997 * except AttributeError:
29000 __pyx_t_4 = __pyx_v_4lxml_9objectify__NO_DEFAULT;
29001 __Pyx_INCREF(__pyx_t_4);
29002 __pyx_t_5 = __pyx_f_4lxml_9objectify__find_object_path(__pyx_v_root, __pyx_v_self->_c_path, __pyx_v_self->_path_len, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 60, __pyx_L3_error)
29003 __Pyx_GOTREF(__pyx_t_5);
29004 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29005 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29007 /* "src/lxml/objectpath.pxi":59
29008 * def hasattr(self, _Element root not None):
29009 * u"hasattr(self, root)"
29010 * try: # <<<<<<<<<<<<<<
29011 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29012 * except AttributeError:
29015 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29016 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29017 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29018 goto __pyx_L8_try_end;
29020 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29021 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29023 /* "src/lxml/objectpath.pxi":61
29025 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29026 * except AttributeError: # <<<<<<<<<<<<<<
29030 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
29032 __Pyx_AddTraceback("lxml.objectify.ObjectPath.hasattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29033 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 61, __pyx_L5_except_error)
29034 __Pyx_GOTREF(__pyx_t_5);
29035 __Pyx_GOTREF(__pyx_t_4);
29036 __Pyx_GOTREF(__pyx_t_7);
29038 /* "src/lxml/objectpath.pxi":62
29039 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29040 * except AttributeError:
29041 * return False # <<<<<<<<<<<<<<
29045 __Pyx_XDECREF(__pyx_r);
29046 __Pyx_INCREF(Py_False);
29047 __pyx_r = Py_False;
29048 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29049 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29050 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29051 goto __pyx_L6_except_return;
29053 goto __pyx_L5_except_error;
29054 __pyx_L5_except_error:;
29056 /* "src/lxml/objectpath.pxi":59
29057 * def hasattr(self, _Element root not None):
29058 * u"hasattr(self, root)"
29059 * try: # <<<<<<<<<<<<<<
29060 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29061 * except AttributeError:
29063 __Pyx_XGIVEREF(__pyx_t_1);
29064 __Pyx_XGIVEREF(__pyx_t_2);
29065 __Pyx_XGIVEREF(__pyx_t_3);
29066 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29067 goto __pyx_L1_error;
29068 __pyx_L6_except_return:;
29069 __Pyx_XGIVEREF(__pyx_t_1);
29070 __Pyx_XGIVEREF(__pyx_t_2);
29071 __Pyx_XGIVEREF(__pyx_t_3);
29072 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29077 /* "src/lxml/objectpath.pxi":63
29078 * except AttributeError:
29080 * return True # <<<<<<<<<<<<<<
29082 * def setattr(self, _Element root not None, value):
29084 __Pyx_XDECREF(__pyx_r);
29085 __Pyx_INCREF(Py_True);
29089 /* "src/lxml/objectpath.pxi":57
29090 * return _find_object_path(root, self._c_path, self._path_len, default)
29092 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
29093 * u"hasattr(self, root)"
29097 /* function exit code */
29099 __Pyx_XDECREF(__pyx_t_4);
29100 __Pyx_XDECREF(__pyx_t_5);
29101 __Pyx_XDECREF(__pyx_t_7);
29102 __Pyx_AddTraceback("lxml.objectify.ObjectPath.hasattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29105 __Pyx_XGIVEREF(__pyx_r);
29106 __Pyx_RefNannyFinishContext();
29110 /* "src/lxml/objectpath.pxi":65
29113 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29114 * u"""setattr(self, root, value)
29118 /* Python wrapper */
29119 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29120 static char __pyx_doc_4lxml_9objectify_10ObjectPath_10setattr[] = "setattr(self, root, value)\n\n Set the value of the target element in a subtree.\n\n If any of the children on the path does not exist, it is created.\n ";
29121 static PyMethodDef __pyx_mdef_4lxml_9objectify_10ObjectPath_11setattr = {"setattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_10setattr};
29122 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29123 struct LxmlElement *__pyx_v_root = 0;
29124 PyObject *__pyx_v_value = 0;
29125 int __pyx_lineno = 0;
29126 const char *__pyx_filename = NULL;
29127 int __pyx_clineno = 0;
29128 PyObject *__pyx_r = 0;
29129 __Pyx_RefNannyDeclarations
29130 __Pyx_RefNannySetupContext("setattr (wrapper)", 0);
29132 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_value,0};
29133 PyObject* values[2] = {0,0};
29134 if (unlikely(__pyx_kwds)) {
29135 Py_ssize_t kw_args;
29136 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29137 switch (pos_args) {
29138 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29139 CYTHON_FALLTHROUGH;
29140 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29141 CYTHON_FALLTHROUGH;
29143 default: goto __pyx_L5_argtuple_error;
29145 kw_args = PyDict_Size(__pyx_kwds);
29146 switch (pos_args) {
29148 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
29149 else goto __pyx_L5_argtuple_error;
29150 CYTHON_FALLTHROUGH;
29152 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
29154 __Pyx_RaiseArgtupleInvalid("setattr", 1, 2, 2, 1); __PYX_ERR(1, 65, __pyx_L3_error)
29157 if (unlikely(kw_args > 0)) {
29158 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setattr") < 0)) __PYX_ERR(1, 65, __pyx_L3_error)
29160 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
29161 goto __pyx_L5_argtuple_error;
29163 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29164 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29166 __pyx_v_root = ((struct LxmlElement *)values[0]);
29167 __pyx_v_value = values[1];
29169 goto __pyx_L4_argument_unpacking_done;
29170 __pyx_L5_argtuple_error:;
29171 __Pyx_RaiseArgtupleInvalid("setattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 65, __pyx_L3_error)
29173 __Pyx_AddTraceback("lxml.objectify.ObjectPath.setattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29174 __Pyx_RefNannyFinishContext();
29176 __pyx_L4_argument_unpacking_done:;
29177 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 65, __pyx_L1_error)
29178 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_10setattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v_value);
29180 /* function exit code */
29185 __Pyx_RefNannyFinishContext();
29189 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_10setattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v_value) {
29190 PyObject *__pyx_r = NULL;
29191 __Pyx_RefNannyDeclarations
29192 PyObject *__pyx_t_1 = NULL;
29193 int __pyx_lineno = 0;
29194 const char *__pyx_filename = NULL;
29195 int __pyx_clineno = 0;
29196 __Pyx_RefNannySetupContext("setattr", 0);
29198 /* "src/lxml/objectpath.pxi":72
29199 * If any of the children on the path does not exist, it is created.
29201 * _create_object_path(root, self._c_path, self._path_len, 1, value) # <<<<<<<<<<<<<<
29203 * def addattr(self, _Element root not None, value):
29205 __pyx_t_1 = __pyx_f_4lxml_9objectify__create_object_path(__pyx_v_root, __pyx_v_self->_c_path, __pyx_v_self->_path_len, 1, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
29206 __Pyx_GOTREF(__pyx_t_1);
29207 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29209 /* "src/lxml/objectpath.pxi":65
29212 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29213 * u"""setattr(self, root, value)
29217 /* function exit code */
29218 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29221 __Pyx_XDECREF(__pyx_t_1);
29222 __Pyx_AddTraceback("lxml.objectify.ObjectPath.setattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29225 __Pyx_XGIVEREF(__pyx_r);
29226 __Pyx_RefNannyFinishContext();
29230 /* "src/lxml/objectpath.pxi":74
29231 * _create_object_path(root, self._c_path, self._path_len, 1, value)
29233 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29234 * u"""addattr(self, root, value)
29238 /* Python wrapper */
29239 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29240 static char __pyx_doc_4lxml_9objectify_10ObjectPath_12addattr[] = "addattr(self, root, value)\n\n Append a value to the target element in a subtree.\n\n If any of the children on the path does not exist, it is created.\n ";
29241 static PyMethodDef __pyx_mdef_4lxml_9objectify_10ObjectPath_13addattr = {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_12addattr};
29242 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29243 struct LxmlElement *__pyx_v_root = 0;
29244 PyObject *__pyx_v_value = 0;
29245 int __pyx_lineno = 0;
29246 const char *__pyx_filename = NULL;
29247 int __pyx_clineno = 0;
29248 PyObject *__pyx_r = 0;
29249 __Pyx_RefNannyDeclarations
29250 __Pyx_RefNannySetupContext("addattr (wrapper)", 0);
29252 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_value,0};
29253 PyObject* values[2] = {0,0};
29254 if (unlikely(__pyx_kwds)) {
29255 Py_ssize_t kw_args;
29256 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29257 switch (pos_args) {
29258 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29259 CYTHON_FALLTHROUGH;
29260 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29261 CYTHON_FALLTHROUGH;
29263 default: goto __pyx_L5_argtuple_error;
29265 kw_args = PyDict_Size(__pyx_kwds);
29266 switch (pos_args) {
29268 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
29269 else goto __pyx_L5_argtuple_error;
29270 CYTHON_FALLTHROUGH;
29272 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
29274 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, 1); __PYX_ERR(1, 74, __pyx_L3_error)
29277 if (unlikely(kw_args > 0)) {
29278 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addattr") < 0)) __PYX_ERR(1, 74, __pyx_L3_error)
29280 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
29281 goto __pyx_L5_argtuple_error;
29283 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29284 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29286 __pyx_v_root = ((struct LxmlElement *)values[0]);
29287 __pyx_v_value = values[1];
29289 goto __pyx_L4_argument_unpacking_done;
29290 __pyx_L5_argtuple_error:;
29291 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 74, __pyx_L3_error)
29293 __Pyx_AddTraceback("lxml.objectify.ObjectPath.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29294 __Pyx_RefNannyFinishContext();
29296 __pyx_L4_argument_unpacking_done:;
29297 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 74, __pyx_L1_error)
29298 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_12addattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v_value);
29300 /* function exit code */
29305 __Pyx_RefNannyFinishContext();
29309 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_12addattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root, PyObject *__pyx_v_value) {
29310 PyObject *__pyx_r = NULL;
29311 __Pyx_RefNannyDeclarations
29312 PyObject *__pyx_t_1 = NULL;
29313 int __pyx_lineno = 0;
29314 const char *__pyx_filename = NULL;
29315 int __pyx_clineno = 0;
29316 __Pyx_RefNannySetupContext("addattr", 0);
29318 /* "src/lxml/objectpath.pxi":81
29319 * If any of the children on the path does not exist, it is created.
29321 * _create_object_path(root, self._c_path, self._path_len, 0, value) # <<<<<<<<<<<<<<
29325 __pyx_t_1 = __pyx_f_4lxml_9objectify__create_object_path(__pyx_v_root, __pyx_v_self->_c_path, __pyx_v_self->_path_len, 0, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
29326 __Pyx_GOTREF(__pyx_t_1);
29327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29329 /* "src/lxml/objectpath.pxi":74
29330 * _create_object_path(root, self._c_path, self._path_len, 1, value)
29332 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29333 * u"""addattr(self, root, value)
29337 /* function exit code */
29338 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29341 __Pyx_XDECREF(__pyx_t_1);
29342 __Pyx_AddTraceback("lxml.objectify.ObjectPath.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29345 __Pyx_XGIVEREF(__pyx_r);
29346 __Pyx_RefNannyFinishContext();
29350 /* "src/lxml/objectpath.pxi":19
29351 * Example for a path: 'root.child[1].{other}child[25]'
29353 * cdef readonly object find # <<<<<<<<<<<<<<
29355 * cdef object _path_str
29358 /* Python wrapper */
29359 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(PyObject *__pyx_v_self); /*proto*/
29360 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(PyObject *__pyx_v_self) {
29361 PyObject *__pyx_r = 0;
29362 __Pyx_RefNannyDeclarations
29363 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29364 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
29366 /* function exit code */
29367 __Pyx_RefNannyFinishContext();
29371 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
29372 PyObject *__pyx_r = NULL;
29373 __Pyx_RefNannyDeclarations
29374 __Pyx_RefNannySetupContext("__get__", 0);
29375 __Pyx_XDECREF(__pyx_r);
29376 __Pyx_INCREF(__pyx_v_self->find);
29377 __pyx_r = __pyx_v_self->find;
29380 /* function exit code */
29382 __Pyx_XGIVEREF(__pyx_r);
29383 __Pyx_RefNannyFinishContext();
29387 /* "src/lxml/objectpath.pxi":91
29390 * cdef list _parse_object_path_string(_path): # <<<<<<<<<<<<<<
29391 * u"""Parse object path string into a (ns, name, index) list.
29395 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__pyx_v__path) {
29396 int __pyx_v_has_dot;
29397 PyObject *__pyx_v_path = 0;
29398 PyObject *__pyx_v_new_path = NULL;
29399 PyObject *__pyx_v_path_pos = NULL;
29400 PyObject *__pyx_v_match = NULL;
29401 PyObject *__pyx_v_dot = NULL;
29402 PyObject *__pyx_v_ns = NULL;
29403 PyObject *__pyx_v_name = NULL;
29404 PyObject *__pyx_v_index = NULL;
29405 PyObject *__pyx_r = NULL;
29406 __Pyx_RefNannyDeclarations
29407 PyObject *__pyx_t_1 = NULL;
29410 PyObject *__pyx_t_4 = NULL;
29411 PyObject *__pyx_t_5 = NULL;
29413 PyObject *__pyx_t_7 = NULL;
29414 PyObject *__pyx_t_8 = NULL;
29415 PyObject *__pyx_t_9 = NULL;
29416 PyObject *(*__pyx_t_10)(PyObject *);
29419 Py_ssize_t __pyx_t_13;
29420 int __pyx_lineno = 0;
29421 const char *__pyx_filename = NULL;
29422 int __pyx_clineno = 0;
29423 __Pyx_RefNannySetupContext("_parse_object_path_string", 0);
29425 /* "src/lxml/objectpath.pxi":96
29426 * cdef bint has_dot
29427 * cdef unicode path
29428 * new_path = [] # <<<<<<<<<<<<<<
29429 * if isinstance(_path, bytes):
29430 * path = (<bytes>_path).decode('ascii')
29432 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
29433 __Pyx_GOTREF(__pyx_t_1);
29434 __pyx_v_new_path = ((PyObject*)__pyx_t_1);
29437 /* "src/lxml/objectpath.pxi":97
29438 * cdef unicode path
29440 * if isinstance(_path, bytes): # <<<<<<<<<<<<<<
29441 * path = (<bytes>_path).decode('ascii')
29442 * elif type(_path) is not unicode:
29444 __pyx_t_2 = PyBytes_Check(__pyx_v__path);
29445 __pyx_t_3 = (__pyx_t_2 != 0);
29448 /* "src/lxml/objectpath.pxi":98
29450 * if isinstance(_path, bytes):
29451 * path = (<bytes>_path).decode('ascii') # <<<<<<<<<<<<<<
29452 * elif type(_path) is not unicode:
29453 * path = unicode(_path)
29455 if (unlikely(__pyx_v__path == Py_None)) {
29456 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
29457 __PYX_ERR(1, 98, __pyx_L1_error)
29459 __pyx_t_1 = __Pyx_decode_bytes(((PyObject*)__pyx_v__path), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 98, __pyx_L1_error)
29460 __Pyx_GOTREF(__pyx_t_1);
29461 __pyx_v_path = ((PyObject*)__pyx_t_1);
29464 /* "src/lxml/objectpath.pxi":97
29465 * cdef unicode path
29467 * if isinstance(_path, bytes): # <<<<<<<<<<<<<<
29468 * path = (<bytes>_path).decode('ascii')
29469 * elif type(_path) is not unicode:
29474 /* "src/lxml/objectpath.pxi":99
29475 * if isinstance(_path, bytes):
29476 * path = (<bytes>_path).decode('ascii')
29477 * elif type(_path) is not unicode: # <<<<<<<<<<<<<<
29478 * path = unicode(_path)
29481 __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v__path)) != ((PyObject *)(&PyUnicode_Type)));
29482 __pyx_t_2 = (__pyx_t_3 != 0);
29485 /* "src/lxml/objectpath.pxi":100
29486 * path = (<bytes>_path).decode('ascii')
29487 * elif type(_path) is not unicode:
29488 * path = unicode(_path) # <<<<<<<<<<<<<<
29492 __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v__path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
29493 __Pyx_GOTREF(__pyx_t_1);
29494 __pyx_v_path = ((PyObject*)__pyx_t_1);
29497 /* "src/lxml/objectpath.pxi":99
29498 * if isinstance(_path, bytes):
29499 * path = (<bytes>_path).decode('ascii')
29500 * elif type(_path) is not unicode: # <<<<<<<<<<<<<<
29501 * path = unicode(_path)
29507 /* "src/lxml/objectpath.pxi":102
29508 * path = unicode(_path)
29510 * path = _path # <<<<<<<<<<<<<<
29511 * path = path.strip()
29515 if (!(likely(PyUnicode_CheckExact(__pyx_v__path))||((__pyx_v__path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v__path)->tp_name), 0))) __PYX_ERR(1, 102, __pyx_L1_error)
29516 __pyx_t_1 = __pyx_v__path;
29517 __Pyx_INCREF(__pyx_t_1);
29518 __pyx_v_path = ((PyObject*)__pyx_t_1);
29523 /* "src/lxml/objectpath.pxi":103
29526 * path = path.strip() # <<<<<<<<<<<<<<
29528 * return [_RELATIVE_PATH_SEGMENT]
29530 __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error)
29531 __Pyx_GOTREF(__pyx_t_1);
29532 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 103, __pyx_L1_error)
29533 __Pyx_DECREF_SET(__pyx_v_path, ((PyObject*)__pyx_t_1));
29536 /* "src/lxml/objectpath.pxi":104
29538 * path = path.strip()
29539 * if path == u'.': # <<<<<<<<<<<<<<
29540 * return [_RELATIVE_PATH_SEGMENT]
29543 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_path, __pyx_kp_u__2, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 104, __pyx_L1_error)
29544 __pyx_t_3 = (__pyx_t_2 != 0);
29547 /* "src/lxml/objectpath.pxi":105
29548 * path = path.strip()
29550 * return [_RELATIVE_PATH_SEGMENT] # <<<<<<<<<<<<<<
29554 __Pyx_XDECREF(__pyx_r);
29555 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
29556 __Pyx_GOTREF(__pyx_t_1);
29557 __Pyx_INCREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29558 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29559 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29560 __pyx_r = ((PyObject*)__pyx_t_1);
29564 /* "src/lxml/objectpath.pxi":104
29566 * path = path.strip()
29567 * if path == u'.': # <<<<<<<<<<<<<<
29568 * return [_RELATIVE_PATH_SEGMENT]
29573 /* "src/lxml/objectpath.pxi":106
29575 * return [_RELATIVE_PATH_SEGMENT]
29576 * path_pos = 0 # <<<<<<<<<<<<<<
29578 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29580 __Pyx_INCREF(__pyx_int_0);
29581 __pyx_v_path_pos = __pyx_int_0;
29583 /* "src/lxml/objectpath.pxi":107
29584 * return [_RELATIVE_PATH_SEGMENT]
29586 * while path: # <<<<<<<<<<<<<<
29587 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29588 * if match is None:
29591 __pyx_t_3 = (__pyx_v_path != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_path) != 0);
29592 if (!__pyx_t_3) break;
29594 /* "src/lxml/objectpath.pxi":108
29597 * match = __MATCH_PATH_SEGMENT(path, path_pos) # <<<<<<<<<<<<<<
29598 * if match is None:
29601 __Pyx_INCREF(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
29602 __pyx_t_4 = __pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT; __pyx_t_5 = NULL;
29604 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
29605 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
29606 if (likely(__pyx_t_5)) {
29607 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
29608 __Pyx_INCREF(__pyx_t_5);
29609 __Pyx_INCREF(function);
29610 __Pyx_DECREF_SET(__pyx_t_4, function);
29614 #if CYTHON_FAST_PYCALL
29615 if (PyFunction_Check(__pyx_t_4)) {
29616 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_path, __pyx_v_path_pos};
29617 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
29618 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29619 __Pyx_GOTREF(__pyx_t_1);
29622 #if CYTHON_FAST_PYCCALL
29623 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
29624 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_path, __pyx_v_path_pos};
29625 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
29626 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29627 __Pyx_GOTREF(__pyx_t_1);
29631 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 108, __pyx_L1_error)
29632 __Pyx_GOTREF(__pyx_t_7);
29634 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
29636 __Pyx_INCREF(__pyx_v_path);
29637 __Pyx_GIVEREF(__pyx_v_path);
29638 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_path);
29639 __Pyx_INCREF(__pyx_v_path_pos);
29640 __Pyx_GIVEREF(__pyx_v_path_pos);
29641 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_path_pos);
29642 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error)
29643 __Pyx_GOTREF(__pyx_t_1);
29644 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29646 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29647 __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_1);
29650 /* "src/lxml/objectpath.pxi":109
29652 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29653 * if match is None: # <<<<<<<<<<<<<<
29657 __pyx_t_3 = (__pyx_v_match == Py_None);
29658 __pyx_t_2 = (__pyx_t_3 != 0);
29661 /* "src/lxml/objectpath.pxi":110
29662 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29663 * if match is None:
29664 * break # <<<<<<<<<<<<<<
29666 * dot, ns, name, index = match.groups()
29668 goto __pyx_L6_break;
29670 /* "src/lxml/objectpath.pxi":109
29672 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29673 * if match is None: # <<<<<<<<<<<<<<
29679 /* "src/lxml/objectpath.pxi":112
29682 * dot, ns, name, index = match.groups() # <<<<<<<<<<<<<<
29683 * index = int(index) if index else 0
29684 * has_dot = dot == u'.'
29686 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_groups); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 112, __pyx_L1_error)
29687 __Pyx_GOTREF(__pyx_t_4);
29689 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
29690 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
29691 if (likely(__pyx_t_7)) {
29692 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
29693 __Pyx_INCREF(__pyx_t_7);
29694 __Pyx_INCREF(function);
29695 __Pyx_DECREF_SET(__pyx_t_4, function);
29698 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
29699 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29700 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 112, __pyx_L1_error)
29701 __Pyx_GOTREF(__pyx_t_1);
29702 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29703 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
29704 PyObject* sequence = __pyx_t_1;
29705 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29706 if (unlikely(size != 4)) {
29707 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
29708 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29709 __PYX_ERR(1, 112, __pyx_L1_error)
29711 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29712 if (likely(PyTuple_CheckExact(sequence))) {
29713 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
29714 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
29715 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
29716 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
29718 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
29719 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
29720 __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
29721 __pyx_t_8 = PyList_GET_ITEM(sequence, 3);
29723 __Pyx_INCREF(__pyx_t_4);
29724 __Pyx_INCREF(__pyx_t_7);
29725 __Pyx_INCREF(__pyx_t_5);
29726 __Pyx_INCREF(__pyx_t_8);
29730 PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8};
29731 for (i=0; i < 4; i++) {
29732 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 112, __pyx_L1_error)
29733 __Pyx_GOTREF(item);
29734 *(temps[i]) = item;
29738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29740 Py_ssize_t index = -1;
29741 PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8};
29742 __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 112, __pyx_L1_error)
29743 __Pyx_GOTREF(__pyx_t_9);
29744 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29745 __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
29746 for (index=0; index < 4; index++) {
29747 PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
29748 __Pyx_GOTREF(item);
29749 *(temps[index]) = item;
29751 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(1, 112, __pyx_L1_error)
29753 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
29754 goto __pyx_L9_unpacking_done;
29755 __pyx_L8_unpacking_failed:;
29756 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
29758 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
29759 __PYX_ERR(1, 112, __pyx_L1_error)
29760 __pyx_L9_unpacking_done:;
29762 __Pyx_XDECREF_SET(__pyx_v_dot, __pyx_t_4);
29764 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
29766 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
29768 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
29771 /* "src/lxml/objectpath.pxi":113
29773 * dot, ns, name, index = match.groups()
29774 * index = int(index) if index else 0 # <<<<<<<<<<<<<<
29775 * has_dot = dot == u'.'
29778 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 113, __pyx_L1_error)
29780 __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 113, __pyx_L1_error)
29781 __Pyx_GOTREF(__pyx_t_8);
29782 __pyx_t_1 = __pyx_t_8;
29785 __Pyx_INCREF(__pyx_int_0);
29786 __pyx_t_1 = __pyx_int_0;
29788 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
29791 /* "src/lxml/objectpath.pxi":114
29792 * dot, ns, name, index = match.groups()
29793 * index = int(index) if index else 0
29794 * has_dot = dot == u'.' # <<<<<<<<<<<<<<
29798 __pyx_t_1 = PyObject_RichCompare(__pyx_v_dot, __pyx_kp_u__2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
29799 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L1_error)
29800 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29801 __pyx_v_has_dot = __pyx_t_2;
29803 /* "src/lxml/objectpath.pxi":115
29804 * index = int(index) if index else 0
29805 * has_dot = dot == u'.'
29806 * if not new_path: # <<<<<<<<<<<<<<
29808 * # path '.child' => ignore root
29810 __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
29811 __pyx_t_3 = ((!__pyx_t_2) != 0);
29814 /* "src/lxml/objectpath.pxi":116
29815 * has_dot = dot == u'.'
29817 * if has_dot: # <<<<<<<<<<<<<<
29818 * # path '.child' => ignore root
29819 * new_path.append(_RELATIVE_PATH_SEGMENT)
29821 __pyx_t_3 = (__pyx_v_has_dot != 0);
29824 /* "src/lxml/objectpath.pxi":118
29826 * # path '.child' => ignore root
29827 * new_path.append(_RELATIVE_PATH_SEGMENT) # <<<<<<<<<<<<<<
29829 * raise ValueError, u"index not allowed on root node"
29831 __pyx_t_1 = __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT;
29832 __Pyx_INCREF(__pyx_t_1);
29833 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error)
29834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29836 /* "src/lxml/objectpath.pxi":116
29837 * has_dot = dot == u'.'
29839 * if has_dot: # <<<<<<<<<<<<<<
29840 * # path '.child' => ignore root
29841 * new_path.append(_RELATIVE_PATH_SEGMENT)
29846 /* "src/lxml/objectpath.pxi":119
29847 * # path '.child' => ignore root
29848 * new_path.append(_RELATIVE_PATH_SEGMENT)
29849 * elif index: # <<<<<<<<<<<<<<
29850 * raise ValueError, u"index not allowed on root node"
29851 * elif not has_dot:
29853 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 119, __pyx_L1_error)
29854 if (unlikely(__pyx_t_3)) {
29856 /* "src/lxml/objectpath.pxi":120
29857 * new_path.append(_RELATIVE_PATH_SEGMENT)
29859 * raise ValueError, u"index not allowed on root node" # <<<<<<<<<<<<<<
29860 * elif not has_dot:
29861 * raise ValueError, u"invalid path"
29863 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_not_allowed_on_root_node, 0, 0);
29864 __PYX_ERR(1, 120, __pyx_L1_error)
29866 /* "src/lxml/objectpath.pxi":119
29867 * # path '.child' => ignore root
29868 * new_path.append(_RELATIVE_PATH_SEGMENT)
29869 * elif index: # <<<<<<<<<<<<<<
29870 * raise ValueError, u"index not allowed on root node"
29871 * elif not has_dot:
29876 /* "src/lxml/objectpath.pxi":115
29877 * index = int(index) if index else 0
29878 * has_dot = dot == u'.'
29879 * if not new_path: # <<<<<<<<<<<<<<
29881 * # path '.child' => ignore root
29886 /* "src/lxml/objectpath.pxi":121
29888 * raise ValueError, u"index not allowed on root node"
29889 * elif not has_dot: # <<<<<<<<<<<<<<
29890 * raise ValueError, u"invalid path"
29891 * if ns is not None:
29893 __pyx_t_3 = ((!(__pyx_v_has_dot != 0)) != 0);
29894 if (unlikely(__pyx_t_3)) {
29896 /* "src/lxml/objectpath.pxi":122
29897 * raise ValueError, u"index not allowed on root node"
29898 * elif not has_dot:
29899 * raise ValueError, u"invalid path" # <<<<<<<<<<<<<<
29900 * if ns is not None:
29901 * ns = python.PyUnicode_AsUTF8String(ns)
29903 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
29904 __PYX_ERR(1, 122, __pyx_L1_error)
29906 /* "src/lxml/objectpath.pxi":121
29908 * raise ValueError, u"index not allowed on root node"
29909 * elif not has_dot: # <<<<<<<<<<<<<<
29910 * raise ValueError, u"invalid path"
29911 * if ns is not None:
29916 /* "src/lxml/objectpath.pxi":123
29917 * elif not has_dot:
29918 * raise ValueError, u"invalid path"
29919 * if ns is not None: # <<<<<<<<<<<<<<
29920 * ns = python.PyUnicode_AsUTF8String(ns)
29921 * name = python.PyUnicode_AsUTF8String(name)
29923 __pyx_t_3 = (__pyx_v_ns != Py_None);
29924 __pyx_t_2 = (__pyx_t_3 != 0);
29927 /* "src/lxml/objectpath.pxi":124
29928 * raise ValueError, u"invalid path"
29929 * if ns is not None:
29930 * ns = python.PyUnicode_AsUTF8String(ns) # <<<<<<<<<<<<<<
29931 * name = python.PyUnicode_AsUTF8String(name)
29932 * new_path.append( (ns, name, index) )
29934 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error)
29935 __Pyx_GOTREF(__pyx_t_1);
29936 __Pyx_DECREF_SET(__pyx_v_ns, __pyx_t_1);
29939 /* "src/lxml/objectpath.pxi":123
29940 * elif not has_dot:
29941 * raise ValueError, u"invalid path"
29942 * if ns is not None: # <<<<<<<<<<<<<<
29943 * ns = python.PyUnicode_AsUTF8String(ns)
29944 * name = python.PyUnicode_AsUTF8String(name)
29948 /* "src/lxml/objectpath.pxi":125
29949 * if ns is not None:
29950 * ns = python.PyUnicode_AsUTF8String(ns)
29951 * name = python.PyUnicode_AsUTF8String(name) # <<<<<<<<<<<<<<
29952 * new_path.append( (ns, name, index) )
29955 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error)
29956 __Pyx_GOTREF(__pyx_t_1);
29957 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
29960 /* "src/lxml/objectpath.pxi":126
29961 * ns = python.PyUnicode_AsUTF8String(ns)
29962 * name = python.PyUnicode_AsUTF8String(name)
29963 * new_path.append( (ns, name, index) ) # <<<<<<<<<<<<<<
29965 * path_pos = match.end()
29967 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
29968 __Pyx_GOTREF(__pyx_t_1);
29969 __Pyx_INCREF(__pyx_v_ns);
29970 __Pyx_GIVEREF(__pyx_v_ns);
29971 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ns);
29972 __Pyx_INCREF(__pyx_v_name);
29973 __Pyx_GIVEREF(__pyx_v_name);
29974 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name);
29975 __Pyx_INCREF(__pyx_v_index);
29976 __Pyx_GIVEREF(__pyx_v_index);
29977 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_index);
29978 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 126, __pyx_L1_error)
29979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29981 /* "src/lxml/objectpath.pxi":128
29982 * new_path.append( (ns, name, index) )
29984 * path_pos = match.end() # <<<<<<<<<<<<<<
29985 * if not new_path or len(path) > path_pos:
29986 * raise ValueError, u"invalid path"
29988 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_end); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 128, __pyx_L1_error)
29989 __Pyx_GOTREF(__pyx_t_8);
29991 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
29992 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
29993 if (likely(__pyx_t_5)) {
29994 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
29995 __Pyx_INCREF(__pyx_t_5);
29996 __Pyx_INCREF(function);
29997 __Pyx_DECREF_SET(__pyx_t_8, function);
30000 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
30001 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30002 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
30003 __Pyx_GOTREF(__pyx_t_1);
30004 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30005 __Pyx_DECREF_SET(__pyx_v_path_pos, __pyx_t_1);
30010 /* "src/lxml/objectpath.pxi":129
30012 * path_pos = match.end()
30013 * if not new_path or len(path) > path_pos: # <<<<<<<<<<<<<<
30014 * raise ValueError, u"invalid path"
30017 __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30018 __pyx_t_12 = ((!__pyx_t_3) != 0);
30021 __pyx_t_2 = __pyx_t_12;
30022 goto __pyx_L14_bool_binop_done;
30024 if (unlikely(__pyx_v_path == Py_None)) {
30025 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30026 __PYX_ERR(1, 129, __pyx_L1_error)
30028 __pyx_t_13 = __Pyx_PyUnicode_GET_LENGTH(__pyx_v_path); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
30029 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
30030 __Pyx_GOTREF(__pyx_t_1);
30031 __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_v_path_pos, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 129, __pyx_L1_error)
30032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30033 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(1, 129, __pyx_L1_error)
30034 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30035 __pyx_t_2 = __pyx_t_12;
30036 __pyx_L14_bool_binop_done:;
30037 if (unlikely(__pyx_t_2)) {
30039 /* "src/lxml/objectpath.pxi":130
30040 * path_pos = match.end()
30041 * if not new_path or len(path) > path_pos:
30042 * raise ValueError, u"invalid path" # <<<<<<<<<<<<<<
30046 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
30047 __PYX_ERR(1, 130, __pyx_L1_error)
30049 /* "src/lxml/objectpath.pxi":129
30051 * path_pos = match.end()
30052 * if not new_path or len(path) > path_pos: # <<<<<<<<<<<<<<
30053 * raise ValueError, u"invalid path"
30058 /* "src/lxml/objectpath.pxi":131
30059 * if not new_path or len(path) > path_pos:
30060 * raise ValueError, u"invalid path"
30061 * return new_path # <<<<<<<<<<<<<<
30065 __Pyx_XDECREF(__pyx_r);
30066 __Pyx_INCREF(__pyx_v_new_path);
30067 __pyx_r = __pyx_v_new_path;
30070 /* "src/lxml/objectpath.pxi":91
30073 * cdef list _parse_object_path_string(_path): # <<<<<<<<<<<<<<
30074 * u"""Parse object path string into a (ns, name, index) list.
30078 /* function exit code */
30080 __Pyx_XDECREF(__pyx_t_1);
30081 __Pyx_XDECREF(__pyx_t_4);
30082 __Pyx_XDECREF(__pyx_t_5);
30083 __Pyx_XDECREF(__pyx_t_7);
30084 __Pyx_XDECREF(__pyx_t_8);
30085 __Pyx_XDECREF(__pyx_t_9);
30086 __Pyx_AddTraceback("lxml.objectify._parse_object_path_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
30089 __Pyx_XDECREF(__pyx_v_path);
30090 __Pyx_XDECREF(__pyx_v_new_path);
30091 __Pyx_XDECREF(__pyx_v_path_pos);
30092 __Pyx_XDECREF(__pyx_v_match);
30093 __Pyx_XDECREF(__pyx_v_dot);
30094 __Pyx_XDECREF(__pyx_v_ns);
30095 __Pyx_XDECREF(__pyx_v_name);
30096 __Pyx_XDECREF(__pyx_v_index);
30097 __Pyx_XGIVEREF(__pyx_r);
30098 __Pyx_RefNannyFinishContext();
30102 /* "src/lxml/objectpath.pxi":134
30105 * cdef list _parse_object_path_list(path): # <<<<<<<<<<<<<<
30106 * u"""Parse object path sequence into a (ns, name, index) list.
30110 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *__pyx_v_path) {
30111 PyObject *__pyx_v_new_path = NULL;
30112 PyObject *__pyx_v_item = NULL;
30113 PyObject *__pyx_v_ns = NULL;
30114 PyObject *__pyx_v_name = NULL;
30115 PyObject *__pyx_v_index = NULL;
30116 const xmlChar *__pyx_v_c_name;
30117 const xmlChar *__pyx_v_index_pos;
30118 const xmlChar *__pyx_v_index_end;
30119 PyObject *__pyx_r = NULL;
30120 __Pyx_RefNannyDeclarations
30121 PyObject *__pyx_t_1 = NULL;
30122 Py_ssize_t __pyx_t_2;
30123 PyObject *(*__pyx_t_3)(PyObject *);
30124 PyObject *__pyx_t_4 = NULL;
30125 PyObject *__pyx_t_5 = NULL;
30126 PyObject *__pyx_t_6 = NULL;
30131 int __pyx_lineno = 0;
30132 const char *__pyx_filename = NULL;
30133 int __pyx_clineno = 0;
30134 __Pyx_RefNannySetupContext("_parse_object_path_list", 0);
30136 /* "src/lxml/objectpath.pxi":137
30137 * u"""Parse object path sequence into a (ns, name, index) list.
30139 * new_path = [] # <<<<<<<<<<<<<<
30140 * for item in path:
30141 * item = item.strip()
30143 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 137, __pyx_L1_error)
30144 __Pyx_GOTREF(__pyx_t_1);
30145 __pyx_v_new_path = ((PyObject*)__pyx_t_1);
30148 /* "src/lxml/objectpath.pxi":138
30151 * for item in path: # <<<<<<<<<<<<<<
30152 * item = item.strip()
30153 * if not new_path and item == u'':
30155 if (likely(PyList_CheckExact(__pyx_v_path)) || PyTuple_CheckExact(__pyx_v_path)) {
30156 __pyx_t_1 = __pyx_v_path; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
30159 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error)
30160 __Pyx_GOTREF(__pyx_t_1);
30161 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
30164 if (likely(!__pyx_t_3)) {
30165 if (likely(PyList_CheckExact(__pyx_t_1))) {
30166 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
30167 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30168 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 138, __pyx_L1_error)
30170 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 138, __pyx_L1_error)
30171 __Pyx_GOTREF(__pyx_t_4);
30174 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
30175 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30176 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 138, __pyx_L1_error)
30178 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 138, __pyx_L1_error)
30179 __Pyx_GOTREF(__pyx_t_4);
30183 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
30184 if (unlikely(!__pyx_t_4)) {
30185 PyObject* exc_type = PyErr_Occurred();
30187 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
30188 else __PYX_ERR(1, 138, __pyx_L1_error)
30192 __Pyx_GOTREF(__pyx_t_4);
30194 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
30197 /* "src/lxml/objectpath.pxi":139
30199 * for item in path:
30200 * item = item.strip() # <<<<<<<<<<<<<<
30201 * if not new_path and item == u'':
30202 * # path '.child' => ignore root
30204 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_item, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
30205 __Pyx_GOTREF(__pyx_t_5);
30207 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
30208 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
30209 if (likely(__pyx_t_6)) {
30210 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
30211 __Pyx_INCREF(__pyx_t_6);
30212 __Pyx_INCREF(function);
30213 __Pyx_DECREF_SET(__pyx_t_5, function);
30216 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
30217 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
30218 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 139, __pyx_L1_error)
30219 __Pyx_GOTREF(__pyx_t_4);
30220 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30221 __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_4);
30224 /* "src/lxml/objectpath.pxi":140
30225 * for item in path:
30226 * item = item.strip()
30227 * if not new_path and item == u'': # <<<<<<<<<<<<<<
30228 * # path '.child' => ignore root
30231 __pyx_t_8 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30232 __pyx_t_9 = ((!__pyx_t_8) != 0);
30235 __pyx_t_7 = __pyx_t_9;
30236 goto __pyx_L6_bool_binop_done;
30238 __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_item, __pyx_kp_u_, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 140, __pyx_L1_error)
30239 __pyx_t_7 = __pyx_t_9;
30240 __pyx_L6_bool_binop_done:;
30243 /* "src/lxml/objectpath.pxi":142
30244 * if not new_path and item == u'':
30245 * # path '.child' => ignore root
30246 * ns = name = None # <<<<<<<<<<<<<<
30250 __Pyx_INCREF(Py_None);
30251 __Pyx_XDECREF_SET(__pyx_v_ns, Py_None);
30252 __Pyx_INCREF(Py_None);
30253 __Pyx_XDECREF_SET(__pyx_v_name, Py_None);
30255 /* "src/lxml/objectpath.pxi":143
30256 * # path '.child' => ignore root
30258 * index = 0 # <<<<<<<<<<<<<<
30260 * ns, name = cetree.getNsTag(item)
30262 __Pyx_INCREF(__pyx_int_0);
30263 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_int_0);
30265 /* "src/lxml/objectpath.pxi":140
30266 * for item in path:
30267 * item = item.strip()
30268 * if not new_path and item == u'': # <<<<<<<<<<<<<<
30269 * # path '.child' => ignore root
30275 /* "src/lxml/objectpath.pxi":145
30278 * ns, name = cetree.getNsTag(item) # <<<<<<<<<<<<<<
30279 * c_name = _xcstr(name)
30280 * index_pos = tree.xmlStrchr(c_name, c'[')
30283 __pyx_t_4 = getNsTag(__pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
30284 __Pyx_GOTREF(__pyx_t_4);
30285 if (likely(__pyx_t_4 != Py_None)) {
30286 PyObject* sequence = __pyx_t_4;
30287 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
30288 if (unlikely(size != 2)) {
30289 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
30290 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
30291 __PYX_ERR(1, 145, __pyx_L1_error)
30293 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30294 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
30295 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
30296 __Pyx_INCREF(__pyx_t_5);
30297 __Pyx_INCREF(__pyx_t_6);
30299 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 145, __pyx_L1_error)
30300 __Pyx_GOTREF(__pyx_t_5);
30301 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 145, __pyx_L1_error)
30302 __Pyx_GOTREF(__pyx_t_6);
30304 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30306 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 145, __pyx_L1_error)
30308 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_5);
30310 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
30313 /* "src/lxml/objectpath.pxi":146
30315 * ns, name = cetree.getNsTag(item)
30316 * c_name = _xcstr(name) # <<<<<<<<<<<<<<
30317 * index_pos = tree.xmlStrchr(c_name, c'[')
30318 * if index_pos is NULL:
30320 __pyx_v_c_name = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name);
30322 /* "src/lxml/objectpath.pxi":147
30323 * ns, name = cetree.getNsTag(item)
30324 * c_name = _xcstr(name)
30325 * index_pos = tree.xmlStrchr(c_name, c'[') # <<<<<<<<<<<<<<
30326 * if index_pos is NULL:
30329 __pyx_v_index_pos = xmlStrchr(__pyx_v_c_name, '[');
30331 /* "src/lxml/objectpath.pxi":148
30332 * c_name = _xcstr(name)
30333 * index_pos = tree.xmlStrchr(c_name, c'[')
30334 * if index_pos is NULL: # <<<<<<<<<<<<<<
30338 __pyx_t_7 = ((__pyx_v_index_pos == NULL) != 0);
30341 /* "src/lxml/objectpath.pxi":149
30342 * index_pos = tree.xmlStrchr(c_name, c'[')
30343 * if index_pos is NULL:
30344 * index = 0 # <<<<<<<<<<<<<<
30346 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30348 __Pyx_INCREF(__pyx_int_0);
30349 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_int_0);
30351 /* "src/lxml/objectpath.pxi":148
30352 * c_name = _xcstr(name)
30353 * index_pos = tree.xmlStrchr(c_name, c'[')
30354 * if index_pos is NULL: # <<<<<<<<<<<<<<
30361 /* "src/lxml/objectpath.pxi":151
30364 * index_end = tree.xmlStrchr(index_pos + 1, c']') # <<<<<<<<<<<<<<
30365 * if index_end is NULL:
30366 * raise ValueError, u"index must be enclosed in []"
30369 __pyx_v_index_end = xmlStrchr((__pyx_v_index_pos + 1), ']');
30371 /* "src/lxml/objectpath.pxi":152
30373 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30374 * if index_end is NULL: # <<<<<<<<<<<<<<
30375 * raise ValueError, u"index must be enclosed in []"
30376 * index = int(index_pos[1:index_end - index_pos])
30378 __pyx_t_7 = ((__pyx_v_index_end == NULL) != 0);
30379 if (unlikely(__pyx_t_7)) {
30381 /* "src/lxml/objectpath.pxi":153
30382 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30383 * if index_end is NULL:
30384 * raise ValueError, u"index must be enclosed in []" # <<<<<<<<<<<<<<
30385 * index = int(index_pos[1:index_end - index_pos])
30386 * if not new_path and index != 0:
30388 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_must_be_enclosed_in, 0, 0);
30389 __PYX_ERR(1, 153, __pyx_L1_error)
30391 /* "src/lxml/objectpath.pxi":152
30393 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30394 * if index_end is NULL: # <<<<<<<<<<<<<<
30395 * raise ValueError, u"index must be enclosed in []"
30396 * index = int(index_pos[1:index_end - index_pos])
30400 /* "src/lxml/objectpath.pxi":154
30401 * if index_end is NULL:
30402 * raise ValueError, u"index must be enclosed in []"
30403 * index = int(index_pos[1:index_end - index_pos]) # <<<<<<<<<<<<<<
30404 * if not new_path and index != 0:
30405 * raise ValueError, u"index not allowed on root node"
30407 __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_index_pos) + 1, (__pyx_v_index_end - __pyx_v_index_pos) - 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 154, __pyx_L1_error)
30408 __Pyx_GOTREF(__pyx_t_4);
30409 __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
30410 __Pyx_GOTREF(__pyx_t_6);
30411 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30412 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
30415 /* "src/lxml/objectpath.pxi":155
30416 * raise ValueError, u"index must be enclosed in []"
30417 * index = int(index_pos[1:index_end - index_pos])
30418 * if not new_path and index != 0: # <<<<<<<<<<<<<<
30419 * raise ValueError, u"index not allowed on root node"
30420 * name = <bytes>c_name[:index_pos - c_name]
30422 __pyx_t_9 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30423 __pyx_t_8 = ((!__pyx_t_9) != 0);
30426 __pyx_t_7 = __pyx_t_8;
30427 goto __pyx_L11_bool_binop_done;
30429 __pyx_t_6 = __Pyx_PyInt_NeObjC(__pyx_v_index, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 155, __pyx_L1_error)
30430 __Pyx_GOTREF(__pyx_t_6);
30431 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
30432 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30433 __pyx_t_7 = __pyx_t_8;
30434 __pyx_L11_bool_binop_done:;
30435 if (unlikely(__pyx_t_7)) {
30437 /* "src/lxml/objectpath.pxi":156
30438 * index = int(index_pos[1:index_end - index_pos])
30439 * if not new_path and index != 0:
30440 * raise ValueError, u"index not allowed on root node" # <<<<<<<<<<<<<<
30441 * name = <bytes>c_name[:index_pos - c_name]
30442 * new_path.append( (ns, name, index) )
30444 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_not_allowed_on_root_node, 0, 0);
30445 __PYX_ERR(1, 156, __pyx_L1_error)
30447 /* "src/lxml/objectpath.pxi":155
30448 * raise ValueError, u"index must be enclosed in []"
30449 * index = int(index_pos[1:index_end - index_pos])
30450 * if not new_path and index != 0: # <<<<<<<<<<<<<<
30451 * raise ValueError, u"index not allowed on root node"
30452 * name = <bytes>c_name[:index_pos - c_name]
30456 /* "src/lxml/objectpath.pxi":157
30457 * if not new_path and index != 0:
30458 * raise ValueError, u"index not allowed on root node"
30459 * name = <bytes>c_name[:index_pos - c_name] # <<<<<<<<<<<<<<
30460 * new_path.append( (ns, name, index) )
30463 __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_c_name) + 0, (__pyx_v_index_pos - __pyx_v_c_name) - 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 157, __pyx_L1_error)
30464 __Pyx_GOTREF(__pyx_t_6);
30465 __pyx_t_4 = __pyx_t_6;
30466 __Pyx_INCREF(__pyx_t_4);
30467 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30468 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
30475 /* "src/lxml/objectpath.pxi":158
30476 * raise ValueError, u"index not allowed on root node"
30477 * name = <bytes>c_name[:index_pos - c_name]
30478 * new_path.append( (ns, name, index) ) # <<<<<<<<<<<<<<
30480 * raise ValueError, u"invalid path"
30482 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 158, __pyx_L1_error)
30483 __Pyx_GOTREF(__pyx_t_4);
30484 __Pyx_INCREF(__pyx_v_ns);
30485 __Pyx_GIVEREF(__pyx_v_ns);
30486 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ns);
30487 __Pyx_INCREF(__pyx_v_name);
30488 __Pyx_GIVEREF(__pyx_v_name);
30489 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name);
30490 __Pyx_INCREF(__pyx_v_index);
30491 __Pyx_GIVEREF(__pyx_v_index);
30492 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_index);
30493 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_path, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 158, __pyx_L1_error)
30494 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30496 /* "src/lxml/objectpath.pxi":138
30499 * for item in path: # <<<<<<<<<<<<<<
30500 * item = item.strip()
30501 * if not new_path and item == u'':
30504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30506 /* "src/lxml/objectpath.pxi":159
30507 * name = <bytes>c_name[:index_pos - c_name]
30508 * new_path.append( (ns, name, index) )
30509 * if not new_path: # <<<<<<<<<<<<<<
30510 * raise ValueError, u"invalid path"
30513 __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30514 __pyx_t_8 = ((!__pyx_t_7) != 0);
30515 if (unlikely(__pyx_t_8)) {
30517 /* "src/lxml/objectpath.pxi":160
30518 * new_path.append( (ns, name, index) )
30520 * raise ValueError, u"invalid path" # <<<<<<<<<<<<<<
30524 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
30525 __PYX_ERR(1, 160, __pyx_L1_error)
30527 /* "src/lxml/objectpath.pxi":159
30528 * name = <bytes>c_name[:index_pos - c_name]
30529 * new_path.append( (ns, name, index) )
30530 * if not new_path: # <<<<<<<<<<<<<<
30531 * raise ValueError, u"invalid path"
30536 /* "src/lxml/objectpath.pxi":161
30538 * raise ValueError, u"invalid path"
30539 * return new_path # <<<<<<<<<<<<<<
30543 __Pyx_XDECREF(__pyx_r);
30544 __Pyx_INCREF(__pyx_v_new_path);
30545 __pyx_r = __pyx_v_new_path;
30548 /* "src/lxml/objectpath.pxi":134
30551 * cdef list _parse_object_path_list(path): # <<<<<<<<<<<<<<
30552 * u"""Parse object path sequence into a (ns, name, index) list.
30556 /* function exit code */
30558 __Pyx_XDECREF(__pyx_t_1);
30559 __Pyx_XDECREF(__pyx_t_4);
30560 __Pyx_XDECREF(__pyx_t_5);
30561 __Pyx_XDECREF(__pyx_t_6);
30562 __Pyx_AddTraceback("lxml.objectify._parse_object_path_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
30565 __Pyx_XDECREF(__pyx_v_new_path);
30566 __Pyx_XDECREF(__pyx_v_item);
30567 __Pyx_XDECREF(__pyx_v_ns);
30568 __Pyx_XDECREF(__pyx_v_name);
30569 __Pyx_XDECREF(__pyx_v_index);
30570 __Pyx_XGIVEREF(__pyx_r);
30571 __Pyx_RefNannyFinishContext();
30575 /* "src/lxml/objectpath.pxi":164
30578 * cdef _ObjectPath* _build_object_path_segments(list path_list) except NULL: # <<<<<<<<<<<<<<
30579 * cdef _ObjectPath* c_path
30580 * cdef _ObjectPath* c_path_segments
30583 static __pyx_t_4lxml_9objectify__ObjectPath *__pyx_f_4lxml_9objectify__build_object_path_segments(PyObject *__pyx_v_path_list) {
30584 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path;
30585 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path_segments;
30586 PyObject *__pyx_v_href = NULL;
30587 PyObject *__pyx_v_name = NULL;
30588 PyObject *__pyx_v_index = NULL;
30589 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_r;
30590 __Pyx_RefNannyDeclarations
30591 Py_ssize_t __pyx_t_1;
30593 PyObject *__pyx_t_3 = NULL;
30594 PyObject *__pyx_t_4 = NULL;
30595 PyObject *__pyx_t_5 = NULL;
30596 PyObject *__pyx_t_6 = NULL;
30597 PyObject *__pyx_t_7 = NULL;
30598 PyObject *__pyx_t_8 = NULL;
30599 PyObject *(*__pyx_t_9)(PyObject *);
30600 const xmlChar *__pyx_t_10;
30601 Py_ssize_t __pyx_t_11;
30602 int __pyx_lineno = 0;
30603 const char *__pyx_filename = NULL;
30604 int __pyx_clineno = 0;
30605 __Pyx_RefNannySetupContext("_build_object_path_segments", 0);
30607 /* "src/lxml/objectpath.pxi":167
30608 * cdef _ObjectPath* c_path
30609 * cdef _ObjectPath* c_path_segments
30610 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath)) # <<<<<<<<<<<<<<
30611 * if c_path_segments is NULL:
30612 * raise MemoryError()
30614 if (unlikely(__pyx_v_path_list == Py_None)) {
30615 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30616 __PYX_ERR(1, 167, __pyx_L1_error)
30618 __pyx_t_1 = PyList_GET_SIZE(__pyx_v_path_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 167, __pyx_L1_error)
30619 __pyx_v_c_path_segments = ((__pyx_t_4lxml_9objectify__ObjectPath *)lxml_malloc(__pyx_t_1, (sizeof(__pyx_t_4lxml_9objectify__ObjectPath))));
30621 /* "src/lxml/objectpath.pxi":168
30622 * cdef _ObjectPath* c_path_segments
30623 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30624 * if c_path_segments is NULL: # <<<<<<<<<<<<<<
30625 * raise MemoryError()
30626 * c_path = c_path_segments
30628 __pyx_t_2 = ((__pyx_v_c_path_segments == NULL) != 0);
30629 if (unlikely(__pyx_t_2)) {
30631 /* "src/lxml/objectpath.pxi":169
30632 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30633 * if c_path_segments is NULL:
30634 * raise MemoryError() # <<<<<<<<<<<<<<
30635 * c_path = c_path_segments
30636 * for href, name, index in path_list:
30638 PyErr_NoMemory(); __PYX_ERR(1, 169, __pyx_L1_error)
30640 /* "src/lxml/objectpath.pxi":168
30641 * cdef _ObjectPath* c_path_segments
30642 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30643 * if c_path_segments is NULL: # <<<<<<<<<<<<<<
30644 * raise MemoryError()
30645 * c_path = c_path_segments
30649 /* "src/lxml/objectpath.pxi":170
30650 * if c_path_segments is NULL:
30651 * raise MemoryError()
30652 * c_path = c_path_segments # <<<<<<<<<<<<<<
30653 * for href, name, index in path_list:
30654 * c_path[0].href = _xcstr(href) if href is not None else NULL
30656 __pyx_v_c_path = __pyx_v_c_path_segments;
30658 /* "src/lxml/objectpath.pxi":171
30659 * raise MemoryError()
30660 * c_path = c_path_segments
30661 * for href, name, index in path_list: # <<<<<<<<<<<<<<
30662 * c_path[0].href = _xcstr(href) if href is not None else NULL
30663 * c_path[0].name = _xcstr(name) if name is not None else NULL
30665 if (unlikely(__pyx_v_path_list == Py_None)) {
30666 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
30667 __PYX_ERR(1, 171, __pyx_L1_error)
30669 __pyx_t_3 = __pyx_v_path_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
30671 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
30672 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30673 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 171, __pyx_L1_error)
30675 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 171, __pyx_L1_error)
30676 __Pyx_GOTREF(__pyx_t_4);
30678 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
30679 PyObject* sequence = __pyx_t_4;
30680 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
30681 if (unlikely(size != 3)) {
30682 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
30683 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
30684 __PYX_ERR(1, 171, __pyx_L1_error)
30686 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30687 if (likely(PyTuple_CheckExact(sequence))) {
30688 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
30689 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
30690 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
30692 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
30693 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
30694 __pyx_t_7 = PyList_GET_ITEM(sequence, 2);
30696 __Pyx_INCREF(__pyx_t_5);
30697 __Pyx_INCREF(__pyx_t_6);
30698 __Pyx_INCREF(__pyx_t_7);
30700 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 171, __pyx_L1_error)
30701 __Pyx_GOTREF(__pyx_t_5);
30702 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 171, __pyx_L1_error)
30703 __Pyx_GOTREF(__pyx_t_6);
30704 __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 171, __pyx_L1_error)
30705 __Pyx_GOTREF(__pyx_t_7);
30707 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30709 Py_ssize_t index = -1;
30710 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 171, __pyx_L1_error)
30711 __Pyx_GOTREF(__pyx_t_8);
30712 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30713 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
30714 index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
30715 __Pyx_GOTREF(__pyx_t_5);
30716 index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
30717 __Pyx_GOTREF(__pyx_t_6);
30718 index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
30719 __Pyx_GOTREF(__pyx_t_7);
30720 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(1, 171, __pyx_L1_error)
30722 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30723 goto __pyx_L7_unpacking_done;
30724 __pyx_L6_unpacking_failed:;
30725 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30727 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
30728 __PYX_ERR(1, 171, __pyx_L1_error)
30729 __pyx_L7_unpacking_done:;
30731 __Pyx_XDECREF_SET(__pyx_v_href, __pyx_t_5);
30733 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
30735 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
30738 /* "src/lxml/objectpath.pxi":172
30739 * c_path = c_path_segments
30740 * for href, name, index in path_list:
30741 * c_path[0].href = _xcstr(href) if href is not None else NULL # <<<<<<<<<<<<<<
30742 * c_path[0].name = _xcstr(name) if name is not None else NULL
30743 * c_path[0].index = index
30745 __pyx_t_2 = (__pyx_v_href != Py_None);
30746 if ((__pyx_t_2 != 0)) {
30747 __pyx_t_10 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_href);
30751 (__pyx_v_c_path[0]).href = __pyx_t_10;
30753 /* "src/lxml/objectpath.pxi":173
30754 * for href, name, index in path_list:
30755 * c_path[0].href = _xcstr(href) if href is not None else NULL
30756 * c_path[0].name = _xcstr(name) if name is not None else NULL # <<<<<<<<<<<<<<
30757 * c_path[0].index = index
30760 __pyx_t_2 = (__pyx_v_name != Py_None);
30761 if ((__pyx_t_2 != 0)) {
30762 __pyx_t_10 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name);
30766 (__pyx_v_c_path[0]).name = __pyx_t_10;
30768 /* "src/lxml/objectpath.pxi":174
30769 * c_path[0].href = _xcstr(href) if href is not None else NULL
30770 * c_path[0].name = _xcstr(name) if name is not None else NULL
30771 * c_path[0].index = index # <<<<<<<<<<<<<<
30773 * return c_path_segments
30775 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 174, __pyx_L1_error)
30776 (__pyx_v_c_path[0]).index = __pyx_t_11;
30778 /* "src/lxml/objectpath.pxi":175
30779 * c_path[0].name = _xcstr(name) if name is not None else NULL
30780 * c_path[0].index = index
30781 * c_path += 1 # <<<<<<<<<<<<<<
30782 * return c_path_segments
30785 __pyx_v_c_path = (__pyx_v_c_path + 1);
30787 /* "src/lxml/objectpath.pxi":171
30788 * raise MemoryError()
30789 * c_path = c_path_segments
30790 * for href, name, index in path_list: # <<<<<<<<<<<<<<
30791 * c_path[0].href = _xcstr(href) if href is not None else NULL
30792 * c_path[0].name = _xcstr(name) if name is not None else NULL
30795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30797 /* "src/lxml/objectpath.pxi":176
30798 * c_path[0].index = index
30800 * return c_path_segments # <<<<<<<<<<<<<<
30804 __pyx_r = __pyx_v_c_path_segments;
30807 /* "src/lxml/objectpath.pxi":164
30810 * cdef _ObjectPath* _build_object_path_segments(list path_list) except NULL: # <<<<<<<<<<<<<<
30811 * cdef _ObjectPath* c_path
30812 * cdef _ObjectPath* c_path_segments
30815 /* function exit code */
30817 __Pyx_XDECREF(__pyx_t_3);
30818 __Pyx_XDECREF(__pyx_t_4);
30819 __Pyx_XDECREF(__pyx_t_5);
30820 __Pyx_XDECREF(__pyx_t_6);
30821 __Pyx_XDECREF(__pyx_t_7);
30822 __Pyx_XDECREF(__pyx_t_8);
30823 __Pyx_AddTraceback("lxml.objectify._build_object_path_segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
30826 __Pyx_XDECREF(__pyx_v_href);
30827 __Pyx_XDECREF(__pyx_v_name);
30828 __Pyx_XDECREF(__pyx_v_index);
30829 __Pyx_RefNannyFinishContext();
30833 /* "src/lxml/objectpath.pxi":179
30836 * cdef _find_object_path(_Element root, _ObjectPath* c_path, Py_ssize_t c_path_len, default_value): # <<<<<<<<<<<<<<
30837 * u"""Follow the path to find the target element.
30841 static PyObject *__pyx_f_4lxml_9objectify__find_object_path(struct LxmlElement *__pyx_v_root, __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path, Py_ssize_t __pyx_v_c_path_len, PyObject *__pyx_v_default_value) {
30842 xmlNode *__pyx_v_c_node;
30843 Py_ssize_t __pyx_v_c_index;
30844 const xmlChar *__pyx_v_c_name;
30845 const xmlChar *__pyx_v_c_href;
30846 PyObject *__pyx_v_tag = NULL;
30847 PyObject *__pyx_r = NULL;
30848 __Pyx_RefNannyDeclarations
30849 xmlNode *__pyx_t_1;
30850 const xmlChar *__pyx_t_2;
30853 PyObject *__pyx_t_5 = NULL;
30854 Py_ssize_t __pyx_t_6;
30856 PyObject *__pyx_t_8 = NULL;
30857 PyObject *__pyx_t_9 = NULL;
30858 int __pyx_lineno = 0;
30859 const char *__pyx_filename = NULL;
30860 int __pyx_clineno = 0;
30861 __Pyx_RefNannySetupContext("_find_object_path", 0);
30863 /* "src/lxml/objectpath.pxi":184
30864 * cdef tree.xmlNode* c_node
30865 * cdef Py_ssize_t c_index
30866 * c_node = root._c_node # <<<<<<<<<<<<<<
30867 * c_name = c_path[0].name
30868 * c_href = c_path[0].href
30870 __pyx_t_1 = __pyx_v_root->_c_node;
30871 __pyx_v_c_node = __pyx_t_1;
30873 /* "src/lxml/objectpath.pxi":185
30874 * cdef Py_ssize_t c_index
30875 * c_node = root._c_node
30876 * c_name = c_path[0].name # <<<<<<<<<<<<<<
30877 * c_href = c_path[0].href
30878 * if c_href is NULL or c_href[0] == c'\0':
30880 __pyx_t_2 = (__pyx_v_c_path[0]).name;
30881 __pyx_v_c_name = __pyx_t_2;
30883 /* "src/lxml/objectpath.pxi":186
30884 * c_node = root._c_node
30885 * c_name = c_path[0].name
30886 * c_href = c_path[0].href # <<<<<<<<<<<<<<
30887 * if c_href is NULL or c_href[0] == c'\0':
30888 * c_href = tree._getNs(c_node)
30890 __pyx_t_2 = (__pyx_v_c_path[0]).href;
30891 __pyx_v_c_href = __pyx_t_2;
30893 /* "src/lxml/objectpath.pxi":187
30894 * c_name = c_path[0].name
30895 * c_href = c_path[0].href
30896 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
30897 * c_href = tree._getNs(c_node)
30898 * if not cetree.tagMatches(c_node, c_href, c_name):
30900 __pyx_t_4 = ((__pyx_v_c_href == NULL) != 0);
30903 __pyx_t_3 = __pyx_t_4;
30904 goto __pyx_L4_bool_binop_done;
30906 __pyx_t_4 = (((__pyx_v_c_href[0]) == '\x00') != 0);
30907 __pyx_t_3 = __pyx_t_4;
30908 __pyx_L4_bool_binop_done:;
30911 /* "src/lxml/objectpath.pxi":188
30912 * c_href = c_path[0].href
30913 * if c_href is NULL or c_href[0] == c'\0':
30914 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
30915 * if not cetree.tagMatches(c_node, c_href, c_name):
30916 * if default_value is not _NO_DEFAULT:
30918 __pyx_v_c_href = _getNs(__pyx_v_c_node);
30920 /* "src/lxml/objectpath.pxi":187
30921 * c_name = c_path[0].name
30922 * c_href = c_path[0].href
30923 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
30924 * c_href = tree._getNs(c_node)
30925 * if not cetree.tagMatches(c_node, c_href, c_name):
30929 /* "src/lxml/objectpath.pxi":189
30930 * if c_href is NULL or c_href[0] == c'\0':
30931 * c_href = tree._getNs(c_node)
30932 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
30933 * if default_value is not _NO_DEFAULT:
30934 * return default_value
30936 __pyx_t_3 = ((!(tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0)) != 0);
30939 /* "src/lxml/objectpath.pxi":190
30940 * c_href = tree._getNs(c_node)
30941 * if not cetree.tagMatches(c_node, c_href, c_name):
30942 * if default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
30943 * return default_value
30946 __pyx_t_3 = (__pyx_v_default_value != __pyx_v_4lxml_9objectify__NO_DEFAULT);
30947 __pyx_t_4 = (__pyx_t_3 != 0);
30948 if (likely(__pyx_t_4)) {
30950 /* "src/lxml/objectpath.pxi":191
30951 * if not cetree.tagMatches(c_node, c_href, c_name):
30952 * if default_value is not _NO_DEFAULT:
30953 * return default_value # <<<<<<<<<<<<<<
30955 * raise ValueError(
30957 __Pyx_XDECREF(__pyx_r);
30958 __Pyx_INCREF(__pyx_v_default_value);
30959 __pyx_r = __pyx_v_default_value;
30962 /* "src/lxml/objectpath.pxi":190
30963 * c_href = tree._getNs(c_node)
30964 * if not cetree.tagMatches(c_node, c_href, c_name):
30965 * if default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
30966 * return default_value
30971 /* "src/lxml/objectpath.pxi":193
30972 * return default_value
30974 * raise ValueError( # <<<<<<<<<<<<<<
30975 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
30980 /* "src/lxml/objectpath.pxi":194
30982 * raise ValueError(
30983 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}") # <<<<<<<<<<<<<<
30985 * while c_node is not NULL:
30987 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 194, __pyx_L1_error)
30988 __Pyx_GOTREF(__pyx_t_5);
30991 __Pyx_INCREF(__pyx_kp_u_root_element_does_not_match_need);
30993 __Pyx_GIVEREF(__pyx_kp_u_root_element_does_not_match_need);
30994 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_root_element_does_not_match_need);
30995 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 194, __pyx_L1_error)
30996 __Pyx_GOTREF(__pyx_t_8);
30997 __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 194, __pyx_L1_error)
30998 __Pyx_GOTREF(__pyx_t_9);
30999 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31000 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_7;
31001 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
31002 __Pyx_GIVEREF(__pyx_t_9);
31003 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
31005 __Pyx_INCREF(__pyx_kp_u_got);
31007 __Pyx_GIVEREF(__pyx_kp_u_got);
31008 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_got);
31009 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_root), __pyx_n_s_tag); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 194, __pyx_L1_error)
31010 __Pyx_GOTREF(__pyx_t_9);
31011 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 194, __pyx_L1_error)
31012 __Pyx_GOTREF(__pyx_t_8);
31013 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31014 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
31015 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
31016 __Pyx_GIVEREF(__pyx_t_8);
31017 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
31019 __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 194, __pyx_L1_error)
31020 __Pyx_GOTREF(__pyx_t_8);
31021 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31023 /* "src/lxml/objectpath.pxi":193
31024 * return default_value
31026 * raise ValueError( # <<<<<<<<<<<<<<
31027 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31030 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 193, __pyx_L1_error)
31031 __Pyx_GOTREF(__pyx_t_5);
31032 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31033 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
31034 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31035 __PYX_ERR(1, 193, __pyx_L1_error)
31038 /* "src/lxml/objectpath.pxi":189
31039 * if c_href is NULL or c_href[0] == c'\0':
31040 * c_href = tree._getNs(c_node)
31041 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31042 * if default_value is not _NO_DEFAULT:
31043 * return default_value
31047 /* "src/lxml/objectpath.pxi":196
31048 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31050 * while c_node is not NULL: # <<<<<<<<<<<<<<
31052 * if c_path_len <= 0:
31055 __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
31056 if (!__pyx_t_4) break;
31058 /* "src/lxml/objectpath.pxi":197
31060 * while c_node is not NULL:
31061 * c_path_len -= 1 # <<<<<<<<<<<<<<
31062 * if c_path_len <= 0:
31065 __pyx_v_c_path_len = (__pyx_v_c_path_len - 1);
31067 /* "src/lxml/objectpath.pxi":198
31068 * while c_node is not NULL:
31070 * if c_path_len <= 0: # <<<<<<<<<<<<<<
31074 __pyx_t_4 = ((__pyx_v_c_path_len <= 0) != 0);
31077 /* "src/lxml/objectpath.pxi":199
31079 * if c_path_len <= 0:
31080 * break # <<<<<<<<<<<<<<
31084 goto __pyx_L9_break;
31086 /* "src/lxml/objectpath.pxi":198
31087 * while c_node is not NULL:
31089 * if c_path_len <= 0: # <<<<<<<<<<<<<<
31095 /* "src/lxml/objectpath.pxi":201
31098 * c_path += 1 # <<<<<<<<<<<<<<
31099 * if c_path[0].href is not NULL:
31100 * c_href = c_path[0].href # otherwise: keep parent namespace
31102 __pyx_v_c_path = (__pyx_v_c_path + 1);
31104 /* "src/lxml/objectpath.pxi":202
31107 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31108 * c_href = c_path[0].href # otherwise: keep parent namespace
31109 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31111 __pyx_t_4 = (((__pyx_v_c_path[0]).href != NULL) != 0);
31114 /* "src/lxml/objectpath.pxi":203
31116 * if c_path[0].href is not NULL:
31117 * c_href = c_path[0].href # otherwise: keep parent namespace # <<<<<<<<<<<<<<
31118 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31119 * if c_name is NULL:
31121 __pyx_t_2 = (__pyx_v_c_path[0]).href;
31122 __pyx_v_c_href = __pyx_t_2;
31124 /* "src/lxml/objectpath.pxi":202
31127 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31128 * c_href = c_path[0].href # otherwise: keep parent namespace
31129 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31133 /* "src/lxml/objectpath.pxi":204
31134 * if c_path[0].href is not NULL:
31135 * c_href = c_path[0].href # otherwise: keep parent namespace
31136 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1) # <<<<<<<<<<<<<<
31137 * if c_name is NULL:
31138 * c_name = c_path[0].name
31140 __pyx_v_c_name = xmlDictExists(__pyx_v_c_node->doc->dict, (__pyx_v_c_path[0]).name, -1);
31142 /* "src/lxml/objectpath.pxi":205
31143 * c_href = c_path[0].href # otherwise: keep parent namespace
31144 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31145 * if c_name is NULL: # <<<<<<<<<<<<<<
31146 * c_name = c_path[0].name
31149 __pyx_t_4 = ((__pyx_v_c_name == NULL) != 0);
31152 /* "src/lxml/objectpath.pxi":206
31153 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31154 * if c_name is NULL:
31155 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31159 __pyx_t_2 = (__pyx_v_c_path[0]).name;
31160 __pyx_v_c_name = __pyx_t_2;
31162 /* "src/lxml/objectpath.pxi":207
31163 * if c_name is NULL:
31164 * c_name = c_path[0].name
31165 * c_node = NULL # <<<<<<<<<<<<<<
31167 * c_index = c_path[0].index
31169 __pyx_v_c_node = NULL;
31171 /* "src/lxml/objectpath.pxi":208
31172 * c_name = c_path[0].name
31174 * break # <<<<<<<<<<<<<<
31175 * c_index = c_path[0].index
31176 * c_node = c_node.last if c_index < 0 else c_node.children
31178 goto __pyx_L9_break;
31180 /* "src/lxml/objectpath.pxi":205
31181 * c_href = c_path[0].href # otherwise: keep parent namespace
31182 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31183 * if c_name is NULL: # <<<<<<<<<<<<<<
31184 * c_name = c_path[0].name
31189 /* "src/lxml/objectpath.pxi":209
31192 * c_index = c_path[0].index # <<<<<<<<<<<<<<
31193 * c_node = c_node.last if c_index < 0 else c_node.children
31194 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31196 __pyx_t_6 = (__pyx_v_c_path[0]).index;
31197 __pyx_v_c_index = __pyx_t_6;
31199 /* "src/lxml/objectpath.pxi":210
31201 * c_index = c_path[0].index
31202 * c_node = c_node.last if c_index < 0 else c_node.children # <<<<<<<<<<<<<<
31203 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31206 if (((__pyx_v_c_index < 0) != 0)) {
31207 __pyx_t_1 = __pyx_v_c_node->last;
31209 __pyx_t_1 = __pyx_v_c_node->children;
31211 __pyx_v_c_node = __pyx_t_1;
31213 /* "src/lxml/objectpath.pxi":211
31214 * c_index = c_path[0].index
31215 * c_node = c_node.last if c_index < 0 else c_node.children
31216 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index) # <<<<<<<<<<<<<<
31218 * if c_node is not NULL:
31220 __pyx_v_c_node = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name, __pyx_v_c_index);
31224 /* "src/lxml/objectpath.pxi":213
31225 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31227 * if c_node is not NULL: # <<<<<<<<<<<<<<
31228 * return cetree.elementFactory(root._doc, c_node)
31229 * elif default_value is not _NO_DEFAULT:
31231 __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
31234 /* "src/lxml/objectpath.pxi":214
31236 * if c_node is not NULL:
31237 * return cetree.elementFactory(root._doc, c_node) # <<<<<<<<<<<<<<
31238 * elif default_value is not _NO_DEFAULT:
31239 * return default_value
31241 __Pyx_XDECREF(__pyx_r);
31242 __pyx_t_5 = ((PyObject *)__pyx_v_root->_doc);
31243 __Pyx_INCREF(__pyx_t_5);
31244 __pyx_t_8 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 214, __pyx_L1_error)
31245 __Pyx_GOTREF(__pyx_t_8);
31246 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31247 __pyx_r = __pyx_t_8;
31251 /* "src/lxml/objectpath.pxi":213
31252 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31254 * if c_node is not NULL: # <<<<<<<<<<<<<<
31255 * return cetree.elementFactory(root._doc, c_node)
31256 * elif default_value is not _NO_DEFAULT:
31260 /* "src/lxml/objectpath.pxi":215
31261 * if c_node is not NULL:
31262 * return cetree.elementFactory(root._doc, c_node)
31263 * elif default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
31264 * return default_value
31267 __pyx_t_4 = (__pyx_v_default_value != __pyx_v_4lxml_9objectify__NO_DEFAULT);
31268 __pyx_t_3 = (__pyx_t_4 != 0);
31269 if (likely(__pyx_t_3)) {
31271 /* "src/lxml/objectpath.pxi":216
31272 * return cetree.elementFactory(root._doc, c_node)
31273 * elif default_value is not _NO_DEFAULT:
31274 * return default_value # <<<<<<<<<<<<<<
31276 * tag = cetree.namespacedNameFromNsName(c_href, c_name)
31278 __Pyx_XDECREF(__pyx_r);
31279 __Pyx_INCREF(__pyx_v_default_value);
31280 __pyx_r = __pyx_v_default_value;
31283 /* "src/lxml/objectpath.pxi":215
31284 * if c_node is not NULL:
31285 * return cetree.elementFactory(root._doc, c_node)
31286 * elif default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
31287 * return default_value
31292 /* "src/lxml/objectpath.pxi":218
31293 * return default_value
31295 * tag = cetree.namespacedNameFromNsName(c_href, c_name) # <<<<<<<<<<<<<<
31296 * raise AttributeError, f"no such child: {tag}"
31300 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 218, __pyx_L1_error)
31301 __Pyx_GOTREF(__pyx_t_8);
31302 __pyx_v_tag = __pyx_t_8;
31305 /* "src/lxml/objectpath.pxi":219
31307 * tag = cetree.namespacedNameFromNsName(c_href, c_name)
31308 * raise AttributeError, f"no such child: {tag}" # <<<<<<<<<<<<<<
31312 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 219, __pyx_L1_error)
31313 __Pyx_GOTREF(__pyx_t_8);
31314 __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_no_such_child, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 219, __pyx_L1_error)
31315 __Pyx_GOTREF(__pyx_t_5);
31316 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31317 __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_t_5, 0, 0);
31318 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31319 __PYX_ERR(1, 219, __pyx_L1_error)
31322 /* "src/lxml/objectpath.pxi":179
31325 * cdef _find_object_path(_Element root, _ObjectPath* c_path, Py_ssize_t c_path_len, default_value): # <<<<<<<<<<<<<<
31326 * u"""Follow the path to find the target element.
31330 /* function exit code */
31332 __Pyx_XDECREF(__pyx_t_5);
31333 __Pyx_XDECREF(__pyx_t_8);
31334 __Pyx_XDECREF(__pyx_t_9);
31335 __Pyx_AddTraceback("lxml.objectify._find_object_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
31338 __Pyx_XDECREF(__pyx_v_tag);
31339 __Pyx_XGIVEREF(__pyx_r);
31340 __Pyx_RefNannyFinishContext();
31344 /* "src/lxml/objectpath.pxi":222
31347 * cdef _create_object_path(_Element root, _ObjectPath* c_path, # <<<<<<<<<<<<<<
31348 * Py_ssize_t c_path_len, int replace, value):
31349 * u"""Follow the path to find the target element, build the missing children
31352 static PyObject *__pyx_f_4lxml_9objectify__create_object_path(struct LxmlElement *__pyx_v_root, __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path, Py_ssize_t __pyx_v_c_path_len, int __pyx_v_replace, PyObject *__pyx_v_value) {
31353 struct LxmlElement *__pyx_v_child = 0;
31354 xmlNode *__pyx_v_c_node;
31355 xmlNode *__pyx_v_c_child;
31356 Py_ssize_t __pyx_v_c_index;
31357 const xmlChar *__pyx_v_c_name;
31358 const xmlChar *__pyx_v_c_href;
31359 struct LxmlElement *__pyx_v_element = NULL;
31360 PyObject *__pyx_r = NULL;
31361 __Pyx_RefNannyDeclarations
31363 xmlNode *__pyx_t_2;
31364 const xmlChar *__pyx_t_3;
31366 PyObject *__pyx_t_5 = NULL;
31367 Py_ssize_t __pyx_t_6;
31369 PyObject *__pyx_t_8 = NULL;
31370 PyObject *__pyx_t_9 = NULL;
31371 int __pyx_lineno = 0;
31372 const char *__pyx_filename = NULL;
31373 int __pyx_clineno = 0;
31374 __Pyx_RefNannySetupContext("_create_object_path", 0);
31376 /* "src/lxml/objectpath.pxi":232
31377 * cdef tree.xmlNode* c_child
31378 * cdef Py_ssize_t c_index
31379 * if c_path_len == 1: # <<<<<<<<<<<<<<
31380 * raise TypeError, u"cannot update root node"
31383 __pyx_t_1 = ((__pyx_v_c_path_len == 1) != 0);
31384 if (unlikely(__pyx_t_1)) {
31386 /* "src/lxml/objectpath.pxi":233
31387 * cdef Py_ssize_t c_index
31388 * if c_path_len == 1:
31389 * raise TypeError, u"cannot update root node" # <<<<<<<<<<<<<<
31391 * c_node = root._c_node
31393 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_cannot_update_root_node, 0, 0);
31394 __PYX_ERR(1, 233, __pyx_L1_error)
31396 /* "src/lxml/objectpath.pxi":232
31397 * cdef tree.xmlNode* c_child
31398 * cdef Py_ssize_t c_index
31399 * if c_path_len == 1: # <<<<<<<<<<<<<<
31400 * raise TypeError, u"cannot update root node"
31405 /* "src/lxml/objectpath.pxi":235
31406 * raise TypeError, u"cannot update root node"
31408 * c_node = root._c_node # <<<<<<<<<<<<<<
31409 * c_name = c_path[0].name
31410 * c_href = c_path[0].href
31412 __pyx_t_2 = __pyx_v_root->_c_node;
31413 __pyx_v_c_node = __pyx_t_2;
31415 /* "src/lxml/objectpath.pxi":236
31417 * c_node = root._c_node
31418 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31419 * c_href = c_path[0].href
31420 * if c_href is NULL or c_href[0] == c'\0':
31422 __pyx_t_3 = (__pyx_v_c_path[0]).name;
31423 __pyx_v_c_name = __pyx_t_3;
31425 /* "src/lxml/objectpath.pxi":237
31426 * c_node = root._c_node
31427 * c_name = c_path[0].name
31428 * c_href = c_path[0].href # <<<<<<<<<<<<<<
31429 * if c_href is NULL or c_href[0] == c'\0':
31430 * c_href = tree._getNs(c_node)
31432 __pyx_t_3 = (__pyx_v_c_path[0]).href;
31433 __pyx_v_c_href = __pyx_t_3;
31435 /* "src/lxml/objectpath.pxi":238
31436 * c_name = c_path[0].name
31437 * c_href = c_path[0].href
31438 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
31439 * c_href = tree._getNs(c_node)
31440 * if not cetree.tagMatches(c_node, c_href, c_name):
31442 __pyx_t_4 = ((__pyx_v_c_href == NULL) != 0);
31445 __pyx_t_1 = __pyx_t_4;
31446 goto __pyx_L5_bool_binop_done;
31448 __pyx_t_4 = (((__pyx_v_c_href[0]) == '\x00') != 0);
31449 __pyx_t_1 = __pyx_t_4;
31450 __pyx_L5_bool_binop_done:;
31453 /* "src/lxml/objectpath.pxi":239
31454 * c_href = c_path[0].href
31455 * if c_href is NULL or c_href[0] == c'\0':
31456 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
31457 * if not cetree.tagMatches(c_node, c_href, c_name):
31458 * raise ValueError(
31460 __pyx_v_c_href = _getNs(__pyx_v_c_node);
31462 /* "src/lxml/objectpath.pxi":238
31463 * c_name = c_path[0].name
31464 * c_href = c_path[0].href
31465 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
31466 * c_href = tree._getNs(c_node)
31467 * if not cetree.tagMatches(c_node, c_href, c_name):
31471 /* "src/lxml/objectpath.pxi":240
31472 * if c_href is NULL or c_href[0] == c'\0':
31473 * c_href = tree._getNs(c_node)
31474 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31475 * raise ValueError(
31476 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31478 __pyx_t_1 = ((!(tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0)) != 0);
31479 if (unlikely(__pyx_t_1)) {
31481 /* "src/lxml/objectpath.pxi":242
31482 * if not cetree.tagMatches(c_node, c_href, c_name):
31483 * raise ValueError(
31484 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}") # <<<<<<<<<<<<<<
31486 * while c_path_len > 1:
31488 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 242, __pyx_L1_error)
31489 __Pyx_GOTREF(__pyx_t_5);
31492 __Pyx_INCREF(__pyx_kp_u_root_element_does_not_match_need);
31494 __Pyx_GIVEREF(__pyx_kp_u_root_element_does_not_match_need);
31495 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_root_element_does_not_match_need);
31496 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 242, __pyx_L1_error)
31497 __Pyx_GOTREF(__pyx_t_8);
31498 __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 242, __pyx_L1_error)
31499 __Pyx_GOTREF(__pyx_t_9);
31500 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31501 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_7;
31502 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
31503 __Pyx_GIVEREF(__pyx_t_9);
31504 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
31506 __Pyx_INCREF(__pyx_kp_u_got);
31508 __Pyx_GIVEREF(__pyx_kp_u_got);
31509 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_got);
31510 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_root), __pyx_n_s_tag); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 242, __pyx_L1_error)
31511 __Pyx_GOTREF(__pyx_t_9);
31512 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 242, __pyx_L1_error)
31513 __Pyx_GOTREF(__pyx_t_8);
31514 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31515 __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
31516 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
31517 __Pyx_GIVEREF(__pyx_t_8);
31518 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
31520 __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_5, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 242, __pyx_L1_error)
31521 __Pyx_GOTREF(__pyx_t_8);
31522 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31524 /* "src/lxml/objectpath.pxi":241
31525 * c_href = tree._getNs(c_node)
31526 * if not cetree.tagMatches(c_node, c_href, c_name):
31527 * raise ValueError( # <<<<<<<<<<<<<<
31528 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31531 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 241, __pyx_L1_error)
31532 __Pyx_GOTREF(__pyx_t_5);
31533 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31534 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
31535 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31536 __PYX_ERR(1, 241, __pyx_L1_error)
31538 /* "src/lxml/objectpath.pxi":240
31539 * if c_href is NULL or c_href[0] == c'\0':
31540 * c_href = tree._getNs(c_node)
31541 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31542 * raise ValueError(
31543 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31547 /* "src/lxml/objectpath.pxi":244
31548 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31550 * while c_path_len > 1: # <<<<<<<<<<<<<<
31555 __pyx_t_1 = ((__pyx_v_c_path_len > 1) != 0);
31556 if (!__pyx_t_1) break;
31558 /* "src/lxml/objectpath.pxi":245
31560 * while c_path_len > 1:
31561 * c_path_len -= 1 # <<<<<<<<<<<<<<
31563 * if c_path[0].href is not NULL:
31565 __pyx_v_c_path_len = (__pyx_v_c_path_len - 1);
31567 /* "src/lxml/objectpath.pxi":246
31568 * while c_path_len > 1:
31570 * c_path += 1 # <<<<<<<<<<<<<<
31571 * if c_path[0].href is not NULL:
31572 * c_href = c_path[0].href # otherwise: keep parent namespace
31574 __pyx_v_c_path = (__pyx_v_c_path + 1);
31576 /* "src/lxml/objectpath.pxi":247
31579 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31580 * c_href = c_path[0].href # otherwise: keep parent namespace
31581 * c_index = c_path[0].index
31583 __pyx_t_1 = (((__pyx_v_c_path[0]).href != NULL) != 0);
31586 /* "src/lxml/objectpath.pxi":248
31588 * if c_path[0].href is not NULL:
31589 * c_href = c_path[0].href # otherwise: keep parent namespace # <<<<<<<<<<<<<<
31590 * c_index = c_path[0].index
31591 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31593 __pyx_t_3 = (__pyx_v_c_path[0]).href;
31594 __pyx_v_c_href = __pyx_t_3;
31596 /* "src/lxml/objectpath.pxi":247
31599 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31600 * c_href = c_path[0].href # otherwise: keep parent namespace
31601 * c_index = c_path[0].index
31605 /* "src/lxml/objectpath.pxi":249
31606 * if c_path[0].href is not NULL:
31607 * c_href = c_path[0].href # otherwise: keep parent namespace
31608 * c_index = c_path[0].index # <<<<<<<<<<<<<<
31609 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31610 * if c_name is NULL:
31612 __pyx_t_6 = (__pyx_v_c_path[0]).index;
31613 __pyx_v_c_index = __pyx_t_6;
31615 /* "src/lxml/objectpath.pxi":250
31616 * c_href = c_path[0].href # otherwise: keep parent namespace
31617 * c_index = c_path[0].index
31618 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1) # <<<<<<<<<<<<<<
31619 * if c_name is NULL:
31620 * c_name = c_path[0].name
31622 __pyx_v_c_name = xmlDictExists(__pyx_v_c_node->doc->dict, (__pyx_v_c_path[0]).name, -1);
31624 /* "src/lxml/objectpath.pxi":251
31625 * c_index = c_path[0].index
31626 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31627 * if c_name is NULL: # <<<<<<<<<<<<<<
31628 * c_name = c_path[0].name
31631 __pyx_t_1 = ((__pyx_v_c_name == NULL) != 0);
31634 /* "src/lxml/objectpath.pxi":252
31635 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31636 * if c_name is NULL:
31637 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31641 __pyx_t_3 = (__pyx_v_c_path[0]).name;
31642 __pyx_v_c_name = __pyx_t_3;
31644 /* "src/lxml/objectpath.pxi":253
31645 * if c_name is NULL:
31646 * c_name = c_path[0].name
31647 * c_child = NULL # <<<<<<<<<<<<<<
31649 * c_child = c_node.last if c_index < 0 else c_node.children
31651 __pyx_v_c_child = NULL;
31653 /* "src/lxml/objectpath.pxi":251
31654 * c_index = c_path[0].index
31655 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31656 * if c_name is NULL: # <<<<<<<<<<<<<<
31657 * c_name = c_path[0].name
31663 /* "src/lxml/objectpath.pxi":255
31666 * c_child = c_node.last if c_index < 0 else c_node.children # <<<<<<<<<<<<<<
31667 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31671 if (((__pyx_v_c_index < 0) != 0)) {
31672 __pyx_t_2 = __pyx_v_c_node->last;
31674 __pyx_t_2 = __pyx_v_c_node->children;
31676 __pyx_v_c_child = __pyx_t_2;
31678 /* "src/lxml/objectpath.pxi":256
31680 * c_child = c_node.last if c_index < 0 else c_node.children
31681 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index) # <<<<<<<<<<<<<<
31683 * if c_child is not NULL:
31685 __pyx_v_c_child = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_child, __pyx_v_c_href, __pyx_v_c_name, __pyx_v_c_index);
31689 /* "src/lxml/objectpath.pxi":258
31690 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31692 * if c_child is not NULL: # <<<<<<<<<<<<<<
31694 * elif c_index != 0:
31696 __pyx_t_1 = ((__pyx_v_c_child != NULL) != 0);
31699 /* "src/lxml/objectpath.pxi":259
31701 * if c_child is not NULL:
31702 * c_node = c_child # <<<<<<<<<<<<<<
31703 * elif c_index != 0:
31704 * raise TypeError, u"creating indexed path attributes is not supported"
31706 __pyx_v_c_node = __pyx_v_c_child;
31708 /* "src/lxml/objectpath.pxi":258
31709 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31711 * if c_child is not NULL: # <<<<<<<<<<<<<<
31713 * elif c_index != 0:
31718 /* "src/lxml/objectpath.pxi":260
31719 * if c_child is not NULL:
31721 * elif c_index != 0: # <<<<<<<<<<<<<<
31722 * raise TypeError, u"creating indexed path attributes is not supported"
31723 * elif c_path_len == 1:
31725 __pyx_t_1 = ((__pyx_v_c_index != 0) != 0);
31726 if (unlikely(__pyx_t_1)) {
31728 /* "src/lxml/objectpath.pxi":261
31730 * elif c_index != 0:
31731 * raise TypeError, u"creating indexed path attributes is not supported" # <<<<<<<<<<<<<<
31732 * elif c_path_len == 1:
31733 * _appendValue(cetree.elementFactory(root._doc, c_node),
31735 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_creating_indexed_path_attributes, 0, 0);
31736 __PYX_ERR(1, 261, __pyx_L1_error)
31738 /* "src/lxml/objectpath.pxi":260
31739 * if c_child is not NULL:
31741 * elif c_index != 0: # <<<<<<<<<<<<<<
31742 * raise TypeError, u"creating indexed path attributes is not supported"
31743 * elif c_path_len == 1:
31747 /* "src/lxml/objectpath.pxi":262
31748 * elif c_index != 0:
31749 * raise TypeError, u"creating indexed path attributes is not supported"
31750 * elif c_path_len == 1: # <<<<<<<<<<<<<<
31751 * _appendValue(cetree.elementFactory(root._doc, c_node),
31752 * cetree.namespacedNameFromNsName(c_href, c_name),
31754 __pyx_t_1 = ((__pyx_v_c_path_len == 1) != 0);
31757 /* "src/lxml/objectpath.pxi":263
31758 * raise TypeError, u"creating indexed path attributes is not supported"
31759 * elif c_path_len == 1:
31760 * _appendValue(cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31761 * cetree.namespacedNameFromNsName(c_href, c_name),
31764 __pyx_t_5 = ((PyObject *)__pyx_v_root->_doc);
31765 __Pyx_INCREF(__pyx_t_5);
31766 __pyx_t_8 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 263, __pyx_L1_error)
31767 __Pyx_GOTREF(__pyx_t_8);
31768 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31770 /* "src/lxml/objectpath.pxi":264
31771 * elif c_path_len == 1:
31772 * _appendValue(cetree.elementFactory(root._doc, c_node),
31773 * cetree.namespacedNameFromNsName(c_href, c_name), # <<<<<<<<<<<<<<
31777 __pyx_t_5 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 264, __pyx_L1_error)
31778 __Pyx_GOTREF(__pyx_t_5);
31780 /* "src/lxml/objectpath.pxi":263
31781 * raise TypeError, u"creating indexed path attributes is not supported"
31782 * elif c_path_len == 1:
31783 * _appendValue(cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31784 * cetree.namespacedNameFromNsName(c_href, c_name),
31787 __pyx_t_9 = __pyx_f_4lxml_9objectify__appendValue(((struct LxmlElement *)__pyx_t_8), __pyx_t_5, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 263, __pyx_L1_error)
31788 __Pyx_GOTREF(__pyx_t_9);
31789 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31790 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31791 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31793 /* "src/lxml/objectpath.pxi":266
31794 * cetree.namespacedNameFromNsName(c_href, c_name),
31796 * return # <<<<<<<<<<<<<<
31798 * child = cetree.makeSubElement(
31800 __Pyx_XDECREF(__pyx_r);
31801 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31804 /* "src/lxml/objectpath.pxi":262
31805 * elif c_index != 0:
31806 * raise TypeError, u"creating indexed path attributes is not supported"
31807 * elif c_path_len == 1: # <<<<<<<<<<<<<<
31808 * _appendValue(cetree.elementFactory(root._doc, c_node),
31809 * cetree.namespacedNameFromNsName(c_href, c_name),
31813 /* "src/lxml/objectpath.pxi":268
31816 * child = cetree.makeSubElement( # <<<<<<<<<<<<<<
31817 * cetree.elementFactory(root._doc, c_node),
31818 * cetree.namespacedNameFromNsName(c_href, c_name),
31822 /* "src/lxml/objectpath.pxi":269
31824 * child = cetree.makeSubElement(
31825 * cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31826 * cetree.namespacedNameFromNsName(c_href, c_name),
31827 * None, None, None, None)
31829 __pyx_t_9 = ((PyObject *)__pyx_v_root->_doc);
31830 __Pyx_INCREF(__pyx_t_9);
31831 __pyx_t_5 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_9), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 269, __pyx_L1_error)
31832 __Pyx_GOTREF(__pyx_t_5);
31833 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31835 /* "src/lxml/objectpath.pxi":270
31836 * child = cetree.makeSubElement(
31837 * cetree.elementFactory(root._doc, c_node),
31838 * cetree.namespacedNameFromNsName(c_href, c_name), # <<<<<<<<<<<<<<
31839 * None, None, None, None)
31840 * c_node = child._c_node
31842 __pyx_t_9 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 270, __pyx_L1_error)
31843 __Pyx_GOTREF(__pyx_t_9);
31845 /* "src/lxml/objectpath.pxi":268
31848 * child = cetree.makeSubElement( # <<<<<<<<<<<<<<
31849 * cetree.elementFactory(root._doc, c_node),
31850 * cetree.namespacedNameFromNsName(c_href, c_name),
31852 __pyx_t_8 = ((PyObject *)makeSubElement(((struct LxmlElement *)__pyx_t_5), __pyx_t_9, Py_None, Py_None, Py_None, Py_None)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 268, __pyx_L1_error)
31853 __Pyx_GOTREF(__pyx_t_8);
31854 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31855 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31856 __Pyx_XDECREF_SET(__pyx_v_child, ((struct LxmlElement *)__pyx_t_8));
31859 /* "src/lxml/objectpath.pxi":272
31860 * cetree.namespacedNameFromNsName(c_href, c_name),
31861 * None, None, None, None)
31862 * c_node = child._c_node # <<<<<<<<<<<<<<
31864 * # if we get here, the entire path was already there
31866 __pyx_t_2 = __pyx_v_child->_c_node;
31867 __pyx_v_c_node = __pyx_t_2;
31872 /* "src/lxml/objectpath.pxi":275
31874 * # if we get here, the entire path was already there
31875 * if replace: # <<<<<<<<<<<<<<
31876 * element = cetree.elementFactory(root._doc, c_node)
31877 * _replaceElement(element, value)
31879 __pyx_t_1 = (__pyx_v_replace != 0);
31882 /* "src/lxml/objectpath.pxi":276
31883 * # if we get here, the entire path was already there
31885 * element = cetree.elementFactory(root._doc, c_node) # <<<<<<<<<<<<<<
31886 * _replaceElement(element, value)
31889 __pyx_t_8 = ((PyObject *)__pyx_v_root->_doc);
31890 __Pyx_INCREF(__pyx_t_8);
31891 __pyx_t_9 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_8), __pyx_v_c_node)); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 276, __pyx_L1_error)
31892 __Pyx_GOTREF(__pyx_t_9);
31893 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31894 __pyx_v_element = ((struct LxmlElement *)__pyx_t_9);
31897 /* "src/lxml/objectpath.pxi":277
31899 * element = cetree.elementFactory(root._doc, c_node)
31900 * _replaceElement(element, value) # <<<<<<<<<<<<<<
31902 * _appendValue(cetree.elementFactory(root._doc, c_node.parent),
31904 __pyx_t_9 = __pyx_f_4lxml_9objectify__replaceElement(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 277, __pyx_L1_error)
31905 __Pyx_GOTREF(__pyx_t_9);
31906 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31908 /* "src/lxml/objectpath.pxi":275
31910 * # if we get here, the entire path was already there
31911 * if replace: # <<<<<<<<<<<<<<
31912 * element = cetree.elementFactory(root._doc, c_node)
31913 * _replaceElement(element, value)
31918 /* "src/lxml/objectpath.pxi":279
31919 * _replaceElement(element, value)
31921 * _appendValue(cetree.elementFactory(root._doc, c_node.parent), # <<<<<<<<<<<<<<
31922 * cetree.namespacedName(c_node), value)
31926 __pyx_t_9 = ((PyObject *)__pyx_v_root->_doc);
31927 __Pyx_INCREF(__pyx_t_9);
31928 __pyx_t_8 = ((PyObject *)elementFactory(((struct LxmlDocument *)__pyx_t_9), __pyx_v_c_node->parent)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 279, __pyx_L1_error)
31929 __Pyx_GOTREF(__pyx_t_8);
31930 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31932 /* "src/lxml/objectpath.pxi":280
31934 * _appendValue(cetree.elementFactory(root._doc, c_node.parent),
31935 * cetree.namespacedName(c_node), value) # <<<<<<<<<<<<<<
31939 __pyx_t_9 = namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 280, __pyx_L1_error)
31940 __Pyx_GOTREF(__pyx_t_9);
31942 /* "src/lxml/objectpath.pxi":279
31943 * _replaceElement(element, value)
31945 * _appendValue(cetree.elementFactory(root._doc, c_node.parent), # <<<<<<<<<<<<<<
31946 * cetree.namespacedName(c_node), value)
31949 __pyx_t_5 = __pyx_f_4lxml_9objectify__appendValue(((struct LxmlElement *)__pyx_t_8), __pyx_t_9, __pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 279, __pyx_L1_error)
31950 __Pyx_GOTREF(__pyx_t_5);
31951 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31952 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31953 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31957 /* "src/lxml/objectpath.pxi":222
31960 * cdef _create_object_path(_Element root, _ObjectPath* c_path, # <<<<<<<<<<<<<<
31961 * Py_ssize_t c_path_len, int replace, value):
31962 * u"""Follow the path to find the target element, build the missing children
31965 /* function exit code */
31966 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31969 __Pyx_XDECREF(__pyx_t_5);
31970 __Pyx_XDECREF(__pyx_t_8);
31971 __Pyx_XDECREF(__pyx_t_9);
31972 __Pyx_AddTraceback("lxml.objectify._create_object_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
31975 __Pyx_XDECREF((PyObject *)__pyx_v_child);
31976 __Pyx_XDECREF((PyObject *)__pyx_v_element);
31977 __Pyx_XGIVEREF(__pyx_r);
31978 __Pyx_RefNannyFinishContext();
31982 /* "src/lxml/objectpath.pxi":283
31985 * cdef list _build_descendant_paths(tree.xmlNode* c_node, prefix_string): # <<<<<<<<<<<<<<
31986 * u"""Returns a list of all descendant paths.
31990 static PyObject *__pyx_f_4lxml_9objectify__build_descendant_paths(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_prefix_string) {
31991 PyObject *__pyx_v_path = 0;
31992 PyObject *__pyx_v_path_list = 0;
31993 PyObject *__pyx_v_tag = NULL;
31994 PyObject *__pyx_r = NULL;
31995 __Pyx_RefNannyDeclarations
31996 PyObject *__pyx_t_1 = NULL;
31999 int __pyx_lineno = 0;
32000 const char *__pyx_filename = NULL;
32001 int __pyx_clineno = 0;
32002 __Pyx_RefNannySetupContext("_build_descendant_paths", 0);
32003 __Pyx_INCREF(__pyx_v_prefix_string);
32005 /* "src/lxml/objectpath.pxi":287
32007 * cdef list path, path_list
32008 * tag = cetree.namespacedName(c_node) # <<<<<<<<<<<<<<
32009 * if prefix_string:
32010 * if prefix_string[-1] != u'.':
32012 __pyx_t_1 = namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
32013 __Pyx_GOTREF(__pyx_t_1);
32014 __pyx_v_tag = __pyx_t_1;
32017 /* "src/lxml/objectpath.pxi":288
32018 * cdef list path, path_list
32019 * tag = cetree.namespacedName(c_node)
32020 * if prefix_string: # <<<<<<<<<<<<<<
32021 * if prefix_string[-1] != u'.':
32022 * prefix_string += u'.'
32024 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix_string); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 288, __pyx_L1_error)
32027 /* "src/lxml/objectpath.pxi":289
32028 * tag = cetree.namespacedName(c_node)
32029 * if prefix_string:
32030 * if prefix_string[-1] != u'.': # <<<<<<<<<<<<<<
32031 * prefix_string += u'.'
32032 * prefix_string = prefix_string + tag
32034 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_prefix_string, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error)
32035 __Pyx_GOTREF(__pyx_t_1);
32036 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__2, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 289, __pyx_L1_error)
32037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32040 /* "src/lxml/objectpath.pxi":290
32041 * if prefix_string:
32042 * if prefix_string[-1] != u'.':
32043 * prefix_string += u'.' # <<<<<<<<<<<<<<
32044 * prefix_string = prefix_string + tag
32047 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_prefix_string, __pyx_kp_u__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
32048 __Pyx_GOTREF(__pyx_t_1);
32049 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_t_1);
32052 /* "src/lxml/objectpath.pxi":289
32053 * tag = cetree.namespacedName(c_node)
32054 * if prefix_string:
32055 * if prefix_string[-1] != u'.': # <<<<<<<<<<<<<<
32056 * prefix_string += u'.'
32057 * prefix_string = prefix_string + tag
32061 /* "src/lxml/objectpath.pxi":291
32062 * if prefix_string[-1] != u'.':
32063 * prefix_string += u'.'
32064 * prefix_string = prefix_string + tag # <<<<<<<<<<<<<<
32066 * prefix_string = tag
32068 __pyx_t_1 = PyNumber_Add(__pyx_v_prefix_string, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
32069 __Pyx_GOTREF(__pyx_t_1);
32070 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_t_1);
32073 /* "src/lxml/objectpath.pxi":288
32074 * cdef list path, path_list
32075 * tag = cetree.namespacedName(c_node)
32076 * if prefix_string: # <<<<<<<<<<<<<<
32077 * if prefix_string[-1] != u'.':
32078 * prefix_string += u'.'
32083 /* "src/lxml/objectpath.pxi":293
32084 * prefix_string = prefix_string + tag
32086 * prefix_string = tag # <<<<<<<<<<<<<<
32087 * path = [prefix_string]
32091 __Pyx_INCREF(__pyx_v_tag);
32092 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_v_tag);
32096 /* "src/lxml/objectpath.pxi":294
32098 * prefix_string = tag
32099 * path = [prefix_string] # <<<<<<<<<<<<<<
32101 * _recursive_build_descendant_paths(c_node, path, path_list)
32103 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 294, __pyx_L1_error)
32104 __Pyx_GOTREF(__pyx_t_1);
32105 __Pyx_INCREF(__pyx_v_prefix_string);
32106 __Pyx_GIVEREF(__pyx_v_prefix_string);
32107 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix_string);
32108 __pyx_v_path = ((PyObject*)__pyx_t_1);
32111 /* "src/lxml/objectpath.pxi":295
32112 * prefix_string = tag
32113 * path = [prefix_string]
32114 * path_list = [] # <<<<<<<<<<<<<<
32115 * _recursive_build_descendant_paths(c_node, path, path_list)
32118 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 295, __pyx_L1_error)
32119 __Pyx_GOTREF(__pyx_t_1);
32120 __pyx_v_path_list = ((PyObject*)__pyx_t_1);
32123 /* "src/lxml/objectpath.pxi":296
32124 * path = [prefix_string]
32126 * _recursive_build_descendant_paths(c_node, path, path_list) # <<<<<<<<<<<<<<
32130 __pyx_t_3 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_node, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 296, __pyx_L1_error)
32132 /* "src/lxml/objectpath.pxi":297
32134 * _recursive_build_descendant_paths(c_node, path, path_list)
32135 * return path_list # <<<<<<<<<<<<<<
32139 __Pyx_XDECREF(__pyx_r);
32140 __Pyx_INCREF(__pyx_v_path_list);
32141 __pyx_r = __pyx_v_path_list;
32144 /* "src/lxml/objectpath.pxi":283
32147 * cdef list _build_descendant_paths(tree.xmlNode* c_node, prefix_string): # <<<<<<<<<<<<<<
32148 * u"""Returns a list of all descendant paths.
32152 /* function exit code */
32154 __Pyx_XDECREF(__pyx_t_1);
32155 __Pyx_AddTraceback("lxml.objectify._build_descendant_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
32158 __Pyx_XDECREF(__pyx_v_path);
32159 __Pyx_XDECREF(__pyx_v_path_list);
32160 __Pyx_XDECREF(__pyx_v_tag);
32161 __Pyx_XDECREF(__pyx_v_prefix_string);
32162 __Pyx_XGIVEREF(__pyx_r);
32163 __Pyx_RefNannyFinishContext();
32167 /* "src/lxml/objectpath.pxi":300
32170 * cdef int _recursive_build_descendant_paths(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
32171 * list path, list path_list) except -1:
32172 * u"""Fills the list 'path_list' with all descendant paths, initial prefix
32175 static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_path, PyObject *__pyx_v_path_list) {
32176 xmlNode *__pyx_v_c_child;
32177 PyObject *__pyx_v_tags = NULL;
32178 const xmlChar *__pyx_v_c_href;
32179 PyObject *__pyx_v_tag = NULL;
32180 PyObject *__pyx_v_count = NULL;
32182 __Pyx_RefNannyDeclarations
32183 PyObject *__pyx_t_1 = NULL;
32185 xmlNode *__pyx_t_3;
32188 PyObject *__pyx_t_6 = NULL;
32189 Py_ssize_t __pyx_t_7;
32192 int __pyx_lineno = 0;
32193 const char *__pyx_filename = NULL;
32194 int __pyx_clineno = 0;
32195 __Pyx_RefNannySetupContext("_recursive_build_descendant_paths", 0);
32197 /* "src/lxml/objectpath.pxi":306
32199 * cdef tree.xmlNode* c_child
32200 * tags = {} # <<<<<<<<<<<<<<
32201 * path_list.append(u'.'.join(path))
32202 * c_href = tree._getNs(c_node)
32204 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 306, __pyx_L1_error)
32205 __Pyx_GOTREF(__pyx_t_1);
32206 __pyx_v_tags = ((PyObject*)__pyx_t_1);
32209 /* "src/lxml/objectpath.pxi":307
32210 * cdef tree.xmlNode* c_child
32212 * path_list.append(u'.'.join(path)) # <<<<<<<<<<<<<<
32213 * c_href = tree._getNs(c_node)
32214 * c_child = c_node.children
32216 if (unlikely(__pyx_v_path_list == Py_None)) {
32217 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
32218 __PYX_ERR(1, 307, __pyx_L1_error)
32220 __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error)
32221 __Pyx_GOTREF(__pyx_t_1);
32222 __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path_list, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 307, __pyx_L1_error)
32223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32225 /* "src/lxml/objectpath.pxi":308
32227 * path_list.append(u'.'.join(path))
32228 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
32229 * c_child = c_node.children
32230 * while c_child is not NULL:
32232 __pyx_v_c_href = _getNs(__pyx_v_c_node);
32234 /* "src/lxml/objectpath.pxi":309
32235 * path_list.append(u'.'.join(path))
32236 * c_href = tree._getNs(c_node)
32237 * c_child = c_node.children # <<<<<<<<<<<<<<
32238 * while c_child is not NULL:
32239 * while c_child.type != tree.XML_ELEMENT_NODE:
32241 __pyx_t_3 = __pyx_v_c_node->children;
32242 __pyx_v_c_child = __pyx_t_3;
32244 /* "src/lxml/objectpath.pxi":310
32245 * c_href = tree._getNs(c_node)
32246 * c_child = c_node.children
32247 * while c_child is not NULL: # <<<<<<<<<<<<<<
32248 * while c_child.type != tree.XML_ELEMENT_NODE:
32249 * c_child = c_child.next
32252 __pyx_t_4 = ((__pyx_v_c_child != NULL) != 0);
32253 if (!__pyx_t_4) break;
32255 /* "src/lxml/objectpath.pxi":311
32256 * c_child = c_node.children
32257 * while c_child is not NULL:
32258 * while c_child.type != tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
32259 * c_child = c_child.next
32260 * if c_child is NULL:
32263 __pyx_t_4 = ((__pyx_v_c_child->type != XML_ELEMENT_NODE) != 0);
32264 if (!__pyx_t_4) break;
32266 /* "src/lxml/objectpath.pxi":312
32267 * while c_child is not NULL:
32268 * while c_child.type != tree.XML_ELEMENT_NODE:
32269 * c_child = c_child.next # <<<<<<<<<<<<<<
32270 * if c_child is NULL:
32273 __pyx_t_3 = __pyx_v_c_child->next;
32274 __pyx_v_c_child = __pyx_t_3;
32276 /* "src/lxml/objectpath.pxi":313
32277 * while c_child.type != tree.XML_ELEMENT_NODE:
32278 * c_child = c_child.next
32279 * if c_child is NULL: # <<<<<<<<<<<<<<
32281 * if c_href is tree._getNs(c_child):
32283 __pyx_t_4 = ((__pyx_v_c_child == NULL) != 0);
32286 /* "src/lxml/objectpath.pxi":314
32287 * c_child = c_child.next
32288 * if c_child is NULL:
32289 * return 0 # <<<<<<<<<<<<<<
32290 * if c_href is tree._getNs(c_child):
32291 * tag = pyunicode(c_child.name)
32296 /* "src/lxml/objectpath.pxi":313
32297 * while c_child.type != tree.XML_ELEMENT_NODE:
32298 * c_child = c_child.next
32299 * if c_child is NULL: # <<<<<<<<<<<<<<
32301 * if c_href is tree._getNs(c_child):
32306 /* "src/lxml/objectpath.pxi":315
32307 * if c_child is NULL:
32309 * if c_href is tree._getNs(c_child): # <<<<<<<<<<<<<<
32310 * tag = pyunicode(c_child.name)
32311 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32313 __pyx_t_4 = ((__pyx_v_c_href == _getNs(__pyx_v_c_child)) != 0);
32316 /* "src/lxml/objectpath.pxi":316
32318 * if c_href is tree._getNs(c_child):
32319 * tag = pyunicode(c_child.name) # <<<<<<<<<<<<<<
32320 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32321 * # special case: parent has namespace, child does not
32323 __pyx_t_1 = pyunicode(__pyx_v_c_child->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
32324 __Pyx_GOTREF(__pyx_t_1);
32325 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_1);
32328 /* "src/lxml/objectpath.pxi":315
32329 * if c_child is NULL:
32331 * if c_href is tree._getNs(c_child): # <<<<<<<<<<<<<<
32332 * tag = pyunicode(c_child.name)
32333 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32338 /* "src/lxml/objectpath.pxi":317
32339 * if c_href is tree._getNs(c_child):
32340 * tag = pyunicode(c_child.name)
32341 * elif c_href is not NULL and tree._getNs(c_child) is NULL: # <<<<<<<<<<<<<<
32342 * # special case: parent has namespace, child does not
32343 * tag = u'{}' + pyunicode(c_child.name)
32345 __pyx_t_5 = ((__pyx_v_c_href != NULL) != 0);
32348 __pyx_t_4 = __pyx_t_5;
32349 goto __pyx_L9_bool_binop_done;
32351 __pyx_t_5 = ((_getNs(__pyx_v_c_child) == NULL) != 0);
32352 __pyx_t_4 = __pyx_t_5;
32353 __pyx_L9_bool_binop_done:;
32356 /* "src/lxml/objectpath.pxi":319
32357 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32358 * # special case: parent has namespace, child does not
32359 * tag = u'{}' + pyunicode(c_child.name) # <<<<<<<<<<<<<<
32361 * tag = cetree.namespacedName(c_child)
32363 __pyx_t_1 = pyunicode(__pyx_v_c_child->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 319, __pyx_L1_error)
32364 __Pyx_GOTREF(__pyx_t_1);
32365 __pyx_t_6 = PyNumber_Add(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __pyx_L1_error)
32366 __Pyx_GOTREF(__pyx_t_6);
32367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32368 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_6);
32371 /* "src/lxml/objectpath.pxi":317
32372 * if c_href is tree._getNs(c_child):
32373 * tag = pyunicode(c_child.name)
32374 * elif c_href is not NULL and tree._getNs(c_child) is NULL: # <<<<<<<<<<<<<<
32375 * # special case: parent has namespace, child does not
32376 * tag = u'{}' + pyunicode(c_child.name)
32381 /* "src/lxml/objectpath.pxi":321
32382 * tag = u'{}' + pyunicode(c_child.name)
32384 * tag = cetree.namespacedName(c_child) # <<<<<<<<<<<<<<
32385 * count = tags.get(tag)
32386 * if count is None:
32389 __pyx_t_6 = namespacedName(__pyx_v_c_child); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 321, __pyx_L1_error)
32390 __Pyx_GOTREF(__pyx_t_6);
32391 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_6);
32396 /* "src/lxml/objectpath.pxi":322
32398 * tag = cetree.namespacedName(c_child)
32399 * count = tags.get(tag) # <<<<<<<<<<<<<<
32400 * if count is None:
32403 __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_tags, __pyx_v_tag, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 322, __pyx_L1_error)
32404 __Pyx_GOTREF(__pyx_t_6);
32405 __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_6);
32408 /* "src/lxml/objectpath.pxi":323
32409 * tag = cetree.namespacedName(c_child)
32410 * count = tags.get(tag)
32411 * if count is None: # <<<<<<<<<<<<<<
32415 __pyx_t_4 = (__pyx_v_count == Py_None);
32416 __pyx_t_5 = (__pyx_t_4 != 0);
32419 /* "src/lxml/objectpath.pxi":324
32420 * count = tags.get(tag)
32421 * if count is None:
32422 * tags[tag] = 1 # <<<<<<<<<<<<<<
32424 * tags[tag] = count + 1
32426 if (unlikely(PyDict_SetItem(__pyx_v_tags, __pyx_v_tag, __pyx_int_1) < 0)) __PYX_ERR(1, 324, __pyx_L1_error)
32428 /* "src/lxml/objectpath.pxi":323
32429 * tag = cetree.namespacedName(c_child)
32430 * count = tags.get(tag)
32431 * if count is None: # <<<<<<<<<<<<<<
32438 /* "src/lxml/objectpath.pxi":326
32441 * tags[tag] = count + 1 # <<<<<<<<<<<<<<
32442 * tag += f'[{count}]'
32446 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 326, __pyx_L1_error)
32447 __Pyx_GOTREF(__pyx_t_6);
32448 if (unlikely(PyDict_SetItem(__pyx_v_tags, __pyx_v_tag, __pyx_t_6) < 0)) __PYX_ERR(1, 326, __pyx_L1_error)
32449 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32451 /* "src/lxml/objectpath.pxi":327
32453 * tags[tag] = count + 1
32454 * tag += f'[{count}]' # <<<<<<<<<<<<<<
32456 * _recursive_build_descendant_paths(c_child, path, path_list)
32458 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 327, __pyx_L1_error)
32459 __Pyx_GOTREF(__pyx_t_6);
32462 __Pyx_INCREF(__pyx_kp_u__20);
32464 __Pyx_GIVEREF(__pyx_kp_u__20);
32465 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__20);
32466 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_count, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
32467 __Pyx_GOTREF(__pyx_t_1);
32468 __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_8;
32469 __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
32470 __Pyx_GIVEREF(__pyx_t_1);
32471 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
32473 __Pyx_INCREF(__pyx_kp_u__21);
32475 __Pyx_GIVEREF(__pyx_kp_u__21);
32476 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__21);
32477 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
32478 __Pyx_GOTREF(__pyx_t_1);
32479 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32480 __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_tag, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 327, __pyx_L1_error)
32481 __Pyx_GOTREF(__pyx_t_6);
32482 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32483 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_6);
32488 /* "src/lxml/objectpath.pxi":328
32489 * tags[tag] = count + 1
32490 * tag += f'[{count}]'
32491 * path.append(tag) # <<<<<<<<<<<<<<
32492 * _recursive_build_descendant_paths(c_child, path, path_list)
32495 if (unlikely(__pyx_v_path == Py_None)) {
32496 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
32497 __PYX_ERR(1, 328, __pyx_L1_error)
32499 __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_path, __pyx_v_tag); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 328, __pyx_L1_error)
32501 /* "src/lxml/objectpath.pxi":329
32502 * tag += f'[{count}]'
32504 * _recursive_build_descendant_paths(c_child, path, path_list) # <<<<<<<<<<<<<<
32506 * c_child = c_child.next
32508 __pyx_t_9 = __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(__pyx_v_c_child, __pyx_v_path, __pyx_v_path_list); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 329, __pyx_L1_error)
32510 /* "src/lxml/objectpath.pxi":330
32512 * _recursive_build_descendant_paths(c_child, path, path_list)
32513 * del path[-1] # <<<<<<<<<<<<<<
32514 * c_child = c_child.next
32517 if (unlikely(__pyx_v_path == Py_None)) {
32518 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
32519 __PYX_ERR(1, 330, __pyx_L1_error)
32521 if (unlikely(__Pyx_DelItemInt(__pyx_v_path, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(1, 330, __pyx_L1_error)
32523 /* "src/lxml/objectpath.pxi":331
32524 * _recursive_build_descendant_paths(c_child, path, path_list)
32526 * c_child = c_child.next # <<<<<<<<<<<<<<
32529 __pyx_t_3 = __pyx_v_c_child->next;
32530 __pyx_v_c_child = __pyx_t_3;
32533 /* "src/lxml/objectpath.pxi":332
32535 * c_child = c_child.next
32536 * return 0 # <<<<<<<<<<<<<<
32541 /* "src/lxml/objectpath.pxi":300
32544 * cdef int _recursive_build_descendant_paths(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
32545 * list path, list path_list) except -1:
32546 * u"""Fills the list 'path_list' with all descendant paths, initial prefix
32549 /* function exit code */
32551 __Pyx_XDECREF(__pyx_t_1);
32552 __Pyx_XDECREF(__pyx_t_6);
32553 __Pyx_AddTraceback("lxml.objectify._recursive_build_descendant_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
32556 __Pyx_XDECREF(__pyx_v_tags);
32557 __Pyx_XDECREF(__pyx_v_tag);
32558 __Pyx_XDECREF(__pyx_v_count);
32559 __Pyx_RefNannyFinishContext();
32563 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32564 PyObject *o = __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_new(t, a, k);
32565 if (unlikely(!o)) return 0;
32569 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement(PyObject *o) {
32570 #if CYTHON_USE_TP_FINALIZE
32571 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32572 if (PyObject_CallFinalizerFromDealloc(o)) return;
32575 PyObject_GC_UnTrack(o);
32576 PyObject_GC_Track(o);
32577 if (likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase)) __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement);
32580 static int __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement(PyObject *o, visitproc v, void *a) {
32582 e = ((likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase)) ? ((__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_traverse) ? __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement)); if (e) return e;
32586 static int __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement(PyObject *o) {
32587 if (likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase)) { if (__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_clear) __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement);
32590 static PyObject *__pyx_sq_item_4lxml_9objectify_ObjectifiedElement(PyObject *o, Py_ssize_t i) {
32592 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
32593 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
32598 static int __pyx_mp_ass_subscript_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *i, PyObject *v) {
32600 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(o, i, v);
32603 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(o, i);
32607 static PyObject *__pyx_tp_getattro_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *n) {
32608 PyObject *v = PyObject_GenericGetAttr(o, n);
32609 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
32611 v = __pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(o, n);
32616 static int __pyx_tp_setattro_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *n, PyObject *v) {
32618 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(o, n, v);
32621 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(o, n);
32625 static PyObject *__pyx_getprop_4lxml_9objectify_18ObjectifiedElement_text(PyObject *o, CYTHON_UNUSED void *x) {
32626 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(o);
32629 static PyObject *__pyx_getprop_4lxml_9objectify_18ObjectifiedElement___dict__(PyObject *o, CYTHON_UNUSED void *x) {
32630 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(o);
32633 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifiedElement[] = {
32634 {"__reduce__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__, METH_NOARGS, 0},
32635 {"countchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_8countchildren},
32636 {"getchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_10getchildren},
32637 {"__getattr__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__, METH_O|METH_COEXIST, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_12__getattr__},
32638 {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_18addattr},
32639 {"descendantpaths", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_26descendantpaths},
32643 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectifiedElement[] = {
32644 {(char *)"text", __pyx_getprop_4lxml_9objectify_18ObjectifiedElement_text, 0, (char *)0, 0},
32645 {(char *)"__dict__", __pyx_getprop_4lxml_9objectify_18ObjectifiedElement___dict__, 0, (char *)"A fake implementation for __dict__ to support dir() etc.\n\n Note that this only considers the first child with a given name.\n ", 0},
32649 static PySequenceMethods __pyx_tp_as_sequence_ObjectifiedElement = {
32650 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__, /*sq_length*/
32653 __pyx_sq_item_4lxml_9objectify_ObjectifiedElement, /*sq_item*/
32656 0, /*sq_ass_slice*/
32658 0, /*sq_inplace_concat*/
32659 0, /*sq_inplace_repeat*/
32662 static PyMappingMethods __pyx_tp_as_mapping_ObjectifiedElement = {
32663 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__, /*mp_length*/
32664 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__, /*mp_subscript*/
32665 __pyx_mp_ass_subscript_4lxml_9objectify_ObjectifiedElement, /*mp_ass_subscript*/
32668 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifiedElement = {
32669 PyVarObject_HEAD_INIT(0, 0)
32670 "lxml.objectify.ObjectifiedElement", /*tp_name*/
32671 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement), /*tp_basicsize*/
32673 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
32674 #if PY_VERSION_HEX < 0x030800b4
32677 #if PY_VERSION_HEX >= 0x030800b4
32678 0, /*tp_vectorcall_offset*/
32682 #if PY_MAJOR_VERSION < 3
32685 #if PY_MAJOR_VERSION >= 3
32689 0, /*tp_as_number*/
32690 &__pyx_tp_as_sequence_ObjectifiedElement, /*tp_as_sequence*/
32691 &__pyx_tp_as_mapping_ObjectifiedElement, /*tp_as_mapping*/
32694 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__, /*tp_str*/
32695 __pyx_tp_getattro_4lxml_9objectify_ObjectifiedElement, /*tp_getattro*/
32696 __pyx_tp_setattro_4lxml_9objectify_ObjectifiedElement, /*tp_setattro*/
32697 0, /*tp_as_buffer*/
32698 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32699 "Main XML Element class.\n\n Element children are accessed as object attributes. Multiple children\n with the same name are available through a list index. Example::\n\n >>> root = XML(\"<root><c1><c2>0</c2><c2>1</c2></c1></root>\")\n >>> second_c2 = root.c1.c2[1]\n >>> print(second_c2.text)\n 1\n\n Note that you cannot (and must not) instantiate this class or its\n subclasses.\n ", /*tp_doc*/
32700 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
32701 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
32702 0, /*tp_richcompare*/
32703 0, /*tp_weaklistoffset*/
32704 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32706 __pyx_methods_4lxml_9objectify_ObjectifiedElement, /*tp_methods*/
32708 __pyx_getsets_4lxml_9objectify_ObjectifiedElement, /*tp_getset*/
32711 0, /*tp_descr_get*/
32712 0, /*tp_descr_set*/
32713 0, /*tp_dictoffset*/
32716 __pyx_tp_new_4lxml_9objectify_ObjectifiedElement, /*tp_new*/
32722 0, /*tp_subclasses*/
32725 0, /*tp_version_tag*/
32726 #if PY_VERSION_HEX >= 0x030400a1
32729 #if PY_VERSION_HEX >= 0x030800b1
32730 0, /*tp_vectorcall*/
32732 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32737 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32738 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedElement(t, a, k);
32739 if (unlikely(!o)) return 0;
32743 static PyObject *__pyx_getprop_4lxml_9objectify_22ObjectifiedDataElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
32744 return __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(o);
32747 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifiedDataElement[] = {
32748 {"_setText", (PyCFunction)__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText, METH_O, __pyx_doc_4lxml_9objectify_22ObjectifiedDataElement_4_setText},
32752 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectifiedDataElement[] = {
32753 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_22ObjectifiedDataElement_pyval, 0, (char *)0, 0},
32757 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifiedDataElement = {
32758 PyVarObject_HEAD_INIT(0, 0)
32759 "lxml.objectify.ObjectifiedDataElement", /*tp_name*/
32760 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement), /*tp_basicsize*/
32762 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
32763 #if PY_VERSION_HEX < 0x030800b4
32766 #if PY_VERSION_HEX >= 0x030800b4
32767 0, /*tp_vectorcall_offset*/
32771 #if PY_MAJOR_VERSION < 3
32774 #if PY_MAJOR_VERSION >= 3
32777 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__, /*tp_repr*/
32778 0, /*tp_as_number*/
32779 0, /*tp_as_sequence*/
32780 0, /*tp_as_mapping*/
32783 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__, /*tp_str*/
32786 0, /*tp_as_buffer*/
32787 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32788 "This is the base class for all data type Elements. Subclasses should\n override the 'pyval' property and possibly the __str__ method.\n ", /*tp_doc*/
32789 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
32790 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
32791 0, /*tp_richcompare*/
32792 0, /*tp_weaklistoffset*/
32793 #if CYTHON_COMPILING_IN_PYPY
32794 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32799 __pyx_methods_4lxml_9objectify_ObjectifiedDataElement, /*tp_methods*/
32801 __pyx_getsets_4lxml_9objectify_ObjectifiedDataElement, /*tp_getset*/
32804 0, /*tp_descr_get*/
32805 0, /*tp_descr_set*/
32806 0, /*tp_dictoffset*/
32809 __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement, /*tp_new*/
32815 0, /*tp_subclasses*/
32818 0, /*tp_version_tag*/
32819 #if PY_VERSION_HEX >= 0x030400a1
32822 #if PY_VERSION_HEX >= 0x030800b1
32823 0, /*tp_vectorcall*/
32825 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32830 static PyObject *__pyx_tp_new_4lxml_9objectify_NumberElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32831 struct __pyx_obj_4lxml_9objectify_NumberElement *p;
32832 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
32833 if (unlikely(!o)) return 0;
32834 p = ((struct __pyx_obj_4lxml_9objectify_NumberElement *)o);
32835 p->_parse_value = Py_None; Py_INCREF(Py_None);
32839 static void __pyx_tp_dealloc_4lxml_9objectify_NumberElement(PyObject *o) {
32840 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32841 #if CYTHON_USE_TP_FINALIZE
32842 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32843 if (PyObject_CallFinalizerFromDealloc(o)) return;
32846 PyObject_GC_UnTrack(o);
32847 Py_CLEAR(p->_parse_value);
32848 PyObject_GC_Track(o);
32849 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement(o);
32852 static int __pyx_tp_traverse_4lxml_9objectify_NumberElement(PyObject *o, visitproc v, void *a) {
32854 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32855 e = __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement(o, v, a); if (e) return e;
32856 if (p->_parse_value) {
32857 e = (*v)(p->_parse_value, a); if (e) return e;
32862 static int __pyx_tp_clear_4lxml_9objectify_NumberElement(PyObject *o) {
32863 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32864 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement(o);
32865 Py_CLEAR(p->_parse_value);
32869 static PyObject *__pyx_getprop_4lxml_9objectify_13NumberElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
32870 return __pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(o);
32873 static PyMethodDef __pyx_methods_4lxml_9objectify_NumberElement[] = {
32874 {"_setValueParser", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser, METH_O, __pyx_doc_4lxml_9objectify_13NumberElement__setValueParser},
32875 {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__, METH_NOARGS, 0},
32879 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_NumberElement[] = {
32880 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_13NumberElement_pyval, 0, (char *)0, 0},
32884 static PyNumberMethods __pyx_tp_as_number_NumberElement = {
32885 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
32886 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
32887 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
32888 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32889 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
32891 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
32893 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
32894 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
32895 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
32896 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
32897 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
32898 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
32899 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
32900 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
32901 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
32902 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
32903 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
32904 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32907 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
32908 #if PY_MAJOR_VERSION < 3
32909 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
32913 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
32914 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32915 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
32917 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32918 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
32920 0, /*nb_inplace_add*/
32921 0, /*nb_inplace_subtract*/
32922 0, /*nb_inplace_multiply*/
32923 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32924 0, /*nb_inplace_divide*/
32926 0, /*nb_inplace_remainder*/
32927 0, /*nb_inplace_power*/
32928 0, /*nb_inplace_lshift*/
32929 0, /*nb_inplace_rshift*/
32930 0, /*nb_inplace_and*/
32931 0, /*nb_inplace_xor*/
32932 0, /*nb_inplace_or*/
32933 0, /*nb_floor_divide*/
32934 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
32935 0, /*nb_inplace_floor_divide*/
32936 0, /*nb_inplace_true_divide*/
32938 #if PY_VERSION_HEX >= 0x03050000
32939 0, /*nb_matrix_multiply*/
32941 #if PY_VERSION_HEX >= 0x03050000
32942 0, /*nb_inplace_matrix_multiply*/
32946 static PyTypeObject __pyx_type_4lxml_9objectify_NumberElement = {
32947 PyVarObject_HEAD_INIT(0, 0)
32948 "lxml.objectify.NumberElement", /*tp_name*/
32949 sizeof(struct __pyx_obj_4lxml_9objectify_NumberElement), /*tp_basicsize*/
32951 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
32952 #if PY_VERSION_HEX < 0x030800b4
32955 #if PY_VERSION_HEX >= 0x030800b4
32956 0, /*tp_vectorcall_offset*/
32960 #if PY_MAJOR_VERSION < 3
32963 #if PY_MAJOR_VERSION >= 3
32966 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
32967 &__pyx_tp_as_number_NumberElement, /*tp_as_number*/
32968 0, /*tp_as_sequence*/
32969 0, /*tp_as_mapping*/
32970 __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__, /*tp_hash*/
32972 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
32975 0, /*tp_as_buffer*/
32976 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32978 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
32979 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
32980 __pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__, /*tp_richcompare*/
32981 0, /*tp_weaklistoffset*/
32982 #if CYTHON_COMPILING_IN_PYPY
32983 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32988 __pyx_methods_4lxml_9objectify_NumberElement, /*tp_methods*/
32990 __pyx_getsets_4lxml_9objectify_NumberElement, /*tp_getset*/
32993 0, /*tp_descr_get*/
32994 0, /*tp_descr_set*/
32995 0, /*tp_dictoffset*/
32998 __pyx_tp_new_4lxml_9objectify_NumberElement, /*tp_new*/
33004 0, /*tp_subclasses*/
33007 0, /*tp_version_tag*/
33008 #if PY_VERSION_HEX >= 0x030400a1
33011 #if PY_VERSION_HEX >= 0x030800b1
33012 0, /*tp_vectorcall*/
33014 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33019 static PyObject *__pyx_tp_new_4lxml_9objectify_IntElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33020 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33021 if (unlikely(!o)) return 0;
33025 static PyMethodDef __pyx_methods_4lxml_9objectify_IntElement[] = {
33026 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_10IntElement_1_init, METH_NOARGS, 0},
33030 static PyNumberMethods __pyx_tp_as_number_IntElement = {
33031 #if CYTHON_COMPILING_IN_PYPY
33032 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33036 #if CYTHON_COMPILING_IN_PYPY
33037 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33041 #if CYTHON_COMPILING_IN_PYPY
33042 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33046 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33047 #if CYTHON_COMPILING_IN_PYPY
33048 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33053 #if CYTHON_COMPILING_IN_PYPY
33054 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33056 0, /*nb_remainder*/
33059 #if CYTHON_COMPILING_IN_PYPY
33060 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33064 #if CYTHON_COMPILING_IN_PYPY
33065 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33069 #if CYTHON_COMPILING_IN_PYPY
33070 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33074 #if CYTHON_COMPILING_IN_PYPY
33075 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33079 #if CYTHON_COMPILING_IN_PYPY
33080 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
33084 #if CYTHON_COMPILING_IN_PYPY
33085 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33089 #if CYTHON_COMPILING_IN_PYPY
33090 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
33094 #if CYTHON_COMPILING_IN_PYPY
33095 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
33099 #if CYTHON_COMPILING_IN_PYPY
33100 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
33104 #if CYTHON_COMPILING_IN_PYPY
33105 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
33109 #if CYTHON_COMPILING_IN_PYPY
33110 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
33114 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33117 #if CYTHON_COMPILING_IN_PYPY
33118 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
33122 #if PY_MAJOR_VERSION < 3
33123 #if CYTHON_COMPILING_IN_PYPY
33124 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
33131 #if CYTHON_COMPILING_IN_PYPY
33132 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
33136 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33137 #if CYTHON_COMPILING_IN_PYPY
33138 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
33143 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33144 #if CYTHON_COMPILING_IN_PYPY
33145 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
33150 0, /*nb_inplace_add*/
33151 0, /*nb_inplace_subtract*/
33152 0, /*nb_inplace_multiply*/
33153 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33154 0, /*nb_inplace_divide*/
33156 0, /*nb_inplace_remainder*/
33157 0, /*nb_inplace_power*/
33158 0, /*nb_inplace_lshift*/
33159 0, /*nb_inplace_rshift*/
33160 0, /*nb_inplace_and*/
33161 0, /*nb_inplace_xor*/
33162 0, /*nb_inplace_or*/
33163 0, /*nb_floor_divide*/
33164 #if CYTHON_COMPILING_IN_PYPY
33165 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
33167 0, /*nb_true_divide*/
33169 0, /*nb_inplace_floor_divide*/
33170 0, /*nb_inplace_true_divide*/
33171 __pyx_pw_4lxml_9objectify_10IntElement_3__index__, /*nb_index*/
33172 #if PY_VERSION_HEX >= 0x03050000
33173 0, /*nb_matrix_multiply*/
33175 #if PY_VERSION_HEX >= 0x03050000
33176 0, /*nb_inplace_matrix_multiply*/
33180 static PyTypeObject __pyx_type_4lxml_9objectify_IntElement = {
33181 PyVarObject_HEAD_INIT(0, 0)
33182 "lxml.objectify.IntElement", /*tp_name*/
33183 sizeof(struct __pyx_obj_4lxml_9objectify_IntElement), /*tp_basicsize*/
33185 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33186 #if PY_VERSION_HEX < 0x030800b4
33189 #if PY_VERSION_HEX >= 0x030800b4
33190 0, /*tp_vectorcall_offset*/
33194 #if PY_MAJOR_VERSION < 3
33197 #if PY_MAJOR_VERSION >= 3
33200 #if CYTHON_COMPILING_IN_PYPY
33201 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33205 &__pyx_tp_as_number_IntElement, /*tp_as_number*/
33206 0, /*tp_as_sequence*/
33207 0, /*tp_as_mapping*/
33210 #if CYTHON_COMPILING_IN_PYPY
33211 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33217 0, /*tp_as_buffer*/
33218 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33220 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33221 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33222 0, /*tp_richcompare*/
33223 0, /*tp_weaklistoffset*/
33224 #if CYTHON_COMPILING_IN_PYPY
33225 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33230 __pyx_methods_4lxml_9objectify_IntElement, /*tp_methods*/
33235 0, /*tp_descr_get*/
33236 0, /*tp_descr_set*/
33237 0, /*tp_dictoffset*/
33240 __pyx_tp_new_4lxml_9objectify_IntElement, /*tp_new*/
33246 0, /*tp_subclasses*/
33249 0, /*tp_version_tag*/
33250 #if PY_VERSION_HEX >= 0x030400a1
33253 #if PY_VERSION_HEX >= 0x030800b1
33254 0, /*tp_vectorcall*/
33256 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33261 static PyObject *__pyx_tp_new_4lxml_9objectify_LongElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33262 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33263 if (unlikely(!o)) return 0;
33267 static PyMethodDef __pyx_methods_4lxml_9objectify_LongElement[] = {
33268 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11LongElement_1_init, METH_NOARGS, 0},
33272 static PyNumberMethods __pyx_tp_as_number_LongElement = {
33273 #if CYTHON_COMPILING_IN_PYPY
33274 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33278 #if CYTHON_COMPILING_IN_PYPY
33279 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33283 #if CYTHON_COMPILING_IN_PYPY
33284 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33288 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33289 #if CYTHON_COMPILING_IN_PYPY
33290 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33295 #if CYTHON_COMPILING_IN_PYPY
33296 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33298 0, /*nb_remainder*/
33301 #if CYTHON_COMPILING_IN_PYPY
33302 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33306 #if CYTHON_COMPILING_IN_PYPY
33307 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33311 #if CYTHON_COMPILING_IN_PYPY
33312 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33316 #if CYTHON_COMPILING_IN_PYPY
33317 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33321 #if CYTHON_COMPILING_IN_PYPY
33322 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
33326 #if CYTHON_COMPILING_IN_PYPY
33327 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33331 #if CYTHON_COMPILING_IN_PYPY
33332 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
33336 #if CYTHON_COMPILING_IN_PYPY
33337 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
33341 #if CYTHON_COMPILING_IN_PYPY
33342 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
33346 #if CYTHON_COMPILING_IN_PYPY
33347 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
33351 #if CYTHON_COMPILING_IN_PYPY
33352 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
33356 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33359 #if CYTHON_COMPILING_IN_PYPY
33360 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
33364 #if PY_MAJOR_VERSION < 3
33365 #if CYTHON_COMPILING_IN_PYPY
33366 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
33373 #if CYTHON_COMPILING_IN_PYPY
33374 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
33378 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33379 #if CYTHON_COMPILING_IN_PYPY
33380 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
33385 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33386 #if CYTHON_COMPILING_IN_PYPY
33387 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
33392 0, /*nb_inplace_add*/
33393 0, /*nb_inplace_subtract*/
33394 0, /*nb_inplace_multiply*/
33395 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33396 0, /*nb_inplace_divide*/
33398 0, /*nb_inplace_remainder*/
33399 0, /*nb_inplace_power*/
33400 0, /*nb_inplace_lshift*/
33401 0, /*nb_inplace_rshift*/
33402 0, /*nb_inplace_and*/
33403 0, /*nb_inplace_xor*/
33404 0, /*nb_inplace_or*/
33405 0, /*nb_floor_divide*/
33406 #if CYTHON_COMPILING_IN_PYPY
33407 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
33409 0, /*nb_true_divide*/
33411 0, /*nb_inplace_floor_divide*/
33412 0, /*nb_inplace_true_divide*/
33413 __pyx_pw_4lxml_9objectify_11LongElement_3__index__, /*nb_index*/
33414 #if PY_VERSION_HEX >= 0x03050000
33415 0, /*nb_matrix_multiply*/
33417 #if PY_VERSION_HEX >= 0x03050000
33418 0, /*nb_inplace_matrix_multiply*/
33422 static PyTypeObject __pyx_type_4lxml_9objectify_LongElement = {
33423 PyVarObject_HEAD_INIT(0, 0)
33424 "lxml.objectify.LongElement", /*tp_name*/
33425 sizeof(struct __pyx_obj_4lxml_9objectify_LongElement), /*tp_basicsize*/
33427 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33428 #if PY_VERSION_HEX < 0x030800b4
33431 #if PY_VERSION_HEX >= 0x030800b4
33432 0, /*tp_vectorcall_offset*/
33436 #if PY_MAJOR_VERSION < 3
33439 #if PY_MAJOR_VERSION >= 3
33442 #if CYTHON_COMPILING_IN_PYPY
33443 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33447 &__pyx_tp_as_number_LongElement, /*tp_as_number*/
33448 0, /*tp_as_sequence*/
33449 0, /*tp_as_mapping*/
33452 #if CYTHON_COMPILING_IN_PYPY
33453 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33459 0, /*tp_as_buffer*/
33460 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33462 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33463 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33464 0, /*tp_richcompare*/
33465 0, /*tp_weaklistoffset*/
33466 #if CYTHON_COMPILING_IN_PYPY
33467 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33472 __pyx_methods_4lxml_9objectify_LongElement, /*tp_methods*/
33477 0, /*tp_descr_get*/
33478 0, /*tp_descr_set*/
33479 0, /*tp_dictoffset*/
33482 __pyx_tp_new_4lxml_9objectify_LongElement, /*tp_new*/
33488 0, /*tp_subclasses*/
33491 0, /*tp_version_tag*/
33492 #if PY_VERSION_HEX >= 0x030400a1
33495 #if PY_VERSION_HEX >= 0x030800b1
33496 0, /*tp_vectorcall*/
33498 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33503 static PyObject *__pyx_tp_new_4lxml_9objectify_FloatElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33504 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33505 if (unlikely(!o)) return 0;
33509 static PyMethodDef __pyx_methods_4lxml_9objectify_FloatElement[] = {
33510 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_12FloatElement_1_init, METH_NOARGS, 0},
33514 static PyTypeObject __pyx_type_4lxml_9objectify_FloatElement = {
33515 PyVarObject_HEAD_INIT(0, 0)
33516 "lxml.objectify.FloatElement", /*tp_name*/
33517 sizeof(struct __pyx_obj_4lxml_9objectify_FloatElement), /*tp_basicsize*/
33519 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33520 #if PY_VERSION_HEX < 0x030800b4
33523 #if PY_VERSION_HEX >= 0x030800b4
33524 0, /*tp_vectorcall_offset*/
33528 #if PY_MAJOR_VERSION < 3
33531 #if PY_MAJOR_VERSION >= 3
33534 #if CYTHON_COMPILING_IN_PYPY
33535 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33539 0, /*tp_as_number*/
33540 0, /*tp_as_sequence*/
33541 0, /*tp_as_mapping*/
33544 #if CYTHON_COMPILING_IN_PYPY
33545 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33551 0, /*tp_as_buffer*/
33552 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33554 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33555 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33556 0, /*tp_richcompare*/
33557 0, /*tp_weaklistoffset*/
33558 #if CYTHON_COMPILING_IN_PYPY
33559 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33564 __pyx_methods_4lxml_9objectify_FloatElement, /*tp_methods*/
33569 0, /*tp_descr_get*/
33570 0, /*tp_descr_set*/
33571 0, /*tp_dictoffset*/
33574 __pyx_tp_new_4lxml_9objectify_FloatElement, /*tp_new*/
33580 0, /*tp_subclasses*/
33583 0, /*tp_version_tag*/
33584 #if PY_VERSION_HEX >= 0x030400a1
33587 #if PY_VERSION_HEX >= 0x030800b1
33588 0, /*tp_vectorcall*/
33590 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33595 static PyObject *__pyx_tp_new_4lxml_9objectify_StringElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33596 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
33597 if (unlikely(!o)) return 0;
33601 static PyObject *__pyx_getprop_4lxml_9objectify_13StringElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33602 return __pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(o);
33605 static PyMethodDef __pyx_methods_4lxml_9objectify_StringElement[] = {
33606 {"strlen", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_3strlen, METH_NOARGS, 0},
33607 {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_23__complex__, METH_NOARGS, 0},
33611 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_StringElement[] = {
33612 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_13StringElement_pyval, 0, (char *)0, 0},
33616 static PyNumberMethods __pyx_tp_as_number_StringElement = {
33617 __pyx_pw_4lxml_9objectify_13StringElement_11__add__, /*nb_add*/
33619 __pyx_pw_4lxml_9objectify_13StringElement_13__mul__, /*nb_multiply*/
33620 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33623 __pyx_pw_4lxml_9objectify_13StringElement_15__mod__, /*nb_remainder*/
33629 __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__, /*nb_nonzero*/
33636 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33639 __pyx_pw_4lxml_9objectify_13StringElement_17__int__, /*nb_int*/
33640 #if PY_MAJOR_VERSION < 3
33641 __pyx_pw_4lxml_9objectify_13StringElement_19__long__, /*nb_long*/
33645 __pyx_pw_4lxml_9objectify_13StringElement_21__float__, /*nb_float*/
33646 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33649 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33652 0, /*nb_inplace_add*/
33653 0, /*nb_inplace_subtract*/
33654 0, /*nb_inplace_multiply*/
33655 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33656 0, /*nb_inplace_divide*/
33658 0, /*nb_inplace_remainder*/
33659 0, /*nb_inplace_power*/
33660 0, /*nb_inplace_lshift*/
33661 0, /*nb_inplace_rshift*/
33662 0, /*nb_inplace_and*/
33663 0, /*nb_inplace_xor*/
33664 0, /*nb_inplace_or*/
33665 0, /*nb_floor_divide*/
33666 0, /*nb_true_divide*/
33667 0, /*nb_inplace_floor_divide*/
33668 0, /*nb_inplace_true_divide*/
33670 #if PY_VERSION_HEX >= 0x03050000
33671 0, /*nb_matrix_multiply*/
33673 #if PY_VERSION_HEX >= 0x03050000
33674 0, /*nb_inplace_matrix_multiply*/
33678 static PyTypeObject __pyx_type_4lxml_9objectify_StringElement = {
33679 PyVarObject_HEAD_INIT(0, 0)
33680 "lxml.objectify.StringElement", /*tp_name*/
33681 sizeof(struct __pyx_obj_4lxml_9objectify_StringElement), /*tp_basicsize*/
33683 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
33684 #if PY_VERSION_HEX < 0x030800b4
33687 #if PY_VERSION_HEX >= 0x030800b4
33688 0, /*tp_vectorcall_offset*/
33692 #if PY_MAJOR_VERSION < 3
33695 #if PY_MAJOR_VERSION >= 3
33698 __pyx_pw_4lxml_9objectify_13StringElement_1__repr__, /*tp_repr*/
33699 &__pyx_tp_as_number_StringElement, /*tp_as_number*/
33700 0, /*tp_as_sequence*/
33701 0, /*tp_as_mapping*/
33702 __pyx_pw_4lxml_9objectify_13StringElement_9__hash__, /*tp_hash*/
33704 #if CYTHON_COMPILING_IN_PYPY
33705 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__, /*tp_str*/
33711 0, /*tp_as_buffer*/
33712 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33713 "String data class.\n\n Note that this class does *not* support the sequence protocol of strings:\n len(), iter(), str_attr[0], str_attr[0:1], etc. are *not* supported.\n Instead, use the .text attribute to get a 'real' string.\n ", /*tp_doc*/
33714 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
33715 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
33716 __pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__, /*tp_richcompare*/
33717 0, /*tp_weaklistoffset*/
33718 #if CYTHON_COMPILING_IN_PYPY
33719 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33724 __pyx_methods_4lxml_9objectify_StringElement, /*tp_methods*/
33726 __pyx_getsets_4lxml_9objectify_StringElement, /*tp_getset*/
33729 0, /*tp_descr_get*/
33730 0, /*tp_descr_set*/
33731 0, /*tp_dictoffset*/
33734 __pyx_tp_new_4lxml_9objectify_StringElement, /*tp_new*/
33740 0, /*tp_subclasses*/
33743 0, /*tp_version_tag*/
33744 #if PY_VERSION_HEX >= 0x030400a1
33747 #if PY_VERSION_HEX >= 0x030800b1
33748 0, /*tp_vectorcall*/
33750 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33755 static PyObject *__pyx_tp_new_4lxml_9objectify_NoneElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33756 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
33757 if (unlikely(!o)) return 0;
33761 static PyObject *__pyx_getprop_4lxml_9objectify_11NoneElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33762 return __pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(o);
33765 static PyMethodDef __pyx_methods_4lxml_9objectify_NoneElement[] = {
33769 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_NoneElement[] = {
33770 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_11NoneElement_pyval, 0, (char *)0, 0},
33774 static PyNumberMethods __pyx_tp_as_number_NoneElement = {
33778 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33781 0, /*nb_remainder*/
33787 __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__, /*nb_nonzero*/
33794 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33798 #if PY_MAJOR_VERSION < 3
33804 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33807 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33810 0, /*nb_inplace_add*/
33811 0, /*nb_inplace_subtract*/
33812 0, /*nb_inplace_multiply*/
33813 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33814 0, /*nb_inplace_divide*/
33816 0, /*nb_inplace_remainder*/
33817 0, /*nb_inplace_power*/
33818 0, /*nb_inplace_lshift*/
33819 0, /*nb_inplace_rshift*/
33820 0, /*nb_inplace_and*/
33821 0, /*nb_inplace_xor*/
33822 0, /*nb_inplace_or*/
33823 0, /*nb_floor_divide*/
33824 0, /*nb_true_divide*/
33825 0, /*nb_inplace_floor_divide*/
33826 0, /*nb_inplace_true_divide*/
33828 #if PY_VERSION_HEX >= 0x03050000
33829 0, /*nb_matrix_multiply*/
33831 #if PY_VERSION_HEX >= 0x03050000
33832 0, /*nb_inplace_matrix_multiply*/
33836 static PyTypeObject __pyx_type_4lxml_9objectify_NoneElement = {
33837 PyVarObject_HEAD_INIT(0, 0)
33838 "lxml.objectify.NoneElement", /*tp_name*/
33839 sizeof(struct __pyx_obj_4lxml_9objectify_NoneElement), /*tp_basicsize*/
33841 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
33842 #if PY_VERSION_HEX < 0x030800b4
33845 #if PY_VERSION_HEX >= 0x030800b4
33846 0, /*tp_vectorcall_offset*/
33850 #if PY_MAJOR_VERSION < 3
33853 #if PY_MAJOR_VERSION >= 3
33856 __pyx_pw_4lxml_9objectify_11NoneElement_3__repr__, /*tp_repr*/
33857 &__pyx_tp_as_number_NoneElement, /*tp_as_number*/
33858 0, /*tp_as_sequence*/
33859 0, /*tp_as_mapping*/
33860 __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__, /*tp_hash*/
33862 __pyx_pw_4lxml_9objectify_11NoneElement_1__str__, /*tp_str*/
33865 0, /*tp_as_buffer*/
33866 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33868 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
33869 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
33870 __pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__, /*tp_richcompare*/
33871 0, /*tp_weaklistoffset*/
33872 #if CYTHON_COMPILING_IN_PYPY
33873 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33878 __pyx_methods_4lxml_9objectify_NoneElement, /*tp_methods*/
33880 __pyx_getsets_4lxml_9objectify_NoneElement, /*tp_getset*/
33883 0, /*tp_descr_get*/
33884 0, /*tp_descr_set*/
33885 0, /*tp_dictoffset*/
33888 __pyx_tp_new_4lxml_9objectify_NoneElement, /*tp_new*/
33894 0, /*tp_subclasses*/
33897 0, /*tp_version_tag*/
33898 #if PY_VERSION_HEX >= 0x030400a1
33901 #if PY_VERSION_HEX >= 0x030800b1
33902 0, /*tp_vectorcall*/
33904 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33909 static PyObject *__pyx_tp_new_4lxml_9objectify_BoolElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33910 PyObject *o = __pyx_tp_new_4lxml_9objectify_IntElement(t, a, k);
33911 if (unlikely(!o)) return 0;
33915 static PyObject *__pyx_getprop_4lxml_9objectify_11BoolElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33916 return __pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(o);
33919 static PyMethodDef __pyx_methods_4lxml_9objectify_BoolElement[] = {
33920 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11BoolElement_1_init, METH_NOARGS, 0},
33924 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_BoolElement[] = {
33925 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_11BoolElement_pyval, 0, (char *)0, 0},
33929 static PyNumberMethods __pyx_tp_as_number_BoolElement = {
33930 #if CYTHON_COMPILING_IN_PYPY
33931 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33935 #if CYTHON_COMPILING_IN_PYPY
33936 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33940 #if CYTHON_COMPILING_IN_PYPY
33941 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33945 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33946 #if CYTHON_COMPILING_IN_PYPY
33947 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33952 #if CYTHON_COMPILING_IN_PYPY
33953 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33955 0, /*nb_remainder*/
33958 #if CYTHON_COMPILING_IN_PYPY
33959 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33963 #if CYTHON_COMPILING_IN_PYPY
33964 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33968 #if CYTHON_COMPILING_IN_PYPY
33969 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33973 #if CYTHON_COMPILING_IN_PYPY
33974 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33978 __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__, /*nb_nonzero*/
33979 #if CYTHON_COMPILING_IN_PYPY
33980 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33984 #if CYTHON_COMPILING_IN_PYPY
33985 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
33989 #if CYTHON_COMPILING_IN_PYPY
33990 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
33994 #if CYTHON_COMPILING_IN_PYPY
33995 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
33999 #if CYTHON_COMPILING_IN_PYPY
34000 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
34004 #if CYTHON_COMPILING_IN_PYPY
34005 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
34009 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34012 #if CYTHON_COMPILING_IN_PYPY
34013 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
34017 #if PY_MAJOR_VERSION < 3
34018 #if CYTHON_COMPILING_IN_PYPY
34019 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
34026 #if CYTHON_COMPILING_IN_PYPY
34027 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
34031 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34032 #if CYTHON_COMPILING_IN_PYPY
34033 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
34038 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34039 #if CYTHON_COMPILING_IN_PYPY
34040 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
34045 0, /*nb_inplace_add*/
34046 0, /*nb_inplace_subtract*/
34047 0, /*nb_inplace_multiply*/
34048 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34049 0, /*nb_inplace_divide*/
34051 0, /*nb_inplace_remainder*/
34052 0, /*nb_inplace_power*/
34053 0, /*nb_inplace_lshift*/
34054 0, /*nb_inplace_rshift*/
34055 0, /*nb_inplace_and*/
34056 0, /*nb_inplace_xor*/
34057 0, /*nb_inplace_or*/
34058 0, /*nb_floor_divide*/
34059 #if CYTHON_COMPILING_IN_PYPY
34060 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
34062 0, /*nb_true_divide*/
34064 0, /*nb_inplace_floor_divide*/
34065 0, /*nb_inplace_true_divide*/
34066 #if CYTHON_COMPILING_IN_PYPY
34067 __pyx_pw_4lxml_9objectify_10IntElement_3__index__, /*nb_index*/
34071 #if PY_VERSION_HEX >= 0x03050000
34072 0, /*nb_matrix_multiply*/
34074 #if PY_VERSION_HEX >= 0x03050000
34075 0, /*nb_inplace_matrix_multiply*/
34079 static PyTypeObject __pyx_type_4lxml_9objectify_BoolElement = {
34080 PyVarObject_HEAD_INIT(0, 0)
34081 "lxml.objectify.BoolElement", /*tp_name*/
34082 sizeof(struct __pyx_obj_4lxml_9objectify_BoolElement), /*tp_basicsize*/
34084 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
34085 #if PY_VERSION_HEX < 0x030800b4
34088 #if PY_VERSION_HEX >= 0x030800b4
34089 0, /*tp_vectorcall_offset*/
34093 #if PY_MAJOR_VERSION < 3
34096 #if PY_MAJOR_VERSION >= 3
34099 __pyx_pw_4lxml_9objectify_11BoolElement_11__repr__, /*tp_repr*/
34100 &__pyx_tp_as_number_BoolElement, /*tp_as_number*/
34101 0, /*tp_as_sequence*/
34102 0, /*tp_as_mapping*/
34103 __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__, /*tp_hash*/
34105 __pyx_pw_4lxml_9objectify_11BoolElement_9__str__, /*tp_str*/
34108 0, /*tp_as_buffer*/
34109 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34110 "Boolean type base on string values: 'true' or 'false'.\n\n Note that this inherits from IntElement to mimic the behaviour of\n Python's bool type.\n ", /*tp_doc*/
34111 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
34112 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
34113 __pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__, /*tp_richcompare*/
34114 0, /*tp_weaklistoffset*/
34115 #if CYTHON_COMPILING_IN_PYPY
34116 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
34121 __pyx_methods_4lxml_9objectify_BoolElement, /*tp_methods*/
34123 __pyx_getsets_4lxml_9objectify_BoolElement, /*tp_getset*/
34126 0, /*tp_descr_get*/
34127 0, /*tp_descr_set*/
34128 0, /*tp_dictoffset*/
34131 __pyx_tp_new_4lxml_9objectify_BoolElement, /*tp_new*/
34137 0, /*tp_subclasses*/
34140 0, /*tp_version_tag*/
34141 #if PY_VERSION_HEX >= 0x030400a1
34144 #if PY_VERSION_HEX >= 0x030800b1
34145 0, /*tp_vectorcall*/
34147 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34152 static PyObject *__pyx_tp_new_4lxml_9objectify_PyType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34153 struct __pyx_obj_4lxml_9objectify_PyType *p;
34155 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34156 o = (*t->tp_alloc)(t, 0);
34158 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34160 if (unlikely(!o)) return 0;
34161 p = ((struct __pyx_obj_4lxml_9objectify_PyType *)o);
34162 p->name = Py_None; Py_INCREF(Py_None);
34163 p->type_check = Py_None; Py_INCREF(Py_None);
34164 p->stringify = Py_None; Py_INCREF(Py_None);
34165 p->_type = Py_None; Py_INCREF(Py_None);
34166 p->_schema_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
34170 static void __pyx_tp_dealloc_4lxml_9objectify_PyType(PyObject *o) {
34171 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34172 #if CYTHON_USE_TP_FINALIZE
34173 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34174 if (PyObject_CallFinalizerFromDealloc(o)) return;
34177 PyObject_GC_UnTrack(o);
34179 Py_CLEAR(p->type_check);
34180 Py_CLEAR(p->stringify);
34181 Py_CLEAR(p->_type);
34182 Py_CLEAR(p->_schema_types);
34183 (*Py_TYPE(o)->tp_free)(o);
34186 static int __pyx_tp_traverse_4lxml_9objectify_PyType(PyObject *o, visitproc v, void *a) {
34188 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34190 e = (*v)(p->name, a); if (e) return e;
34192 if (p->type_check) {
34193 e = (*v)(p->type_check, a); if (e) return e;
34195 if (p->stringify) {
34196 e = (*v)(p->stringify, a); if (e) return e;
34199 e = (*v)(p->_type, a); if (e) return e;
34201 if (p->_schema_types) {
34202 e = (*v)(p->_schema_types, a); if (e) return e;
34207 static int __pyx_tp_clear_4lxml_9objectify_PyType(PyObject *o) {
34208 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34210 Py_CLEAR(p->type_check);
34211 Py_CLEAR(p->stringify);
34212 Py_CLEAR(p->_type);
34213 Py_CLEAR(p->_schema_types);
34217 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_xmlSchemaTypes(PyObject *o, CYTHON_UNUSED void *x) {
34218 return __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(o);
34221 static int __pyx_setprop_4lxml_9objectify_6PyType_xmlSchemaTypes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
34223 return __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(o, v);
34226 PyErr_SetString(PyExc_NotImplementedError, "__del__");
34231 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_name(PyObject *o, CYTHON_UNUSED void *x) {
34232 return __pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(o);
34235 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_type_check(PyObject *o, CYTHON_UNUSED void *x) {
34236 return __pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(o);
34239 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_stringify(PyObject *o, CYTHON_UNUSED void *x) {
34240 return __pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(o);
34243 static PyMethodDef __pyx_methods_4lxml_9objectify_PyType[] = {
34244 {"register", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_6PyType_5register, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_6PyType_4register},
34245 {"unregister", (PyCFunction)__pyx_pw_4lxml_9objectify_6PyType_7unregister, METH_NOARGS, __pyx_doc_4lxml_9objectify_6PyType_6unregister},
34249 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_PyType[] = {
34250 {(char *)"xmlSchemaTypes", __pyx_getprop_4lxml_9objectify_6PyType_xmlSchemaTypes, __pyx_setprop_4lxml_9objectify_6PyType_xmlSchemaTypes, (char *)"The list of XML Schema datatypes this Python type maps to.\n\n Note that this must be set before registering the type!\n ", 0},
34251 {(char *)"name", __pyx_getprop_4lxml_9objectify_6PyType_name, 0, (char *)0, 0},
34252 {(char *)"type_check", __pyx_getprop_4lxml_9objectify_6PyType_type_check, 0, (char *)0, 0},
34253 {(char *)"stringify", __pyx_getprop_4lxml_9objectify_6PyType_stringify, 0, (char *)0, 0},
34257 static PyTypeObject __pyx_type_4lxml_9objectify_PyType = {
34258 PyVarObject_HEAD_INIT(0, 0)
34259 "lxml.objectify.PyType", /*tp_name*/
34260 sizeof(struct __pyx_obj_4lxml_9objectify_PyType), /*tp_basicsize*/
34262 __pyx_tp_dealloc_4lxml_9objectify_PyType, /*tp_dealloc*/
34263 #if PY_VERSION_HEX < 0x030800b4
34266 #if PY_VERSION_HEX >= 0x030800b4
34267 0, /*tp_vectorcall_offset*/
34271 #if PY_MAJOR_VERSION < 3
34274 #if PY_MAJOR_VERSION >= 3
34277 __pyx_pw_4lxml_9objectify_6PyType_3__repr__, /*tp_repr*/
34278 0, /*tp_as_number*/
34279 0, /*tp_as_sequence*/
34280 0, /*tp_as_mapping*/
34286 0, /*tp_as_buffer*/
34287 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34288 "PyType(self, name, type_check, type_class, stringify=None)\n User defined type.\n\n Named type that contains a type check function, a type class that\n inherits from ObjectifiedDataElement and an optional \"stringification\"\n function. The type check must take a string as argument and raise\n ValueError or TypeError if it cannot handle the string value. It may be\n None in which case it is not considered for type guessing. For registered\n named types, the 'stringify' function (or unicode() if None) is used to\n convert a Python object with type name 'name' to the string representation\n stored in the XML tree.\n\n Example::\n\n PyType('int', int, MyIntClass).register()\n\n Note that the order in which types are registered matters. The first\n matching type will be used.\n ", /*tp_doc*/
34289 __pyx_tp_traverse_4lxml_9objectify_PyType, /*tp_traverse*/
34290 __pyx_tp_clear_4lxml_9objectify_PyType, /*tp_clear*/
34291 0, /*tp_richcompare*/
34292 0, /*tp_weaklistoffset*/
34295 __pyx_methods_4lxml_9objectify_PyType, /*tp_methods*/
34297 __pyx_getsets_4lxml_9objectify_PyType, /*tp_getset*/
34300 0, /*tp_descr_get*/
34301 0, /*tp_descr_set*/
34302 0, /*tp_dictoffset*/
34303 __pyx_pw_4lxml_9objectify_6PyType_1__init__, /*tp_init*/
34305 __pyx_tp_new_4lxml_9objectify_PyType, /*tp_new*/
34311 0, /*tp_subclasses*/
34314 0, /*tp_version_tag*/
34315 #if PY_VERSION_HEX >= 0x030400a1
34318 #if PY_VERSION_HEX >= 0x030800b1
34319 0, /*tp_vectorcall*/
34321 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34326 static PyObject *__pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34327 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p;
34329 o = (*t->tp_alloc)(t, 0);
34330 if (unlikely(!o)) return 0;
34331 p = ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o);
34332 p->_tag = Py_None; Py_INCREF(Py_None);
34333 p->_nsmap = Py_None; Py_INCREF(Py_None);
34334 p->_element_factory = Py_None; Py_INCREF(Py_None);
34338 static void __pyx_tp_dealloc_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o) {
34339 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34340 PyObject_GC_UnTrack(o);
34342 Py_CLEAR(p->_nsmap);
34343 Py_CLEAR(p->_element_factory);
34344 (*Py_TYPE(o)->tp_free)(o);
34347 static int __pyx_tp_traverse_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o, visitproc v, void *a) {
34349 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34351 e = (*v)(p->_tag, a); if (e) return e;
34354 e = (*v)(p->_nsmap, a); if (e) return e;
34356 if (p->_element_factory) {
34357 e = (*v)(p->_element_factory, a); if (e) return e;
34362 static int __pyx_tp_clear_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o) {
34363 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34365 Py_CLEAR(p->_nsmap);
34366 Py_CLEAR(p->_element_factory);
34370 static PyMethodDef __pyx_methods_4lxml_9objectify__ObjectifyElementMakerCaller[] = {
34374 static PyTypeObject __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller = {
34375 PyVarObject_HEAD_INIT(0, 0)
34376 "lxml.objectify._ObjectifyElementMakerCaller", /*tp_name*/
34377 sizeof(struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller), /*tp_basicsize*/
34379 __pyx_tp_dealloc_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_dealloc*/
34380 #if PY_VERSION_HEX < 0x030800b4
34383 #if PY_VERSION_HEX >= 0x030800b4
34384 0, /*tp_vectorcall_offset*/
34388 #if PY_MAJOR_VERSION < 3
34391 #if PY_MAJOR_VERSION >= 3
34395 0, /*tp_as_number*/
34396 0, /*tp_as_sequence*/
34397 0, /*tp_as_mapping*/
34399 __pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__, /*tp_call*/
34403 0, /*tp_as_buffer*/
34404 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34406 __pyx_tp_traverse_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_traverse*/
34407 __pyx_tp_clear_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_clear*/
34408 0, /*tp_richcompare*/
34409 0, /*tp_weaklistoffset*/
34412 __pyx_methods_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_methods*/
34417 0, /*tp_descr_get*/
34418 0, /*tp_descr_set*/
34419 0, /*tp_dictoffset*/
34422 __pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_new*/
34428 0, /*tp_subclasses*/
34431 0, /*tp_version_tag*/
34432 #if PY_VERSION_HEX >= 0x030400a1
34435 #if PY_VERSION_HEX >= 0x030800b1
34436 0, /*tp_vectorcall*/
34438 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34442 static struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker __pyx_vtable_4lxml_9objectify_ElementMaker;
34444 static PyObject *__pyx_tp_new_4lxml_9objectify_ElementMaker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34445 struct __pyx_obj_4lxml_9objectify_ElementMaker *p;
34447 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34448 o = (*t->tp_alloc)(t, 0);
34450 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34452 if (unlikely(!o)) return 0;
34453 p = ((struct __pyx_obj_4lxml_9objectify_ElementMaker *)o);
34454 p->__pyx_vtab = __pyx_vtabptr_4lxml_9objectify_ElementMaker;
34455 p->_makeelement = Py_None; Py_INCREF(Py_None);
34456 p->_namespace = Py_None; Py_INCREF(Py_None);
34457 p->_nsmap = Py_None; Py_INCREF(Py_None);
34458 p->_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
34462 static void __pyx_tp_dealloc_4lxml_9objectify_ElementMaker(PyObject *o) {
34463 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34464 #if CYTHON_USE_TP_FINALIZE
34465 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34466 if (PyObject_CallFinalizerFromDealloc(o)) return;
34469 PyObject_GC_UnTrack(o);
34470 Py_CLEAR(p->_makeelement);
34471 Py_CLEAR(p->_namespace);
34472 Py_CLEAR(p->_nsmap);
34473 Py_CLEAR(p->_cache);
34474 (*Py_TYPE(o)->tp_free)(o);
34477 static int __pyx_tp_traverse_4lxml_9objectify_ElementMaker(PyObject *o, visitproc v, void *a) {
34479 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34480 if (p->_makeelement) {
34481 e = (*v)(p->_makeelement, a); if (e) return e;
34483 if (p->_namespace) {
34484 e = (*v)(p->_namespace, a); if (e) return e;
34487 e = (*v)(p->_nsmap, a); if (e) return e;
34490 e = (*v)(p->_cache, a); if (e) return e;
34495 static int __pyx_tp_clear_4lxml_9objectify_ElementMaker(PyObject *o) {
34496 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34497 Py_CLEAR(p->_makeelement);
34498 Py_CLEAR(p->_namespace);
34499 Py_CLEAR(p->_nsmap);
34500 Py_CLEAR(p->_cache);
34504 static PyObject *__pyx_tp_getattro_4lxml_9objectify_ElementMaker(PyObject *o, PyObject *n) {
34505 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
34506 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34508 v = __pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(o, n);
34513 static PyMethodDef __pyx_methods_4lxml_9objectify_ElementMaker[] = {
34514 {"__getattr__", (PyCFunction)__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__, METH_O|METH_COEXIST, 0},
34518 static PyTypeObject __pyx_type_4lxml_9objectify_ElementMaker = {
34519 PyVarObject_HEAD_INIT(0, 0)
34520 "lxml.objectify.ElementMaker", /*tp_name*/
34521 sizeof(struct __pyx_obj_4lxml_9objectify_ElementMaker), /*tp_basicsize*/
34523 __pyx_tp_dealloc_4lxml_9objectify_ElementMaker, /*tp_dealloc*/
34524 #if PY_VERSION_HEX < 0x030800b4
34527 #if PY_VERSION_HEX >= 0x030800b4
34528 0, /*tp_vectorcall_offset*/
34532 #if PY_MAJOR_VERSION < 3
34535 #if PY_MAJOR_VERSION >= 3
34539 0, /*tp_as_number*/
34540 0, /*tp_as_sequence*/
34541 0, /*tp_as_mapping*/
34543 __pyx_pw_4lxml_9objectify_12ElementMaker_5__call__, /*tp_call*/
34545 __pyx_tp_getattro_4lxml_9objectify_ElementMaker, /*tp_getattro*/
34547 0, /*tp_as_buffer*/
34548 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34549 "ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)\n\n An ElementMaker that can be used for constructing trees.\n\n Example::\n\n >>> M = ElementMaker(annotate=False)\n >>> attributes = {'class': 'par'}\n >>> html = M.html( M.body( M.p('hello', attributes, M.br, 'objectify', style=\"font-weight: bold\") ) )\n\n >>> from lxml.etree import tostring\n >>> print(tostring(html, method='html').decode('ascii'))\n <html><body><p style=\"font-weight: bold\" class=\"par\">hello<br>objectify</p></body></html>\n\n To create tags that are not valid Python identifiers, call the factory\n directly and pass the tag name as first argument::\n\n >>> root = M('tricky-tag', 'some text')\n >>> print(root.tag)\n tricky-tag\n >>> print(root.text)\n some text\n\n Note that this module has a predefined ElementMaker instance called ``E``.\n ", /*tp_doc*/
34550 __pyx_tp_traverse_4lxml_9objectify_ElementMaker, /*tp_traverse*/
34551 __pyx_tp_clear_4lxml_9objectify_ElementMaker, /*tp_clear*/
34552 0, /*tp_richcompare*/
34553 0, /*tp_weaklistoffset*/
34556 __pyx_methods_4lxml_9objectify_ElementMaker, /*tp_methods*/
34561 0, /*tp_descr_get*/
34562 0, /*tp_descr_set*/
34563 0, /*tp_dictoffset*/
34564 __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__, /*tp_init*/
34566 __pyx_tp_new_4lxml_9objectify_ElementMaker, /*tp_new*/
34572 0, /*tp_subclasses*/
34575 0, /*tp_version_tag*/
34576 #if PY_VERSION_HEX >= 0x030400a1
34579 #if PY_VERSION_HEX >= 0x030800b1
34580 0, /*tp_vectorcall*/
34582 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34587 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
34588 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p;
34589 PyObject *o = __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_new(t, a, k);
34590 if (unlikely(!o)) return 0;
34591 p = ((struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o);
34592 p->empty_data_class = Py_None; Py_INCREF(Py_None);
34593 p->tree_class = Py_None; Py_INCREF(Py_None);
34597 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o) {
34598 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34599 #if CYTHON_USE_TP_FINALIZE
34600 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34601 if (PyObject_CallFinalizerFromDealloc(o)) return;
34604 PyObject_GC_UnTrack(o);
34605 Py_CLEAR(p->empty_data_class);
34606 Py_CLEAR(p->tree_class);
34607 #if CYTHON_USE_TYPE_SLOTS
34608 if (PyType_IS_GC(Py_TYPE(o)->tp_base))
34610 PyObject_GC_Track(o);
34611 if (likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup)) __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup);
34614 static int __pyx_tp_traverse_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o, visitproc v, void *a) {
34616 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34617 e = ((likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup)) ? ((__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_traverse) ? __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_4lxml_9objectify_ObjectifyElementClassLookup)); if (e) return e;
34618 if (p->empty_data_class) {
34619 e = (*v)(p->empty_data_class, a); if (e) return e;
34621 if (p->tree_class) {
34622 e = (*v)(p->tree_class, a); if (e) return e;
34627 static int __pyx_tp_clear_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o) {
34628 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34629 if (likely(__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup)) { if (__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_clear) __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_4lxml_9objectify_ObjectifyElementClassLookup);
34630 Py_CLEAR(p->empty_data_class);
34631 Py_CLEAR(p->tree_class);
34635 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifyElementClassLookup[] = {
34639 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup = {
34640 PyVarObject_HEAD_INIT(0, 0)
34641 "lxml.objectify.ObjectifyElementClassLookup", /*tp_name*/
34642 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup), /*tp_basicsize*/
34644 __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_dealloc*/
34645 #if PY_VERSION_HEX < 0x030800b4
34648 #if PY_VERSION_HEX >= 0x030800b4
34649 0, /*tp_vectorcall_offset*/
34653 #if PY_MAJOR_VERSION < 3
34656 #if PY_MAJOR_VERSION >= 3
34660 0, /*tp_as_number*/
34661 0, /*tp_as_sequence*/
34662 0, /*tp_as_mapping*/
34668 0, /*tp_as_buffer*/
34669 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34670 "ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None)\n Element class lookup method that uses the objectify classes.\n ", /*tp_doc*/
34671 __pyx_tp_traverse_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_traverse*/
34672 __pyx_tp_clear_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_clear*/
34673 0, /*tp_richcompare*/
34674 0, /*tp_weaklistoffset*/
34677 __pyx_methods_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_methods*/
34682 0, /*tp_descr_get*/
34683 0, /*tp_descr_set*/
34684 0, /*tp_dictoffset*/
34685 __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__, /*tp_init*/
34687 __pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_new*/
34693 0, /*tp_subclasses*/
34696 0, /*tp_version_tag*/
34697 #if PY_VERSION_HEX >= 0x030400a1
34700 #if PY_VERSION_HEX >= 0x030800b1
34701 0, /*tp_vectorcall*/
34703 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34708 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectPath(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34709 struct __pyx_obj_4lxml_9objectify_ObjectPath *p;
34711 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34712 o = (*t->tp_alloc)(t, 0);
34714 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34716 if (unlikely(!o)) return 0;
34717 p = ((struct __pyx_obj_4lxml_9objectify_ObjectPath *)o);
34718 p->find = Py_None; Py_INCREF(Py_None);
34719 p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None);
34720 p->_path_str = Py_None; Py_INCREF(Py_None);
34724 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectPath(PyObject *o) {
34725 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34726 #if CYTHON_USE_TP_FINALIZE
34727 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34728 if (PyObject_CallFinalizerFromDealloc(o)) return;
34731 PyObject_GC_UnTrack(o);
34733 PyObject *etype, *eval, *etb;
34734 PyErr_Fetch(&etype, &eval, &etb);
34736 __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(o);
34738 PyErr_Restore(etype, eval, etb);
34741 Py_CLEAR(p->_path);
34742 Py_CLEAR(p->_path_str);
34743 (*Py_TYPE(o)->tp_free)(o);
34746 static int __pyx_tp_traverse_4lxml_9objectify_ObjectPath(PyObject *o, visitproc v, void *a) {
34748 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34750 e = (*v)(p->find, a); if (e) return e;
34753 e = (*v)(p->_path, a); if (e) return e;
34755 if (p->_path_str) {
34756 e = (*v)(p->_path_str, a); if (e) return e;
34761 static int __pyx_tp_clear_4lxml_9objectify_ObjectPath(PyObject *o) {
34762 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34764 Py_CLEAR(p->_path);
34765 Py_CLEAR(p->_path_str);
34769 static PyObject *__pyx_getprop_4lxml_9objectify_10ObjectPath_find(PyObject *o, CYTHON_UNUSED void *x) {
34770 return __pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(o);
34773 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectPath[] = {
34774 {"hasattr", (PyCFunction)__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr, METH_O, __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr},
34775 {"setattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_10setattr},
34776 {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_12addattr},
34780 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectPath[] = {
34781 {(char *)"find", __pyx_getprop_4lxml_9objectify_10ObjectPath_find, 0, (char *)0, 0},
34785 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectPath = {
34786 PyVarObject_HEAD_INIT(0, 0)
34787 "lxml.objectify.ObjectPath", /*tp_name*/
34788 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectPath), /*tp_basicsize*/
34790 __pyx_tp_dealloc_4lxml_9objectify_ObjectPath, /*tp_dealloc*/
34791 #if PY_VERSION_HEX < 0x030800b4
34794 #if PY_VERSION_HEX >= 0x030800b4
34795 0, /*tp_vectorcall_offset*/
34799 #if PY_MAJOR_VERSION < 3
34802 #if PY_MAJOR_VERSION >= 3
34806 0, /*tp_as_number*/
34807 0, /*tp_as_sequence*/
34808 0, /*tp_as_mapping*/
34810 __pyx_pw_4lxml_9objectify_10ObjectPath_7__call__, /*tp_call*/
34811 __pyx_pw_4lxml_9objectify_10ObjectPath_5__str__, /*tp_str*/
34814 0, /*tp_as_buffer*/
34815 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34816 "ObjectPath(path)\n Immutable object that represents a compiled object path.\n\n Example for a path: 'root.child[1].{other}child[25]'\n ", /*tp_doc*/
34817 __pyx_tp_traverse_4lxml_9objectify_ObjectPath, /*tp_traverse*/
34818 __pyx_tp_clear_4lxml_9objectify_ObjectPath, /*tp_clear*/
34819 0, /*tp_richcompare*/
34820 0, /*tp_weaklistoffset*/
34823 __pyx_methods_4lxml_9objectify_ObjectPath, /*tp_methods*/
34825 __pyx_getsets_4lxml_9objectify_ObjectPath, /*tp_getset*/
34828 0, /*tp_descr_get*/
34829 0, /*tp_descr_set*/
34830 0, /*tp_dictoffset*/
34831 __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__, /*tp_init*/
34833 __pyx_tp_new_4lxml_9objectify_ObjectPath, /*tp_new*/
34839 0, /*tp_subclasses*/
34842 0, /*tp_version_tag*/
34843 #if PY_VERSION_HEX >= 0x030400a1
34846 #if PY_VERSION_HEX >= 0x030800b1
34847 0, /*tp_vectorcall*/
34849 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34854 static PyMethodDef __pyx_methods[] = {
34858 #if PY_MAJOR_VERSION >= 3
34859 #if CYTHON_PEP489_MULTI_PHASE_INIT
34860 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
34861 static int __pyx_pymod_exec_objectify(PyObject* module); /*proto*/
34862 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
34863 {Py_mod_create, (void*)__pyx_pymod_create},
34864 {Py_mod_exec, (void*)__pyx_pymod_exec_objectify},
34869 static struct PyModuleDef __pyx_moduledef = {
34870 PyModuleDef_HEAD_INIT,
34872 __pyx_k_The_lxml_objectify_module_imple, /* m_doc */
34873 #if CYTHON_PEP489_MULTI_PHASE_INIT
34878 __pyx_methods /* m_methods */,
34879 #if CYTHON_PEP489_MULTI_PHASE_INIT
34880 __pyx_moduledef_slots, /* m_slots */
34882 NULL, /* m_reload */
34884 NULL, /* m_traverse */
34885 NULL, /* m_clear */
34886 (freefunc)__pyx_module_cleanup /* m_free */
34889 #ifndef CYTHON_SMALL_CODE
34890 #if defined(__clang__)
34891 #define CYTHON_SMALL_CODE
34892 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
34893 #define CYTHON_SMALL_CODE __attribute__((cold))
34895 #define CYTHON_SMALL_CODE
34899 static __Pyx_StringTabEntry __pyx_string_tab[] = {
34900 {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
34901 {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
34902 {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
34903 {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
34904 {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
34905 {&__pyx_n_s_BoolElement, __pyx_k_BoolElement, sizeof(__pyx_k_BoolElement), 0, 0, 1, 1},
34906 {&__pyx_n_u_BoolElement, __pyx_k_BoolElement, sizeof(__pyx_k_BoolElement), 0, 1, 0, 1},
34907 {&__pyx_n_s_BoolElement__init, __pyx_k_BoolElement__init, sizeof(__pyx_k_BoolElement__init), 0, 0, 1, 1},
34908 {&__pyx_kp_u_Cannot_register_tree_type, __pyx_k_Cannot_register_tree_type, sizeof(__pyx_k_Cannot_register_tree_type), 0, 1, 0, 0},
34909 {&__pyx_n_s_DataElement, __pyx_k_DataElement, sizeof(__pyx_k_DataElement), 0, 0, 1, 1},
34910 {&__pyx_n_u_DataElement, __pyx_k_DataElement, sizeof(__pyx_k_DataElement), 0, 1, 0, 1},
34911 {&__pyx_kp_u_Data_classes_must_inherit_from_O, __pyx_k_Data_classes_must_inherit_from_O, sizeof(__pyx_k_Data_classes_must_inherit_from_O), 0, 1, 0, 0},
34912 {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
34913 {&__pyx_n_u_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 1, 0, 1},
34914 {&__pyx_n_u_ENTITY, __pyx_k_ENTITY, sizeof(__pyx_k_ENTITY), 0, 1, 0, 1},
34915 {&__pyx_n_s_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 0, 1, 1},
34916 {&__pyx_n_u_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 1, 0, 1},
34917 {&__pyx_n_s_ElementChildIterator, __pyx_k_ElementChildIterator, sizeof(__pyx_k_ElementChildIterator), 0, 0, 1, 1},
34918 {&__pyx_n_s_ElementMaker, __pyx_k_ElementMaker, sizeof(__pyx_k_ElementMaker), 0, 0, 1, 1},
34919 {&__pyx_n_u_ElementMaker, __pyx_k_ElementMaker, sizeof(__pyx_k_ElementMaker), 0, 1, 0, 1},
34920 {&__pyx_n_s_ElementTree, __pyx_k_ElementTree, sizeof(__pyx_k_ElementTree), 0, 0, 1, 1},
34921 {&__pyx_n_s_ElementTree_2, __pyx_k_ElementTree_2, sizeof(__pyx_k_ElementTree_2), 0, 0, 1, 1},
34922 {&__pyx_n_s_FloatElement, __pyx_k_FloatElement, sizeof(__pyx_k_FloatElement), 0, 0, 1, 1},
34923 {&__pyx_n_u_FloatElement, __pyx_k_FloatElement, sizeof(__pyx_k_FloatElement), 0, 1, 0, 1},
34924 {&__pyx_n_s_FloatElement__init, __pyx_k_FloatElement__init, sizeof(__pyx_k_FloatElement__init), 0, 0, 1, 1},
34925 {&__pyx_n_u_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 1, 0, 1},
34926 {&__pyx_n_u_IDREF, __pyx_k_IDREF, sizeof(__pyx_k_IDREF), 0, 1, 0, 1},
34927 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
34928 {&__pyx_n_s_IntElement, __pyx_k_IntElement, sizeof(__pyx_k_IntElement), 0, 0, 1, 1},
34929 {&__pyx_n_u_IntElement, __pyx_k_IntElement, sizeof(__pyx_k_IntElement), 0, 1, 0, 1},
34930 {&__pyx_n_s_IntElement__init, __pyx_k_IntElement__init, sizeof(__pyx_k_IntElement__init), 0, 0, 1, 1},
34931 {&__pyx_kp_u_Invalid_boolean_value, __pyx_k_Invalid_boolean_value, sizeof(__pyx_k_Invalid_boolean_value), 0, 1, 0, 0},
34932 {&__pyx_kp_u_Invalid_slice, __pyx_k_Invalid_slice, sizeof(__pyx_k_Invalid_slice), 0, 1, 0, 0},
34933 {&__pyx_n_s_LongElement, __pyx_k_LongElement, sizeof(__pyx_k_LongElement), 0, 0, 1, 1},
34934 {&__pyx_n_u_LongElement, __pyx_k_LongElement, sizeof(__pyx_k_LongElement), 0, 1, 0, 1},
34935 {&__pyx_n_s_LongElement__init, __pyx_k_LongElement__init, sizeof(__pyx_k_LongElement__init), 0, 0, 1, 1},
34936 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
34937 {&__pyx_n_u_NCName, __pyx_k_NCName, sizeof(__pyx_k_NCName), 0, 1, 0, 1},
34938 {&__pyx_n_u_NMTOKEN, __pyx_k_NMTOKEN, sizeof(__pyx_k_NMTOKEN), 0, 1, 0, 1},
34939 {&__pyx_n_u_Name, __pyx_k_Name, sizeof(__pyx_k_Name), 0, 1, 0, 1},
34940 {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
34941 {&__pyx_n_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 1},
34942 {&__pyx_n_s_NoneElement, __pyx_k_NoneElement, sizeof(__pyx_k_NoneElement), 0, 0, 1, 1},
34943 {&__pyx_n_u_NoneElement, __pyx_k_NoneElement, sizeof(__pyx_k_NoneElement), 0, 1, 0, 1},
34944 {&__pyx_n_s_NoneType, __pyx_k_NoneType, sizeof(__pyx_k_NoneType), 0, 0, 1, 1},
34945 {&__pyx_n_u_NoneType, __pyx_k_NoneType, sizeof(__pyx_k_NoneType), 0, 1, 0, 1},
34946 {&__pyx_n_s_NumberElement, __pyx_k_NumberElement, sizeof(__pyx_k_NumberElement), 0, 0, 1, 1},
34947 {&__pyx_n_u_NumberElement, __pyx_k_NumberElement, sizeof(__pyx_k_NumberElement), 0, 1, 0, 1},
34948 {&__pyx_n_s_NumberElement___complex, __pyx_k_NumberElement___complex, sizeof(__pyx_k_NumberElement___complex), 0, 0, 1, 1},
34949 {&__pyx_n_s_NumberElement__setValueParser, __pyx_k_NumberElement__setValueParser, sizeof(__pyx_k_NumberElement__setValueParser), 0, 0, 1, 1},
34950 {&__pyx_n_s_ObjectPath, __pyx_k_ObjectPath, sizeof(__pyx_k_ObjectPath), 0, 0, 1, 1},
34951 {&__pyx_n_u_ObjectPath, __pyx_k_ObjectPath, sizeof(__pyx_k_ObjectPath), 0, 1, 0, 1},
34952 {&__pyx_n_s_ObjectPath_addattr, __pyx_k_ObjectPath_addattr, sizeof(__pyx_k_ObjectPath_addattr), 0, 0, 1, 1},
34953 {&__pyx_n_s_ObjectPath_hasattr, __pyx_k_ObjectPath_hasattr, sizeof(__pyx_k_ObjectPath_hasattr), 0, 0, 1, 1},
34954 {&__pyx_n_s_ObjectPath_setattr, __pyx_k_ObjectPath_setattr, sizeof(__pyx_k_ObjectPath_setattr), 0, 0, 1, 1},
34955 {&__pyx_n_s_ObjectifiedDataElement, __pyx_k_ObjectifiedDataElement, sizeof(__pyx_k_ObjectifiedDataElement), 0, 0, 1, 1},
34956 {&__pyx_n_u_ObjectifiedDataElement, __pyx_k_ObjectifiedDataElement, sizeof(__pyx_k_ObjectifiedDataElement), 0, 1, 0, 1},
34957 {&__pyx_n_s_ObjectifiedDataElement__setText, __pyx_k_ObjectifiedDataElement__setText, sizeof(__pyx_k_ObjectifiedDataElement__setText), 0, 0, 1, 1},
34958 {&__pyx_n_s_ObjectifiedElement, __pyx_k_ObjectifiedElement, sizeof(__pyx_k_ObjectifiedElement), 0, 0, 1, 1},
34959 {&__pyx_n_u_ObjectifiedElement, __pyx_k_ObjectifiedElement, sizeof(__pyx_k_ObjectifiedElement), 0, 1, 0, 1},
34960 {&__pyx_n_s_ObjectifiedElement___reduce, __pyx_k_ObjectifiedElement___reduce, sizeof(__pyx_k_ObjectifiedElement___reduce), 0, 0, 1, 1},
34961 {&__pyx_n_s_ObjectifiedElement_addattr, __pyx_k_ObjectifiedElement_addattr, sizeof(__pyx_k_ObjectifiedElement_addattr), 0, 0, 1, 1},
34962 {&__pyx_n_s_ObjectifiedElement_countchildren, __pyx_k_ObjectifiedElement_countchildren, sizeof(__pyx_k_ObjectifiedElement_countchildren), 0, 0, 1, 1},
34963 {&__pyx_n_s_ObjectifiedElement_descendantpat, __pyx_k_ObjectifiedElement_descendantpat, sizeof(__pyx_k_ObjectifiedElement_descendantpat), 0, 0, 1, 1},
34964 {&__pyx_n_s_ObjectifiedElement_getchildren, __pyx_k_ObjectifiedElement_getchildren, sizeof(__pyx_k_ObjectifiedElement_getchildren), 0, 0, 1, 1},
34965 {&__pyx_n_s_ObjectifyElementClassLookup, __pyx_k_ObjectifyElementClassLookup, sizeof(__pyx_k_ObjectifyElementClassLookup), 0, 0, 1, 1},
34966 {&__pyx_n_u_ObjectifyElementClassLookup, __pyx_k_ObjectifyElementClassLookup, sizeof(__pyx_k_ObjectifyElementClassLookup), 0, 1, 0, 1},
34967 {&__pyx_n_s_PYTYPE_ATTRIBUTE, __pyx_k_PYTYPE_ATTRIBUTE, sizeof(__pyx_k_PYTYPE_ATTRIBUTE), 0, 0, 1, 1},
34968 {&__pyx_n_u_PYTYPE_ATTRIBUTE, __pyx_k_PYTYPE_ATTRIBUTE, sizeof(__pyx_k_PYTYPE_ATTRIBUTE), 0, 1, 0, 1},
34969 {&__pyx_n_s_PyType, __pyx_k_PyType, sizeof(__pyx_k_PyType), 0, 0, 1, 1},
34970 {&__pyx_n_u_PyType, __pyx_k_PyType, sizeof(__pyx_k_PyType), 0, 1, 0, 1},
34971 {&__pyx_n_s_PyType_register, __pyx_k_PyType_register, sizeof(__pyx_k_PyType_register), 0, 0, 1, 1},
34972 {&__pyx_kp_s_PyType_s_s, __pyx_k_PyType_s_s, sizeof(__pyx_k_PyType_s_s), 0, 0, 1, 0},
34973 {&__pyx_n_s_PyType_unregister, __pyx_k_PyType_unregister, sizeof(__pyx_k_PyType_unregister), 0, 0, 1, 1},
34974 {&__pyx_n_s_StringElement, __pyx_k_StringElement, sizeof(__pyx_k_StringElement), 0, 0, 1, 1},
34975 {&__pyx_n_u_StringElement, __pyx_k_StringElement, sizeof(__pyx_k_StringElement), 0, 1, 0, 1},
34976 {&__pyx_n_s_StringElement___complex, __pyx_k_StringElement___complex, sizeof(__pyx_k_StringElement___complex), 0, 0, 1, 1},
34977 {&__pyx_n_s_StringElement_strlen, __pyx_k_StringElement_strlen, sizeof(__pyx_k_StringElement_strlen), 0, 0, 1, 1},
34978 {&__pyx_n_s_SubElement, __pyx_k_SubElement, sizeof(__pyx_k_SubElement), 0, 0, 1, 1},
34979 {&__pyx_n_u_SubElement, __pyx_k_SubElement, sizeof(__pyx_k_SubElement), 0, 1, 0, 1},
34980 {&__pyx_n_u_TREE, __pyx_k_TREE, sizeof(__pyx_k_TREE), 0, 1, 0, 1},
34981 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
34982 {&__pyx_kp_u_Type_check_function_must_be_call, __pyx_k_Type_check_function_must_be_call, sizeof(__pyx_k_Type_check_function_must_be_call), 0, 1, 0, 0},
34983 {&__pyx_kp_u_Type_name_must_be_a_string, __pyx_k_Type_name_must_be_a_string, sizeof(__pyx_k_Type_name_must_be_a_string), 0, 1, 0, 0},
34984 {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
34985 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
34986 {&__pyx_n_s_XML, __pyx_k_XML, sizeof(__pyx_k_XML), 0, 0, 1, 1},
34987 {&__pyx_n_u_XML, __pyx_k_XML, sizeof(__pyx_k_XML), 0, 1, 0, 1},
34988 {&__pyx_n_s_XMLParser, __pyx_k_XMLParser, sizeof(__pyx_k_XMLParser), 0, 0, 1, 1},
34989 {&__pyx_kp_u_XSD_types_require_the_XSD_namesp, __pyx_k_XSD_types_require_the_XSD_namesp, sizeof(__pyx_k_XSD_types_require_the_XSD_namesp), 0, 1, 0, 0},
34990 {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
34991 {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
34992 {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
34993 {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
34994 {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
34995 {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
34996 {&__pyx_kp_b__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 0, 0},
34997 {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
34998 {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
34999 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
35000 {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
35001 {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
35002 {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
35003 {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
35004 {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
35005 {&__pyx_n_s_addattr, __pyx_k_addattr, sizeof(__pyx_k_addattr), 0, 0, 1, 1},
35006 {&__pyx_n_s_addnext, __pyx_k_addnext, sizeof(__pyx_k_addnext), 0, 0, 1, 1},
35007 {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1},
35008 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
35009 {&__pyx_n_s_annotate, __pyx_k_annotate, sizeof(__pyx_k_annotate), 0, 0, 1, 1},
35010 {&__pyx_n_u_annotate, __pyx_k_annotate, sizeof(__pyx_k_annotate), 0, 1, 0, 1},
35011 {&__pyx_n_s_annotate_pytype, __pyx_k_annotate_pytype, sizeof(__pyx_k_annotate_pytype), 0, 0, 1, 1},
35012 {&__pyx_n_s_annotate_xsi, __pyx_k_annotate_xsi, sizeof(__pyx_k_annotate_xsi), 0, 0, 1, 1},
35013 {&__pyx_kp_u_argument_of_makeelement_paramete, __pyx_k_argument_of_makeelement_paramete, sizeof(__pyx_k_argument_of_makeelement_paramete), 0, 1, 0, 0},
35014 {&__pyx_kp_u_assignment_to_root_element_is_in, __pyx_k_assignment_to_root_element_is_in, sizeof(__pyx_k_assignment_to_root_element_is_in), 0, 1, 0, 0},
35015 {&__pyx_kp_u_attempt_to_assign_sequence_of_si, __pyx_k_attempt_to_assign_sequence_of_si, sizeof(__pyx_k_attempt_to_assign_sequence_of_si), 0, 1, 0, 0},
35016 {&__pyx_n_s_attrib, __pyx_k_attrib, sizeof(__pyx_k_attrib), 0, 0, 1, 1},
35017 {&__pyx_kp_u_attribute, __pyx_k_attribute, sizeof(__pyx_k_attribute), 0, 1, 0, 0},
35018 {&__pyx_n_s_attribute_names, __pyx_k_attribute_names, sizeof(__pyx_k_attribute_names), 0, 0, 1, 1},
35019 {&__pyx_n_s_attribute_tag, __pyx_k_attribute_tag, sizeof(__pyx_k_attribute_tag), 0, 0, 1, 1},
35020 {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1},
35021 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
35022 {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
35023 {&__pyx_n_u_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 1, 0, 1},
35024 {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1},
35025 {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1},
35026 {&__pyx_n_u_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 0, 1},
35027 {&__pyx_n_u_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 1, 0, 1},
35028 {&__pyx_n_u_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 1, 0, 1},
35029 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
35030 {&__pyx_n_s_c_node, __pyx_k_c_node, sizeof(__pyx_k_c_node), 0, 0, 1, 1},
35031 {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
35032 {&__pyx_kp_u_cannot_update_root_node, __pyx_k_cannot_update_root_node, sizeof(__pyx_k_cannot_update_root_node), 0, 1, 0, 0},
35033 {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
35034 {&__pyx_n_s_checkBool, __pyx_k_checkBool, sizeof(__pyx_k_checkBool), 0, 0, 1, 1},
35035 {&__pyx_n_s_cleanup_namespaces, __pyx_k_cleanup_namespaces, sizeof(__pyx_k_cleanup_namespaces), 0, 0, 1, 1},
35036 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
35037 {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
35038 {&__pyx_n_s_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 0, 1, 1},
35039 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
35040 {&__pyx_n_s_copy_reg, __pyx_k_copy_reg, sizeof(__pyx_k_copy_reg), 0, 0, 1, 1},
35041 {&__pyx_n_s_copyreg, __pyx_k_copyreg, sizeof(__pyx_k_copyreg), 0, 0, 1, 1},
35042 {&__pyx_n_s_countchildren, __pyx_k_countchildren, sizeof(__pyx_k_countchildren), 0, 0, 1, 1},
35043 {&__pyx_kp_u_creating_indexed_path_attributes, __pyx_k_creating_indexed_path_attributes, sizeof(__pyx_k_creating_indexed_path_attributes), 0, 1, 0, 0},
35044 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
35045 {&__pyx_n_s_deannotate, __pyx_k_deannotate, sizeof(__pyx_k_deannotate), 0, 0, 1, 1},
35046 {&__pyx_n_u_deannotate, __pyx_k_deannotate, sizeof(__pyx_k_deannotate), 0, 1, 0, 1},
35047 {&__pyx_kp_u_deleting_items_not_supported_by, __pyx_k_deleting_items_not_supported_by, sizeof(__pyx_k_deleting_items_not_supported_by), 0, 1, 0, 0},
35048 {&__pyx_n_s_descendantpaths, __pyx_k_descendantpaths, sizeof(__pyx_k_descendantpaths), 0, 0, 1, 1},
35049 {&__pyx_n_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 1},
35050 {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
35051 {&__pyx_n_u_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 1, 0, 1},
35052 {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
35053 {&__pyx_n_s_element_or_tree, __pyx_k_element_or_tree, sizeof(__pyx_k_element_or_tree), 0, 0, 1, 1},
35054 {&__pyx_n_s_empty_data_class, __pyx_k_empty_data_class, sizeof(__pyx_k_empty_data_class), 0, 0, 1, 1},
35055 {&__pyx_n_s_empty_pytype, __pyx_k_empty_pytype, sizeof(__pyx_k_empty_pytype), 0, 0, 1, 1},
35056 {&__pyx_n_s_empty_type, __pyx_k_empty_type, sizeof(__pyx_k_empty_type), 0, 0, 1, 1},
35057 {&__pyx_n_s_enable_recursive_str, __pyx_k_enable_recursive_str, sizeof(__pyx_k_enable_recursive_str), 0, 0, 1, 1},
35058 {&__pyx_n_u_enable_recursive_str, __pyx_k_enable_recursive_str, sizeof(__pyx_k_enable_recursive_str), 0, 1, 0, 1},
35059 {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
35060 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
35061 {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1},
35062 {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
35063 {&__pyx_n_s_etree, __pyx_k_etree, sizeof(__pyx_k_etree), 0, 0, 1, 1},
35064 {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
35065 {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1},
35066 {&__pyx_n_u_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 1, 0, 1},
35067 {&__pyx_n_s_first_pos, __pyx_k_first_pos, sizeof(__pyx_k_first_pos), 0, 0, 1, 1},
35068 {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
35069 {&__pyx_n_s_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 0, 1, 1},
35070 {&__pyx_n_u_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 1, 0, 1},
35071 {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1},
35072 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
35073 {&__pyx_n_s_getRegisteredTypes, __pyx_k_getRegisteredTypes, sizeof(__pyx_k_getRegisteredTypes), 0, 0, 1, 1},
35074 {&__pyx_n_u_getRegisteredTypes, __pyx_k_getRegisteredTypes, sizeof(__pyx_k_getRegisteredTypes), 0, 1, 0, 1},
35075 {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
35076 {&__pyx_n_s_getchildren, __pyx_k_getchildren, sizeof(__pyx_k_getchildren), 0, 0, 1, 1},
35077 {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
35078 {&__pyx_n_s_getparent, __pyx_k_getparent, sizeof(__pyx_k_getparent), 0, 0, 1, 1},
35079 {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
35080 {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
35081 {&__pyx_n_s_hasattr, __pyx_k_hasattr, sizeof(__pyx_k_hasattr), 0, 0, 1, 1},
35082 {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
35083 {&__pyx_kp_u_http_codespeak_net_lxml_objectif, __pyx_k_http_codespeak_net_lxml_objectif, sizeof(__pyx_k_http_codespeak_net_lxml_objectif), 0, 1, 0, 0},
35084 {&__pyx_kp_u_http_www_w3_org_2001_XMLSchema, __pyx_k_http_www_w3_org_2001_XMLSchema, sizeof(__pyx_k_http_www_w3_org_2001_XMLSchema), 0, 1, 0, 0},
35085 {&__pyx_kp_u_http_www_w3_org_2001_XMLSchema_i, __pyx_k_http_www_w3_org_2001_XMLSchema_i, sizeof(__pyx_k_http_www_w3_org_2001_XMLSchema_i), 0, 1, 0, 0},
35086 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
35087 {&__pyx_n_s_ignore_old, __pyx_k_ignore_old, sizeof(__pyx_k_ignore_old), 0, 0, 1, 1},
35088 {&__pyx_n_s_ignore_pytype, __pyx_k_ignore_pytype, sizeof(__pyx_k_ignore_pytype), 0, 0, 1, 1},
35089 {&__pyx_n_s_ignore_xsi, __pyx_k_ignore_xsi, sizeof(__pyx_k_ignore_xsi), 0, 0, 1, 1},
35090 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
35091 {&__pyx_kp_u_inconsistent_before_after_depend, __pyx_k_inconsistent_before_after_depend, sizeof(__pyx_k_inconsistent_before_after_depend), 0, 1, 0, 0},
35092 {&__pyx_kp_u_index_must_be_enclosed_in, __pyx_k_index_must_be_enclosed_in, sizeof(__pyx_k_index_must_be_enclosed_in), 0, 1, 0, 0},
35093 {&__pyx_kp_u_index_not_allowed_on_root_node, __pyx_k_index_not_allowed_on_root_node, sizeof(__pyx_k_index_not_allowed_on_root_node), 0, 1, 0, 0},
35094 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
35095 {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1},
35096 {&__pyx_n_u_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 1, 0, 1},
35097 {&__pyx_kp_u_invalid_number_of_arguments_need, __pyx_k_invalid_number_of_arguments_need, sizeof(__pyx_k_invalid_number_of_arguments_need), 0, 1, 0, 0},
35098 {&__pyx_kp_u_invalid_path, __pyx_k_invalid_path, sizeof(__pyx_k_invalid_path), 0, 1, 0, 0},
35099 {&__pyx_kp_u_invalid_types_for_operator, __pyx_k_invalid_types_for_operator, sizeof(__pyx_k_invalid_types_for_operator), 0, 1, 0, 0},
35100 {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
35101 {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
35102 {&__pyx_n_s_iterchildren, __pyx_k_iterchildren, sizeof(__pyx_k_iterchildren), 0, 0, 1, 1},
35103 {&__pyx_n_s_known, __pyx_k_known, sizeof(__pyx_k_known), 0, 0, 1, 1},
35104 {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
35105 {&__pyx_n_u_language, __pyx_k_language, sizeof(__pyx_k_language), 0, 1, 0, 1},
35106 {&__pyx_n_s_last_pos, __pyx_k_last_pos, sizeof(__pyx_k_last_pos), 0, 0, 1, 1},
35107 {&__pyx_n_u_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 1, 0, 1},
35108 {&__pyx_n_s_lower_bool, __pyx_k_lower_bool, sizeof(__pyx_k_lower_bool), 0, 0, 1, 1},
35109 {&__pyx_n_s_lxml, __pyx_k_lxml, sizeof(__pyx_k_lxml), 0, 0, 1, 1},
35110 {&__pyx_n_s_lxml_objectify, __pyx_k_lxml_objectify, sizeof(__pyx_k_lxml_objectify), 0, 0, 1, 1},
35111 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
35112 {&__pyx_n_s_makeelement, __pyx_k_makeelement, sizeof(__pyx_k_makeelement), 0, 0, 1, 1},
35113 {&__pyx_n_s_makeparser, __pyx_k_makeparser, sizeof(__pyx_k_makeparser), 0, 0, 1, 1},
35114 {&__pyx_n_u_makeparser, __pyx_k_makeparser, sizeof(__pyx_k_makeparser), 0, 1, 0, 1},
35115 {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
35116 {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
35117 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
35118 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
35119 {&__pyx_n_s_namespace, __pyx_k_namespace, sizeof(__pyx_k_namespace), 0, 0, 1, 1},
35120 {&__pyx_n_u_negativeInteger, __pyx_k_negativeInteger, sizeof(__pyx_k_negativeInteger), 0, 1, 0, 1},
35121 {&__pyx_n_s_new_parser, __pyx_k_new_parser, sizeof(__pyx_k_new_parser), 0, 0, 1, 1},
35122 {&__pyx_kp_u_no_such_child, __pyx_k_no_such_child, sizeof(__pyx_k_no_such_child), 0, 1, 0, 0},
35123 {&__pyx_n_u_nonNegativeInteger, __pyx_k_nonNegativeInteger, sizeof(__pyx_k_nonNegativeInteger), 0, 1, 0, 1},
35124 {&__pyx_n_u_nonPositiveInteger, __pyx_k_nonPositiveInteger, sizeof(__pyx_k_nonPositiveInteger), 0, 1, 0, 1},
35125 {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1},
35126 {&__pyx_n_u_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 1, 0, 1},
35127 {&__pyx_n_u_normalizedString, __pyx_k_normalizedString, sizeof(__pyx_k_normalizedString), 0, 1, 0, 1},
35128 {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1},
35129 {&__pyx_n_s_nsmap, __pyx_k_nsmap, sizeof(__pyx_k_nsmap), 0, 0, 1, 1},
35130 {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
35131 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
35132 {&__pyx_kp_u_objects_is_not_writable, __pyx_k_objects_is_not_writable, sizeof(__pyx_k_objects_is_not_writable), 0, 1, 0, 0},
35133 {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1},
35134 {&__pyx_kp_u_of, __pyx_k_of, sizeof(__pyx_k_of), 0, 1, 0, 0},
35135 {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1},
35136 {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
35137 {&__pyx_n_u_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 1, 0, 1},
35138 {&__pyx_n_s_parseBool, __pyx_k_parseBool, sizeof(__pyx_k_parseBool), 0, 0, 1, 1},
35139 {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
35140 {&__pyx_kp_u_parser_must_inherit_from_lxml_et, __pyx_k_parser_must_inherit_from_lxml_et, sizeof(__pyx_k_parser_must_inherit_from_lxml_et), 0, 1, 0, 0},
35141 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
35142 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
35143 {&__pyx_n_s_pickleReduceElementTree, __pyx_k_pickleReduceElementTree, sizeof(__pyx_k_pickleReduceElementTree), 0, 0, 1, 1},
35144 {&__pyx_n_u_positiveInteger, __pyx_k_positiveInteger, sizeof(__pyx_k_positiveInteger), 0, 1, 0, 1},
35145 {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
35146 {&__pyx_kp_u_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 1, 0, 0},
35147 {&__pyx_n_s_py_2, __pyx_k_py_2, sizeof(__pyx_k_py_2), 0, 0, 1, 1},
35148 {&__pyx_n_s_py_type, __pyx_k_py_type, sizeof(__pyx_k_py_type), 0, 0, 1, 1},
35149 {&__pyx_n_s_pyannotate, __pyx_k_pyannotate, sizeof(__pyx_k_pyannotate), 0, 0, 1, 1},
35150 {&__pyx_n_u_pyannotate, __pyx_k_pyannotate, sizeof(__pyx_k_pyannotate), 0, 1, 0, 1},
35151 {&__pyx_n_s_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 0, 1, 1},
35152 {&__pyx_n_u_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 1, 0, 1},
35153 {&__pyx_n_s_pytype_2, __pyx_k_pytype_2, sizeof(__pyx_k_pytype_2), 0, 0, 1, 1},
35154 {&__pyx_n_s_pytypename, __pyx_k_pytypename, sizeof(__pyx_k_pytypename), 0, 0, 1, 1},
35155 {&__pyx_n_u_pytypename, __pyx_k_pytypename, sizeof(__pyx_k_pytypename), 0, 1, 0, 1},
35156 {&__pyx_n_s_pyval, __pyx_k_pyval, sizeof(__pyx_k_pyval), 0, 0, 1, 1},
35157 {&__pyx_n_u_pyval, __pyx_k_pyval, sizeof(__pyx_k_pyval), 0, 1, 0, 1},
35158 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
35159 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
35160 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
35161 {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
35162 {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
35163 {&__pyx_n_s_remove_blank_text, __pyx_k_remove_blank_text, sizeof(__pyx_k_remove_blank_text), 0, 0, 1, 1},
35164 {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
35165 {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
35166 {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
35167 {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
35168 {&__pyx_kp_u_root_element_does_not_match_need, __pyx_k_root_element_does_not_match_need, sizeof(__pyx_k_root_element_does_not_match_need), 0, 1, 0, 0},
35169 {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
35170 {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
35171 {&__pyx_n_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 1},
35172 {&__pyx_kp_u_s_nil, __pyx_k_s_nil, sizeof(__pyx_k_s_nil), 0, 1, 0, 0},
35173 {&__pyx_kp_u_s_s_s_s_s_0_9_s, __pyx_k_s_s_s_s_s_0_9_s, sizeof(__pyx_k_s_s_s_s_s_0_9_s), 0, 1, 0, 0},
35174 {&__pyx_kp_u_s_type, __pyx_k_s_type, sizeof(__pyx_k_s_type), 0, 1, 0, 0},
35175 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
35176 {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
35177 {&__pyx_n_s_setText, __pyx_k_setText, sizeof(__pyx_k_setText), 0, 0, 1, 1},
35178 {&__pyx_n_s_setValueParser, __pyx_k_setValueParser, sizeof(__pyx_k_setValueParser), 0, 0, 1, 1},
35179 {&__pyx_n_s_set_default_parser, __pyx_k_set_default_parser, sizeof(__pyx_k_set_default_parser), 0, 0, 1, 1},
35180 {&__pyx_n_u_set_default_parser, __pyx_k_set_default_parser, sizeof(__pyx_k_set_default_parser), 0, 1, 0, 1},
35181 {&__pyx_n_s_set_element_class_lookup, __pyx_k_set_element_class_lookup, sizeof(__pyx_k_set_element_class_lookup), 0, 0, 1, 1},
35182 {&__pyx_n_s_set_pytype_attribute_tag, __pyx_k_set_pytype_attribute_tag, sizeof(__pyx_k_set_pytype_attribute_tag), 0, 0, 1, 1},
35183 {&__pyx_n_u_set_pytype_attribute_tag, __pyx_k_set_pytype_attribute_tag, sizeof(__pyx_k_set_pytype_attribute_tag), 0, 1, 0, 1},
35184 {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
35185 {&__pyx_n_u_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 1, 0, 1},
35186 {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
35187 {&__pyx_kp_s_src_lxml_objectify_pyx, __pyx_k_src_lxml_objectify_pyx, sizeof(__pyx_k_src_lxml_objectify_pyx), 0, 0, 1, 0},
35188 {&__pyx_kp_s_src_lxml_objectpath_pxi, __pyx_k_src_lxml_objectpath_pxi, sizeof(__pyx_k_src_lxml_objectpath_pxi), 0, 0, 1, 0},
35189 {&__pyx_n_u_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 1, 0, 1},
35190 {&__pyx_n_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 1},
35191 {&__pyx_n_s_stringify, __pyx_k_stringify, sizeof(__pyx_k_stringify), 0, 0, 1, 1},
35192 {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
35193 {&__pyx_n_s_strip_attributes, __pyx_k_strip_attributes, sizeof(__pyx_k_strip_attributes), 0, 0, 1, 1},
35194 {&__pyx_n_s_strlen, __pyx_k_strlen, sizeof(__pyx_k_strlen), 0, 0, 1, 1},
35195 {&__pyx_n_s_strval, __pyx_k_strval, sizeof(__pyx_k_strval), 0, 0, 1, 1},
35196 {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
35197 {&__pyx_n_u_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 1, 0, 1},
35198 {&__pyx_n_s_tag_2, __pyx_k_tag_2, sizeof(__pyx_k_tag_2), 0, 0, 1, 1},
35199 {&__pyx_n_u_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 1, 0, 1},
35200 {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
35201 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
35202 {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
35203 {&__pyx_n_u_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 1, 0, 1},
35204 {&__pyx_kp_u_to_extended_slice_of_size, __pyx_k_to_extended_slice_of_size, sizeof(__pyx_k_to_extended_slice_of_size), 0, 1, 0, 0},
35205 {&__pyx_n_u_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 1, 0, 1},
35206 {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
35207 {&__pyx_n_s_tree_class, __pyx_k_tree_class, sizeof(__pyx_k_tree_class), 0, 0, 1, 1},
35208 {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1},
35209 {&__pyx_n_u_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 1, 0, 1},
35210 {&__pyx_n_s_type_check, __pyx_k_type_check, sizeof(__pyx_k_type_check), 0, 0, 1, 1},
35211 {&__pyx_n_s_type_class, __pyx_k_type_class, sizeof(__pyx_k_type_class), 0, 0, 1, 1},
35212 {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
35213 {&__pyx_kp_s_unicode_escape, __pyx_k_unicode_escape, sizeof(__pyx_k_unicode_escape), 0, 0, 1, 0},
35214 {&__pyx_n_s_unpickleElementTree, __pyx_k_unpickleElementTree, sizeof(__pyx_k_unpickleElementTree), 0, 0, 1, 1},
35215 {&__pyx_n_s_unregister, __pyx_k_unregister, sizeof(__pyx_k_unregister), 0, 0, 1, 1},
35216 {&__pyx_n_u_unsignedByte, __pyx_k_unsignedByte, sizeof(__pyx_k_unsignedByte), 0, 1, 0, 1},
35217 {&__pyx_n_u_unsignedInt, __pyx_k_unsignedInt, sizeof(__pyx_k_unsignedInt), 0, 1, 0, 1},
35218 {&__pyx_n_u_unsignedLong, __pyx_k_unsignedLong, sizeof(__pyx_k_unsignedLong), 0, 1, 0, 1},
35219 {&__pyx_n_u_unsignedShort, __pyx_k_unsignedShort, sizeof(__pyx_k_unsignedShort), 0, 1, 0, 1},
35220 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
35221 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
35222 {&__pyx_n_u_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 1, 0, 1},
35223 {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1},
35224 {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
35225 {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
35226 {&__pyx_n_s_xml, __pyx_k_xml, sizeof(__pyx_k_xml), 0, 0, 1, 1},
35227 {&__pyx_n_s_xmlSchemaTypes, __pyx_k_xmlSchemaTypes, sizeof(__pyx_k_xmlSchemaTypes), 0, 0, 1, 1},
35228 {&__pyx_n_s_xs_type, __pyx_k_xs_type, sizeof(__pyx_k_xs_type), 0, 0, 1, 1},
35229 {&__pyx_kp_u_xsd, __pyx_k_xsd, sizeof(__pyx_k_xsd), 0, 1, 0, 0},
35230 {&__pyx_n_s_xsd_2, __pyx_k_xsd_2, sizeof(__pyx_k_xsd_2), 0, 0, 1, 1},
35231 {&__pyx_kp_u_xsi, __pyx_k_xsi, sizeof(__pyx_k_xsi), 0, 1, 0, 0},
35232 {&__pyx_n_s_xsi_2, __pyx_k_xsi_2, sizeof(__pyx_k_xsi_2), 0, 0, 1, 1},
35233 {&__pyx_n_s_xsi_3, __pyx_k_xsi_3, sizeof(__pyx_k_xsi_3), 0, 0, 1, 1},
35234 {&__pyx_n_s_xsi_nil, __pyx_k_xsi_nil, sizeof(__pyx_k_xsi_nil), 0, 0, 1, 1},
35235 {&__pyx_n_s_xsiannotate, __pyx_k_xsiannotate, sizeof(__pyx_k_xsiannotate), 0, 0, 1, 1},
35236 {&__pyx_n_u_xsiannotate, __pyx_k_xsiannotate, sizeof(__pyx_k_xsiannotate), 0, 1, 0, 1},
35237 {0, 0, 0, 0, 0, 0, 0}
35239 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
35240 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 44, __pyx_L1_error)
35241 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 44, __pyx_L1_error)
35242 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 10, __pyx_L1_error)
35243 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 299, __pyx_L1_error)
35244 __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 450, __pyx_L1_error)
35245 __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) __PYX_ERR(0, 644, __pyx_L1_error)
35246 __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 647, __pyx_L1_error)
35247 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 973, __pyx_L1_error)
35248 __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 1011, __pyx_L1_error)
35249 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 169, __pyx_L1_error)
35255 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
35256 __Pyx_RefNannyDeclarations
35257 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
35259 /* "lxml/objectify.pyx":467
35260 * new_element.tag = element.tag
35261 * elif isinstance(value, (list, tuple)):
35262 * element[:] = value # <<<<<<<<<<<<<<
35266 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 467, __pyx_L1_error)
35267 __Pyx_GOTREF(__pyx_slice__3);
35268 __Pyx_GIVEREF(__pyx_slice__3);
35270 /* "lxml/objectify.pyx":1033
35271 * cdef _registerPyTypes():
35272 * pytype = PyType(u'int', int, IntElement)
35273 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort", # <<<<<<<<<<<<<<
35274 * u"unsignedByte", u"nonPositiveInteger",
35275 * u"negativeInteger", u"long", u"nonNegativeInteger",
35277 __pyx_tuple__5 = PyTuple_Pack(13, __pyx_n_u_integer, __pyx_n_u_int, __pyx_n_u_short, __pyx_n_u_byte, __pyx_n_u_unsignedShort, __pyx_n_u_unsignedByte, __pyx_n_u_nonPositiveInteger, __pyx_n_u_negativeInteger, __pyx_n_u_long, __pyx_n_u_nonNegativeInteger, __pyx_n_u_unsignedLong, __pyx_n_u_unsignedInt, __pyx_n_u_positiveInteger); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1033, __pyx_L1_error)
35278 __Pyx_GOTREF(__pyx_tuple__5);
35279 __Pyx_GIVEREF(__pyx_tuple__5);
35281 /* "lxml/objectify.pyx":1044
35283 * pytype = PyType(u'float', float, FloatElement, repr)
35284 * pytype.xmlSchemaTypes = (u"double", u"float") # <<<<<<<<<<<<<<
35285 * pytype.register()
35288 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_u_double, __pyx_n_u_float); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1044, __pyx_L1_error)
35289 __Pyx_GOTREF(__pyx_tuple__6);
35290 __Pyx_GIVEREF(__pyx_tuple__6);
35292 /* "lxml/objectify.pyx":1048
35294 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
35295 * pytype.xmlSchemaTypes = (u"boolean",) # <<<<<<<<<<<<<<
35296 * pytype.register()
35299 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_u_boolean); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1048, __pyx_L1_error)
35300 __Pyx_GOTREF(__pyx_tuple__7);
35301 __Pyx_GIVEREF(__pyx_tuple__7);
35303 /* "lxml/objectify.pyx":1052
35305 * pytype = PyType(u'str', None, StringElement)
35306 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language", # <<<<<<<<<<<<<<
35307 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
35310 __pyx_tuple__8 = PyTuple_Pack(10, __pyx_n_u_string, __pyx_n_u_normalizedString, __pyx_n_u_token, __pyx_n_u_language, __pyx_n_u_Name, __pyx_n_u_NCName, __pyx_n_u_ID, __pyx_n_u_IDREF, __pyx_n_u_ENTITY, __pyx_n_u_NMTOKEN); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1052, __pyx_L1_error)
35311 __Pyx_GOTREF(__pyx_tuple__8);
35312 __Pyx_GIVEREF(__pyx_tuple__8);
35314 /* "lxml/objectify.pyx":1349
35315 * result += _dump(child, indent)
35317 * return result[:-1] # strip last '\n' # <<<<<<<<<<<<<<
35321 __pyx_slice__16 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 1349, __pyx_L1_error)
35322 __Pyx_GOTREF(__pyx_slice__16);
35323 __Pyx_GIVEREF(__pyx_slice__16);
35325 /* "lxml/objectify.pyx":1430
35326 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
35327 * if schema_type is None and u':' in value:
35328 * prefix, value = value.split(u':', 1) # <<<<<<<<<<<<<<
35329 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
35330 * if schema_type is not None:
35332 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_kp_u__17, __pyx_int_1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1430, __pyx_L1_error)
35333 __Pyx_GOTREF(__pyx_tuple__18);
35334 __Pyx_GIVEREF(__pyx_tuple__18);
35336 /* "lxml/objectify.pyx":44
35339 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError) # <<<<<<<<<<<<<<
35340 * cdef object is_special_method = re.compile(u'__.*__$').match
35343 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_builtin_ValueError, __pyx_builtin_TypeError); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 44, __pyx_L1_error)
35344 __Pyx_GOTREF(__pyx_tuple__22);
35345 __Pyx_GIVEREF(__pyx_tuple__22);
35347 /* "lxml/objectify.pyx":45
35349 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
35350 * cdef object is_special_method = re.compile(u'__.*__$').match # <<<<<<<<<<<<<<
35354 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u__23); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 45, __pyx_L1_error)
35355 __Pyx_GOTREF(__pyx_tuple__24);
35356 __Pyx_GIVEREF(__pyx_tuple__24);
35358 /* "lxml/objectify.pyx":82
35359 * return s, python.PyUnicode_AsUTF8String(s)
35361 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
35362 * u"""set_pytype_attribute_tag(attribute_tag=None)
35363 * Change name and namespace of the XML attribute that holds Python type
35365 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_attribute_tag); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 82, __pyx_L1_error)
35366 __Pyx_GOTREF(__pyx_tuple__25);
35367 __Pyx_GIVEREF(__pyx_tuple__25);
35368 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_pytype_attribute_tag, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 82, __pyx_L1_error)
35369 __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 82, __pyx_L1_error)
35370 __Pyx_GOTREF(__pyx_tuple__27);
35371 __Pyx_GIVEREF(__pyx_tuple__27);
35373 /* "lxml/objectify.pyx":162
35375 * # pickle support for objectified Element
35376 * def __reduce__(self): # <<<<<<<<<<<<<<
35377 * return fromstring, (etree.tostring(self),)
35380 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 162, __pyx_L1_error)
35381 __Pyx_GOTREF(__pyx_tuple__28);
35382 __Pyx_GIVEREF(__pyx_tuple__28);
35383 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_reduce, 162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 162, __pyx_L1_error)
35385 /* "lxml/objectify.pyx":193
35386 * return _countSiblings(self._c_node)
35388 * def countchildren(self): # <<<<<<<<<<<<<<
35389 * u"""countchildren(self)
35392 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 193, __pyx_L1_error)
35393 __Pyx_GOTREF(__pyx_tuple__30);
35394 __Pyx_GIVEREF(__pyx_tuple__30);
35395 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_countchildren, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 193, __pyx_L1_error)
35397 /* "lxml/objectify.pyx":210
35400 * def getchildren(self): # <<<<<<<<<<<<<<
35401 * u"""getchildren(self)
35404 __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_c_node, __pyx_n_s_result); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 210, __pyx_L1_error)
35405 __Pyx_GOTREF(__pyx_tuple__32);
35406 __Pyx_GIVEREF(__pyx_tuple__32);
35407 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getchildren, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 210, __pyx_L1_error)
35409 /* "lxml/objectify.pyx":263
35410 * self.remove(child)
35412 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
35413 * u"""addattr(self, tag, value)
35416 __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 263, __pyx_L1_error)
35417 __Pyx_GOTREF(__pyx_tuple__34);
35418 __Pyx_GIVEREF(__pyx_tuple__34);
35419 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_addattr, 263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 263, __pyx_L1_error)
35421 /* "lxml/objectify.pyx":369
35422 * parent.remove(sibling)
35424 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
35425 * u"""descendantpaths(self, prefix=None)
35428 __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 369, __pyx_L1_error)
35429 __Pyx_GOTREF(__pyx_tuple__36);
35430 __Pyx_GIVEREF(__pyx_tuple__36);
35431 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_descendantpaths, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 369, __pyx_L1_error)
35433 /* "lxml/objectify.pyx":606
35434 * return strrepr(textOf(self._c_node) or '')
35436 * def _setText(self, s): # <<<<<<<<<<<<<<
35437 * u"""For use in subclasses only. Don't use unless you know what you are
35440 __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 606, __pyx_L1_error)
35441 __Pyx_GOTREF(__pyx_tuple__38);
35442 __Pyx_GIVEREF(__pyx_tuple__38);
35443 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setText, 606, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 606, __pyx_L1_error)
35445 /* "lxml/objectify.pyx":614
35446 * cdef class NumberElement(ObjectifiedDataElement):
35447 * cdef object _parse_value
35448 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
35449 * u"""Set the function that parses the Python value from a string.
35452 __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_function); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 614, __pyx_L1_error)
35453 __Pyx_GOTREF(__pyx_tuple__40);
35454 __Pyx_GIVEREF(__pyx_tuple__40);
35455 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_setValueParser, 614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 614, __pyx_L1_error)
35457 /* "lxml/objectify.pyx":634
35458 * return float(_parseNumber(self))
35460 * def __complex__(self): # <<<<<<<<<<<<<<
35461 * return complex(_parseNumber(self))
35464 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 634, __pyx_L1_error)
35465 __Pyx_GOTREF(__pyx_tuple__42);
35466 __Pyx_GIVEREF(__pyx_tuple__42);
35467 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 634, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 634, __pyx_L1_error)
35469 /* "lxml/objectify.pyx":710
35471 * cdef class IntElement(NumberElement):
35472 * def _init(self): # <<<<<<<<<<<<<<
35473 * self._parse_value = int
35476 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 710, __pyx_L1_error)
35477 __Pyx_GOTREF(__pyx_tuple__44);
35478 __Pyx_GIVEREF(__pyx_tuple__44);
35479 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 710, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 710, __pyx_L1_error)
35481 /* "lxml/objectify.pyx":717
35483 * cdef class LongElement(NumberElement):
35484 * def _init(self): # <<<<<<<<<<<<<<
35485 * self._parse_value = long
35488 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 717, __pyx_L1_error)
35489 __Pyx_GOTREF(__pyx_tuple__46);
35490 __Pyx_GIVEREF(__pyx_tuple__46);
35491 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 717, __pyx_L1_error)
35493 /* "lxml/objectify.pyx":724
35495 * cdef class FloatElement(NumberElement):
35496 * def _init(self): # <<<<<<<<<<<<<<
35497 * self._parse_value = float
35500 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 724, __pyx_L1_error)
35501 __Pyx_GOTREF(__pyx_tuple__48);
35502 __Pyx_GIVEREF(__pyx_tuple__48);
35503 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 724, __pyx_L1_error)
35505 /* "lxml/objectify.pyx":741
35506 * return repr(textOf(self._c_node) or u'')
35508 * def strlen(self): # <<<<<<<<<<<<<<
35509 * text = textOf(self._c_node)
35512 __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_text); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 741, __pyx_L1_error)
35513 __Pyx_GOTREF(__pyx_tuple__50);
35514 __Pyx_GIVEREF(__pyx_tuple__50);
35515 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_strlen, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 741, __pyx_L1_error)
35517 /* "lxml/objectify.pyx":786
35518 * return float(textOf(self._c_node))
35520 * def __complex__(self): # <<<<<<<<<<<<<<
35521 * return complex(textOf(self._c_node))
35524 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 786, __pyx_L1_error)
35525 __Pyx_GOTREF(__pyx_tuple__52);
35526 __Pyx_GIVEREF(__pyx_tuple__52);
35527 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_complex, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 786, __pyx_L1_error)
35529 /* "lxml/objectify.pyx":821
35530 * Python's bool type.
35532 * def _init(self): # <<<<<<<<<<<<<<
35533 * self._parse_value = __parseBool
35536 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 821, __pyx_L1_error)
35537 __Pyx_GOTREF(__pyx_tuple__54);
35538 __Pyx_GIVEREF(__pyx_tuple__54);
35539 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_init, 821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 821, __pyx_L1_error)
35541 /* "lxml/objectify.pyx":843
35542 * return __parseBool(textOf(self._c_node))
35544 * def __checkBool(s): # <<<<<<<<<<<<<<
35545 * cdef int value = -1
35546 * if s is not None:
35548 __pyx_tuple__56 = PyTuple_Pack(2, __pyx_n_s_s_3, __pyx_n_s_value); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 843, __pyx_L1_error)
35549 __Pyx_GOTREF(__pyx_tuple__56);
35550 __Pyx_GIVEREF(__pyx_tuple__56);
35551 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_checkBool, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 843, __pyx_L1_error)
35553 /* "lxml/objectify.pyx":850
35556 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
35560 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 850, __pyx_L1_error)
35561 __Pyx_GOTREF(__pyx_tuple__58);
35562 __Pyx_GIVEREF(__pyx_tuple__58);
35563 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parseBool, 850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 850, __pyx_L1_error)
35565 /* "lxml/objectify.pyx":948
35566 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
35568 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
35569 * u"""register(self, before=None, after=None)
35572 __pyx_tuple__60 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_before, __pyx_n_s_after, __pyx_n_s_item, __pyx_n_s_entry, __pyx_n_s_first_pos, __pyx_n_s_last_pos, __pyx_n_s_i, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_xs_type); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 948, __pyx_L1_error)
35573 __Pyx_GOTREF(__pyx_tuple__60);
35574 __Pyx_GIVEREF(__pyx_tuple__60);
35575 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_register, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 948, __pyx_L1_error)
35577 /* "lxml/objectify.pyx":989
35578 * _SCHEMA_TYPE_DICT[xs_type] = self
35580 * def unregister(self): # <<<<<<<<<<<<<<
35581 * u"unregister(self)"
35582 * if _PYTYPE_DICT.get(self.name) is self:
35584 __pyx_tuple__62 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_xs_type, __pyx_n_s_pytype); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 989, __pyx_L1_error)
35585 __Pyx_GOTREF(__pyx_tuple__62);
35586 __Pyx_GIVEREF(__pyx_tuple__62);
35587 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unregister, 989, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 989, __pyx_L1_error)
35589 /* "lxml/objectify.pyx":1018
35590 * cdef list _TYPE_CHECKS = []
35592 * def __lower_bool(b): # <<<<<<<<<<<<<<
35593 * return u"true" if b else u"false"
35596 __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1018, __pyx_L1_error)
35597 __Pyx_GOTREF(__pyx_tuple__64);
35598 __Pyx_GIVEREF(__pyx_tuple__64);
35599 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_lower_bool, 1018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1018, __pyx_L1_error)
35601 /* "lxml/objectify.pyx":1024
35602 * return u"str" if python._isString(obj) else _typename(obj)
35604 * def pytypename(obj): # <<<<<<<<<<<<<<
35605 * u"""pytypename(obj)
35608 __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1024, __pyx_L1_error)
35609 __Pyx_GOTREF(__pyx_tuple__66);
35610 __Pyx_GIVEREF(__pyx_tuple__66);
35611 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pytypename, 1024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1024, __pyx_L1_error)
35613 /* "lxml/objectify.pyx":1070
35614 * _registerPyTypes()
35616 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
35617 * u"""getRegisteredTypes()
35620 __pyx_tuple__68 = PyTuple_Pack(5, __pyx_n_s_types, __pyx_n_s_known, __pyx_n_s_check, __pyx_n_s_pytype, __pyx_n_s_name); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1070, __pyx_L1_error)
35621 __Pyx_GOTREF(__pyx_tuple__68);
35622 __Pyx_GIVEREF(__pyx_tuple__68);
35623 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_getRegisteredTypes, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1070, __pyx_L1_error)
35625 /* "lxml/objectify.pyx":1305
35626 * cdef bint __RECURSIVE_STR = 0 # default: off
35628 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
35629 * u"""enable_recursive_str(on=True)
35632 __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1305, __pyx_L1_error)
35633 __Pyx_GOTREF(__pyx_tuple__70);
35634 __Pyx_GIVEREF(__pyx_tuple__70);
35635 __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_enable_recursive_str, 1305, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1305, __pyx_L1_error)
35636 __pyx_tuple__72 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1305, __pyx_L1_error)
35637 __Pyx_GOTREF(__pyx_tuple__72);
35638 __Pyx_GIVEREF(__pyx_tuple__72);
35640 /* "lxml/objectify.pyx":1314
35641 * __RECURSIVE_STR = on
35643 * def dump(_Element element not None): # <<<<<<<<<<<<<<
35644 * u"""dump(_Element element not None)
35647 __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1314, __pyx_L1_error)
35648 __Pyx_GOTREF(__pyx_tuple__73);
35649 __Pyx_GIVEREF(__pyx_tuple__73);
35650 __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_dump, 1314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1314, __pyx_L1_error)
35652 /* "lxml/objectify.pyx":1357
35653 * # Pickle support for objectified ElementTree
35655 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
35656 * return etree.ElementTree(fromstring(data))
35659 __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1357, __pyx_L1_error)
35660 __Pyx_GOTREF(__pyx_tuple__75);
35661 __Pyx_GIVEREF(__pyx_tuple__75);
35662 __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_unpickleElementTree, 1357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1357, __pyx_L1_error)
35664 /* "lxml/objectify.pyx":1368
35665 * elementTreeReduceFunction, __unpickleElementTree)
35667 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
35668 * return __unpickleElementTree, (etree.tostring(obj),)
35671 __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1368, __pyx_L1_error)
35672 __Pyx_GOTREF(__pyx_tuple__77);
35673 __Pyx_GIVEREF(__pyx_tuple__77);
35674 __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pickleReduceElementTree, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1368, __pyx_L1_error)
35676 /* "lxml/objectify.pyx":1462
35679 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
35680 * empty_pytype=None):
35681 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
35683 __pyx_tuple__79 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1462, __pyx_L1_error)
35684 __Pyx_GOTREF(__pyx_tuple__79);
35685 __Pyx_GIVEREF(__pyx_tuple__79);
35686 __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_pyannotate, 1462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1462, __pyx_L1_error)
35688 /* "lxml/objectify.pyx":1485
35689 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
35691 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
35692 * empty_type=None):
35693 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
35695 __pyx_tuple__81 = PyTuple_Pack(5, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_pytype, __pyx_n_s_empty_type, __pyx_n_s_element); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1485, __pyx_L1_error)
35696 __Pyx_GOTREF(__pyx_tuple__81);
35697 __Pyx_GIVEREF(__pyx_tuple__81);
35698 __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 3, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_xsiannotate, 1485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1485, __pyx_L1_error)
35700 /* "lxml/objectify.pyx":1513
35701 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
35703 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
35704 * empty_pytype=None, empty_type=None, annotate_xsi=0,
35705 * annotate_pytype=1):
35707 __pyx_tuple__83 = PyTuple_Pack(8, __pyx_n_s_element_or_tree, __pyx_n_s_ignore_old, __pyx_n_s_ignore_xsi, __pyx_n_s_empty_pytype, __pyx_n_s_empty_type, __pyx_n_s_annotate_xsi, __pyx_n_s_annotate_pytype, __pyx_n_s_element); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1513, __pyx_L1_error)
35708 __Pyx_GOTREF(__pyx_tuple__83);
35709 __Pyx_GIVEREF(__pyx_tuple__83);
35710 __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 6, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_annotate, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1513, __pyx_L1_error)
35712 /* "lxml/objectify.pyx":1709
35713 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
35715 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
35716 * bint xsi_nil=False, bint cleanup_namespaces=False):
35717 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
35719 __pyx_tuple__85 = PyTuple_Pack(6, __pyx_n_s_element_or_tree, __pyx_n_s_pytype, __pyx_n_s_xsi_2, __pyx_n_s_xsi_nil, __pyx_n_s_cleanup_namespaces, __pyx_n_s_attribute_names); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 1709, __pyx_L1_error)
35720 __Pyx_GOTREF(__pyx_tuple__85);
35721 __Pyx_GIVEREF(__pyx_tuple__85);
35722 __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 4, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_deannotate, 1709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 1709, __pyx_L1_error)
35724 /* "lxml/objectify.pyx":1749
35725 * objectify_parser = __DEFAULT_PARSER
35727 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
35728 * u"""set_default_parser(new_parser = None)
35731 __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_new_parser); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1749, __pyx_L1_error)
35732 __Pyx_GOTREF(__pyx_tuple__87);
35733 __Pyx_GIVEREF(__pyx_tuple__87);
35734 __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_set_default_parser, 1749, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 1749, __pyx_L1_error)
35735 __pyx_tuple__89 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1749, __pyx_L1_error)
35736 __Pyx_GOTREF(__pyx_tuple__89);
35737 __Pyx_GIVEREF(__pyx_tuple__89);
35739 /* "lxml/objectify.pyx":1767
35740 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
35742 * def makeparser(**kw): # <<<<<<<<<<<<<<
35743 * u"""makeparser(remove_blank_text=True, **kw)
35746 __pyx_tuple__90 = PyTuple_Pack(2, __pyx_n_s_kw, __pyx_n_s_parser); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1767, __pyx_L1_error)
35747 __Pyx_GOTREF(__pyx_tuple__90);
35748 __Pyx_GIVEREF(__pyx_tuple__90);
35749 __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_makeparser, 1767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1767, __pyx_L1_error)
35751 /* "lxml/objectify.pyx":1794
35752 * SubElement = etree.SubElement
35754 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35755 * u"""fromstring(xml, parser=None, base_url=None)
35758 __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1794, __pyx_L1_error)
35759 __Pyx_GOTREF(__pyx_tuple__92);
35760 __Pyx_GIVEREF(__pyx_tuple__92);
35761 __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_fromstring, 1794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1794, __pyx_L1_error)
35762 __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1794, __pyx_L1_error)
35763 __Pyx_GOTREF(__pyx_tuple__94);
35764 __Pyx_GIVEREF(__pyx_tuple__94);
35766 /* "lxml/objectify.pyx":1810
35767 * return _fromstring(xml, parser, base_url=base_url)
35769 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35770 * u"""XML(xml, parser=None, base_url=None)
35773 __pyx_tuple__95 = PyTuple_Pack(3, __pyx_n_s_xml, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 1810, __pyx_L1_error)
35774 __Pyx_GOTREF(__pyx_tuple__95);
35775 __Pyx_GIVEREF(__pyx_tuple__95);
35776 __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_XML, 1810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 1810, __pyx_L1_error)
35777 __pyx_tuple__97 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1810, __pyx_L1_error)
35778 __Pyx_GOTREF(__pyx_tuple__97);
35779 __Pyx_GIVEREF(__pyx_tuple__97);
35781 /* "lxml/objectify.pyx":1829
35782 * _parse = etree.parse
35784 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35785 * u"""parse(f, parser=None, base_url=None)
35788 __pyx_tuple__98 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_parser, __pyx_n_s_base_url); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 1829, __pyx_L1_error)
35789 __Pyx_GOTREF(__pyx_tuple__98);
35790 __Pyx_GIVEREF(__pyx_tuple__98);
35791 __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_parse, 1829, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 1829, __pyx_L1_error)
35792 __pyx_tuple__100 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1829, __pyx_L1_error)
35793 __Pyx_GOTREF(__pyx_tuple__100);
35794 __Pyx_GIVEREF(__pyx_tuple__100);
35796 /* "lxml/objectify.pyx":1852
35797 * E = ElementMaker()
35799 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
35800 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
35803 __pyx_tuple__101 = PyTuple_Pack(5, __pyx_n_s_tag_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_attributes); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1852, __pyx_L1_error)
35804 __Pyx_GOTREF(__pyx_tuple__101);
35805 __Pyx_GIVEREF(__pyx_tuple__101);
35806 __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(3, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_Element, 1852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 1852, __pyx_L1_error)
35807 __pyx_tuple__103 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1852, __pyx_L1_error)
35808 __Pyx_GOTREF(__pyx_tuple__103);
35809 __Pyx_GIVEREF(__pyx_tuple__103);
35811 /* "lxml/objectify.pyx":1872
35812 * return _makeElement(_tag, None, _attributes, nsmap)
35814 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
35816 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
35818 __pyx_tuple__104 = PyTuple_Pack(13, __pyx_n_s_value_2, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_pytype_2, __pyx_n_s_xsi_3, __pyx_n_s_attributes, __pyx_n_s_temp, __pyx_n_s_prefix, __pyx_n_s_name, __pyx_n_s_ns, __pyx_n_s_py_type, __pyx_n_s_strval, __pyx_n_s_stringify); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 1872, __pyx_L1_error)
35819 __Pyx_GOTREF(__pyx_tuple__104);
35820 __Pyx_GIVEREF(__pyx_tuple__104);
35821 __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(3, 2, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectify_pyx, __pyx_n_s_DataElement, 1872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 1872, __pyx_L1_error)
35822 __pyx_tuple__106 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1872, __pyx_L1_error)
35823 __Pyx_GOTREF(__pyx_tuple__106);
35824 __Pyx_GIVEREF(__pyx_tuple__106);
35826 /* "src/lxml/objectpath.pxi":57
35827 * return _find_object_path(root, self._c_path, self._path_len, default)
35829 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
35830 * u"hasattr(self, root)"
35833 __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_root); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 57, __pyx_L1_error)
35834 __Pyx_GOTREF(__pyx_tuple__107);
35835 __Pyx_GIVEREF(__pyx_tuple__107);
35836 __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_hasattr, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(1, 57, __pyx_L1_error)
35838 /* "src/lxml/objectpath.pxi":65
35841 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
35842 * u"""setattr(self, root, value)
35845 __pyx_tuple__109 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 65, __pyx_L1_error)
35846 __Pyx_GOTREF(__pyx_tuple__109);
35847 __Pyx_GIVEREF(__pyx_tuple__109);
35848 __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_setattr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(1, 65, __pyx_L1_error)
35850 /* "src/lxml/objectpath.pxi":74
35851 * _create_object_path(root, self._c_path, self._path_len, 1, value)
35853 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
35854 * u"""addattr(self, root, value)
35857 __pyx_tuple__111 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_root, __pyx_n_s_value); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(1, 74, __pyx_L1_error)
35858 __Pyx_GOTREF(__pyx_tuple__111);
35859 __Pyx_GIVEREF(__pyx_tuple__111);
35860 __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_objectpath_pxi, __pyx_n_s_addattr, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(1, 74, __pyx_L1_error)
35862 /* "src/lxml/objectpath.pxi":88
35865 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0) # <<<<<<<<<<<<<<
35869 __pyx_tuple__113 = PyTuple_Pack(3, Py_None, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(1, 88, __pyx_L1_error)
35870 __Pyx_GOTREF(__pyx_tuple__113);
35871 __Pyx_GIVEREF(__pyx_tuple__113);
35872 __Pyx_RefNannyFinishContext();
35875 __Pyx_RefNannyFinishContext();
35879 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
35880 __pyx_umethod_PyBytes_Type_split.type = (PyObject*)&PyBytes_Type;
35881 __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
35882 __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
35883 __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
35884 __pyx_umethod_PyList_Type_remove.type = (PyObject*)&PyList_Type;
35885 __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type;
35886 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
35887 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
35888 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35889 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35895 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
35896 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
35897 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
35898 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
35899 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
35900 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
35901 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
35903 static int __Pyx_modinit_global_init_code(void) {
35904 __Pyx_RefNannyDeclarations
35905 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
35906 /*--- Global init code ---*/
35907 __pyx_v_4lxml_9objectify_etree = Py_None; Py_INCREF(Py_None);
35908 __pyx_v_4lxml_9objectify_re = Py_None; Py_INCREF(Py_None);
35909 __pyx_v_4lxml_9objectify_IGNORABLE_ERRORS = ((PyObject*)Py_None); Py_INCREF(Py_None);
35910 __pyx_v_4lxml_9objectify_is_special_method = Py_None; Py_INCREF(Py_None);
35911 __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE = Py_None; Py_INCREF(Py_None);
35912 __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
35913 __pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME = Py_None; Py_INCREF(Py_None);
35914 __pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
35915 __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME = ((PyObject*)Py_None); Py_INCREF(Py_None);
35916 __pyx_v_4lxml_9objectify_XML_SCHEMA_NS = Py_None; Py_INCREF(Py_None);
35917 __pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8 = Py_None; Py_INCREF(Py_None);
35918 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS = Py_None; Py_INCREF(Py_None);
35919 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8 = Py_None; Py_INCREF(Py_None);
35920 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR = Py_None; Py_INCREF(Py_None);
35921 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR = Py_None; Py_INCREF(Py_None);
35922 __pyx_v_4lxml_9objectify__PYTYPE_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35923 __pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35924 __pyx_v_4lxml_9objectify__TYPE_CHECKS = ((PyObject*)Py_None); Py_INCREF(Py_None);
35925 __pyx_v_4lxml_9objectify_TREE_PYTYPE = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); Py_INCREF(Py_None);
35926 __pyx_v_4lxml_9objectify__strip_attributes = Py_None; Py_INCREF(Py_None);
35927 __pyx_v_4lxml_9objectify__cleanup_namespaces = Py_None; Py_INCREF(Py_None);
35928 __pyx_v_4lxml_9objectify___DEFAULT_PARSER = Py_None; Py_INCREF(Py_None);
35929 __pyx_v_4lxml_9objectify_objectify_parser = Py_None; Py_INCREF(Py_None);
35930 __pyx_v_4lxml_9objectify__fromstring = Py_None; Py_INCREF(Py_None);
35931 __pyx_v_4lxml_9objectify__parse = Py_None; Py_INCREF(Py_None);
35932 __pyx_v_4lxml_9objectify__DEFAULT_NSMAP = ((PyObject*)Py_None); Py_INCREF(Py_None);
35933 __pyx_v_4lxml_9objectify__NO_DEFAULT = Py_None; Py_INCREF(Py_None);
35934 __pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT = Py_None; Py_INCREF(Py_None);
35935 __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35936 __Pyx_RefNannyFinishContext();
35940 static int __Pyx_modinit_variable_export_code(void) {
35941 __Pyx_RefNannyDeclarations
35942 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
35943 /*--- Variable export code ---*/
35944 __Pyx_RefNannyFinishContext();
35948 static int __Pyx_modinit_function_export_code(void) {
35949 __Pyx_RefNannyDeclarations
35950 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
35951 /*--- Function export code ---*/
35952 __Pyx_RefNannyFinishContext();
35956 static int __Pyx_modinit_type_init_code(void) {
35957 __Pyx_RefNannyDeclarations
35958 PyObject *__pyx_t_1 = NULL;
35959 int __pyx_lineno = 0;
35960 const char *__pyx_filename = NULL;
35961 int __pyx_clineno = 0;
35962 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
35963 /*--- Type init code ---*/
35964 __pyx_t_1 = PyImport_ImportModule("lxml.etree"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35965 __Pyx_GOTREF(__pyx_t_1);
35966 __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "ElementBase", sizeof(struct LxmlElementBase), __Pyx_ImportType_CheckSize_Warn);
35967 if (!__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase) __PYX_ERR(0, 1, __pyx_L1_error)
35968 __pyx_type_4lxml_9objectify_ObjectifiedElement.tp_base = __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase;
35969 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifiedElement) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
35970 #if PY_VERSION_HEX < 0x030800B1
35971 __pyx_type_4lxml_9objectify_ObjectifiedElement.tp_print = 0;
35973 #if CYTHON_COMPILING_IN_CPYTHON
35975 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
35976 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
35977 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
35978 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement___iter__;
35979 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__;
35983 #if CYTHON_COMPILING_IN_CPYTHON
35985 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
35986 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
35987 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
35988 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_6__len__;
35989 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__;
35993 #if CYTHON_COMPILING_IN_CPYTHON
35995 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__getattr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
35996 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
35997 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
35998 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
35999 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
36003 #if CYTHON_COMPILING_IN_CPYTHON
36005 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__setattr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36006 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36007 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36008 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
36009 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
36013 #if CYTHON_COMPILING_IN_CPYTHON
36015 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36016 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36017 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36018 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
36019 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
36023 #if CYTHON_COMPILING_IN_CPYTHON
36025 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36026 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36027 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36028 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
36029 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
36033 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifiedElement, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
36034 __pyx_ptype_4lxml_9objectify_ObjectifiedElement = &__pyx_type_4lxml_9objectify_ObjectifiedElement;
36035 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedElement;
36036 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifiedDataElement) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
36037 #if PY_VERSION_HEX < 0x030800B1
36038 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_print = 0;
36040 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_dictoffset && __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_getattro == PyObject_GenericGetAttr)) {
36041 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36043 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifiedDataElement, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedDataElement) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
36044 __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement = &__pyx_type_4lxml_9objectify_ObjectifiedDataElement;
36045 __pyx_type_4lxml_9objectify_NumberElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36046 if (PyType_Ready(&__pyx_type_4lxml_9objectify_NumberElement) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
36047 #if PY_VERSION_HEX < 0x030800B1
36048 __pyx_type_4lxml_9objectify_NumberElement.tp_print = 0;
36050 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_NumberElement.tp_dictoffset && __pyx_type_4lxml_9objectify_NumberElement.tp_getattro == PyObject_GenericGetAttr)) {
36051 __pyx_type_4lxml_9objectify_NumberElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36053 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumberElement, (PyObject *)&__pyx_type_4lxml_9objectify_NumberElement) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
36054 __pyx_ptype_4lxml_9objectify_NumberElement = &__pyx_type_4lxml_9objectify_NumberElement;
36055 __pyx_type_4lxml_9objectify_IntElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36056 if (PyType_Ready(&__pyx_type_4lxml_9objectify_IntElement) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
36057 #if PY_VERSION_HEX < 0x030800B1
36058 __pyx_type_4lxml_9objectify_IntElement.tp_print = 0;
36060 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_IntElement.tp_dictoffset && __pyx_type_4lxml_9objectify_IntElement.tp_getattro == PyObject_GenericGetAttr)) {
36061 __pyx_type_4lxml_9objectify_IntElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36063 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntElement, (PyObject *)&__pyx_type_4lxml_9objectify_IntElement) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
36064 __pyx_ptype_4lxml_9objectify_IntElement = &__pyx_type_4lxml_9objectify_IntElement;
36065 __pyx_type_4lxml_9objectify_LongElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36066 if (PyType_Ready(&__pyx_type_4lxml_9objectify_LongElement) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
36067 #if PY_VERSION_HEX < 0x030800B1
36068 __pyx_type_4lxml_9objectify_LongElement.tp_print = 0;
36070 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_LongElement.tp_dictoffset && __pyx_type_4lxml_9objectify_LongElement.tp_getattro == PyObject_GenericGetAttr)) {
36071 __pyx_type_4lxml_9objectify_LongElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36073 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LongElement, (PyObject *)&__pyx_type_4lxml_9objectify_LongElement) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
36074 __pyx_ptype_4lxml_9objectify_LongElement = &__pyx_type_4lxml_9objectify_LongElement;
36075 __pyx_type_4lxml_9objectify_FloatElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36076 if (PyType_Ready(&__pyx_type_4lxml_9objectify_FloatElement) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
36077 #if PY_VERSION_HEX < 0x030800B1
36078 __pyx_type_4lxml_9objectify_FloatElement.tp_print = 0;
36080 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_FloatElement.tp_dictoffset && __pyx_type_4lxml_9objectify_FloatElement.tp_getattro == PyObject_GenericGetAttr)) {
36081 __pyx_type_4lxml_9objectify_FloatElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36083 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatElement, (PyObject *)&__pyx_type_4lxml_9objectify_FloatElement) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
36084 __pyx_ptype_4lxml_9objectify_FloatElement = &__pyx_type_4lxml_9objectify_FloatElement;
36085 __pyx_type_4lxml_9objectify_StringElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36086 if (PyType_Ready(&__pyx_type_4lxml_9objectify_StringElement) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
36087 #if PY_VERSION_HEX < 0x030800B1
36088 __pyx_type_4lxml_9objectify_StringElement.tp_print = 0;
36090 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_StringElement.tp_dictoffset && __pyx_type_4lxml_9objectify_StringElement.tp_getattro == PyObject_GenericGetAttr)) {
36091 __pyx_type_4lxml_9objectify_StringElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36093 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringElement, (PyObject *)&__pyx_type_4lxml_9objectify_StringElement) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
36094 __pyx_ptype_4lxml_9objectify_StringElement = &__pyx_type_4lxml_9objectify_StringElement;
36095 __pyx_type_4lxml_9objectify_NoneElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36096 if (PyType_Ready(&__pyx_type_4lxml_9objectify_NoneElement) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
36097 #if PY_VERSION_HEX < 0x030800B1
36098 __pyx_type_4lxml_9objectify_NoneElement.tp_print = 0;
36100 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_NoneElement.tp_dictoffset && __pyx_type_4lxml_9objectify_NoneElement.tp_getattro == PyObject_GenericGetAttr)) {
36101 __pyx_type_4lxml_9objectify_NoneElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36103 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NoneElement, (PyObject *)&__pyx_type_4lxml_9objectify_NoneElement) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
36104 __pyx_ptype_4lxml_9objectify_NoneElement = &__pyx_type_4lxml_9objectify_NoneElement;
36105 __pyx_type_4lxml_9objectify_BoolElement.tp_base = __pyx_ptype_4lxml_9objectify_IntElement;
36106 if (PyType_Ready(&__pyx_type_4lxml_9objectify_BoolElement) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
36107 #if PY_VERSION_HEX < 0x030800B1
36108 __pyx_type_4lxml_9objectify_BoolElement.tp_print = 0;
36110 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_BoolElement.tp_dictoffset && __pyx_type_4lxml_9objectify_BoolElement.tp_getattro == PyObject_GenericGetAttr)) {
36111 __pyx_type_4lxml_9objectify_BoolElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36113 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoolElement, (PyObject *)&__pyx_type_4lxml_9objectify_BoolElement) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
36114 __pyx_ptype_4lxml_9objectify_BoolElement = &__pyx_type_4lxml_9objectify_BoolElement;
36115 if (PyType_Ready(&__pyx_type_4lxml_9objectify_PyType) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
36116 #if PY_VERSION_HEX < 0x030800B1
36117 __pyx_type_4lxml_9objectify_PyType.tp_print = 0;
36119 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_PyType.tp_dictoffset && __pyx_type_4lxml_9objectify_PyType.tp_getattro == PyObject_GenericGetAttr)) {
36120 __pyx_type_4lxml_9objectify_PyType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36122 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PyType, (PyObject *)&__pyx_type_4lxml_9objectify_PyType) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
36123 __pyx_ptype_4lxml_9objectify_PyType = &__pyx_type_4lxml_9objectify_PyType;
36124 if (PyType_Ready(&__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller) < 0) __PYX_ERR(0, 1131, __pyx_L1_error)
36125 #if PY_VERSION_HEX < 0x030800B1
36126 __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_print = 0;
36128 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_dictoffset && __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_getattro == PyObject_GenericGetAttr)) {
36129 __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36131 #if CYTHON_COMPILING_IN_CPYTHON
36133 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1131, __pyx_L1_error)
36134 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36135 __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36136 __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__.doc = __pyx_doc_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
36137 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
36141 __pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller = &__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller;
36142 __pyx_vtabptr_4lxml_9objectify_ElementMaker = &__pyx_vtable_4lxml_9objectify_ElementMaker;
36143 __pyx_vtable_4lxml_9objectify_ElementMaker._build_element_maker = (PyObject *(*)(struct __pyx_obj_4lxml_9objectify_ElementMaker *, PyObject *, int))__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker;
36144 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36145 #if PY_VERSION_HEX < 0x030800B1
36146 __pyx_type_4lxml_9objectify_ElementMaker.tp_print = 0;
36148 if (__Pyx_SetVtable(__pyx_type_4lxml_9objectify_ElementMaker.tp_dict, __pyx_vtabptr_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36149 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementMaker, (PyObject *)&__pyx_type_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36150 __pyx_ptype_4lxml_9objectify_ElementMaker = &__pyx_type_4lxml_9objectify_ElementMaker;
36151 __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "ElementClassLookup", sizeof(struct LxmlElementClassLookup), __Pyx_ImportType_CheckSize_Warn);
36152 if (!__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup) __PYX_ERR(0, 1, __pyx_L1_error)
36153 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_base = __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup;
36154 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
36155 #if PY_VERSION_HEX < 0x030800B1
36156 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_print = 0;
36158 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_dictoffset && __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
36159 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36161 #if CYTHON_COMPILING_IN_CPYTHON
36163 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1377, __pyx_L1_error)
36164 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36165 __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36166 __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__.doc = __pyx_doc_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
36167 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
36171 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifyElementClassLookup, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
36172 __pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup = &__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup;
36173 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectPath) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
36174 #if PY_VERSION_HEX < 0x030800B1
36175 __pyx_type_4lxml_9objectify_ObjectPath.tp_print = 0;
36177 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_9objectify_ObjectPath.tp_dictoffset && __pyx_type_4lxml_9objectify_ObjectPath.tp_getattro == PyObject_GenericGetAttr)) {
36178 __pyx_type_4lxml_9objectify_ObjectPath.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36180 #if CYTHON_COMPILING_IN_CPYTHON
36182 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectPath, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 13, __pyx_L1_error)
36183 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36184 __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36185 __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__.doc = __pyx_doc_4lxml_9objectify_10ObjectPath_6__call__;
36186 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__;
36190 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectPath, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectPath) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
36191 __pyx_ptype_4lxml_9objectify_ObjectPath = &__pyx_type_4lxml_9objectify_ObjectPath;
36192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36193 __Pyx_RefNannyFinishContext();
36196 __Pyx_XDECREF(__pyx_t_1);
36197 __Pyx_RefNannyFinishContext();
36201 static int __Pyx_modinit_type_import_code(void) {
36202 __Pyx_RefNannyDeclarations
36203 PyObject *__pyx_t_1 = NULL;
36204 int __pyx_lineno = 0;
36205 const char *__pyx_filename = NULL;
36206 int __pyx_clineno = 0;
36207 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
36208 /*--- Type import code ---*/
36209 __pyx_t_1 = PyImport_ImportModule("lxml.etree"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
36210 __Pyx_GOTREF(__pyx_t_1);
36211 __pyx_ptype_4lxml_8includes_11etreepublic__Document = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_Document", sizeof(struct LxmlDocument), __Pyx_ImportType_CheckSize_Warn);
36212 if (!__pyx_ptype_4lxml_8includes_11etreepublic__Document) __PYX_ERR(2, 30, __pyx_L1_error)
36213 __pyx_ptype_4lxml_8includes_11etreepublic__Element = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_Element", sizeof(struct LxmlElement), __Pyx_ImportType_CheckSize_Warn);
36214 if (!__pyx_ptype_4lxml_8includes_11etreepublic__Element) __PYX_ERR(2, 33, __pyx_L1_error)
36215 __pyx_ptype_4lxml_8includes_11etreepublic__ElementTree = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementTree", sizeof(struct LxmlElementTree), __Pyx_ImportType_CheckSize_Warn);
36216 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree) __PYX_ERR(2, 40, __pyx_L1_error)
36217 __pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "FallbackElementClassLookup", sizeof(struct LxmlFallbackElementClassLookup), __Pyx_ImportType_CheckSize_Warn);
36218 if (!__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup) __PYX_ERR(2, 47, __pyx_L1_error)
36219 __pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementTagMatcher", sizeof(struct LxmlElementTagMatcher), __Pyx_ImportType_CheckSize_Warn);
36220 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher) __PYX_ERR(2, 159, __pyx_L1_error)
36221 __pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementIterator", sizeof(struct LxmlElementIterator), __Pyx_ImportType_CheckSize_Warn);
36222 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator) __PYX_ERR(2, 168, __pyx_L1_error)
36223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36224 __Pyx_RefNannyFinishContext();
36227 __Pyx_XDECREF(__pyx_t_1);
36228 __Pyx_RefNannyFinishContext();
36232 static int __Pyx_modinit_variable_import_code(void) {
36233 __Pyx_RefNannyDeclarations
36234 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
36235 /*--- Variable import code ---*/
36236 __Pyx_RefNannyFinishContext();
36240 static int __Pyx_modinit_function_import_code(void) {
36241 __Pyx_RefNannyDeclarations
36242 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
36243 /*--- Function import code ---*/
36244 __Pyx_RefNannyFinishContext();
36249 #ifndef CYTHON_NO_PYINIT_EXPORT
36250 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
36251 #elif PY_MAJOR_VERSION < 3
36253 #define __Pyx_PyMODINIT_FUNC extern "C" void
36255 #define __Pyx_PyMODINIT_FUNC void
36259 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
36261 #define __Pyx_PyMODINIT_FUNC PyObject *
36266 #if PY_MAJOR_VERSION < 3
36267 __Pyx_PyMODINIT_FUNC initobjectify(void) CYTHON_SMALL_CODE; /*proto*/
36268 __Pyx_PyMODINIT_FUNC initobjectify(void)
36270 __Pyx_PyMODINIT_FUNC PyInit_objectify(void) CYTHON_SMALL_CODE; /*proto*/
36271 __Pyx_PyMODINIT_FUNC PyInit_objectify(void)
36272 #if CYTHON_PEP489_MULTI_PHASE_INIT
36274 return PyModuleDef_Init(&__pyx_moduledef);
36276 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
36277 #if PY_VERSION_HEX >= 0x030700A1
36278 static PY_INT64_T main_interpreter_id = -1;
36279 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
36280 if (main_interpreter_id == -1) {
36281 main_interpreter_id = current_id;
36282 return (unlikely(current_id == -1)) ? -1 : 0;
36283 } else if (unlikely(main_interpreter_id != current_id))
36285 static PyInterpreterState *main_interpreter = NULL;
36286 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
36287 if (!main_interpreter) {
36288 main_interpreter = current_interpreter;
36289 } else if (unlikely(main_interpreter != current_interpreter))
36294 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
36299 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
36300 PyObject *value = PyObject_GetAttrString(spec, from_name);
36302 if (likely(value)) {
36303 if (allow_none || value != Py_None) {
36304 result = PyDict_SetItemString(moddict, to_name, value);
36307 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
36314 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
36315 PyObject *module = NULL, *moddict, *modname;
36316 if (__Pyx_check_single_interpreter())
36319 return __Pyx_NewRef(__pyx_m);
36320 modname = PyObject_GetAttrString(spec, "name");
36321 if (unlikely(!modname)) goto bad;
36322 module = PyModule_NewObject(modname);
36323 Py_DECREF(modname);
36324 if (unlikely(!module)) goto bad;
36325 moddict = PyModule_GetDict(module);
36326 if (unlikely(!moddict)) goto bad;
36327 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
36328 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
36329 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
36330 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
36333 Py_XDECREF(module);
36338 static CYTHON_SMALL_CODE int __pyx_pymod_exec_objectify(PyObject *__pyx_pyinit_module)
36342 PyObject *__pyx_t_1 = NULL;
36343 PyObject *__pyx_t_2 = NULL;
36345 PyObject *__pyx_t_4 = NULL;
36346 int __pyx_lineno = 0;
36347 const char *__pyx_filename = NULL;
36348 int __pyx_clineno = 0;
36349 __Pyx_RefNannyDeclarations
36350 #if CYTHON_PEP489_MULTI_PHASE_INIT
36352 if (__pyx_m == __pyx_pyinit_module) return 0;
36353 PyErr_SetString(PyExc_RuntimeError, "Module 'objectify' has already been imported. Re-initialisation is not supported.");
36356 #elif PY_MAJOR_VERSION >= 3
36357 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
36359 #if CYTHON_REFNANNY
36360 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
36361 if (!__Pyx_RefNanny) {
36363 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
36364 if (!__Pyx_RefNanny)
36365 Py_FatalError("failed to import 'refnanny' module");
36368 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_objectify(void)", 0);
36369 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36370 #ifdef __Pxy_PyFrame_Initialize_Offsets
36371 __Pxy_PyFrame_Initialize_Offsets();
36373 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
36374 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
36375 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
36376 #ifdef __Pyx_CyFunction_USED
36377 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36379 #ifdef __Pyx_FusedFunction_USED
36380 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36382 #ifdef __Pyx_Coroutine_USED
36383 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36385 #ifdef __Pyx_Generator_USED
36386 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36388 #ifdef __Pyx_AsyncGen_USED
36389 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36391 #ifdef __Pyx_StopAsyncIteration_USED
36392 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36394 /*--- Library function declarations ---*/
36395 /*--- Threads initialization code ---*/
36396 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
36397 #ifdef WITH_THREAD /* Python build with threading support? */
36398 PyEval_InitThreads();
36401 /*--- Module creation code ---*/
36402 #if CYTHON_PEP489_MULTI_PHASE_INIT
36403 __pyx_m = __pyx_pyinit_module;
36404 Py_INCREF(__pyx_m);
36406 #if PY_MAJOR_VERSION < 3
36407 __pyx_m = Py_InitModule4("objectify", __pyx_methods, __pyx_k_The_lxml_objectify_module_imple, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
36409 __pyx_m = PyModule_Create(&__pyx_moduledef);
36411 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
36413 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
36414 Py_INCREF(__pyx_d);
36415 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
36416 Py_INCREF(__pyx_b);
36417 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
36418 Py_INCREF(__pyx_cython_runtime);
36419 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36420 /*--- Initialize various global constants etc. ---*/
36421 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36422 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
36423 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36425 if (__pyx_module_is_main_lxml__objectify) {
36426 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36428 #if PY_MAJOR_VERSION >= 3
36430 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
36431 if (!PyDict_GetItemString(modules, "lxml.objectify")) {
36432 if (unlikely(PyDict_SetItemString(modules, "lxml.objectify", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36436 /*--- Builtin init code ---*/
36437 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36438 /*--- Constants init code ---*/
36439 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36440 /*--- Global type/function init code ---*/
36441 (void)__Pyx_modinit_global_init_code();
36442 (void)__Pyx_modinit_variable_export_code();
36443 (void)__Pyx_modinit_function_export_code();
36444 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36445 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36446 (void)__Pyx_modinit_variable_import_code();
36447 (void)__Pyx_modinit_function_import_code();
36448 /*--- Execution code ---*/
36449 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
36450 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36453 /* "lxml/objectify.pyx":24
36454 * from libc.string cimport const_char
36456 * __all__ = [u'BoolElement', u'DataElement', u'E', u'Element', u'ElementMaker', # <<<<<<<<<<<<<<
36457 * u'FloatElement', u'IntElement', u'LongElement', u'NoneElement',
36458 * u'NumberElement', u'ObjectPath', u'ObjectifiedDataElement',
36460 __pyx_t_1 = PyList_New(32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
36461 __Pyx_GOTREF(__pyx_t_1);
36462 __Pyx_INCREF(__pyx_n_u_BoolElement);
36463 __Pyx_GIVEREF(__pyx_n_u_BoolElement);
36464 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_BoolElement);
36465 __Pyx_INCREF(__pyx_n_u_DataElement);
36466 __Pyx_GIVEREF(__pyx_n_u_DataElement);
36467 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_DataElement);
36468 __Pyx_INCREF(__pyx_n_u_E);
36469 __Pyx_GIVEREF(__pyx_n_u_E);
36470 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_E);
36471 __Pyx_INCREF(__pyx_n_u_Element);
36472 __Pyx_GIVEREF(__pyx_n_u_Element);
36473 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_Element);
36474 __Pyx_INCREF(__pyx_n_u_ElementMaker);
36475 __Pyx_GIVEREF(__pyx_n_u_ElementMaker);
36476 PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_ElementMaker);
36477 __Pyx_INCREF(__pyx_n_u_FloatElement);
36478 __Pyx_GIVEREF(__pyx_n_u_FloatElement);
36479 PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_FloatElement);
36480 __Pyx_INCREF(__pyx_n_u_IntElement);
36481 __Pyx_GIVEREF(__pyx_n_u_IntElement);
36482 PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_IntElement);
36483 __Pyx_INCREF(__pyx_n_u_LongElement);
36484 __Pyx_GIVEREF(__pyx_n_u_LongElement);
36485 PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_LongElement);
36486 __Pyx_INCREF(__pyx_n_u_NoneElement);
36487 __Pyx_GIVEREF(__pyx_n_u_NoneElement);
36488 PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_NoneElement);
36489 __Pyx_INCREF(__pyx_n_u_NumberElement);
36490 __Pyx_GIVEREF(__pyx_n_u_NumberElement);
36491 PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_u_NumberElement);
36492 __Pyx_INCREF(__pyx_n_u_ObjectPath);
36493 __Pyx_GIVEREF(__pyx_n_u_ObjectPath);
36494 PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_u_ObjectPath);
36495 __Pyx_INCREF(__pyx_n_u_ObjectifiedDataElement);
36496 __Pyx_GIVEREF(__pyx_n_u_ObjectifiedDataElement);
36497 PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_u_ObjectifiedDataElement);
36498 __Pyx_INCREF(__pyx_n_u_ObjectifiedElement);
36499 __Pyx_GIVEREF(__pyx_n_u_ObjectifiedElement);
36500 PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_u_ObjectifiedElement);
36501 __Pyx_INCREF(__pyx_n_u_ObjectifyElementClassLookup);
36502 __Pyx_GIVEREF(__pyx_n_u_ObjectifyElementClassLookup);
36503 PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_u_ObjectifyElementClassLookup);
36504 __Pyx_INCREF(__pyx_n_u_PYTYPE_ATTRIBUTE);
36505 __Pyx_GIVEREF(__pyx_n_u_PYTYPE_ATTRIBUTE);
36506 PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_u_PYTYPE_ATTRIBUTE);
36507 __Pyx_INCREF(__pyx_n_u_PyType);
36508 __Pyx_GIVEREF(__pyx_n_u_PyType);
36509 PyList_SET_ITEM(__pyx_t_1, 15, __pyx_n_u_PyType);
36510 __Pyx_INCREF(__pyx_n_u_StringElement);
36511 __Pyx_GIVEREF(__pyx_n_u_StringElement);
36512 PyList_SET_ITEM(__pyx_t_1, 16, __pyx_n_u_StringElement);
36513 __Pyx_INCREF(__pyx_n_u_SubElement);
36514 __Pyx_GIVEREF(__pyx_n_u_SubElement);
36515 PyList_SET_ITEM(__pyx_t_1, 17, __pyx_n_u_SubElement);
36516 __Pyx_INCREF(__pyx_n_u_XML);
36517 __Pyx_GIVEREF(__pyx_n_u_XML);
36518 PyList_SET_ITEM(__pyx_t_1, 18, __pyx_n_u_XML);
36519 __Pyx_INCREF(__pyx_n_u_annotate);
36520 __Pyx_GIVEREF(__pyx_n_u_annotate);
36521 PyList_SET_ITEM(__pyx_t_1, 19, __pyx_n_u_annotate);
36522 __Pyx_INCREF(__pyx_n_u_deannotate);
36523 __Pyx_GIVEREF(__pyx_n_u_deannotate);
36524 PyList_SET_ITEM(__pyx_t_1, 20, __pyx_n_u_deannotate);
36525 __Pyx_INCREF(__pyx_n_u_dump);
36526 __Pyx_GIVEREF(__pyx_n_u_dump);
36527 PyList_SET_ITEM(__pyx_t_1, 21, __pyx_n_u_dump);
36528 __Pyx_INCREF(__pyx_n_u_enable_recursive_str);
36529 __Pyx_GIVEREF(__pyx_n_u_enable_recursive_str);
36530 PyList_SET_ITEM(__pyx_t_1, 22, __pyx_n_u_enable_recursive_str);
36531 __Pyx_INCREF(__pyx_n_u_fromstring);
36532 __Pyx_GIVEREF(__pyx_n_u_fromstring);
36533 PyList_SET_ITEM(__pyx_t_1, 23, __pyx_n_u_fromstring);
36534 __Pyx_INCREF(__pyx_n_u_getRegisteredTypes);
36535 __Pyx_GIVEREF(__pyx_n_u_getRegisteredTypes);
36536 PyList_SET_ITEM(__pyx_t_1, 24, __pyx_n_u_getRegisteredTypes);
36537 __Pyx_INCREF(__pyx_n_u_makeparser);
36538 __Pyx_GIVEREF(__pyx_n_u_makeparser);
36539 PyList_SET_ITEM(__pyx_t_1, 25, __pyx_n_u_makeparser);
36540 __Pyx_INCREF(__pyx_n_u_parse);
36541 __Pyx_GIVEREF(__pyx_n_u_parse);
36542 PyList_SET_ITEM(__pyx_t_1, 26, __pyx_n_u_parse);
36543 __Pyx_INCREF(__pyx_n_u_pyannotate);
36544 __Pyx_GIVEREF(__pyx_n_u_pyannotate);
36545 PyList_SET_ITEM(__pyx_t_1, 27, __pyx_n_u_pyannotate);
36546 __Pyx_INCREF(__pyx_n_u_pytypename);
36547 __Pyx_GIVEREF(__pyx_n_u_pytypename);
36548 PyList_SET_ITEM(__pyx_t_1, 28, __pyx_n_u_pytypename);
36549 __Pyx_INCREF(__pyx_n_u_set_default_parser);
36550 __Pyx_GIVEREF(__pyx_n_u_set_default_parser);
36551 PyList_SET_ITEM(__pyx_t_1, 29, __pyx_n_u_set_default_parser);
36552 __Pyx_INCREF(__pyx_n_u_set_pytype_attribute_tag);
36553 __Pyx_GIVEREF(__pyx_n_u_set_pytype_attribute_tag);
36554 PyList_SET_ITEM(__pyx_t_1, 30, __pyx_n_u_set_pytype_attribute_tag);
36555 __Pyx_INCREF(__pyx_n_u_xsiannotate);
36556 __Pyx_GIVEREF(__pyx_n_u_xsiannotate);
36557 PyList_SET_ITEM(__pyx_t_1, 31, __pyx_n_u_xsiannotate);
36558 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
36559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36561 /* "lxml/objectify.pyx":35
36563 * cdef object etree
36564 * from lxml import etree # <<<<<<<<<<<<<<
36565 * # initialize C-API of lxml.etree
36566 * import_lxml__etree()
36568 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
36569 __Pyx_GOTREF(__pyx_t_1);
36570 __Pyx_INCREF(__pyx_n_s_etree);
36571 __Pyx_GIVEREF(__pyx_n_s_etree);
36572 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_etree);
36573 __pyx_t_2 = __Pyx_Import(__pyx_n_s_lxml, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
36574 __Pyx_GOTREF(__pyx_t_2);
36575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36576 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
36577 __Pyx_GOTREF(__pyx_t_1);
36578 __Pyx_INCREF(__pyx_t_1);
36579 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_etree);
36580 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_etree, __pyx_t_1);
36581 __Pyx_GIVEREF(__pyx_t_1);
36582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36583 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36585 /* "lxml/objectify.pyx":37
36586 * from lxml import etree
36587 * # initialize C-API of lxml.etree
36588 * import_lxml__etree() # <<<<<<<<<<<<<<
36590 * __version__ = etree.__version__
36592 __pyx_t_3 = import_lxml__etree(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 37, __pyx_L1_error)
36594 /* "lxml/objectify.pyx":39
36595 * import_lxml__etree()
36597 * __version__ = etree.__version__ # <<<<<<<<<<<<<<
36601 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
36602 __Pyx_GOTREF(__pyx_t_2);
36603 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
36604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36606 /* "lxml/objectify.pyx":42
36609 * import re # <<<<<<<<<<<<<<
36611 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
36613 __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
36614 __Pyx_GOTREF(__pyx_t_2);
36615 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_re);
36616 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_re, __pyx_t_2);
36617 __Pyx_GIVEREF(__pyx_t_2);
36620 /* "lxml/objectify.pyx":44
36623 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError) # <<<<<<<<<<<<<<
36624 * cdef object is_special_method = re.compile(u'__.*__$').match
36627 __Pyx_INCREF(__pyx_tuple__22);
36628 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
36629 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS, __pyx_tuple__22);
36630 __Pyx_GIVEREF(__pyx_tuple__22);
36632 /* "lxml/objectify.pyx":45
36634 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
36635 * cdef object is_special_method = re.compile(u'__.*__$').match # <<<<<<<<<<<<<<
36639 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
36640 __Pyx_GOTREF(__pyx_t_2);
36641 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
36642 __Pyx_GOTREF(__pyx_t_1);
36643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36644 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
36645 __Pyx_GOTREF(__pyx_t_2);
36646 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36647 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_is_special_method);
36648 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_is_special_method, __pyx_t_2);
36649 __Pyx_GIVEREF(__pyx_t_2);
36652 /* "lxml/objectify.pyx":75
36653 * cdef const_xmlChar* _PYTYPE_ATTRIBUTE_NAME
36655 * PYTYPE_ATTRIBUTE = None # <<<<<<<<<<<<<<
36657 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
36659 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYTYPE_ATTRIBUTE, Py_None) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
36661 /* "lxml/objectify.pyx":77
36662 * PYTYPE_ATTRIBUTE = None
36664 * cdef unicode TREE_PYTYPE_NAME = u"TREE" # <<<<<<<<<<<<<<
36666 * cdef tuple _unicodeAndUtf8(s):
36668 __Pyx_INCREF(__pyx_n_u_TREE);
36669 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
36670 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, __pyx_n_u_TREE);
36671 __Pyx_GIVEREF(__pyx_n_u_TREE);
36673 /* "lxml/objectify.pyx":82
36674 * return s, python.PyUnicode_AsUTF8String(s)
36676 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
36677 * u"""set_pytype_attribute_tag(attribute_tag=None)
36678 * Change name and namespace of the XML attribute that holds Python type
36680 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_1set_pytype_attribute_tag, 0, __pyx_n_s_set_pytype_attribute_tag, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
36681 __Pyx_GOTREF(__pyx_t_2);
36682 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__27);
36683 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pytype_attribute_tag, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
36684 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36686 /* "lxml/objectify.pyx":112
36687 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
36689 * set_pytype_attribute_tag() # <<<<<<<<<<<<<<
36693 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_pytype_attribute_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
36694 __Pyx_GOTREF(__pyx_t_2);
36695 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
36696 __Pyx_GOTREF(__pyx_t_1);
36697 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36698 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36700 /* "lxml/objectify.pyx":118
36701 * cdef object XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8
36702 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \
36703 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema") # <<<<<<<<<<<<<<
36704 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8)
36707 __pyx_t_1 = __pyx_f_4lxml_9objectify__unicodeAndUtf8(__pyx_kp_u_http_www_w3_org_2001_XMLSchema); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
36708 __Pyx_GOTREF(__pyx_t_1);
36709 if (likely(__pyx_t_1 != Py_None)) {
36710 PyObject* sequence = __pyx_t_1;
36711 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36712 if (unlikely(size != 2)) {
36713 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36714 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36715 __PYX_ERR(0, 117, __pyx_L1_error)
36717 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36718 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
36719 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
36720 __Pyx_INCREF(__pyx_t_2);
36721 __Pyx_INCREF(__pyx_t_4);
36723 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
36724 __Pyx_GOTREF(__pyx_t_2);
36725 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
36726 __Pyx_GOTREF(__pyx_t_4);
36728 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36730 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 117, __pyx_L1_error)
36733 /* "lxml/objectify.pyx":117
36734 * # namespaces for XML Schema
36735 * cdef object XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8
36736 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \ # <<<<<<<<<<<<<<
36737 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema")
36738 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8)
36740 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS);
36741 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS, __pyx_t_2);
36742 __Pyx_GIVEREF(__pyx_t_2);
36744 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8);
36745 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8, __pyx_t_4);
36746 __Pyx_GIVEREF(__pyx_t_4);
36749 /* "lxml/objectify.pyx":119
36750 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \
36751 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema")
36752 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8) # <<<<<<<<<<<<<<
36754 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36756 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8;
36757 __Pyx_INCREF(__pyx_t_1);
36758 __pyx_v_4lxml_9objectify__XML_SCHEMA_NS = (const xmlChar*)PyBytes_AS_STRING(__pyx_t_1);
36759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36761 /* "lxml/objectify.pyx":123
36762 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36763 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \
36764 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance") # <<<<<<<<<<<<<<
36765 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36768 __pyx_t_1 = __pyx_f_4lxml_9objectify__unicodeAndUtf8(__pyx_kp_u_http_www_w3_org_2001_XMLSchema_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
36769 __Pyx_GOTREF(__pyx_t_1);
36770 if (likely(__pyx_t_1 != Py_None)) {
36771 PyObject* sequence = __pyx_t_1;
36772 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36773 if (unlikely(size != 2)) {
36774 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36775 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36776 __PYX_ERR(0, 122, __pyx_L1_error)
36778 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36779 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
36780 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
36781 __Pyx_INCREF(__pyx_t_4);
36782 __Pyx_INCREF(__pyx_t_2);
36784 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
36785 __Pyx_GOTREF(__pyx_t_4);
36786 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
36787 __Pyx_GOTREF(__pyx_t_2);
36789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36791 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 122, __pyx_L1_error)
36794 /* "lxml/objectify.pyx":122
36796 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36797 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \ # <<<<<<<<<<<<<<
36798 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance")
36799 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36801 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS);
36802 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS, __pyx_t_4);
36803 __Pyx_GIVEREF(__pyx_t_4);
36805 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8);
36806 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8, __pyx_t_2);
36807 __Pyx_GIVEREF(__pyx_t_2);
36810 /* "lxml/objectify.pyx":124
36811 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \
36812 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance")
36813 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8) # <<<<<<<<<<<<<<
36815 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS
36817 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8;
36818 __Pyx_INCREF(__pyx_t_1);
36819 __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS = (const xmlChar*)PyBytes_AS_STRING(__pyx_t_1);
36820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36822 /* "lxml/objectify.pyx":126
36823 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36825 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS # <<<<<<<<<<<<<<
36826 * cdef object XML_SCHEMA_INSTANCE_TYPE_ATTR = u"{%s}type" % XML_SCHEMA_INSTANCE_NS
36829 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_nil, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
36830 __Pyx_GOTREF(__pyx_t_1);
36831 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR);
36832 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR, __pyx_t_1);
36833 __Pyx_GIVEREF(__pyx_t_1);
36836 /* "lxml/objectify.pyx":127
36838 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS
36839 * cdef object XML_SCHEMA_INSTANCE_TYPE_ATTR = u"{%s}type" % XML_SCHEMA_INSTANCE_NS # <<<<<<<<<<<<<<
36843 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_type, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
36844 __Pyx_GOTREF(__pyx_t_1);
36845 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR);
36846 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR, __pyx_t_1);
36847 __Pyx_GIVEREF(__pyx_t_1);
36850 /* "lxml/objectify.pyx":162
36852 * # pickle support for objectified Element
36853 * def __reduce__(self): # <<<<<<<<<<<<<<
36854 * return fromstring, (etree.tostring(self),)
36857 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement___reduce, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
36858 __Pyx_GOTREF(__pyx_t_1);
36859 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_reduce, __pyx_t_1) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
36860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36861 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36863 /* "lxml/objectify.pyx":193
36864 * return _countSiblings(self._c_node)
36866 * def countchildren(self): # <<<<<<<<<<<<<<
36867 * u"""countchildren(self)
36870 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_9countchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_countchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
36871 __Pyx_GOTREF(__pyx_t_1);
36872 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_countchildren, __pyx_t_1) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
36873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36874 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36876 /* "lxml/objectify.pyx":210
36879 * def getchildren(self): # <<<<<<<<<<<<<<
36880 * u"""getchildren(self)
36883 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_11getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_getchildren, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
36884 __Pyx_GOTREF(__pyx_t_1);
36885 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_getchildren, __pyx_t_1) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
36886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36887 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36889 /* "lxml/objectify.pyx":263
36890 * self.remove(child)
36892 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
36893 * u"""addattr(self, tag, value)
36896 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_19addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
36897 __Pyx_GOTREF(__pyx_t_1);
36898 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_addattr, __pyx_t_1) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
36899 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36900 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36902 /* "lxml/objectify.pyx":369
36903 * parent.remove(sibling)
36905 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
36906 * u"""descendantpaths(self, prefix=None)
36909 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedElement_descendantpat, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
36910 __Pyx_GOTREF(__pyx_t_1);
36911 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement->tp_dict, __pyx_n_s_descendantpaths, __pyx_t_1) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
36912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36913 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36915 /* "lxml/objectify.pyx":606
36916 * return strrepr(textOf(self._c_node) or '')
36918 * def _setText(self, s): # <<<<<<<<<<<<<<
36919 * u"""For use in subclasses only. Don't use unless you know what you are
36922 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_22ObjectifiedDataElement_5_setText, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectifiedDataElement__setText, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
36923 __Pyx_GOTREF(__pyx_t_1);
36924 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement->tp_dict, __pyx_n_s_setText, __pyx_t_1) < 0) __PYX_ERR(0, 606, __pyx_L1_error)
36925 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36926 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
36928 /* "lxml/objectify.pyx":614
36929 * cdef class NumberElement(ObjectifiedDataElement):
36930 * cdef object _parse_value
36931 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
36932 * u"""Set the function that parses the Python value from a string.
36935 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_13NumberElement_1_setValueParser, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement__setValueParser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
36936 __Pyx_GOTREF(__pyx_t_1);
36937 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_NumberElement->tp_dict, __pyx_n_s_setValueParser, __pyx_t_1) < 0) __PYX_ERR(0, 614, __pyx_L1_error)
36938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36939 PyType_Modified(__pyx_ptype_4lxml_9objectify_NumberElement);
36941 /* "lxml/objectify.pyx":634
36942 * return float(_parseNumber(self))
36944 * def __complex__(self): # <<<<<<<<<<<<<<
36945 * return complex(_parseNumber(self))
36948 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_13NumberElement_9__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NumberElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
36949 __Pyx_GOTREF(__pyx_t_1);
36950 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_NumberElement->tp_dict, __pyx_n_s_complex, __pyx_t_1) < 0) __PYX_ERR(0, 634, __pyx_L1_error)
36951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36952 PyType_Modified(__pyx_ptype_4lxml_9objectify_NumberElement);
36954 /* "lxml/objectify.pyx":710
36956 * cdef class IntElement(NumberElement):
36957 * def _init(self): # <<<<<<<<<<<<<<
36958 * self._parse_value = int
36961 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_10IntElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IntElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
36962 __Pyx_GOTREF(__pyx_t_1);
36963 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement->tp_dict, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 710, __pyx_L1_error)
36964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36965 PyType_Modified(__pyx_ptype_4lxml_9objectify_IntElement);
36967 /* "lxml/objectify.pyx":717
36969 * cdef class LongElement(NumberElement):
36970 * def _init(self): # <<<<<<<<<<<<<<
36971 * self._parse_value = long
36974 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_11LongElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LongElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
36975 __Pyx_GOTREF(__pyx_t_1);
36976 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_LongElement->tp_dict, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
36977 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36978 PyType_Modified(__pyx_ptype_4lxml_9objectify_LongElement);
36980 /* "lxml/objectify.pyx":724
36982 * cdef class FloatElement(NumberElement):
36983 * def _init(self): # <<<<<<<<<<<<<<
36984 * self._parse_value = float
36987 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_12FloatElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FloatElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error)
36988 __Pyx_GOTREF(__pyx_t_1);
36989 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement->tp_dict, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
36990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36991 PyType_Modified(__pyx_ptype_4lxml_9objectify_FloatElement);
36993 /* "lxml/objectify.pyx":741
36994 * return repr(textOf(self._c_node) or u'')
36996 * def strlen(self): # <<<<<<<<<<<<<<
36997 * text = textOf(self._c_node)
37000 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_13StringElement_3strlen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement_strlen, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
37001 __Pyx_GOTREF(__pyx_t_1);
37002 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement->tp_dict, __pyx_n_s_strlen, __pyx_t_1) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
37003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37004 PyType_Modified(__pyx_ptype_4lxml_9objectify_StringElement);
37006 /* "lxml/objectify.pyx":786
37007 * return float(textOf(self._c_node))
37009 * def __complex__(self): # <<<<<<<<<<<<<<
37010 * return complex(textOf(self._c_node))
37013 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_13StringElement_23__complex__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_StringElement___complex, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
37014 __Pyx_GOTREF(__pyx_t_1);
37015 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement->tp_dict, __pyx_n_s_complex, __pyx_t_1) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
37016 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37017 PyType_Modified(__pyx_ptype_4lxml_9objectify_StringElement);
37019 /* "lxml/objectify.pyx":821
37020 * Python's bool type.
37022 * def _init(self): # <<<<<<<<<<<<<<
37023 * self._parse_value = __parseBool
37026 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_11BoolElement_1_init, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoolElement__init, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
37027 __Pyx_GOTREF(__pyx_t_1);
37028 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement->tp_dict, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
37029 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37030 PyType_Modified(__pyx_ptype_4lxml_9objectify_BoolElement);
37032 /* "lxml/objectify.pyx":843
37033 * return __parseBool(textOf(self._c_node))
37035 * def __checkBool(s): # <<<<<<<<<<<<<<
37036 * cdef int value = -1
37037 * if s is not None:
37039 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_3__checkBool, 0, __pyx_n_s_checkBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
37040 __Pyx_GOTREF(__pyx_t_1);
37041 if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkBool, __pyx_t_1) < 0) __PYX_ERR(0, 843, __pyx_L1_error)
37042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37044 /* "lxml/objectify.pyx":850
37047 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
37051 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_5__parseBool, 0, __pyx_n_s_parseBool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
37052 __Pyx_GOTREF(__pyx_t_1);
37053 if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseBool, __pyx_t_1) < 0) __PYX_ERR(0, 850, __pyx_L1_error)
37054 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37056 /* "lxml/objectify.pyx":948
37057 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
37059 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
37060 * u"""register(self, before=None, after=None)
37063 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_6PyType_5register, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_register, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
37064 __Pyx_GOTREF(__pyx_t_1);
37065 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_PyType->tp_dict, __pyx_n_s_register, __pyx_t_1) < 0) __PYX_ERR(0, 948, __pyx_L1_error)
37066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37067 PyType_Modified(__pyx_ptype_4lxml_9objectify_PyType);
37069 /* "lxml/objectify.pyx":989
37070 * _SCHEMA_TYPE_DICT[xs_type] = self
37072 * def unregister(self): # <<<<<<<<<<<<<<
37073 * u"unregister(self)"
37074 * if _PYTYPE_DICT.get(self.name) is self:
37076 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_6PyType_7unregister, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PyType_unregister, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
37077 __Pyx_GOTREF(__pyx_t_1);
37078 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_PyType->tp_dict, __pyx_n_s_unregister, __pyx_t_1) < 0) __PYX_ERR(0, 989, __pyx_L1_error)
37079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37080 PyType_Modified(__pyx_ptype_4lxml_9objectify_PyType);
37082 /* "lxml/objectify.pyx":1014
37085 * cdef dict _PYTYPE_DICT = {} # <<<<<<<<<<<<<<
37086 * cdef dict _SCHEMA_TYPE_DICT = {}
37087 * cdef list _TYPE_CHECKS = []
37089 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
37090 __Pyx_GOTREF(__pyx_t_1);
37091 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__PYTYPE_DICT);
37092 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__PYTYPE_DICT, ((PyObject*)__pyx_t_1));
37093 __Pyx_GIVEREF(__pyx_t_1);
37096 /* "lxml/objectify.pyx":1015
37098 * cdef dict _PYTYPE_DICT = {}
37099 * cdef dict _SCHEMA_TYPE_DICT = {} # <<<<<<<<<<<<<<
37100 * cdef list _TYPE_CHECKS = []
37103 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
37104 __Pyx_GOTREF(__pyx_t_1);
37105 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT);
37106 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, ((PyObject*)__pyx_t_1));
37107 __Pyx_GIVEREF(__pyx_t_1);
37110 /* "lxml/objectify.pyx":1016
37111 * cdef dict _PYTYPE_DICT = {}
37112 * cdef dict _SCHEMA_TYPE_DICT = {}
37113 * cdef list _TYPE_CHECKS = [] # <<<<<<<<<<<<<<
37115 * def __lower_bool(b):
37117 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
37118 __Pyx_GOTREF(__pyx_t_1);
37119 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__TYPE_CHECKS);
37120 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__TYPE_CHECKS, ((PyObject*)__pyx_t_1));
37121 __Pyx_GIVEREF(__pyx_t_1);
37124 /* "lxml/objectify.pyx":1018
37125 * cdef list _TYPE_CHECKS = []
37127 * def __lower_bool(b): # <<<<<<<<<<<<<<
37128 * return u"true" if b else u"false"
37131 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_7__lower_bool, 0, __pyx_n_s_lower_bool, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
37132 __Pyx_GOTREF(__pyx_t_1);
37133 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lower_bool, __pyx_t_1) < 0) __PYX_ERR(0, 1018, __pyx_L1_error)
37134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37136 /* "lxml/objectify.pyx":1024
37137 * return u"str" if python._isString(obj) else _typename(obj)
37139 * def pytypename(obj): # <<<<<<<<<<<<<<
37140 * u"""pytypename(obj)
37143 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_9pytypename, 0, __pyx_n_s_pytypename, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1024, __pyx_L1_error)
37144 __Pyx_GOTREF(__pyx_t_1);
37145 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytypename, __pyx_t_1) < 0) __PYX_ERR(0, 1024, __pyx_L1_error)
37146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37148 /* "lxml/objectify.pyx":1066
37150 * # non-registered PyType for inner tree elements
37151 * cdef PyType TREE_PYTYPE = PyType(TREE_PYTYPE_NAME, None, ObjectifiedElement) # <<<<<<<<<<<<<<
37153 * _registerPyTypes()
37155 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
37156 __Pyx_GOTREF(__pyx_t_1);
37157 __Pyx_INCREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37158 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37159 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37160 __Pyx_INCREF(Py_None);
37161 __Pyx_GIVEREF(Py_None);
37162 PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
37163 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37164 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37165 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37166 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_9objectify_PyType), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error)
37167 __Pyx_GOTREF(__pyx_t_2);
37168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37169 __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_9objectify_TREE_PYTYPE));
37170 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_TREE_PYTYPE, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
37171 __Pyx_GIVEREF(__pyx_t_2);
37174 /* "lxml/objectify.pyx":1068
37175 * cdef PyType TREE_PYTYPE = PyType(TREE_PYTYPE_NAME, None, ObjectifiedElement)
37177 * _registerPyTypes() # <<<<<<<<<<<<<<
37179 * def getRegisteredTypes():
37181 __pyx_t_2 = __pyx_f_4lxml_9objectify__registerPyTypes(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
37182 __Pyx_GOTREF(__pyx_t_2);
37183 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37185 /* "lxml/objectify.pyx":1070
37186 * _registerPyTypes()
37188 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
37189 * u"""getRegisteredTypes()
37192 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_11getRegisteredTypes, 0, __pyx_n_s_getRegisteredTypes, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1070, __pyx_L1_error)
37193 __Pyx_GOTREF(__pyx_t_2);
37194 if (PyDict_SetItem(__pyx_d, __pyx_n_s_getRegisteredTypes, __pyx_t_2) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
37195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37197 /* "lxml/objectify.pyx":1303
37198 * # Recursive element dumping
37200 * cdef bint __RECURSIVE_STR = 0 # default: off # <<<<<<<<<<<<<<
37202 * def enable_recursive_str(on=True):
37204 __pyx_v_4lxml_9objectify___RECURSIVE_STR = 0;
37206 /* "lxml/objectify.pyx":1305
37207 * cdef bint __RECURSIVE_STR = 0 # default: off
37209 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
37210 * u"""enable_recursive_str(on=True)
37213 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_13enable_recursive_str, 0, __pyx_n_s_enable_recursive_str, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
37214 __Pyx_GOTREF(__pyx_t_2);
37215 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__72);
37216 if (PyDict_SetItem(__pyx_d, __pyx_n_s_enable_recursive_str, __pyx_t_2) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
37217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37219 /* "lxml/objectify.pyx":1314
37220 * __RECURSIVE_STR = on
37222 * def dump(_Element element not None): # <<<<<<<<<<<<<<
37223 * u"""dump(_Element element not None)
37226 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_15dump, 0, __pyx_n_s_dump, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __pyx_L1_error)
37227 __Pyx_GOTREF(__pyx_t_2);
37228 if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump, __pyx_t_2) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
37229 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37231 /* "lxml/objectify.pyx":1357
37232 * # Pickle support for objectified ElementTree
37234 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
37235 * return etree.ElementTree(fromstring(data))
37238 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_17__unpickleElementTree, 0, __pyx_n_s_unpickleElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
37239 __Pyx_GOTREF(__pyx_t_2);
37240 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpickleElementTree, __pyx_t_2) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
37241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37243 /* "lxml/objectify.pyx":1368
37244 * elementTreeReduceFunction, __unpickleElementTree)
37246 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
37247 * return __unpickleElementTree, (etree.tostring(obj),)
37250 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_19pickleReduceElementTree, 0, __pyx_n_s_pickleReduceElementTree, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
37251 __Pyx_GOTREF(__pyx_t_2);
37252 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickleReduceElementTree, __pyx_t_2) < 0) __PYX_ERR(0, 1368, __pyx_L1_error)
37253 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37255 /* "lxml/objectify.pyx":1371
37256 * return __unpickleElementTree, (etree.tostring(obj),)
37258 * _setupPickle(pickleReduceElementTree) # <<<<<<<<<<<<<<
37259 * del pickleReduceElementTree
37262 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickleReduceElementTree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
37263 __Pyx_GOTREF(__pyx_t_2);
37264 __pyx_t_1 = __pyx_f_4lxml_9objectify__setupPickle(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
37265 __Pyx_GOTREF(__pyx_t_1);
37266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37269 /* "lxml/objectify.pyx":1372
37271 * _setupPickle(pickleReduceElementTree)
37272 * del pickleReduceElementTree # <<<<<<<<<<<<<<
37274 * ################################################################################
37276 if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_pickleReduceElementTree) < 0) __PYX_ERR(0, 1372, __pyx_L1_error)
37278 /* "lxml/objectify.pyx":1462
37281 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
37282 * empty_pytype=None):
37283 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
37285 __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
37286 __Pyx_GOTREF(__pyx_t_1);
37287 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37288 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37289 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_pytype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37290 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_21pyannotate, 0, __pyx_n_s_pyannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
37291 __Pyx_GOTREF(__pyx_t_2);
37292 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37294 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyannotate, __pyx_t_2) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37295 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37297 /* "lxml/objectify.pyx":1485
37298 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
37300 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
37301 * empty_type=None):
37302 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
37304 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error)
37305 __Pyx_GOTREF(__pyx_t_2);
37306 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37307 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_pytype, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37308 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37309 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_23xsiannotate, 0, __pyx_n_s_xsiannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error)
37310 __Pyx_GOTREF(__pyx_t_1);
37311 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37313 if (PyDict_SetItem(__pyx_d, __pyx_n_s_xsiannotate, __pyx_t_1) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37316 /* "lxml/objectify.pyx":1513
37317 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
37319 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
37320 * empty_pytype=None, empty_type=None, annotate_xsi=0,
37321 * annotate_pytype=1):
37323 __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
37324 __Pyx_GOTREF(__pyx_t_1);
37325 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_old, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37326 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37327 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_pytype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37328 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37329 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_annotate_xsi, ((PyObject *)__pyx_int_0)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37330 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_annotate_pytype, ((PyObject *)__pyx_int_1)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37331 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_25annotate, 0, __pyx_n_s_annotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1513, __pyx_L1_error)
37332 __Pyx_GOTREF(__pyx_t_2);
37333 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37334 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_annotate, __pyx_t_2) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37338 /* "lxml/objectify.pyx":1706
37341 * cdef object _strip_attributes = etree.strip_attributes # <<<<<<<<<<<<<<
37342 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37345 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_strip_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1706, __pyx_L1_error)
37346 __Pyx_GOTREF(__pyx_t_2);
37347 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__strip_attributes);
37348 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__strip_attributes, __pyx_t_2);
37349 __Pyx_GIVEREF(__pyx_t_2);
37352 /* "lxml/objectify.pyx":1707
37354 * cdef object _strip_attributes = etree.strip_attributes
37355 * cdef object _cleanup_namespaces = etree.cleanup_namespaces # <<<<<<<<<<<<<<
37357 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
37359 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_cleanup_namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error)
37360 __Pyx_GOTREF(__pyx_t_2);
37361 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__cleanup_namespaces);
37362 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__cleanup_namespaces, __pyx_t_2);
37363 __Pyx_GIVEREF(__pyx_t_2);
37366 /* "lxml/objectify.pyx":1709
37367 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37369 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
37370 * bint xsi_nil=False, bint cleanup_namespaces=False):
37371 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37373 __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error)
37374 __Pyx_GOTREF(__pyx_t_2);
37375 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error)
37376 __Pyx_GOTREF(__pyx_t_1);
37377 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pytype, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37379 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error)
37380 __Pyx_GOTREF(__pyx_t_1);
37381 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsi_2, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37382 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37384 /* "lxml/objectify.pyx":1710
37386 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
37387 * bint xsi_nil=False, bint cleanup_namespaces=False): # <<<<<<<<<<<<<<
37388 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37391 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
37392 __Pyx_GOTREF(__pyx_t_1);
37393 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsi_nil, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37395 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
37396 __Pyx_GOTREF(__pyx_t_1);
37397 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cleanup_namespaces, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37398 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37400 /* "lxml/objectify.pyx":1709
37401 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37403 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
37404 * bint xsi_nil=False, bint cleanup_namespaces=False):
37405 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37407 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_27deannotate, 0, __pyx_n_s_deannotate, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error)
37408 __Pyx_GOTREF(__pyx_t_1);
37409 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37410 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37411 if (PyDict_SetItem(__pyx_d, __pyx_n_s_deannotate, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37412 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37414 /* "lxml/objectify.pyx":1743
37416 * cdef object __DEFAULT_PARSER
37417 * __DEFAULT_PARSER = etree.XMLParser(remove_blank_text=True) # <<<<<<<<<<<<<<
37418 * __DEFAULT_PARSER.set_element_class_lookup( ObjectifyElementClassLookup() )
37421 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_XMLParser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1743, __pyx_L1_error)
37422 __Pyx_GOTREF(__pyx_t_1);
37423 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error)
37424 __Pyx_GOTREF(__pyx_t_2);
37425 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_remove_blank_text, Py_True) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
37426 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L1_error)
37427 __Pyx_GOTREF(__pyx_t_4);
37428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37429 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37430 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37431 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify___DEFAULT_PARSER, __pyx_t_4);
37432 __Pyx_GIVEREF(__pyx_t_4);
37435 /* "lxml/objectify.pyx":1744
37436 * cdef object __DEFAULT_PARSER
37437 * __DEFAULT_PARSER = etree.XMLParser(remove_blank_text=True)
37438 * __DEFAULT_PARSER.set_element_class_lookup( ObjectifyElementClassLookup() ) # <<<<<<<<<<<<<<
37440 * cdef object objectify_parser
37442 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify___DEFAULT_PARSER, __pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1744, __pyx_L1_error)
37443 __Pyx_GOTREF(__pyx_t_4);
37444 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1744, __pyx_L1_error)
37445 __Pyx_GOTREF(__pyx_t_2);
37446 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
37447 __Pyx_GOTREF(__pyx_t_1);
37448 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37449 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37452 /* "lxml/objectify.pyx":1747
37454 * cdef object objectify_parser
37455 * objectify_parser = __DEFAULT_PARSER # <<<<<<<<<<<<<<
37457 * def set_default_parser(new_parser = None):
37459 __Pyx_INCREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37460 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
37461 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37462 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37464 /* "lxml/objectify.pyx":1749
37465 * objectify_parser = __DEFAULT_PARSER
37467 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
37468 * u"""set_default_parser(new_parser = None)
37471 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_29set_default_parser, 0, __pyx_n_s_set_default_parser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1749, __pyx_L1_error)
37472 __Pyx_GOTREF(__pyx_t_1);
37473 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__89);
37474 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_parser, __pyx_t_1) < 0) __PYX_ERR(0, 1749, __pyx_L1_error)
37475 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37477 /* "lxml/objectify.pyx":1767
37478 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
37480 * def makeparser(**kw): # <<<<<<<<<<<<<<
37481 * u"""makeparser(remove_blank_text=True, **kw)
37484 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_31makeparser, 0, __pyx_n_s_makeparser, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1767, __pyx_L1_error)
37485 __Pyx_GOTREF(__pyx_t_1);
37486 if (PyDict_SetItem(__pyx_d, __pyx_n_s_makeparser, __pyx_t_1) < 0) __PYX_ERR(0, 1767, __pyx_L1_error)
37487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37489 /* "lxml/objectify.pyx":1790
37491 * cdef object _fromstring
37492 * _fromstring = etree.fromstring # <<<<<<<<<<<<<<
37494 * SubElement = etree.SubElement
37496 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __pyx_L1_error)
37497 __Pyx_GOTREF(__pyx_t_1);
37498 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__fromstring);
37499 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_1);
37500 __Pyx_GIVEREF(__pyx_t_1);
37503 /* "lxml/objectify.pyx":1792
37504 * _fromstring = etree.fromstring
37506 * SubElement = etree.SubElement # <<<<<<<<<<<<<<
37508 * def fromstring(xml, parser=None, *, base_url=None):
37510 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_SubElement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error)
37511 __Pyx_GOTREF(__pyx_t_1);
37512 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SubElement, __pyx_t_1) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
37513 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37515 /* "lxml/objectify.pyx":1794
37516 * SubElement = etree.SubElement
37518 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37519 * u"""fromstring(xml, parser=None, base_url=None)
37522 __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
37523 __Pyx_GOTREF(__pyx_t_1);
37524 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1794, __pyx_L1_error)
37525 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_33fromstring, 0, __pyx_n_s_fromstring, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error)
37526 __Pyx_GOTREF(__pyx_t_2);
37527 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__94);
37528 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37530 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_2) < 0) __PYX_ERR(0, 1794, __pyx_L1_error)
37531 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37533 /* "lxml/objectify.pyx":1810
37534 * return _fromstring(xml, parser, base_url=base_url)
37536 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37537 * u"""XML(xml, parser=None, base_url=None)
37540 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
37541 __Pyx_GOTREF(__pyx_t_2);
37542 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
37543 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_35XML, 0, __pyx_n_s_XML, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error)
37544 __Pyx_GOTREF(__pyx_t_1);
37545 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__97);
37546 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37547 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37548 if (PyDict_SetItem(__pyx_d, __pyx_n_s_XML, __pyx_t_1) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
37549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37551 /* "lxml/objectify.pyx":1827
37553 * cdef object _parse
37554 * _parse = etree.parse # <<<<<<<<<<<<<<
37556 * def parse(f, parser=None, *, base_url=None):
37558 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_etree, __pyx_n_s_parse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1827, __pyx_L1_error)
37559 __Pyx_GOTREF(__pyx_t_1);
37560 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__parse);
37561 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__parse, __pyx_t_1);
37562 __Pyx_GIVEREF(__pyx_t_1);
37565 /* "lxml/objectify.pyx":1829
37566 * _parse = etree.parse
37568 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37569 * u"""parse(f, parser=None, base_url=None)
37572 __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error)
37573 __Pyx_GOTREF(__pyx_t_1);
37574 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1829, __pyx_L1_error)
37575 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_37parse, 0, __pyx_n_s_parse, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error)
37576 __Pyx_GOTREF(__pyx_t_2);
37577 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__100);
37578 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37580 if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse, __pyx_t_2) < 0) __PYX_ERR(0, 1829, __pyx_L1_error)
37581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37583 /* "lxml/objectify.pyx":1845
37585 * cdef dict _DEFAULT_NSMAP = {
37586 * "py" : PYTYPE_NAMESPACE, # <<<<<<<<<<<<<<
37587 * "xsi" : XML_SCHEMA_INSTANCE_NS,
37588 * "xsd" : XML_SCHEMA_NS
37590 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
37591 __Pyx_GOTREF(__pyx_t_2);
37592 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_py_2, __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
37594 /* "lxml/objectify.pyx":1846
37595 * cdef dict _DEFAULT_NSMAP = {
37596 * "py" : PYTYPE_NAMESPACE,
37597 * "xsi" : XML_SCHEMA_INSTANCE_NS, # <<<<<<<<<<<<<<
37598 * "xsd" : XML_SCHEMA_NS
37601 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsi_2, __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
37603 /* "lxml/objectify.pyx":1847
37604 * "py" : PYTYPE_NAMESPACE,
37605 * "xsi" : XML_SCHEMA_INSTANCE_NS,
37606 * "xsd" : XML_SCHEMA_NS # <<<<<<<<<<<<<<
37610 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsd_2, __pyx_v_4lxml_9objectify_XML_SCHEMA_NS) < 0) __PYX_ERR(0, 1845, __pyx_L1_error)
37611 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
37612 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP, ((PyObject*)__pyx_t_2));
37613 __Pyx_GIVEREF(__pyx_t_2);
37616 /* "lxml/objectify.pyx":1850
37619 * E = ElementMaker() # <<<<<<<<<<<<<<
37621 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes):
37623 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ElementMaker)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
37624 __Pyx_GOTREF(__pyx_t_2);
37625 if (PyDict_SetItem(__pyx_d, __pyx_n_s_E, __pyx_t_2) < 0) __PYX_ERR(0, 1850, __pyx_L1_error)
37626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37628 /* "lxml/objectify.pyx":1852
37629 * E = ElementMaker()
37631 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
37632 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
37635 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1852, __pyx_L1_error)
37636 __Pyx_GOTREF(__pyx_t_2);
37637 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1852, __pyx_L1_error)
37638 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_39Element, 0, __pyx_n_s_Element, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error)
37639 __Pyx_GOTREF(__pyx_t_1);
37640 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__103);
37641 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37642 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37643 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Element, __pyx_t_1) < 0) __PYX_ERR(0, 1852, __pyx_L1_error)
37644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37646 /* "lxml/objectify.pyx":1872
37647 * return _makeElement(_tag, None, _attributes, nsmap)
37649 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
37651 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
37653 __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1872, __pyx_L1_error)
37654 __Pyx_GOTREF(__pyx_t_1);
37655 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37656 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_xsi_3, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37657 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_41DataElement, 0, __pyx_n_s_DataElement, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1872, __pyx_L1_error)
37658 __Pyx_GOTREF(__pyx_t_2);
37659 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__106);
37660 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37662 if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataElement, __pyx_t_2) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37665 /* "src/lxml/objectpath.pxi":10
37668 * cdef object _NO_DEFAULT = object() # <<<<<<<<<<<<<<
37672 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error)
37673 __Pyx_GOTREF(__pyx_t_2);
37674 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__NO_DEFAULT);
37675 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__NO_DEFAULT, __pyx_t_2);
37676 __Pyx_GIVEREF(__pyx_t_2);
37679 /* "src/lxml/objectpath.pxi":57
37680 * return _find_object_path(root, self._c_path, self._path_len, default)
37682 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
37683 * u"hasattr(self, root)"
37686 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_10ObjectPath_9hasattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_hasattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 57, __pyx_L1_error)
37687 __Pyx_GOTREF(__pyx_t_2);
37688 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_hasattr, __pyx_t_2) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
37689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37690 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37692 /* "src/lxml/objectpath.pxi":65
37695 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
37696 * u"""setattr(self, root, value)
37699 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_10ObjectPath_11setattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_setattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error)
37700 __Pyx_GOTREF(__pyx_t_2);
37701 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_setattr, __pyx_t_2) < 0) __PYX_ERR(1, 65, __pyx_L1_error)
37702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37703 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37705 /* "src/lxml/objectpath.pxi":74
37706 * _create_object_path(root, self._c_path, self._path_len, 1, value)
37708 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
37709 * u"""addattr(self, root, value)
37712 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_9objectify_10ObjectPath_13addattr, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectPath_addattr, NULL, __pyx_n_s_lxml_objectify, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error)
37713 __Pyx_GOTREF(__pyx_t_2);
37714 if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectPath->tp_dict, __pyx_n_s_addattr, __pyx_t_2) < 0) __PYX_ERR(1, 74, __pyx_L1_error)
37715 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37716 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37718 /* "src/lxml/objectpath.pxi":84
37721 * cdef object __MATCH_PATH_SEGMENT = re.compile( # <<<<<<<<<<<<<<
37722 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37725 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
37726 __Pyx_GOTREF(__pyx_t_2);
37728 /* "src/lxml/objectpath.pxi":86
37729 * cdef object __MATCH_PATH_SEGMENT = re.compile(
37730 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37731 * re.U).match # <<<<<<<<<<<<<<
37733 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0)
37735 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_9objectify_re, __pyx_n_s_U); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
37736 __Pyx_GOTREF(__pyx_t_1);
37738 /* "src/lxml/objectpath.pxi":84
37741 * cdef object __MATCH_PATH_SEGMENT = re.compile( # <<<<<<<<<<<<<<
37742 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37745 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
37746 __Pyx_GOTREF(__pyx_t_4);
37747 __Pyx_INCREF(__pyx_kp_u_s_s_s_s_s_0_9_s);
37748 __Pyx_GIVEREF(__pyx_kp_u_s_s_s_s_s_0_9_s);
37749 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_s_s_s_s_s_0_9_s);
37750 __Pyx_GIVEREF(__pyx_t_1);
37751 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
37753 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
37754 __Pyx_GOTREF(__pyx_t_1);
37755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37756 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37758 /* "src/lxml/objectpath.pxi":86
37759 * cdef object __MATCH_PATH_SEGMENT = re.compile(
37760 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37761 * re.U).match # <<<<<<<<<<<<<<
37763 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0)
37765 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 86, __pyx_L1_error)
37766 __Pyx_GOTREF(__pyx_t_4);
37767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37768 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
37769 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT, __pyx_t_4);
37770 __Pyx_GIVEREF(__pyx_t_4);
37773 /* "src/lxml/objectpath.pxi":88
37776 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0) # <<<<<<<<<<<<<<
37780 __Pyx_INCREF(__pyx_tuple__113);
37781 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
37782 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT, __pyx_tuple__113);
37783 __Pyx_GIVEREF(__pyx_tuple__113);
37785 /* "lxml/objectify.pyx":1
37786 * # cython: binding=True # <<<<<<<<<<<<<<
37787 * # cython: auto_pickle=False
37788 * # cython: language_level=2
37790 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
37791 __Pyx_GOTREF(__pyx_t_4);
37792 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
37793 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37795 /*--- Wrapped vars code ---*/
37797 if (__Pyx_RegisterCleanup()) __PYX_ERR(0, 1, __pyx_L1_error);
37800 __Pyx_XDECREF(__pyx_t_1);
37801 __Pyx_XDECREF(__pyx_t_2);
37802 __Pyx_XDECREF(__pyx_t_4);
37805 __Pyx_AddTraceback("init lxml.objectify", __pyx_clineno, __pyx_lineno, __pyx_filename);
37808 } else if (!PyErr_Occurred()) {
37809 PyErr_SetString(PyExc_ImportError, "init lxml.objectify");
37812 __Pyx_RefNannyFinishContext();
37813 #if CYTHON_PEP489_MULTI_PHASE_INIT
37814 return (__pyx_m != NULL) ? 0 : -1;
37815 #elif PY_MAJOR_VERSION >= 3
37822 static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {
37823 Py_CLEAR(__pyx_slice__3);
37824 Py_CLEAR(__pyx_tuple__5);
37825 Py_CLEAR(__pyx_tuple__6);
37826 Py_CLEAR(__pyx_tuple__7);
37827 Py_CLEAR(__pyx_tuple__8);
37828 Py_CLEAR(__pyx_slice__16);
37829 Py_CLEAR(__pyx_tuple__18);
37830 Py_CLEAR(__pyx_tuple__22);
37831 Py_CLEAR(__pyx_tuple__24);
37832 Py_CLEAR(__pyx_tuple__25);
37833 Py_CLEAR(__pyx_codeobj__26);
37834 Py_CLEAR(__pyx_tuple__27);
37835 Py_CLEAR(__pyx_tuple__28);
37836 Py_CLEAR(__pyx_codeobj__29);
37837 Py_CLEAR(__pyx_tuple__30);
37838 Py_CLEAR(__pyx_codeobj__31);
37839 Py_CLEAR(__pyx_tuple__32);
37840 Py_CLEAR(__pyx_codeobj__33);
37841 Py_CLEAR(__pyx_tuple__34);
37842 Py_CLEAR(__pyx_codeobj__35);
37843 Py_CLEAR(__pyx_tuple__36);
37844 Py_CLEAR(__pyx_codeobj__37);
37845 Py_CLEAR(__pyx_tuple__38);
37846 Py_CLEAR(__pyx_codeobj__39);
37847 Py_CLEAR(__pyx_tuple__40);
37848 Py_CLEAR(__pyx_codeobj__41);
37849 Py_CLEAR(__pyx_tuple__42);
37850 Py_CLEAR(__pyx_codeobj__43);
37851 Py_CLEAR(__pyx_tuple__44);
37852 Py_CLEAR(__pyx_codeobj__45);
37853 Py_CLEAR(__pyx_tuple__46);
37854 Py_CLEAR(__pyx_codeobj__47);
37855 Py_CLEAR(__pyx_tuple__48);
37856 Py_CLEAR(__pyx_codeobj__49);
37857 Py_CLEAR(__pyx_tuple__50);
37858 Py_CLEAR(__pyx_codeobj__51);
37859 Py_CLEAR(__pyx_tuple__52);
37860 Py_CLEAR(__pyx_codeobj__53);
37861 Py_CLEAR(__pyx_tuple__54);
37862 Py_CLEAR(__pyx_codeobj__55);
37863 Py_CLEAR(__pyx_tuple__56);
37864 Py_CLEAR(__pyx_codeobj__57);
37865 Py_CLEAR(__pyx_tuple__58);
37866 Py_CLEAR(__pyx_codeobj__59);
37867 Py_CLEAR(__pyx_tuple__60);
37868 Py_CLEAR(__pyx_codeobj__61);
37869 Py_CLEAR(__pyx_tuple__62);
37870 Py_CLEAR(__pyx_codeobj__63);
37871 Py_CLEAR(__pyx_tuple__64);
37872 Py_CLEAR(__pyx_codeobj__65);
37873 Py_CLEAR(__pyx_tuple__66);
37874 Py_CLEAR(__pyx_codeobj__67);
37875 Py_CLEAR(__pyx_tuple__68);
37876 Py_CLEAR(__pyx_codeobj__69);
37877 Py_CLEAR(__pyx_tuple__70);
37878 Py_CLEAR(__pyx_codeobj__71);
37879 Py_CLEAR(__pyx_tuple__72);
37880 Py_CLEAR(__pyx_tuple__73);
37881 Py_CLEAR(__pyx_codeobj__74);
37882 Py_CLEAR(__pyx_tuple__75);
37883 Py_CLEAR(__pyx_codeobj__76);
37884 Py_CLEAR(__pyx_tuple__77);
37885 Py_CLEAR(__pyx_codeobj__78);
37886 Py_CLEAR(__pyx_tuple__79);
37887 Py_CLEAR(__pyx_codeobj__80);
37888 Py_CLEAR(__pyx_tuple__81);
37889 Py_CLEAR(__pyx_codeobj__82);
37890 Py_CLEAR(__pyx_tuple__83);
37891 Py_CLEAR(__pyx_codeobj__84);
37892 Py_CLEAR(__pyx_tuple__85);
37893 Py_CLEAR(__pyx_codeobj__86);
37894 Py_CLEAR(__pyx_tuple__87);
37895 Py_CLEAR(__pyx_codeobj__88);
37896 Py_CLEAR(__pyx_tuple__89);
37897 Py_CLEAR(__pyx_tuple__90);
37898 Py_CLEAR(__pyx_codeobj__91);
37899 Py_CLEAR(__pyx_tuple__92);
37900 Py_CLEAR(__pyx_codeobj__93);
37901 Py_CLEAR(__pyx_tuple__94);
37902 Py_CLEAR(__pyx_tuple__95);
37903 Py_CLEAR(__pyx_codeobj__96);
37904 Py_CLEAR(__pyx_tuple__97);
37905 Py_CLEAR(__pyx_tuple__98);
37906 Py_CLEAR(__pyx_codeobj__99);
37907 Py_CLEAR(__pyx_tuple__100);
37908 Py_CLEAR(__pyx_tuple__101);
37909 Py_CLEAR(__pyx_codeobj__102);
37910 Py_CLEAR(__pyx_tuple__103);
37911 Py_CLEAR(__pyx_tuple__104);
37912 Py_CLEAR(__pyx_codeobj__105);
37913 Py_CLEAR(__pyx_tuple__106);
37914 Py_CLEAR(__pyx_tuple__107);
37915 Py_CLEAR(__pyx_codeobj__108);
37916 Py_CLEAR(__pyx_tuple__109);
37917 Py_CLEAR(__pyx_codeobj__110);
37918 Py_CLEAR(__pyx_tuple__111);
37919 Py_CLEAR(__pyx_codeobj__112);
37920 Py_CLEAR(__pyx_tuple__113);
37921 /* CodeObjectCache.cleanup */
37922 if (__pyx_code_cache.entries) {
37923 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
37924 int i, count = __pyx_code_cache.count;
37925 __pyx_code_cache.count = 0;
37926 __pyx_code_cache.max_count = 0;
37927 __pyx_code_cache.entries = NULL;
37928 for (i=0; i<count; i++) {
37929 Py_DECREF(entries[i].code_object);
37931 PyMem_Free(entries);
37934 Py_CLEAR(__pyx_umethod_PyBytes_Type_split.method);
37935 Py_CLEAR(__pyx_umethod_PyDict_Type_get.method);
37936 Py_CLEAR(__pyx_umethod_PyDict_Type_items.method);
37937 Py_CLEAR(__pyx_umethod_PyDict_Type_values.method);
37938 Py_CLEAR(__pyx_umethod_PyList_Type_remove.method);
37939 Py_CLEAR(__pyx_umethod_PyUnicode_Type_strip.method);
37941 static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
37942 /*--- Global cleanup code ---*/
37943 Py_CLEAR(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
37944 Py_CLEAR(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
37945 Py_CLEAR(__pyx_v_4lxml_9objectify__NO_DEFAULT);
37946 Py_CLEAR(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
37947 Py_CLEAR(__pyx_v_4lxml_9objectify__parse);
37948 Py_CLEAR(__pyx_v_4lxml_9objectify__fromstring);
37949 Py_CLEAR(__pyx_v_4lxml_9objectify_objectify_parser);
37950 Py_CLEAR(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37951 Py_CLEAR(__pyx_v_4lxml_9objectify__cleanup_namespaces);
37952 Py_CLEAR(__pyx_v_4lxml_9objectify__strip_attributes);
37953 Py_CLEAR(__pyx_v_4lxml_9objectify_TREE_PYTYPE);
37954 Py_CLEAR(__pyx_v_4lxml_9objectify__TYPE_CHECKS);
37955 Py_CLEAR(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT);
37956 Py_CLEAR(__pyx_v_4lxml_9objectify__PYTYPE_DICT);
37957 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR);
37958 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR);
37959 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8);
37960 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS);
37961 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8);
37962 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS);
37963 Py_CLEAR(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37964 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
37965 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
37966 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
37967 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
37968 Py_CLEAR(__pyx_v_4lxml_9objectify_is_special_method);
37969 Py_CLEAR(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
37970 Py_CLEAR(__pyx_v_4lxml_9objectify_re);
37971 Py_CLEAR(__pyx_v_4lxml_9objectify_etree);
37972 __Pyx_CleanupGlobals();
37973 /*--- Type import cleanup code ---*/
37974 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase);
37975 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup);
37976 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup);
37977 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__Document);
37978 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__Element);
37979 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator);
37980 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher);
37981 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree);
37982 /*--- Builtin cleanup code ---*/
37983 Py_CLEAR(__pyx_builtin_ValueError);
37984 Py_CLEAR(__pyx_builtin_TypeError);
37985 Py_CLEAR(__pyx_builtin_object);
37986 Py_CLEAR(__pyx_builtin_IndexError);
37987 Py_CLEAR(__pyx_builtin_AttributeError);
37988 Py_CLEAR(__pyx_builtin_oct);
37989 Py_CLEAR(__pyx_builtin_hex);
37990 Py_CLEAR(__pyx_builtin_enumerate);
37991 Py_CLEAR(__pyx_builtin_map);
37992 Py_CLEAR(__pyx_builtin_MemoryError);
37993 /*--- Intern cleanup code ---*/
37994 Py_CLEAR(__pyx_empty_tuple);
37996 Py_CLEAR(__pyx_cython_runtime);
38000 /* --- Runtime support code --- */
38002 #if CYTHON_REFNANNY
38003 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
38004 PyObject *m = NULL, *p = NULL;
38006 m = PyImport_ImportModule(modname);
38008 p = PyObject_GetAttrString(m, "RefNannyAPI");
38010 r = PyLong_AsVoidPtr(p);
38014 return (__Pyx_RefNannyAPIStruct *)r;
38018 /* PyObjectGetAttrStr */
38019 #if CYTHON_USE_TYPE_SLOTS
38020 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
38021 PyTypeObject* tp = Py_TYPE(obj);
38022 if (likely(tp->tp_getattro))
38023 return tp->tp_getattro(obj, attr_name);
38024 #if PY_MAJOR_VERSION < 3
38025 if (likely(tp->tp_getattr))
38026 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
38028 return PyObject_GetAttr(obj, attr_name);
38032 /* GetBuiltinName */
38033 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
38034 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
38035 if (unlikely(!result)) {
38036 PyErr_Format(PyExc_NameError,
38037 #if PY_MAJOR_VERSION >= 3
38038 "name '%U' is not defined", name);
38040 "name '%.200s' is not defined", PyString_AS_STRING(name));
38046 /* PyCFunctionFastCall */
38047 #if CYTHON_FAST_PYCCALL
38048 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
38049 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
38050 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
38051 PyObject *self = PyCFunction_GET_SELF(func);
38052 int flags = PyCFunction_GET_FLAGS(func);
38053 assert(PyCFunction_Check(func));
38054 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
38055 assert(nargs >= 0);
38056 assert(nargs == 0 || args != NULL);
38057 /* _PyCFunction_FastCallDict() must not be called with an exception set,
38058 because it may clear it (directly or indirectly) and so the
38059 caller loses its exception */
38060 assert(!PyErr_Occurred());
38061 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
38062 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
38064 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
38069 /* PyFunctionFastCall */
38070 #if CYTHON_FAST_PYCALL
38071 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
38072 PyObject *globals) {
38074 PyThreadState *tstate = __Pyx_PyThreadState_Current;
38075 PyObject **fastlocals;
38078 assert(globals != NULL);
38079 /* XXX Perhaps we should create a specialized
38080 PyFrame_New() that doesn't take locals, but does
38081 take builtins without sanity checking them.
38083 assert(tstate != NULL);
38084 f = PyFrame_New(tstate, co, globals, NULL);
38088 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
38089 for (i = 0; i < na; i++) {
38091 fastlocals[i] = *args++;
38093 result = PyEval_EvalFrameEx(f,0);
38094 ++tstate->recursion_depth;
38096 --tstate->recursion_depth;
38099 #if 1 || PY_VERSION_HEX < 0x030600B1
38100 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
38101 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
38102 PyObject *globals = PyFunction_GET_GLOBALS(func);
38103 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
38105 #if PY_MAJOR_VERSION >= 3
38108 PyObject *kwtuple, **k;
38113 assert(kwargs == NULL || PyDict_Check(kwargs));
38114 nk = kwargs ? PyDict_Size(kwargs) : 0;
38115 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
38119 #if PY_MAJOR_VERSION >= 3
38120 co->co_kwonlyargcount == 0 &&
38122 likely(kwargs == NULL || nk == 0) &&
38123 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
38124 if (argdefs == NULL && co->co_argcount == nargs) {
38125 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
38128 else if (nargs == 0 && argdefs != NULL
38129 && co->co_argcount == Py_SIZE(argdefs)) {
38130 /* function called with no arguments, but all parameters have
38131 a default value: use default values as arguments .*/
38132 args = &PyTuple_GET_ITEM(argdefs, 0);
38133 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
38137 if (kwargs != NULL) {
38139 kwtuple = PyTuple_New(2 * nk);
38140 if (kwtuple == NULL) {
38144 k = &PyTuple_GET_ITEM(kwtuple, 0);
38146 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
38157 closure = PyFunction_GET_CLOSURE(func);
38158 #if PY_MAJOR_VERSION >= 3
38159 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
38161 if (argdefs != NULL) {
38162 d = &PyTuple_GET_ITEM(argdefs, 0);
38163 nd = Py_SIZE(argdefs);
38169 #if PY_MAJOR_VERSION >= 3
38170 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
38173 d, (int)nd, kwdefs, closure);
38175 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
38178 d, (int)nd, closure);
38180 Py_XDECREF(kwtuple);
38182 Py_LeaveRecursiveCall();
38189 #if CYTHON_COMPILING_IN_CPYTHON
38190 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
38192 ternaryfunc call = func->ob_type->tp_call;
38193 if (unlikely(!call))
38194 return PyObject_Call(func, arg, kw);
38195 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
38197 result = (*call)(func, arg, kw);
38198 Py_LeaveRecursiveCall();
38199 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
38202 "NULL result without error in PyObject_Call");
38208 /* PyObjectCall2Args */
38209 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
38210 PyObject *args, *result = NULL;
38211 #if CYTHON_FAST_PYCALL
38212 if (PyFunction_Check(function)) {
38213 PyObject *args[2] = {arg1, arg2};
38214 return __Pyx_PyFunction_FastCall(function, args, 2);
38217 #if CYTHON_FAST_PYCCALL
38218 if (__Pyx_PyFastCFunction_Check(function)) {
38219 PyObject *args[2] = {arg1, arg2};
38220 return __Pyx_PyCFunction_FastCall(function, args, 2);
38223 args = PyTuple_New(2);
38224 if (unlikely(!args)) goto done;
38226 PyTuple_SET_ITEM(args, 0, arg1);
38228 PyTuple_SET_ITEM(args, 1, arg2);
38229 Py_INCREF(function);
38230 result = __Pyx_PyObject_Call(function, args, NULL);
38232 Py_DECREF(function);
38237 /* PyObjectCallMethO */
38238 #if CYTHON_COMPILING_IN_CPYTHON
38239 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
38240 PyObject *self, *result;
38242 cfunc = PyCFunction_GET_FUNCTION(func);
38243 self = PyCFunction_GET_SELF(func);
38244 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
38246 result = cfunc(self, arg);
38247 Py_LeaveRecursiveCall();
38248 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
38251 "NULL result without error in PyObject_Call");
38257 /* PyObjectCallOneArg */
38258 #if CYTHON_COMPILING_IN_CPYTHON
38259 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38261 PyObject *args = PyTuple_New(1);
38262 if (unlikely(!args)) return NULL;
38264 PyTuple_SET_ITEM(args, 0, arg);
38265 result = __Pyx_PyObject_Call(func, args, NULL);
38269 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38270 #if CYTHON_FAST_PYCALL
38271 if (PyFunction_Check(func)) {
38272 return __Pyx_PyFunction_FastCall(func, &arg, 1);
38275 if (likely(PyCFunction_Check(func))) {
38276 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
38277 return __Pyx_PyObject_CallMethO(func, arg);
38278 #if CYTHON_FAST_PYCCALL
38279 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
38280 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
38284 return __Pyx__PyObject_CallOneArg(func, arg);
38287 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38289 PyObject *args = PyTuple_Pack(1, arg);
38290 if (unlikely(!args)) return NULL;
38291 result = __Pyx_PyObject_Call(func, args, NULL);
38297 /* RaiseDoubleKeywords */
38298 static void __Pyx_RaiseDoubleKeywordsError(
38299 const char* func_name,
38302 PyErr_Format(PyExc_TypeError,
38303 #if PY_MAJOR_VERSION >= 3
38304 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
38306 "%s() got multiple values for keyword argument '%s'", func_name,
38307 PyString_AsString(kw_name));
38311 /* ParseKeywords */
38312 static int __Pyx_ParseOptionalKeywords(
38314 PyObject **argnames[],
38316 PyObject *values[],
38317 Py_ssize_t num_pos_args,
38318 const char* function_name)
38320 PyObject *key = 0, *value = 0;
38321 Py_ssize_t pos = 0;
38323 PyObject*** first_kw_arg = argnames + num_pos_args;
38324 while (PyDict_Next(kwds, &pos, &key, &value)) {
38325 name = first_kw_arg;
38326 while (*name && (**name != key)) name++;
38328 values[name-argnames] = value;
38331 name = first_kw_arg;
38332 #if PY_MAJOR_VERSION < 3
38333 if (likely(PyString_Check(key))) {
38335 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
38336 && _PyString_Eq(**name, key)) {
38337 values[name-argnames] = value;
38342 if (*name) continue;
38344 PyObject*** argname = argnames;
38345 while (argname != first_kw_arg) {
38346 if ((**argname == key) || (
38347 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
38348 && _PyString_Eq(**argname, key))) {
38349 goto arg_passed_twice;
38356 if (likely(PyUnicode_Check(key))) {
38358 int cmp = (**name == key) ? 0 :
38359 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
38360 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
38362 PyUnicode_Compare(**name, key);
38363 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
38365 values[name-argnames] = value;
38370 if (*name) continue;
38372 PyObject*** argname = argnames;
38373 while (argname != first_kw_arg) {
38374 int cmp = (**argname == key) ? 0 :
38375 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
38376 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
38378 PyUnicode_Compare(**argname, key);
38379 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
38380 if (cmp == 0) goto arg_passed_twice;
38385 goto invalid_keyword_type;
38387 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
38389 goto invalid_keyword;
38394 __Pyx_RaiseDoubleKeywordsError(function_name, key);
38396 invalid_keyword_type:
38397 PyErr_Format(PyExc_TypeError,
38398 "%.200s() keywords must be strings", function_name);
38401 PyErr_Format(PyExc_TypeError,
38402 #if PY_MAJOR_VERSION < 3
38403 "%.200s() got an unexpected keyword argument '%.200s'",
38404 function_name, PyString_AsString(key));
38406 "%s() got an unexpected keyword argument '%U'",
38407 function_name, key);
38413 /* RaiseArgTupleInvalid */
38414 static void __Pyx_RaiseArgtupleInvalid(
38415 const char* func_name,
38417 Py_ssize_t num_min,
38418 Py_ssize_t num_max,
38419 Py_ssize_t num_found)
38421 Py_ssize_t num_expected;
38422 const char *more_or_less;
38423 if (num_found < num_min) {
38424 num_expected = num_min;
38425 more_or_less = "at least";
38427 num_expected = num_max;
38428 more_or_less = "at most";
38431 more_or_less = "exactly";
38433 PyErr_Format(PyExc_TypeError,
38434 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
38435 func_name, more_or_less, num_expected,
38436 (num_expected == 1) ? "" : "s", num_found);
38439 /* RaiseTooManyValuesToUnpack */
38440 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
38441 PyErr_Format(PyExc_ValueError,
38442 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
38445 /* RaiseNeedMoreValuesToUnpack */
38446 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
38447 PyErr_Format(PyExc_ValueError,
38448 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
38449 index, (index == 1) ? "" : "s");
38452 /* RaiseNoneIterError */
38453 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
38454 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
38457 /* decode_c_bytes */
38458 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
38459 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
38460 const char* encoding, const char* errors,
38461 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
38462 if (unlikely((start < 0) | (stop < 0))) {
38473 if (unlikely(stop <= start))
38474 return PyUnicode_FromUnicode(NULL, 0);
38475 length = stop - start;
38478 return decode_func(cstring, length, errors);
38480 return PyUnicode_Decode(cstring, length, encoding, errors);
38484 /* PyObjectCallNoArg */
38485 #if CYTHON_COMPILING_IN_CPYTHON
38486 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
38487 #if CYTHON_FAST_PYCALL
38488 if (PyFunction_Check(func)) {
38489 return __Pyx_PyFunction_FastCall(func, NULL, 0);
38492 #ifdef __Pyx_CyFunction_USED
38493 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
38495 if (likely(PyCFunction_Check(func)))
38498 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
38499 return __Pyx_PyObject_CallMethO(func, NULL);
38502 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
38506 /* PyDictVersioning */
38507 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
38508 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
38509 PyObject *dict = Py_TYPE(obj)->tp_dict;
38510 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
38512 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
38513 PyObject **dictptr = NULL;
38514 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
38516 #if CYTHON_COMPILING_IN_CPYTHON
38517 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
38519 dictptr = _PyObject_GetDictPtr(obj);
38522 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
38524 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
38525 PyObject *dict = Py_TYPE(obj)->tp_dict;
38526 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
38528 return obj_dict_version == __Pyx_get_object_dict_version(obj);
38532 /* GetModuleGlobalName */
38533 #if CYTHON_USE_DICT_VERSIONS
38534 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
38536 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
38540 #if !CYTHON_AVOID_BORROWED_REFS
38541 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
38542 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
38543 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38544 if (likely(result)) {
38545 return __Pyx_NewRef(result);
38546 } else if (unlikely(PyErr_Occurred())) {
38550 result = PyDict_GetItem(__pyx_d, name);
38551 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38552 if (likely(result)) {
38553 return __Pyx_NewRef(result);
38557 result = PyObject_GetItem(__pyx_d, name);
38558 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38559 if (likely(result)) {
38560 return __Pyx_NewRef(result);
38564 return __Pyx_GetBuiltinName(name);
38568 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
38569 if (unlikely(!type)) {
38570 PyErr_SetString(PyExc_SystemError, "Missing type object");
38573 if (likely(__Pyx_TypeCheck(obj, type)))
38575 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
38576 Py_TYPE(obj)->tp_name, type->tp_name);
38581 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
38582 #if CYTHON_COMPILING_IN_PYPY
38583 return PyObject_RichCompareBool(s1, s2, equals);
38586 return (equals == Py_EQ);
38587 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
38588 const char *ps1, *ps2;
38589 Py_ssize_t length = PyBytes_GET_SIZE(s1);
38590 if (length != PyBytes_GET_SIZE(s2))
38591 return (equals == Py_NE);
38592 ps1 = PyBytes_AS_STRING(s1);
38593 ps2 = PyBytes_AS_STRING(s2);
38594 if (ps1[0] != ps2[0]) {
38595 return (equals == Py_NE);
38596 } else if (length == 1) {
38597 return (equals == Py_EQ);
38600 #if CYTHON_USE_UNICODE_INTERNALS
38601 Py_hash_t hash1, hash2;
38602 hash1 = ((PyBytesObject*)s1)->ob_shash;
38603 hash2 = ((PyBytesObject*)s2)->ob_shash;
38604 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38605 return (equals == Py_NE);
38608 result = memcmp(ps1, ps2, (size_t)length);
38609 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38611 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
38612 return (equals == Py_NE);
38613 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
38614 return (equals == Py_NE);
38617 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38620 result = __Pyx_PyObject_IsTrue(py_result);
38621 Py_DECREF(py_result);
38627 /* UnicodeEquals */
38628 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
38629 #if CYTHON_COMPILING_IN_PYPY
38630 return PyObject_RichCompareBool(s1, s2, equals);
38632 #if PY_MAJOR_VERSION < 3
38633 PyObject* owned_ref = NULL;
38635 int s1_is_unicode, s2_is_unicode;
38639 s1_is_unicode = PyUnicode_CheckExact(s1);
38640 s2_is_unicode = PyUnicode_CheckExact(s2);
38641 #if PY_MAJOR_VERSION < 3
38642 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
38643 owned_ref = PyUnicode_FromObject(s2);
38644 if (unlikely(!owned_ref))
38648 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
38649 owned_ref = PyUnicode_FromObject(s1);
38650 if (unlikely(!owned_ref))
38654 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
38655 return __Pyx_PyBytes_Equals(s1, s2, equals);
38658 if (s1_is_unicode & s2_is_unicode) {
38661 void *data1, *data2;
38662 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
38664 length = __Pyx_PyUnicode_GET_LENGTH(s1);
38665 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
38668 #if CYTHON_USE_UNICODE_INTERNALS
38670 Py_hash_t hash1, hash2;
38671 #if CYTHON_PEP393_ENABLED
38672 hash1 = ((PyASCIIObject*)s1)->hash;
38673 hash2 = ((PyASCIIObject*)s2)->hash;
38675 hash1 = ((PyUnicodeObject*)s1)->hash;
38676 hash2 = ((PyUnicodeObject*)s2)->hash;
38678 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38683 kind = __Pyx_PyUnicode_KIND(s1);
38684 if (kind != __Pyx_PyUnicode_KIND(s2)) {
38687 data1 = __Pyx_PyUnicode_DATA(s1);
38688 data2 = __Pyx_PyUnicode_DATA(s2);
38689 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
38691 } else if (length == 1) {
38694 int result = memcmp(data1, data2, (size_t)(length * kind));
38695 #if PY_MAJOR_VERSION < 3
38696 Py_XDECREF(owned_ref);
38698 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38700 } else if ((s1 == Py_None) & s2_is_unicode) {
38702 } else if ((s2 == Py_None) & s1_is_unicode) {
38706 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38707 #if PY_MAJOR_VERSION < 3
38708 Py_XDECREF(owned_ref);
38712 result = __Pyx_PyObject_IsTrue(py_result);
38713 Py_DECREF(py_result);
38717 #if PY_MAJOR_VERSION < 3
38718 Py_XDECREF(owned_ref);
38720 return (equals == Py_EQ);
38722 #if PY_MAJOR_VERSION < 3
38723 Py_XDECREF(owned_ref);
38725 return (equals == Py_NE);
38729 /* JoinPyUnicode */
38730 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
38731 CYTHON_UNUSED Py_UCS4 max_char) {
38732 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38733 PyObject *result_uval;
38735 Py_ssize_t i, char_pos;
38736 void *result_udata;
38737 #if CYTHON_PEP393_ENABLED
38738 result_uval = PyUnicode_New(result_ulength, max_char);
38739 if (unlikely(!result_uval)) return NULL;
38740 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
38741 result_udata = PyUnicode_DATA(result_uval);
38743 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
38744 if (unlikely(!result_uval)) return NULL;
38745 result_ukind = sizeof(Py_UNICODE);
38746 result_udata = PyUnicode_AS_UNICODE(result_uval);
38749 for (i=0; i < value_count; i++) {
38751 Py_ssize_t ulength;
38753 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
38754 if (unlikely(__Pyx_PyUnicode_READY(uval)))
38756 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
38757 if (unlikely(!ulength))
38759 if (unlikely(char_pos + ulength < 0))
38761 ukind = __Pyx_PyUnicode_KIND(uval);
38762 udata = __Pyx_PyUnicode_DATA(uval);
38763 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
38764 memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
38766 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
38767 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
38770 for (j=0; j < ulength; j++) {
38771 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
38772 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
38776 char_pos += ulength;
38778 return result_uval;
38780 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
38782 Py_DECREF(result_uval);
38787 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
38791 /* PyErrFetchRestore */
38792 #if CYTHON_FAST_THREAD_STATE
38793 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
38794 PyObject *tmp_type, *tmp_value, *tmp_tb;
38795 tmp_type = tstate->curexc_type;
38796 tmp_value = tstate->curexc_value;
38797 tmp_tb = tstate->curexc_traceback;
38798 tstate->curexc_type = type;
38799 tstate->curexc_value = value;
38800 tstate->curexc_traceback = tb;
38801 Py_XDECREF(tmp_type);
38802 Py_XDECREF(tmp_value);
38803 Py_XDECREF(tmp_tb);
38805 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
38806 *type = tstate->curexc_type;
38807 *value = tstate->curexc_value;
38808 *tb = tstate->curexc_traceback;
38809 tstate->curexc_type = 0;
38810 tstate->curexc_value = 0;
38811 tstate->curexc_traceback = 0;
38815 /* RaiseException */
38816 #if PY_MAJOR_VERSION < 3
38817 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
38818 CYTHON_UNUSED PyObject *cause) {
38819 __Pyx_PyThreadState_declare
38821 if (!value || value == Py_None)
38825 if (!tb || tb == Py_None)
38829 if (!PyTraceBack_Check(tb)) {
38830 PyErr_SetString(PyExc_TypeError,
38831 "raise: arg 3 must be a traceback or None");
38835 if (PyType_Check(type)) {
38836 #if CYTHON_COMPILING_IN_PYPY
38838 Py_INCREF(Py_None);
38842 PyErr_NormalizeException(&type, &value, &tb);
38845 PyErr_SetString(PyExc_TypeError,
38846 "instance exception may not have a separate value");
38850 type = (PyObject*) Py_TYPE(type);
38852 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
38853 PyErr_SetString(PyExc_TypeError,
38854 "raise: exception class must be a subclass of BaseException");
38858 __Pyx_PyThreadState_assign
38859 __Pyx_ErrRestore(type, value, tb);
38868 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
38869 PyObject* owned_instance = NULL;
38870 if (tb == Py_None) {
38872 } else if (tb && !PyTraceBack_Check(tb)) {
38873 PyErr_SetString(PyExc_TypeError,
38874 "raise: arg 3 must be a traceback or None");
38877 if (value == Py_None)
38879 if (PyExceptionInstance_Check(type)) {
38881 PyErr_SetString(PyExc_TypeError,
38882 "instance exception may not have a separate value");
38886 type = (PyObject*) Py_TYPE(value);
38887 } else if (PyExceptionClass_Check(type)) {
38888 PyObject *instance_class = NULL;
38889 if (value && PyExceptionInstance_Check(value)) {
38890 instance_class = (PyObject*) Py_TYPE(value);
38891 if (instance_class != type) {
38892 int is_subclass = PyObject_IsSubclass(instance_class, type);
38893 if (!is_subclass) {
38894 instance_class = NULL;
38895 } else if (unlikely(is_subclass == -1)) {
38898 type = instance_class;
38902 if (!instance_class) {
38905 args = PyTuple_New(0);
38906 else if (PyTuple_Check(value)) {
38910 args = PyTuple_Pack(1, value);
38913 owned_instance = PyObject_Call(type, args, NULL);
38915 if (!owned_instance)
38917 value = owned_instance;
38918 if (!PyExceptionInstance_Check(value)) {
38919 PyErr_Format(PyExc_TypeError,
38920 "calling %R should have returned an instance of "
38921 "BaseException, not %R",
38922 type, Py_TYPE(value));
38927 PyErr_SetString(PyExc_TypeError,
38928 "raise: exception class must be a subclass of BaseException");
38932 PyObject *fixed_cause;
38933 if (cause == Py_None) {
38934 fixed_cause = NULL;
38935 } else if (PyExceptionClass_Check(cause)) {
38936 fixed_cause = PyObject_CallObject(cause, NULL);
38937 if (fixed_cause == NULL)
38939 } else if (PyExceptionInstance_Check(cause)) {
38940 fixed_cause = cause;
38941 Py_INCREF(fixed_cause);
38943 PyErr_SetString(PyExc_TypeError,
38944 "exception causes must derive from "
38948 PyException_SetCause(value, fixed_cause);
38950 PyErr_SetObject(type, value);
38952 #if CYTHON_COMPILING_IN_PYPY
38953 PyObject *tmp_type, *tmp_value, *tmp_tb;
38954 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
38956 PyErr_Restore(tmp_type, tmp_value, tb);
38957 Py_XDECREF(tmp_tb);
38959 PyThreadState *tstate = __Pyx_PyThreadState_Current;
38960 PyObject* tmp_tb = tstate->curexc_traceback;
38961 if (tb != tmp_tb) {
38963 tstate->curexc_traceback = tb;
38964 Py_XDECREF(tmp_tb);
38969 Py_XDECREF(owned_instance);
38975 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
38977 if (!j) return NULL;
38978 r = PyObject_GetItem(o, j);
38982 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
38983 CYTHON_NCP_UNUSED int wraparound,
38984 CYTHON_NCP_UNUSED int boundscheck) {
38985 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38986 Py_ssize_t wrapped_i = i;
38987 if (wraparound & unlikely(i < 0)) {
38988 wrapped_i += PyList_GET_SIZE(o);
38990 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
38991 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
38995 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
38997 return PySequence_GetItem(o, i);
39000 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
39001 CYTHON_NCP_UNUSED int wraparound,
39002 CYTHON_NCP_UNUSED int boundscheck) {
39003 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
39004 Py_ssize_t wrapped_i = i;
39005 if (wraparound & unlikely(i < 0)) {
39006 wrapped_i += PyTuple_GET_SIZE(o);
39008 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
39009 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
39013 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
39015 return PySequence_GetItem(o, i);
39018 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
39019 CYTHON_NCP_UNUSED int wraparound,
39020 CYTHON_NCP_UNUSED int boundscheck) {
39021 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
39022 if (is_list || PyList_CheckExact(o)) {
39023 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
39024 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
39025 PyObject *r = PyList_GET_ITEM(o, n);
39030 else if (PyTuple_CheckExact(o)) {
39031 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
39032 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
39033 PyObject *r = PyTuple_GET_ITEM(o, n);
39038 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
39039 if (likely(m && m->sq_item)) {
39040 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
39041 Py_ssize_t l = m->sq_length(o);
39042 if (likely(l >= 0)) {
39045 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
39050 return m->sq_item(o, i);
39054 if (is_list || PySequence_Check(o)) {
39055 return PySequence_GetItem(o, i);
39058 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
39061 /* ObjectGetItem */
39062 #if CYTHON_USE_TYPE_SLOTS
39063 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
39065 Py_ssize_t key_value;
39066 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
39067 if (unlikely(!(m && m->sq_item))) {
39068 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
39071 key_value = __Pyx_PyIndex_AsSsize_t(index);
39072 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
39073 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
39075 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
39077 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
39081 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
39082 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
39083 if (likely(m && m->mp_subscript)) {
39084 return m->mp_subscript(obj, key);
39086 return __Pyx_PyObject_GetIndex(obj, key);
39090 /* PyObjectSetAttrStr */
39091 #if CYTHON_USE_TYPE_SLOTS
39092 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
39093 PyTypeObject* tp = Py_TYPE(obj);
39094 if (likely(tp->tp_setattro))
39095 return tp->tp_setattro(obj, attr_name, value);
39096 #if PY_MAJOR_VERSION < 3
39097 if (likely(tp->tp_setattr))
39098 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
39100 return PyObject_SetAttr(obj, attr_name, value);
39105 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
39106 Py_ssize_t cstart, Py_ssize_t cstop,
39107 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
39108 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
39109 #if CYTHON_USE_TYPE_SLOTS
39110 PyMappingMethods* mp;
39111 #if PY_MAJOR_VERSION < 3
39112 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
39113 if (likely(ms && ms->sq_ass_slice)) {
39115 if (_py_start && (*_py_start != Py_None)) {
39116 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
39117 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
39122 if (_py_stop && (*_py_stop != Py_None)) {
39123 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
39124 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
39126 cstop = PY_SSIZE_T_MAX;
39128 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
39129 Py_ssize_t l = ms->sq_length(obj);
39130 if (likely(l >= 0)) {
39133 if (cstop < 0) cstop = 0;
39137 if (cstart < 0) cstart = 0;
39140 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
39145 return ms->sq_ass_slice(obj, cstart, cstop, value);
39148 mp = Py_TYPE(obj)->tp_as_mapping;
39149 if (likely(mp && mp->mp_ass_subscript))
39153 PyObject *py_slice, *py_start, *py_stop;
39155 py_slice = *_py_slice;
39157 PyObject* owned_start = NULL;
39158 PyObject* owned_stop = NULL;
39160 py_start = *_py_start;
39163 owned_start = py_start = PyInt_FromSsize_t(cstart);
39164 if (unlikely(!py_start)) goto bad;
39166 py_start = Py_None;
39169 py_stop = *_py_stop;
39172 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
39173 if (unlikely(!py_stop)) {
39174 Py_XDECREF(owned_start);
39180 py_slice = PySlice_New(py_start, py_stop, Py_None);
39181 Py_XDECREF(owned_start);
39182 Py_XDECREF(owned_stop);
39183 if (unlikely(!py_slice)) goto bad;
39185 #if CYTHON_USE_TYPE_SLOTS
39186 result = mp->mp_ass_subscript(obj, py_slice, value);
39188 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
39191 Py_DECREF(py_slice);
39195 PyErr_Format(PyExc_TypeError,
39196 "'%.200s' object does not support slice %.10s",
39197 Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
39202 /* UnpackUnboundCMethod */
39203 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
39205 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
39206 if (unlikely(!method))
39208 target->method = method;
39209 #if CYTHON_COMPILING_IN_CPYTHON
39210 #if PY_MAJOR_VERSION >= 3
39211 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
39214 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
39215 target->func = descr->d_method->ml_meth;
39216 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
39222 /* CallUnboundCMethod1 */
39223 #if CYTHON_COMPILING_IN_CPYTHON
39224 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
39225 if (likely(cfunc->func)) {
39226 int flag = cfunc->flag;
39227 if (flag == METH_O) {
39228 return (*(cfunc->func))(self, arg);
39229 } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
39230 if (PY_VERSION_HEX >= 0x030700A0) {
39231 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
39233 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
39235 } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
39236 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
39239 return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
39242 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
39243 PyObject *args, *result = NULL;
39244 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
39245 #if CYTHON_COMPILING_IN_CPYTHON
39246 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
39247 args = PyTuple_New(1);
39248 if (unlikely(!args)) goto bad;
39250 PyTuple_SET_ITEM(args, 0, arg);
39251 if (cfunc->flag & METH_KEYWORDS)
39252 result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
39254 result = (*cfunc->func)(self, args);
39256 args = PyTuple_New(2);
39257 if (unlikely(!args)) goto bad;
39259 PyTuple_SET_ITEM(args, 0, self);
39261 PyTuple_SET_ITEM(args, 1, arg);
39262 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39265 args = PyTuple_Pack(2, self, arg);
39266 if (unlikely(!args)) goto bad;
39267 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39274 /* CallUnboundCMethod2 */
39275 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
39276 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
39277 if (likely(cfunc->func)) {
39278 PyObject *args[2] = {arg1, arg2};
39279 if (cfunc->flag == METH_FASTCALL) {
39280 #if PY_VERSION_HEX >= 0x030700A0
39281 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
39283 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
39286 #if PY_VERSION_HEX >= 0x030700A0
39287 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
39288 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
39291 return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
39294 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
39295 PyObject *args, *result = NULL;
39296 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
39297 #if CYTHON_COMPILING_IN_CPYTHON
39298 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
39299 args = PyTuple_New(2);
39300 if (unlikely(!args)) goto bad;
39302 PyTuple_SET_ITEM(args, 0, arg1);
39304 PyTuple_SET_ITEM(args, 1, arg2);
39305 if (cfunc->flag & METH_KEYWORDS)
39306 result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
39308 result = (*cfunc->func)(self, args);
39310 args = PyTuple_New(3);
39311 if (unlikely(!args)) goto bad;
39313 PyTuple_SET_ITEM(args, 0, self);
39315 PyTuple_SET_ITEM(args, 1, arg1);
39317 PyTuple_SET_ITEM(args, 2, arg2);
39318 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39321 args = PyTuple_Pack(3, self, arg1, arg2);
39322 if (unlikely(!args)) goto bad;
39323 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39330 /* dict_getitem_default */
39331 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
39333 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
39334 value = PyDict_GetItemWithError(d, key);
39335 if (unlikely(!value)) {
39336 if (unlikely(PyErr_Occurred()))
39338 value = default_value;
39343 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
39344 value = PyDict_GetItem(d, key);
39345 if (unlikely(!value)) {
39346 value = default_value;
39352 if (default_value == Py_None)
39353 value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
39355 value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
39361 static const char DIGIT_PAIRS_10[2*10*10+1] = {
39362 "00010203040506070809"
39363 "10111213141516171819"
39364 "20212223242526272829"
39365 "30313233343536373839"
39366 "40414243444546474849"
39367 "50515253545556575859"
39368 "60616263646566676869"
39369 "70717273747576777879"
39370 "80818283848586878889"
39371 "90919293949596979899"
39373 static const char DIGIT_PAIRS_8[2*8*8+1] = {
39383 static const char DIGITS_HEX[2*16+1] = {
39388 /* BuildPyUnicode */
39389 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
39390 int prepend_sign, char padding_char) {
39392 Py_ssize_t uoffset = ulength - clength;
39393 #if CYTHON_USE_UNICODE_INTERNALS
39395 #if CYTHON_PEP393_ENABLED
39397 uval = PyUnicode_New(ulength, 127);
39398 if (unlikely(!uval)) return NULL;
39399 udata = PyUnicode_DATA(uval);
39402 uval = PyUnicode_FromUnicode(NULL, ulength);
39403 if (unlikely(!uval)) return NULL;
39404 udata = PyUnicode_AS_UNICODE(uval);
39408 if (prepend_sign) {
39409 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
39412 for (; i < uoffset; i++) {
39413 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
39416 for (i=0; i < clength; i++) {
39417 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
39421 PyObject *sign = NULL, *padding = NULL;
39424 prepend_sign = !!prepend_sign;
39425 if (uoffset > prepend_sign) {
39426 padding = PyUnicode_FromOrdinal(padding_char);
39427 if (likely(padding) && uoffset > prepend_sign + 1) {
39429 PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
39430 if (unlikely(!repeat)) goto done_or_error;
39431 tmp = PyNumber_Multiply(padding, repeat);
39433 Py_DECREF(padding);
39436 if (unlikely(!padding)) goto done_or_error;
39438 if (prepend_sign) {
39439 sign = PyUnicode_FromOrdinal('-');
39440 if (unlikely(!sign)) goto done_or_error;
39443 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
39444 if (likely(uval) && padding) {
39445 PyObject *tmp = PyNumber_Add(padding, uval);
39449 if (likely(uval) && sign) {
39450 PyObject *tmp = PyNumber_Add(sign, uval);
39455 Py_XDECREF(padding);
39462 /* CIntToPyUnicode */
39464 #ifndef _MSC_STDINT_H_
39465 #if _MSC_VER < 1300
39466 typedef unsigned short uint16_t;
39468 typedef unsigned __int16 uint16_t;
39472 #include <stdint.h>
39474 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
39475 #define GCC_DIAGNOSTIC
39477 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
39478 char digits[sizeof(Py_ssize_t)*3+2];
39479 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
39480 const char *hex_digits = DIGITS_HEX;
39481 Py_ssize_t length, ulength;
39482 int prepend_sign, last_one_off;
39483 Py_ssize_t remaining;
39484 #ifdef GCC_DIAGNOSTIC
39485 #pragma GCC diagnostic push
39486 #pragma GCC diagnostic ignored "-Wconversion"
39488 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
39489 #ifdef GCC_DIAGNOSTIC
39490 #pragma GCC diagnostic pop
39492 const int is_unsigned = neg_one > const_zero;
39493 if (format_char == 'X') {
39502 switch (format_char) {
39504 digit_pos = abs((int)(remaining % (8*8)));
39505 remaining = (Py_ssize_t) (remaining / (8*8));
39507 *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos];
39508 last_one_off = (digit_pos < 8);
39511 digit_pos = abs((int)(remaining % (10*10)));
39512 remaining = (Py_ssize_t) (remaining / (10*10));
39514 *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos];
39515 last_one_off = (digit_pos < 10);
39518 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
39519 remaining = (Py_ssize_t) (remaining / 16);
39525 } while (unlikely(remaining != 0));
39526 if (last_one_off) {
39527 assert(*dpos == '0');
39530 length = end - dpos;
39533 if (!is_unsigned && value <= neg_one) {
39534 if (padding_char == ' ' || width <= length + 1) {
39542 if (width > ulength) {
39545 if (ulength == 1) {
39546 return PyUnicode_FromOrdinal(*dpos);
39548 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
39552 #if !CYTHON_COMPILING_IN_PYPY
39553 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
39555 (void)zerodivision_check;
39556 #if PY_MAJOR_VERSION < 3
39557 if (likely(PyInt_CheckExact(op1))) {
39558 const long b = intval;
39560 long a = PyInt_AS_LONG(op1);
39561 x = (long)((unsigned long)a - b);
39562 if (likely((x^a) >= 0 || (x^~b) >= 0))
39563 return PyInt_FromLong(x);
39564 return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
39567 #if CYTHON_USE_PYLONG_INTERNALS
39568 if (likely(PyLong_CheckExact(op1))) {
39569 const long b = intval;
39571 #ifdef HAVE_LONG_LONG
39572 const PY_LONG_LONG llb = intval;
39573 PY_LONG_LONG lla, llx;
39575 const digit* digits = ((PyLongObject*)op1)->ob_digit;
39576 const Py_ssize_t size = Py_SIZE(op1);
39577 if (likely(__Pyx_sst_abs(size) <= 1)) {
39578 a = likely(size) ? digits[0] : 0;
39579 if (size == -1) a = -a;
39583 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
39584 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39586 #ifdef HAVE_LONG_LONG
39587 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39588 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39592 CYTHON_FALLTHROUGH;
39594 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
39595 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39597 #ifdef HAVE_LONG_LONG
39598 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39599 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39603 CYTHON_FALLTHROUGH;
39605 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
39606 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39608 #ifdef HAVE_LONG_LONG
39609 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
39610 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39614 CYTHON_FALLTHROUGH;
39616 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
39617 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39619 #ifdef HAVE_LONG_LONG
39620 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
39621 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39625 CYTHON_FALLTHROUGH;
39627 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39628 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39630 #ifdef HAVE_LONG_LONG
39631 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39632 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39636 CYTHON_FALLTHROUGH;
39638 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39639 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39641 #ifdef HAVE_LONG_LONG
39642 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39643 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39647 CYTHON_FALLTHROUGH;
39648 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
39652 return PyLong_FromLong(x);
39653 #ifdef HAVE_LONG_LONG
39656 return PyLong_FromLongLong(llx);
39662 if (PyFloat_CheckExact(op1)) {
39663 const long b = intval;
39664 double a = PyFloat_AS_DOUBLE(op1);
39666 PyFPE_START_PROTECT("subtract", return NULL)
39667 result = ((double)a) - (double)b;
39668 PyFPE_END_PROTECT(result)
39669 return PyFloat_FromDouble(result);
39671 return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
39676 #if CYTHON_USE_PYLONG_INTERNALS
39677 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
39678 if (likely(Py_SIZE(n) == -1)) {
39679 return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
39681 #if CYTHON_COMPILING_IN_CPYTHON
39683 PyObject *copy = _PyLong_Copy((PyLongObject*)n);
39684 if (likely(copy)) {
39685 Py_SIZE(copy) = -(Py_SIZE(copy));
39690 return PyNumber_Negative(n);
39695 /* GetTopmostException */
39696 #if CYTHON_USE_EXC_INFO_STACK
39697 static _PyErr_StackItem *
39698 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
39700 _PyErr_StackItem *exc_info = tstate->exc_info;
39701 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
39702 exc_info->previous_item != NULL)
39704 exc_info = exc_info->previous_item;
39710 /* SaveResetException */
39711 #if CYTHON_FAST_THREAD_STATE
39712 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
39713 #if CYTHON_USE_EXC_INFO_STACK
39714 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
39715 *type = exc_info->exc_type;
39716 *value = exc_info->exc_value;
39717 *tb = exc_info->exc_traceback;
39719 *type = tstate->exc_type;
39720 *value = tstate->exc_value;
39721 *tb = tstate->exc_traceback;
39724 Py_XINCREF(*value);
39727 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
39728 PyObject *tmp_type, *tmp_value, *tmp_tb;
39729 #if CYTHON_USE_EXC_INFO_STACK
39730 _PyErr_StackItem *exc_info = tstate->exc_info;
39731 tmp_type = exc_info->exc_type;
39732 tmp_value = exc_info->exc_value;
39733 tmp_tb = exc_info->exc_traceback;
39734 exc_info->exc_type = type;
39735 exc_info->exc_value = value;
39736 exc_info->exc_traceback = tb;
39738 tmp_type = tstate->exc_type;
39739 tmp_value = tstate->exc_value;
39740 tmp_tb = tstate->exc_traceback;
39741 tstate->exc_type = type;
39742 tstate->exc_value = value;
39743 tstate->exc_traceback = tb;
39745 Py_XDECREF(tmp_type);
39746 Py_XDECREF(tmp_value);
39747 Py_XDECREF(tmp_tb);
39751 /* PyErrExceptionMatches */
39752 #if CYTHON_FAST_THREAD_STATE
39753 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
39755 n = PyTuple_GET_SIZE(tuple);
39756 #if PY_MAJOR_VERSION >= 3
39757 for (i=0; i<n; i++) {
39758 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
39761 for (i=0; i<n; i++) {
39762 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
39766 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
39767 PyObject *exc_type = tstate->curexc_type;
39768 if (exc_type == err) return 1;
39769 if (unlikely(!exc_type)) return 0;
39770 if (unlikely(PyTuple_Check(err)))
39771 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
39772 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
39777 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
39778 #if CYTHON_USE_TYPE_SLOTS
39779 #if PY_MAJOR_VERSION >= 3
39780 if (likely(PyUnicode_Check(n)))
39782 if (likely(PyString_Check(n)))
39784 return __Pyx_PyObject_GetAttrStr(o, n);
39786 return PyObject_GetAttr(o, n);
39790 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
39791 __Pyx_PyThreadState_declare
39792 __Pyx_PyThreadState_assign
39793 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
39795 __Pyx_PyErr_Clear();
39799 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
39800 PyObject *r = __Pyx_GetAttr(o, n);
39801 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
39805 static CYTHON_INLINE int __Pyx_IterFinish(void) {
39806 #if CYTHON_FAST_THREAD_STATE
39807 PyThreadState *tstate = __Pyx_PyThreadState_Current;
39808 PyObject* exc_type = tstate->curexc_type;
39809 if (unlikely(exc_type)) {
39810 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
39811 PyObject *exc_value, *exc_tb;
39812 exc_value = tstate->curexc_value;
39813 exc_tb = tstate->curexc_traceback;
39814 tstate->curexc_type = 0;
39815 tstate->curexc_value = 0;
39816 tstate->curexc_traceback = 0;
39817 Py_DECREF(exc_type);
39818 Py_XDECREF(exc_value);
39819 Py_XDECREF(exc_tb);
39827 if (unlikely(PyErr_Occurred())) {
39828 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
39839 /* UnpackItemEndCheck */
39840 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
39841 if (unlikely(retval)) {
39843 __Pyx_RaiseTooManyValuesError(expected);
39846 return __Pyx_IterFinish();
39852 #if !CYTHON_COMPILING_IN_PYPY
39853 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
39855 (void)zerodivision_check;
39856 #if PY_MAJOR_VERSION < 3
39857 if (likely(PyInt_CheckExact(op1))) {
39858 const long b = intval;
39860 long a = PyInt_AS_LONG(op1);
39861 x = (long)((unsigned long)a + b);
39862 if (likely((x^a) >= 0 || (x^b) >= 0))
39863 return PyInt_FromLong(x);
39864 return PyLong_Type.tp_as_number->nb_add(op1, op2);
39867 #if CYTHON_USE_PYLONG_INTERNALS
39868 if (likely(PyLong_CheckExact(op1))) {
39869 const long b = intval;
39871 #ifdef HAVE_LONG_LONG
39872 const PY_LONG_LONG llb = intval;
39873 PY_LONG_LONG lla, llx;
39875 const digit* digits = ((PyLongObject*)op1)->ob_digit;
39876 const Py_ssize_t size = Py_SIZE(op1);
39877 if (likely(__Pyx_sst_abs(size) <= 1)) {
39878 a = likely(size) ? digits[0] : 0;
39879 if (size == -1) a = -a;
39883 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
39884 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39886 #ifdef HAVE_LONG_LONG
39887 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39888 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39892 CYTHON_FALLTHROUGH;
39894 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
39895 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39897 #ifdef HAVE_LONG_LONG
39898 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39899 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39903 CYTHON_FALLTHROUGH;
39905 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
39906 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39908 #ifdef HAVE_LONG_LONG
39909 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
39910 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39914 CYTHON_FALLTHROUGH;
39916 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
39917 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39919 #ifdef HAVE_LONG_LONG
39920 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
39921 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39925 CYTHON_FALLTHROUGH;
39927 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39928 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39930 #ifdef HAVE_LONG_LONG
39931 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39932 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39936 CYTHON_FALLTHROUGH;
39938 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39939 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39941 #ifdef HAVE_LONG_LONG
39942 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39943 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
39947 CYTHON_FALLTHROUGH;
39948 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
39952 return PyLong_FromLong(x);
39953 #ifdef HAVE_LONG_LONG
39956 return PyLong_FromLongLong(llx);
39962 if (PyFloat_CheckExact(op1)) {
39963 const long b = intval;
39964 double a = PyFloat_AS_DOUBLE(op1);
39966 PyFPE_START_PROTECT("add", return NULL)
39967 result = ((double)a) + (double)b;
39968 PyFPE_END_PROTECT(result)
39969 return PyFloat_FromDouble(result);
39971 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
39976 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
39980 #if PY_MAJOR_VERSION < 3
39981 if (likely(PyInt_CheckExact(op1))) {
39982 const long b = intval;
39983 long a = PyInt_AS_LONG(op1);
39984 if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
39987 #if CYTHON_USE_PYLONG_INTERNALS
39988 if (likely(PyLong_CheckExact(op1))) {
39990 unsigned long uintval;
39991 Py_ssize_t size = Py_SIZE(op1);
39992 const digit* digits = ((PyLongObject*)op1)->ob_digit;
39994 if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
39995 } else if (intval < 0) {
40004 uintval = (unsigned long) intval;
40005 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
40006 if (uintval >> (PyLong_SHIFT * 4)) {
40007 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40008 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40011 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
40012 if (uintval >> (PyLong_SHIFT * 3)) {
40013 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40014 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40017 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
40018 if (uintval >> (PyLong_SHIFT * 2)) {
40019 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40020 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40023 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
40024 if (uintval >> (PyLong_SHIFT * 1)) {
40025 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40026 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40029 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
40030 if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40033 if (PyFloat_CheckExact(op1)) {
40034 const long b = intval;
40035 double a = PyFloat_AS_DOUBLE(op1);
40036 if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40039 PyObject_RichCompare(op1, op2, Py_EQ));
40042 /* CallUnboundCMethod0 */
40043 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
40044 PyObject *args, *result = NULL;
40045 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
40046 #if CYTHON_ASSUME_SAFE_MACROS
40047 args = PyTuple_New(1);
40048 if (unlikely(!args)) goto bad;
40050 PyTuple_SET_ITEM(args, 0, self);
40052 args = PyTuple_Pack(1, self);
40053 if (unlikely(!args)) goto bad;
40055 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
40061 /* py_dict_items */
40062 static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
40063 if (PY_MAJOR_VERSION >= 3)
40064 return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
40066 return PyDict_Items(d);
40069 /* pyfrozenset_new */
40070 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
40073 #if CYTHON_COMPILING_IN_PYPY
40075 args = PyTuple_Pack(1, it);
40076 if (unlikely(!args))
40078 result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
40082 if (PyFrozenSet_CheckExact(it)) {
40086 result = PyFrozenSet_New(it);
40087 if (unlikely(!result))
40089 if (likely(PySet_GET_SIZE(result)))
40094 #if CYTHON_USE_TYPE_SLOTS
40095 return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
40097 return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
40101 /* PySetContains */
40102 static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
40104 if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
40107 tmpkey = __Pyx_PyFrozenSet_New(key);
40108 if (tmpkey != NULL) {
40109 result = PySet_Contains(set, tmpkey);
40115 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
40116 int result = PySet_Contains(set, key);
40117 if (unlikely(result < 0)) {
40118 result = __Pyx_PySet_ContainsUnhashable(set, key);
40120 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
40123 /* py_dict_values */
40124 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
40125 if (PY_MAJOR_VERSION >= 3)
40126 return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
40128 return PyDict_Values(d);
40131 /* KeywordStringCheck */
40132 static int __Pyx_CheckKeywordStrings(
40134 const char* function_name,
40138 Py_ssize_t pos = 0;
40139 #if CYTHON_COMPILING_IN_PYPY
40140 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
40141 goto invalid_keyword;
40144 while (PyDict_Next(kwdict, &pos, &key, 0)) {
40145 #if PY_MAJOR_VERSION < 3
40146 if (unlikely(!PyString_Check(key)))
40148 if (unlikely(!PyUnicode_Check(key)))
40149 goto invalid_keyword_type;
40151 if ((!kw_allowed) && unlikely(key))
40152 goto invalid_keyword;
40154 invalid_keyword_type:
40155 PyErr_Format(PyExc_TypeError,
40156 "%.200s() keywords must be strings", function_name);
40160 PyErr_Format(PyExc_TypeError,
40161 #if PY_MAJOR_VERSION < 3
40162 "%.200s() got an unexpected keyword argument '%.200s'",
40163 function_name, PyString_AsString(key));
40165 "%s() got an unexpected keyword argument '%U'",
40166 function_name, key);
40172 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
40174 if (unlikely(!type)) {
40175 PyErr_SetString(PyExc_SystemError, "Missing type object");
40179 #if PY_MAJOR_VERSION == 2
40180 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
40184 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
40186 PyErr_Format(PyExc_TypeError,
40187 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
40188 name, type->tp_name, Py_TYPE(obj)->tp_name);
40192 /* PyUnicode_Unicode */
40193 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
40194 if (unlikely(obj == Py_None))
40195 obj = __pyx_n_u_None;
40196 return __Pyx_NewRef(obj);
40199 /* PyObjectFormatAndDecref */
40200 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
40201 if (unlikely(!s)) return NULL;
40202 if (likely(PyUnicode_CheckExact(s))) return s;
40203 #if PY_MAJOR_VERSION < 3
40204 if (likely(PyString_CheckExact(s))) {
40205 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
40210 return __Pyx_PyObject_FormatAndDecref(s, f);
40212 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
40213 PyObject *result = PyObject_Format(s, f);
40219 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
40220 Py_ssize_t cstart, Py_ssize_t cstop,
40221 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
40222 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
40223 #if CYTHON_USE_TYPE_SLOTS
40224 PyMappingMethods* mp;
40225 #if PY_MAJOR_VERSION < 3
40226 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
40227 if (likely(ms && ms->sq_slice)) {
40229 if (_py_start && (*_py_start != Py_None)) {
40230 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
40231 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
40236 if (_py_stop && (*_py_stop != Py_None)) {
40237 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
40238 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
40240 cstop = PY_SSIZE_T_MAX;
40242 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
40243 Py_ssize_t l = ms->sq_length(obj);
40244 if (likely(l >= 0)) {
40247 if (cstop < 0) cstop = 0;
40251 if (cstart < 0) cstart = 0;
40254 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
40259 return ms->sq_slice(obj, cstart, cstop);
40262 mp = Py_TYPE(obj)->tp_as_mapping;
40263 if (likely(mp && mp->mp_subscript))
40267 PyObject *py_slice, *py_start, *py_stop;
40269 py_slice = *_py_slice;
40271 PyObject* owned_start = NULL;
40272 PyObject* owned_stop = NULL;
40274 py_start = *_py_start;
40277 owned_start = py_start = PyInt_FromSsize_t(cstart);
40278 if (unlikely(!py_start)) goto bad;
40280 py_start = Py_None;
40283 py_stop = *_py_stop;
40286 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
40287 if (unlikely(!py_stop)) {
40288 Py_XDECREF(owned_start);
40294 py_slice = PySlice_New(py_start, py_stop, Py_None);
40295 Py_XDECREF(owned_start);
40296 Py_XDECREF(owned_stop);
40297 if (unlikely(!py_slice)) goto bad;
40299 #if CYTHON_USE_TYPE_SLOTS
40300 result = mp->mp_subscript(obj, py_slice);
40302 result = PyObject_GetItem(obj, py_slice);
40305 Py_DECREF(py_slice);
40309 PyErr_Format(PyExc_TypeError,
40310 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
40316 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
40317 PyObject *empty_list = 0;
40318 PyObject *module = 0;
40319 PyObject *global_dict = 0;
40320 PyObject *empty_dict = 0;
40322 #if PY_MAJOR_VERSION < 3
40323 PyObject *py_import;
40324 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
40331 empty_list = PyList_New(0);
40336 global_dict = PyModule_GetDict(__pyx_m);
40339 empty_dict = PyDict_New();
40343 #if PY_MAJOR_VERSION >= 3
40345 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
40346 module = PyImport_ImportModuleLevelObject(
40347 name, global_dict, empty_dict, list, 1);
40349 if (!PyErr_ExceptionMatches(PyExc_ImportError))
40358 #if PY_MAJOR_VERSION < 3
40359 PyObject *py_level = PyInt_FromLong(level);
40362 module = PyObject_CallFunctionObjArgs(py_import,
40363 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
40364 Py_DECREF(py_level);
40366 module = PyImport_ImportModuleLevelObject(
40367 name, global_dict, empty_dict, list, level);
40372 #if PY_MAJOR_VERSION < 3
40373 Py_XDECREF(py_import);
40375 Py_XDECREF(empty_list);
40376 Py_XDECREF(empty_dict);
40381 #if CYTHON_FAST_THREAD_STATE
40382 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
40384 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
40387 PyObject *local_type, *local_value, *local_tb;
40388 #if CYTHON_FAST_THREAD_STATE
40389 PyObject *tmp_type, *tmp_value, *tmp_tb;
40390 local_type = tstate->curexc_type;
40391 local_value = tstate->curexc_value;
40392 local_tb = tstate->curexc_traceback;
40393 tstate->curexc_type = 0;
40394 tstate->curexc_value = 0;
40395 tstate->curexc_traceback = 0;
40397 PyErr_Fetch(&local_type, &local_value, &local_tb);
40399 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
40400 #if CYTHON_FAST_THREAD_STATE
40401 if (unlikely(tstate->curexc_type))
40403 if (unlikely(PyErr_Occurred()))
40406 #if PY_MAJOR_VERSION >= 3
40408 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
40412 Py_XINCREF(local_tb);
40413 Py_XINCREF(local_type);
40414 Py_XINCREF(local_value);
40415 *type = local_type;
40416 *value = local_value;
40418 #if CYTHON_FAST_THREAD_STATE
40419 #if CYTHON_USE_EXC_INFO_STACK
40421 _PyErr_StackItem *exc_info = tstate->exc_info;
40422 tmp_type = exc_info->exc_type;
40423 tmp_value = exc_info->exc_value;
40424 tmp_tb = exc_info->exc_traceback;
40425 exc_info->exc_type = local_type;
40426 exc_info->exc_value = local_value;
40427 exc_info->exc_traceback = local_tb;
40430 tmp_type = tstate->exc_type;
40431 tmp_value = tstate->exc_value;
40432 tmp_tb = tstate->exc_traceback;
40433 tstate->exc_type = local_type;
40434 tstate->exc_value = local_value;
40435 tstate->exc_traceback = local_tb;
40437 Py_XDECREF(tmp_type);
40438 Py_XDECREF(tmp_value);
40439 Py_XDECREF(tmp_tb);
40441 PyErr_SetExcInfo(local_type, local_value, local_tb);
40448 Py_XDECREF(local_type);
40449 Py_XDECREF(local_value);
40450 Py_XDECREF(local_tb);
40455 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
40459 #if PY_MAJOR_VERSION < 3
40460 if (likely(PyInt_CheckExact(op1))) {
40461 const long b = intval;
40462 long a = PyInt_AS_LONG(op1);
40463 if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40466 #if CYTHON_USE_PYLONG_INTERNALS
40467 if (likely(PyLong_CheckExact(op1))) {
40469 unsigned long uintval;
40470 Py_ssize_t size = Py_SIZE(op1);
40471 const digit* digits = ((PyLongObject*)op1)->ob_digit;
40473 if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40474 } else if (intval < 0) {
40483 uintval = (unsigned long) intval;
40484 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
40485 if (uintval >> (PyLong_SHIFT * 4)) {
40486 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40487 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40490 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
40491 if (uintval >> (PyLong_SHIFT * 3)) {
40492 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40493 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40496 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
40497 if (uintval >> (PyLong_SHIFT * 2)) {
40498 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40499 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40502 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
40503 if (uintval >> (PyLong_SHIFT * 1)) {
40504 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40505 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40508 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
40509 if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40512 if (PyFloat_CheckExact(op1)) {
40513 const long b = intval;
40514 double a = PyFloat_AS_DOUBLE(op1);
40515 if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40518 PyObject_RichCompare(op1, op2, Py_NE));
40522 static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
40525 r = PyObject_DelItem(o, j);
40529 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
40530 CYTHON_UNUSED int is_list, CYTHON_NCP_UNUSED int wraparound) {
40531 #if !CYTHON_USE_TYPE_SLOTS
40532 if (is_list || PySequence_Check(o)) {
40533 return PySequence_DelItem(o, i);
40536 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
40537 if (likely(m && m->sq_ass_item)) {
40538 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
40539 Py_ssize_t l = m->sq_length(o);
40540 if (likely(l >= 0)) {
40543 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
40548 return m->sq_ass_item(o, i, (PyObject *)NULL);
40551 return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i));
40554 /* CallNextTpDealloc */
40555 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
40556 PyTypeObject* type = Py_TYPE(obj);
40557 while (type && type->tp_dealloc != current_tp_dealloc)
40558 type = type->tp_base;
40559 while (type && type->tp_dealloc == current_tp_dealloc)
40560 type = type->tp_base;
40562 type->tp_dealloc(obj);
40565 /* CallNextTpTraverse */
40566 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
40567 PyTypeObject* type = Py_TYPE(obj);
40568 while (type && type->tp_traverse != current_tp_traverse)
40569 type = type->tp_base;
40570 while (type && type->tp_traverse == current_tp_traverse)
40571 type = type->tp_base;
40572 if (type && type->tp_traverse)
40573 return type->tp_traverse(obj, v, a);
40577 /* CallNextTpClear */
40578 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
40579 PyTypeObject* type = Py_TYPE(obj);
40580 while (type && type->tp_clear != current_tp_clear)
40581 type = type->tp_base;
40582 while (type && type->tp_clear == current_tp_clear)
40583 type = type->tp_base;
40584 if (type && type->tp_clear)
40585 type->tp_clear(obj);
40588 /* PyObject_GenericGetAttrNoDict */
40589 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
40590 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
40591 PyErr_Format(PyExc_AttributeError,
40592 #if PY_MAJOR_VERSION >= 3
40593 "'%.50s' object has no attribute '%U'",
40594 tp->tp_name, attr_name);
40596 "'%.50s' object has no attribute '%.400s'",
40597 tp->tp_name, PyString_AS_STRING(attr_name));
40601 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
40603 PyTypeObject *tp = Py_TYPE(obj);
40604 if (unlikely(!PyString_Check(attr_name))) {
40605 return PyObject_GenericGetAttr(obj, attr_name);
40607 assert(!tp->tp_dictoffset);
40608 descr = _PyType_Lookup(tp, attr_name);
40609 if (unlikely(!descr)) {
40610 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
40613 #if PY_MAJOR_VERSION < 3
40614 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
40617 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
40619 PyObject *res = f(descr, obj, (PyObject *)tp);
40628 /* PyObject_GenericGetAttr */
40629 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
40630 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
40631 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
40632 return PyObject_GenericGetAttr(obj, attr_name);
40634 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
40639 #ifndef __PYX_HAVE_RT_ImportType
40640 #define __PYX_HAVE_RT_ImportType
40641 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
40642 size_t size, enum __Pyx_ImportType_CheckSize check_size)
40644 PyObject *result = 0;
40646 Py_ssize_t basicsize;
40647 #ifdef Py_LIMITED_API
40648 PyObject *py_basicsize;
40650 result = PyObject_GetAttrString(module, class_name);
40653 if (!PyType_Check(result)) {
40654 PyErr_Format(PyExc_TypeError,
40655 "%.200s.%.200s is not a type object",
40656 module_name, class_name);
40659 #ifndef Py_LIMITED_API
40660 basicsize = ((PyTypeObject *)result)->tp_basicsize;
40662 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
40665 basicsize = PyLong_AsSsize_t(py_basicsize);
40666 Py_DECREF(py_basicsize);
40668 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
40671 if ((size_t)basicsize < size) {
40672 PyErr_Format(PyExc_ValueError,
40673 "%.200s.%.200s size changed, may indicate binary incompatibility. "
40674 "Expected %zd from C header, got %zd from PyObject",
40675 module_name, class_name, size, basicsize);
40678 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
40679 PyErr_Format(PyExc_ValueError,
40680 "%.200s.%.200s size changed, may indicate binary incompatibility. "
40681 "Expected %zd from C header, got %zd from PyObject",
40682 module_name, class_name, size, basicsize);
40685 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
40686 PyOS_snprintf(warning, sizeof(warning),
40687 "%s.%s size changed, may indicate binary incompatibility. "
40688 "Expected %zd from C header, got %zd from PyObject",
40689 module_name, class_name, size, basicsize);
40690 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
40692 return (PyTypeObject *)result;
40694 Py_XDECREF(result);
40700 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
40701 #if PY_VERSION_HEX >= 0x02070000
40702 PyObject *ob = PyCapsule_New(vtable, 0, 0);
40704 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
40708 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
40718 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
40719 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
40720 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
40721 PyErr_Format(PyExc_ImportError,
40722 #if PY_MAJOR_VERSION < 3
40723 "cannot import name %.230s", PyString_AS_STRING(name));
40725 "cannot import name %S", name);
40731 /* FetchCommonType */
40732 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
40733 PyObject* fake_module;
40734 PyTypeObject* cached_type = NULL;
40735 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
40736 if (!fake_module) return NULL;
40737 Py_INCREF(fake_module);
40738 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
40740 if (!PyType_Check((PyObject*)cached_type)) {
40741 PyErr_Format(PyExc_TypeError,
40742 "Shared Cython type %.200s is not a type object",
40746 if (cached_type->tp_basicsize != type->tp_basicsize) {
40747 PyErr_Format(PyExc_TypeError,
40748 "Shared Cython type %.200s has the wrong size, try recompiling",
40753 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
40755 if (PyType_Ready(type) < 0) goto bad;
40756 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
40759 cached_type = type;
40762 Py_DECREF(fake_module);
40763 return cached_type;
40765 Py_XDECREF(cached_type);
40766 cached_type = NULL;
40770 /* CythonFunctionShared */
40771 #include <structmember.h>
40773 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
40775 if (unlikely(op->func_doc == NULL)) {
40776 if (op->func.m_ml->ml_doc) {
40777 #if PY_MAJOR_VERSION >= 3
40778 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
40780 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
40782 if (unlikely(op->func_doc == NULL))
40785 Py_INCREF(Py_None);
40789 Py_INCREF(op->func_doc);
40790 return op->func_doc;
40793 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40795 PyObject *tmp = op->func_doc;
40796 if (value == NULL) {
40800 op->func_doc = value;
40805 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40807 if (unlikely(op->func_name == NULL)) {
40808 #if PY_MAJOR_VERSION >= 3
40809 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
40811 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
40813 if (unlikely(op->func_name == NULL))
40816 Py_INCREF(op->func_name);
40817 return op->func_name;
40820 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40823 #if PY_MAJOR_VERSION >= 3
40824 if (unlikely(value == NULL || !PyUnicode_Check(value)))
40826 if (unlikely(value == NULL || !PyString_Check(value)))
40829 PyErr_SetString(PyExc_TypeError,
40830 "__name__ must be set to a string object");
40833 tmp = op->func_name;
40835 op->func_name = value;
40840 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40842 Py_INCREF(op->func_qualname);
40843 return op->func_qualname;
40846 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40849 #if PY_MAJOR_VERSION >= 3
40850 if (unlikely(value == NULL || !PyUnicode_Check(value)))
40852 if (unlikely(value == NULL || !PyString_Check(value)))
40855 PyErr_SetString(PyExc_TypeError,
40856 "__qualname__ must be set to a string object");
40859 tmp = op->func_qualname;
40861 op->func_qualname = value;
40866 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
40869 self = m->func_closure;
40876 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40878 if (unlikely(op->func_dict == NULL)) {
40879 op->func_dict = PyDict_New();
40880 if (unlikely(op->func_dict == NULL))
40883 Py_INCREF(op->func_dict);
40884 return op->func_dict;
40887 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40890 if (unlikely(value == NULL)) {
40891 PyErr_SetString(PyExc_TypeError,
40892 "function's dictionary may not be deleted");
40895 if (unlikely(!PyDict_Check(value))) {
40896 PyErr_SetString(PyExc_TypeError,
40897 "setting function's dictionary to a non-dict");
40900 tmp = op->func_dict;
40902 op->func_dict = value;
40907 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40909 Py_INCREF(op->func_globals);
40910 return op->func_globals;
40913 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40915 Py_INCREF(Py_None);
40919 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40921 PyObject* result = (op->func_code) ? op->func_code : Py_None;
40926 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
40928 PyObject *res = op->defaults_getter((PyObject *) op);
40929 if (unlikely(!res))
40931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40932 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
40933 Py_INCREF(op->defaults_tuple);
40934 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
40935 Py_INCREF(op->defaults_kwdict);
40937 op->defaults_tuple = PySequence_ITEM(res, 0);
40938 if (unlikely(!op->defaults_tuple)) result = -1;
40940 op->defaults_kwdict = PySequence_ITEM(res, 1);
40941 if (unlikely(!op->defaults_kwdict)) result = -1;
40948 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
40952 } else if (value != Py_None && !PyTuple_Check(value)) {
40953 PyErr_SetString(PyExc_TypeError,
40954 "__defaults__ must be set to a tuple object");
40958 tmp = op->defaults_tuple;
40959 op->defaults_tuple = value;
40964 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
40965 PyObject* result = op->defaults_tuple;
40966 if (unlikely(!result)) {
40967 if (op->defaults_getter) {
40968 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
40969 result = op->defaults_tuple;
40978 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
40982 } else if (value != Py_None && !PyDict_Check(value)) {
40983 PyErr_SetString(PyExc_TypeError,
40984 "__kwdefaults__ must be set to a dict object");
40988 tmp = op->defaults_kwdict;
40989 op->defaults_kwdict = value;
40994 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
40995 PyObject* result = op->defaults_kwdict;
40996 if (unlikely(!result)) {
40997 if (op->defaults_getter) {
40998 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
40999 result = op->defaults_kwdict;
41008 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
41010 if (!value || value == Py_None) {
41012 } else if (!PyDict_Check(value)) {
41013 PyErr_SetString(PyExc_TypeError,
41014 "__annotations__ must be set to a dict object");
41018 tmp = op->func_annotations;
41019 op->func_annotations = value;
41024 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
41025 PyObject* result = op->func_annotations;
41026 if (unlikely(!result)) {
41027 result = PyDict_New();
41028 if (unlikely(!result)) return NULL;
41029 op->func_annotations = result;
41034 static PyGetSetDef __pyx_CyFunction_getsets[] = {
41035 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
41036 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
41037 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
41038 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
41039 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
41040 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
41041 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
41042 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
41043 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
41044 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
41045 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
41046 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
41047 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
41048 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
41049 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
41050 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
41051 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
41052 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
41055 static PyMemberDef __pyx_CyFunction_members[] = {
41056 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
41060 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
41062 #if PY_MAJOR_VERSION >= 3
41063 return PyUnicode_FromString(m->func.m_ml->ml_name);
41065 return PyString_FromString(m->func.m_ml->ml_name);
41068 static PyMethodDef __pyx_CyFunction_methods[] = {
41069 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
41072 #if PY_VERSION_HEX < 0x030500A0
41073 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
41075 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
41077 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
41078 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
41079 if (unlikely(op == NULL))
41082 __Pyx_CyFunction_weakreflist(op) = NULL;
41083 op->func.m_ml = ml;
41084 op->func.m_self = (PyObject *) op;
41085 Py_XINCREF(closure);
41086 op->func_closure = closure;
41087 Py_XINCREF(module);
41088 op->func.m_module = module;
41089 op->func_dict = NULL;
41090 op->func_name = NULL;
41091 Py_INCREF(qualname);
41092 op->func_qualname = qualname;
41093 op->func_doc = NULL;
41094 op->func_classobj = NULL;
41095 op->func_globals = globals;
41096 Py_INCREF(op->func_globals);
41098 op->func_code = code;
41099 op->defaults_pyobjects = 0;
41100 op->defaults_size = 0;
41101 op->defaults = NULL;
41102 op->defaults_tuple = NULL;
41103 op->defaults_kwdict = NULL;
41104 op->defaults_getter = NULL;
41105 op->func_annotations = NULL;
41106 return (PyObject *) op;
41109 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
41111 Py_CLEAR(m->func_closure);
41112 Py_CLEAR(m->func.m_module);
41113 Py_CLEAR(m->func_dict);
41114 Py_CLEAR(m->func_name);
41115 Py_CLEAR(m->func_qualname);
41116 Py_CLEAR(m->func_doc);
41117 Py_CLEAR(m->func_globals);
41118 Py_CLEAR(m->func_code);
41119 Py_CLEAR(m->func_classobj);
41120 Py_CLEAR(m->defaults_tuple);
41121 Py_CLEAR(m->defaults_kwdict);
41122 Py_CLEAR(m->func_annotations);
41124 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
41126 for (i = 0; i < m->defaults_pyobjects; i++)
41127 Py_XDECREF(pydefaults[i]);
41128 PyObject_Free(m->defaults);
41129 m->defaults = NULL;
41133 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
41135 if (__Pyx_CyFunction_weakreflist(m) != NULL)
41136 PyObject_ClearWeakRefs((PyObject *) m);
41137 __Pyx_CyFunction_clear(m);
41138 PyObject_GC_Del(m);
41140 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
41142 PyObject_GC_UnTrack(m);
41143 __Pyx__CyFunction_dealloc(m);
41145 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
41147 Py_VISIT(m->func_closure);
41148 Py_VISIT(m->func.m_module);
41149 Py_VISIT(m->func_dict);
41150 Py_VISIT(m->func_name);
41151 Py_VISIT(m->func_qualname);
41152 Py_VISIT(m->func_doc);
41153 Py_VISIT(m->func_globals);
41154 Py_VISIT(m->func_code);
41155 Py_VISIT(m->func_classobj);
41156 Py_VISIT(m->defaults_tuple);
41157 Py_VISIT(m->defaults_kwdict);
41159 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
41161 for (i = 0; i < m->defaults_pyobjects; i++)
41162 Py_VISIT(pydefaults[i]);
41166 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
41168 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41169 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
41173 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
41175 type = (PyObject *)(Py_TYPE(obj));
41176 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
41178 if (obj == Py_None)
41180 return __Pyx_PyMethod_New(func, obj, type);
41183 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
41185 #if PY_MAJOR_VERSION >= 3
41186 return PyUnicode_FromFormat("<cyfunction %U at %p>",
41187 op->func_qualname, (void *)op);
41189 return PyString_FromFormat("<cyfunction %s at %p>",
41190 PyString_AsString(op->func_qualname), (void *)op);
41193 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
41194 PyCFunctionObject* f = (PyCFunctionObject*)func;
41195 PyCFunction meth = f->m_ml->ml_meth;
41197 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
41199 if (likely(kw == NULL || PyDict_Size(kw) == 0))
41200 return (*meth)(self, arg);
41202 case METH_VARARGS | METH_KEYWORDS:
41203 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
41205 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
41206 size = PyTuple_GET_SIZE(arg);
41207 if (likely(size == 0))
41208 return (*meth)(self, NULL);
41209 PyErr_Format(PyExc_TypeError,
41210 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
41211 f->m_ml->ml_name, size);
41216 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
41217 size = PyTuple_GET_SIZE(arg);
41218 if (likely(size == 1)) {
41219 PyObject *result, *arg0;
41220 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41221 arg0 = PyTuple_GET_ITEM(arg, 0);
41223 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
41225 result = (*meth)(self, arg0);
41226 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
41231 PyErr_Format(PyExc_TypeError,
41232 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
41233 f->m_ml->ml_name, size);
41238 PyErr_SetString(PyExc_SystemError, "Bad call flags in "
41239 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
41240 "longer supported!");
41243 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
41247 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
41248 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
41250 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
41252 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
41253 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
41255 PyObject *new_args;
41257 argc = PyTuple_GET_SIZE(args);
41258 new_args = PyTuple_GetSlice(args, 1, argc);
41259 if (unlikely(!new_args))
41261 self = PyTuple_GetItem(args, 0);
41262 if (unlikely(!self)) {
41263 Py_DECREF(new_args);
41266 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
41267 Py_DECREF(new_args);
41269 result = __Pyx_CyFunction_Call(func, args, kw);
41273 static PyTypeObject __pyx_CyFunctionType_type = {
41274 PyVarObject_HEAD_INIT(0, 0)
41275 "cython_function_or_method",
41276 sizeof(__pyx_CyFunctionObject),
41278 (destructor) __Pyx_CyFunction_dealloc,
41282 #if PY_MAJOR_VERSION < 3
41287 (reprfunc) __Pyx_CyFunction_repr,
41292 __Pyx_CyFunction_CallAsMethod,
41297 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
41299 (traverseproc) __Pyx_CyFunction_traverse,
41300 (inquiry) __Pyx_CyFunction_clear,
41302 #if PY_VERSION_HEX < 0x030500A0
41303 offsetof(__pyx_CyFunctionObject, func_weakreflist),
41305 offsetof(PyCFunctionObject, m_weakreflist),
41309 __pyx_CyFunction_methods,
41310 __pyx_CyFunction_members,
41311 __pyx_CyFunction_getsets,
41314 __Pyx_CyFunction_descr_get,
41316 offsetof(__pyx_CyFunctionObject, func_dict),
41329 #if PY_VERSION_HEX >= 0x030400a1
41332 #if PY_VERSION_HEX >= 0x030800b1
41335 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
41339 static int __pyx_CyFunction_init(void) {
41340 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
41341 if (unlikely(__pyx_CyFunctionType == NULL)) {
41346 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
41347 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41348 m->defaults = PyObject_Malloc(size);
41349 if (unlikely(!m->defaults))
41350 return PyErr_NoMemory();
41351 memset(m->defaults, 0, size);
41352 m->defaults_pyobjects = pyobjects;
41353 m->defaults_size = size;
41354 return m->defaults;
41356 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
41357 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41358 m->defaults_tuple = tuple;
41361 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
41362 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41363 m->defaults_kwdict = dict;
41366 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
41367 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41368 m->func_annotations = dict;
41372 /* CythonFunction */
41373 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
41374 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
41375 PyObject *op = __Pyx_CyFunction_Init(
41376 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
41377 ml, flags, qualname, closure, module, globals, code
41380 PyObject_GC_Track(op);
41385 /* RegisterModuleCleanup */
41386 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
41387 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
41388 __pyx_module_cleanup(module);
41389 Py_INCREF(Py_None); return Py_None;
41391 static int __Pyx_RegisterCleanup(void) {
41392 static PyMethodDef cleanup_def = {
41393 "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0};
41394 PyObject *cleanup_func = 0;
41395 PyObject *atexit = 0;
41397 PyObject *args = 0;
41400 cleanup_func = PyCFunction_New(&cleanup_def, 0);
41403 atexit = PyImport_ImportModule("atexit");
41406 reg = PyObject_GetAttrString(atexit, "_exithandlers");
41407 if (reg && PyList_Check(reg)) {
41409 a = PyTuple_New(0);
41416 args = PyTuple_Pack(3, cleanup_func, a, kw);
41421 ret = PyList_Insert(reg, 0, args);
41426 reg = PyObject_GetAttrString(atexit, "register");
41429 args = PyTuple_Pack(1, cleanup_func);
41432 res = PyObject_CallObject(reg, args);
41438 Py_XDECREF(cleanup_func);
41439 Py_XDECREF(atexit);
41447 /* CLineInTraceback */
41448 #ifndef CYTHON_CLINE_IN_TRACEBACK
41449 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
41450 PyObject *use_cline;
41451 PyObject *ptype, *pvalue, *ptraceback;
41452 #if CYTHON_COMPILING_IN_CPYTHON
41453 PyObject **cython_runtime_dict;
41455 if (unlikely(!__pyx_cython_runtime)) {
41458 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
41459 #if CYTHON_COMPILING_IN_CPYTHON
41460 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
41461 if (likely(cython_runtime_dict)) {
41462 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
41463 use_cline, *cython_runtime_dict,
41464 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
41468 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
41469 if (use_cline_obj) {
41470 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
41471 Py_DECREF(use_cline_obj);
41479 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
41481 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
41484 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
41489 /* CodeObjectCache */
41490 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
41491 int start = 0, mid = 0, end = count - 1;
41492 if (end >= 0 && code_line > entries[end].code_line) {
41495 while (start < end) {
41496 mid = start + (end - start) / 2;
41497 if (code_line < entries[mid].code_line) {
41499 } else if (code_line > entries[mid].code_line) {
41505 if (code_line <= entries[mid].code_line) {
41511 static PyCodeObject *__pyx_find_code_object(int code_line) {
41512 PyCodeObject* code_object;
41514 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
41517 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
41518 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
41521 code_object = __pyx_code_cache.entries[pos].code_object;
41522 Py_INCREF(code_object);
41523 return code_object;
41525 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
41527 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
41528 if (unlikely(!code_line)) {
41531 if (unlikely(!entries)) {
41532 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
41533 if (likely(entries)) {
41534 __pyx_code_cache.entries = entries;
41535 __pyx_code_cache.max_count = 64;
41536 __pyx_code_cache.count = 1;
41537 entries[0].code_line = code_line;
41538 entries[0].code_object = code_object;
41539 Py_INCREF(code_object);
41543 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
41544 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
41545 PyCodeObject* tmp = entries[pos].code_object;
41546 entries[pos].code_object = code_object;
41550 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
41551 int new_max = __pyx_code_cache.max_count + 64;
41552 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
41553 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
41554 if (unlikely(!entries)) {
41557 __pyx_code_cache.entries = entries;
41558 __pyx_code_cache.max_count = new_max;
41560 for (i=__pyx_code_cache.count; i>pos; i--) {
41561 entries[i] = entries[i-1];
41563 entries[pos].code_line = code_line;
41564 entries[pos].code_object = code_object;
41565 __pyx_code_cache.count++;
41566 Py_INCREF(code_object);
41570 #include "compile.h"
41571 #include "frameobject.h"
41572 #include "traceback.h"
41573 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
41574 const char *funcname, int c_line,
41575 int py_line, const char *filename) {
41576 PyCodeObject *py_code = 0;
41577 PyObject *py_srcfile = 0;
41578 PyObject *py_funcname = 0;
41579 #if PY_MAJOR_VERSION < 3
41580 py_srcfile = PyString_FromString(filename);
41582 py_srcfile = PyUnicode_FromString(filename);
41584 if (!py_srcfile) goto bad;
41586 #if PY_MAJOR_VERSION < 3
41587 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
41589 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
41593 #if PY_MAJOR_VERSION < 3
41594 py_funcname = PyString_FromString(funcname);
41596 py_funcname = PyUnicode_FromString(funcname);
41599 if (!py_funcname) goto bad;
41600 py_code = __Pyx_PyCode_New(
41606 __pyx_empty_bytes, /*PyObject *code,*/
41607 __pyx_empty_tuple, /*PyObject *consts,*/
41608 __pyx_empty_tuple, /*PyObject *names,*/
41609 __pyx_empty_tuple, /*PyObject *varnames,*/
41610 __pyx_empty_tuple, /*PyObject *freevars,*/
41611 __pyx_empty_tuple, /*PyObject *cellvars,*/
41612 py_srcfile, /*PyObject *filename,*/
41613 py_funcname, /*PyObject *name,*/
41615 __pyx_empty_bytes /*PyObject *lnotab*/
41617 Py_DECREF(py_srcfile);
41618 Py_DECREF(py_funcname);
41621 Py_XDECREF(py_srcfile);
41622 Py_XDECREF(py_funcname);
41625 static void __Pyx_AddTraceback(const char *funcname, int c_line,
41626 int py_line, const char *filename) {
41627 PyCodeObject *py_code = 0;
41628 PyFrameObject *py_frame = 0;
41629 PyThreadState *tstate = __Pyx_PyThreadState_Current;
41631 c_line = __Pyx_CLineForTraceback(tstate, c_line);
41633 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
41635 py_code = __Pyx_CreateCodeObjectForTraceback(
41636 funcname, c_line, py_line, filename);
41637 if (!py_code) goto bad;
41638 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
41640 py_frame = PyFrame_New(
41641 tstate, /*PyThreadState *tstate,*/
41642 py_code, /*PyCodeObject *code,*/
41643 __pyx_d, /*PyObject *globals,*/
41644 0 /*PyObject *locals*/
41646 if (!py_frame) goto bad;
41647 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
41648 PyTraceBack_Here(py_frame);
41650 Py_XDECREF(py_code);
41651 Py_XDECREF(py_frame);
41654 /* CIntFromPyVerify */
41655 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
41656 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
41657 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
41658 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
41659 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
41661 func_type value = func_value;\
41662 if (sizeof(target_type) < sizeof(func_type)) {\
41663 if (unlikely(value != (func_type) (target_type) value)) {\
41664 func_type zero = 0;\
41665 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
41666 return (target_type) -1;\
41667 if (is_unsigned && unlikely(value < zero))\
41668 goto raise_neg_overflow;\
41670 goto raise_overflow;\
41673 return (target_type) value;\
41677 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
41678 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
41679 const int is_unsigned = neg_one > const_zero;
41681 if (sizeof(long) < sizeof(long)) {
41682 return PyInt_FromLong((long) value);
41683 } else if (sizeof(long) <= sizeof(unsigned long)) {
41684 return PyLong_FromUnsignedLong((unsigned long) value);
41685 #ifdef HAVE_LONG_LONG
41686 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
41687 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41691 if (sizeof(long) <= sizeof(long)) {
41692 return PyInt_FromLong((long) value);
41693 #ifdef HAVE_LONG_LONG
41694 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
41695 return PyLong_FromLongLong((PY_LONG_LONG) value);
41700 int one = 1; int little = (int)*(unsigned char *)&one;
41701 unsigned char *bytes = (unsigned char *)&value;
41702 return _PyLong_FromByteArray(bytes, sizeof(long),
41703 little, !is_unsigned);
41708 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
41709 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
41710 const int is_unsigned = neg_one > const_zero;
41712 if (sizeof(int) < sizeof(long)) {
41713 return PyInt_FromLong((long) value);
41714 } else if (sizeof(int) <= sizeof(unsigned long)) {
41715 return PyLong_FromUnsignedLong((unsigned long) value);
41716 #ifdef HAVE_LONG_LONG
41717 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41718 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41722 if (sizeof(int) <= sizeof(long)) {
41723 return PyInt_FromLong((long) value);
41724 #ifdef HAVE_LONG_LONG
41725 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41726 return PyLong_FromLongLong((PY_LONG_LONG) value);
41731 int one = 1; int little = (int)*(unsigned char *)&one;
41732 unsigned char *bytes = (unsigned char *)&value;
41733 return _PyLong_FromByteArray(bytes, sizeof(int),
41734 little, !is_unsigned);
41739 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
41740 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
41741 const int is_unsigned = neg_one > const_zero;
41742 #if PY_MAJOR_VERSION < 3
41743 if (likely(PyInt_Check(x))) {
41744 if (sizeof(int) < sizeof(long)) {
41745 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
41747 long val = PyInt_AS_LONG(x);
41748 if (is_unsigned && unlikely(val < 0)) {
41749 goto raise_neg_overflow;
41755 if (likely(PyLong_Check(x))) {
41757 #if CYTHON_USE_PYLONG_INTERNALS
41758 const digit* digits = ((PyLongObject*)x)->ob_digit;
41759 switch (Py_SIZE(x)) {
41760 case 0: return (int) 0;
41761 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
41763 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41764 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41765 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41766 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
41767 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41772 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41773 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41774 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41775 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
41776 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41781 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41782 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41783 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41784 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
41785 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41791 #if CYTHON_COMPILING_IN_CPYTHON
41792 if (unlikely(Py_SIZE(x) < 0)) {
41793 goto raise_neg_overflow;
41797 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41798 if (unlikely(result < 0))
41800 if (unlikely(result == 1))
41801 goto raise_neg_overflow;
41804 if (sizeof(int) <= sizeof(unsigned long)) {
41805 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
41806 #ifdef HAVE_LONG_LONG
41807 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41808 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41812 #if CYTHON_USE_PYLONG_INTERNALS
41813 const digit* digits = ((PyLongObject*)x)->ob_digit;
41814 switch (Py_SIZE(x)) {
41815 case 0: return (int) 0;
41816 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
41817 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
41819 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
41820 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41821 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41822 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41823 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41828 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41829 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41830 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41831 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41832 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41837 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41838 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41839 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41840 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41841 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41846 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41847 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41848 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41849 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41850 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41855 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41856 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41857 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41858 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41859 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41864 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41865 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41866 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41867 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41868 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41874 if (sizeof(int) <= sizeof(long)) {
41875 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
41876 #ifdef HAVE_LONG_LONG
41877 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41878 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
41883 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41884 PyErr_SetString(PyExc_RuntimeError,
41885 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41888 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
41889 #if PY_MAJOR_VERSION < 3
41890 if (likely(v) && !PyLong_Check(v)) {
41892 v = PyNumber_Long(tmp);
41897 int one = 1; int is_little = (int)*(unsigned char *)&one;
41898 unsigned char *bytes = (unsigned char *)&val;
41899 int ret = _PyLong_AsByteArray((PyLongObject *)v,
41900 bytes, sizeof(val),
41901 is_little, !is_unsigned);
41911 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41912 if (!tmp) return (int) -1;
41913 val = __Pyx_PyInt_As_int(tmp);
41918 PyErr_SetString(PyExc_OverflowError,
41919 "value too large to convert to int");
41921 raise_neg_overflow:
41922 PyErr_SetString(PyExc_OverflowError,
41923 "can't convert negative value to int");
41928 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
41929 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
41930 const int is_unsigned = neg_one > const_zero;
41931 #if PY_MAJOR_VERSION < 3
41932 if (likely(PyInt_Check(x))) {
41933 if (sizeof(long) < sizeof(long)) {
41934 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
41936 long val = PyInt_AS_LONG(x);
41937 if (is_unsigned && unlikely(val < 0)) {
41938 goto raise_neg_overflow;
41944 if (likely(PyLong_Check(x))) {
41946 #if CYTHON_USE_PYLONG_INTERNALS
41947 const digit* digits = ((PyLongObject*)x)->ob_digit;
41948 switch (Py_SIZE(x)) {
41949 case 0: return (long) 0;
41950 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
41952 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
41953 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41954 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41955 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
41956 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41961 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
41962 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41963 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41964 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
41965 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41970 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
41971 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41972 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41973 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
41974 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41980 #if CYTHON_COMPILING_IN_CPYTHON
41981 if (unlikely(Py_SIZE(x) < 0)) {
41982 goto raise_neg_overflow;
41986 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41987 if (unlikely(result < 0))
41989 if (unlikely(result == 1))
41990 goto raise_neg_overflow;
41993 if (sizeof(long) <= sizeof(unsigned long)) {
41994 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
41995 #ifdef HAVE_LONG_LONG
41996 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
41997 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
42001 #if CYTHON_USE_PYLONG_INTERNALS
42002 const digit* digits = ((PyLongObject*)x)->ob_digit;
42003 switch (Py_SIZE(x)) {
42004 case 0: return (long) 0;
42005 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
42006 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
42008 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
42009 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
42010 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42011 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42012 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42017 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
42018 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
42019 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42020 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42021 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42026 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42027 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
42028 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42029 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42030 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42035 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
42036 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
42037 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42038 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42039 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42044 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42045 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
42046 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42047 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
42048 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42053 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
42054 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
42055 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42056 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
42057 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42063 if (sizeof(long) <= sizeof(long)) {
42064 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
42065 #ifdef HAVE_LONG_LONG
42066 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
42067 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
42072 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
42073 PyErr_SetString(PyExc_RuntimeError,
42074 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
42077 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
42078 #if PY_MAJOR_VERSION < 3
42079 if (likely(v) && !PyLong_Check(v)) {
42081 v = PyNumber_Long(tmp);
42086 int one = 1; int is_little = (int)*(unsigned char *)&one;
42087 unsigned char *bytes = (unsigned char *)&val;
42088 int ret = _PyLong_AsByteArray((PyLongObject *)v,
42089 bytes, sizeof(val),
42090 is_little, !is_unsigned);
42100 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
42101 if (!tmp) return (long) -1;
42102 val = __Pyx_PyInt_As_long(tmp);
42107 PyErr_SetString(PyExc_OverflowError,
42108 "value too large to convert to long");
42110 raise_neg_overflow:
42111 PyErr_SetString(PyExc_OverflowError,
42112 "can't convert negative value to long");
42116 /* FastTypeChecks */
42117 #if CYTHON_COMPILING_IN_CPYTHON
42118 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
42124 return b == &PyBaseObject_Type;
42126 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
42128 if (a == b) return 1;
42132 n = PyTuple_GET_SIZE(mro);
42133 for (i = 0; i < n; i++) {
42134 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
42139 return __Pyx_InBases(a, b);
42141 #if PY_MAJOR_VERSION == 2
42142 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
42143 PyObject *exception, *value, *tb;
42145 __Pyx_PyThreadState_declare
42146 __Pyx_PyThreadState_assign
42147 __Pyx_ErrFetch(&exception, &value, &tb);
42148 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
42149 if (unlikely(res == -1)) {
42150 PyErr_WriteUnraisable(err);
42154 res = PyObject_IsSubclass(err, exc_type2);
42155 if (unlikely(res == -1)) {
42156 PyErr_WriteUnraisable(err);
42160 __Pyx_ErrRestore(exception, value, tb);
42164 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
42165 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
42167 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
42172 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
42174 assert(PyExceptionClass_Check(exc_type));
42175 n = PyTuple_GET_SIZE(tuple);
42176 #if PY_MAJOR_VERSION >= 3
42177 for (i=0; i<n; i++) {
42178 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
42181 for (i=0; i<n; i++) {
42182 PyObject *t = PyTuple_GET_ITEM(tuple, i);
42183 #if PY_MAJOR_VERSION < 3
42184 if (likely(exc_type == t)) return 1;
42186 if (likely(PyExceptionClass_Check(t))) {
42187 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
42193 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
42194 if (likely(err == exc_type)) return 1;
42195 if (likely(PyExceptionClass_Check(err))) {
42196 if (likely(PyExceptionClass_Check(exc_type))) {
42197 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
42198 } else if (likely(PyTuple_Check(exc_type))) {
42199 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
42203 return PyErr_GivenExceptionMatches(err, exc_type);
42205 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
42206 assert(PyExceptionClass_Check(exc_type1));
42207 assert(PyExceptionClass_Check(exc_type2));
42208 if (likely(err == exc_type1 || err == exc_type2)) return 1;
42209 if (likely(PyExceptionClass_Check(err))) {
42210 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
42212 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
42216 /* CheckBinaryVersion */
42217 static int __Pyx_check_binary_version(void) {
42218 char ctversion[4], rtversion[4];
42219 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
42220 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
42221 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
42223 PyOS_snprintf(message, sizeof(message),
42224 "compiletime version %s of module '%.100s' "
42225 "does not match runtime version %s",
42226 ctversion, __Pyx_MODULE_NAME, rtversion);
42227 return PyErr_WarnEx(NULL, message, 1);
42233 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
42235 #if PY_MAJOR_VERSION < 3
42236 if (t->is_unicode) {
42237 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
42238 } else if (t->intern) {
42239 *t->p = PyString_InternFromString(t->s);
42241 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
42244 if (t->is_unicode | t->is_str) {
42246 *t->p = PyUnicode_InternFromString(t->s);
42247 } else if (t->encoding) {
42248 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
42250 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
42253 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
42258 if (PyObject_Hash(*t->p) == -1)
42265 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
42266 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
42268 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
42270 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
42272 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42273 #if !CYTHON_PEP393_ENABLED
42274 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42276 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
42277 if (!defenc) return NULL;
42278 defenc_c = PyBytes_AS_STRING(defenc);
42279 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42281 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
42283 for (c = defenc_c; c < end; c++) {
42284 if ((unsigned char) (*c) >= 128) {
42285 PyUnicode_AsASCIIString(o);
42291 *length = PyBytes_GET_SIZE(defenc);
42295 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42296 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
42297 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42298 if (likely(PyUnicode_IS_ASCII(o))) {
42299 *length = PyUnicode_GET_LENGTH(o);
42300 return PyUnicode_AsUTF8(o);
42302 PyUnicode_AsASCIIString(o);
42306 return PyUnicode_AsUTF8AndSize(o, length);
42311 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42312 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42314 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42315 __Pyx_sys_getdefaultencoding_not_ascii &&
42317 PyUnicode_Check(o)) {
42318 return __Pyx_PyUnicode_AsStringAndSize(o, length);
42321 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
42322 if (PyByteArray_Check(o)) {
42323 *length = PyByteArray_GET_SIZE(o);
42324 return PyByteArray_AS_STRING(o);
42329 int r = PyBytes_AsStringAndSize(o, &result, length);
42330 if (unlikely(r < 0)) {
42337 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
42338 int is_true = x == Py_True;
42339 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
42340 else return PyObject_IsTrue(x);
42342 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
42344 if (unlikely(!x)) return -1;
42345 retval = __Pyx_PyObject_IsTrue(x);
42349 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
42350 #if PY_MAJOR_VERSION >= 3
42351 if (PyLong_Check(result)) {
42352 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
42353 "__int__ returned non-int (type %.200s). "
42354 "The ability to return an instance of a strict subclass of int "
42355 "is deprecated, and may be removed in a future version of Python.",
42356 Py_TYPE(result)->tp_name)) {
42363 PyErr_Format(PyExc_TypeError,
42364 "__%.4s__ returned non-%.4s (type %.200s)",
42365 type_name, type_name, Py_TYPE(result)->tp_name);
42369 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
42370 #if CYTHON_USE_TYPE_SLOTS
42371 PyNumberMethods *m;
42373 const char *name = NULL;
42374 PyObject *res = NULL;
42375 #if PY_MAJOR_VERSION < 3
42376 if (likely(PyInt_Check(x) || PyLong_Check(x)))
42378 if (likely(PyLong_Check(x)))
42380 return __Pyx_NewRef(x);
42381 #if CYTHON_USE_TYPE_SLOTS
42382 m = Py_TYPE(x)->tp_as_number;
42383 #if PY_MAJOR_VERSION < 3
42384 if (m && m->nb_int) {
42386 res = m->nb_int(x);
42388 else if (m && m->nb_long) {
42390 res = m->nb_long(x);
42393 if (likely(m && m->nb_int)) {
42395 res = m->nb_int(x);
42399 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
42400 res = PyNumber_Int(x);
42404 #if PY_MAJOR_VERSION < 3
42405 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
42407 if (unlikely(!PyLong_CheckExact(res))) {
42409 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
42412 else if (!PyErr_Occurred()) {
42413 PyErr_SetString(PyExc_TypeError,
42414 "an integer is required");
42418 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
42421 #if PY_MAJOR_VERSION < 3
42422 if (likely(PyInt_CheckExact(b))) {
42423 if (sizeof(Py_ssize_t) >= sizeof(long))
42424 return PyInt_AS_LONG(b);
42426 return PyInt_AsSsize_t(b);
42429 if (likely(PyLong_CheckExact(b))) {
42430 #if CYTHON_USE_PYLONG_INTERNALS
42431 const digit* digits = ((PyLongObject*)b)->ob_digit;
42432 const Py_ssize_t size = Py_SIZE(b);
42433 if (likely(__Pyx_sst_abs(size) <= 1)) {
42434 ival = likely(size) ? digits[0] : 0;
42435 if (size == -1) ival = -ival;
42440 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42441 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42445 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42446 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42450 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42451 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42455 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42456 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42460 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42461 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42465 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42466 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42472 return PyLong_AsSsize_t(b);
42474 x = PyNumber_Index(b);
42476 ival = PyInt_AsSsize_t(x);
42480 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
42481 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
42483 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
42484 return PyInt_FromSize_t(ival);
42488 #endif /* Py_PYTHON_H */