1 /* Generated by Cython 0.29.21 */
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_21"
79 #define CYTHON_HEX_VERSION 0x001D15F0
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 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
507 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
509 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
512 #define CYTHON_PEP393_ENABLED 0
513 #define PyUnicode_1BYTE_KIND 1
514 #define PyUnicode_2BYTE_KIND 2
515 #define PyUnicode_4BYTE_KIND 4
516 #define __Pyx_PyUnicode_READY(op) (0)
517 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
518 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
519 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
520 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
521 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
522 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
523 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
526 #if CYTHON_COMPILING_IN_PYPY
527 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
528 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
530 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
531 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
532 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
534 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
535 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
537 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
538 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
540 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
541 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
543 #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))
544 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
545 #if PY_MAJOR_VERSION >= 3
546 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
548 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
550 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
551 #define PyObject_ASCII(o) PyObject_Repr(o)
553 #if PY_MAJOR_VERSION >= 3
554 #define PyBaseString_Type PyUnicode_Type
555 #define PyStringObject PyUnicodeObject
556 #define PyString_Type PyUnicode_Type
557 #define PyString_Check PyUnicode_Check
558 #define PyString_CheckExact PyUnicode_CheckExact
559 #ifndef PyObject_Unicode
560 #define PyObject_Unicode PyObject_Str
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
565 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
567 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
568 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
570 #ifndef PySet_CheckExact
571 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
573 #if PY_VERSION_HEX >= 0x030900A4
574 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
575 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
577 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
578 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
580 #if CYTHON_ASSUME_SAFE_MACROS
581 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
583 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
585 #if PY_MAJOR_VERSION >= 3
586 #define PyIntObject PyLongObject
587 #define PyInt_Type PyLong_Type
588 #define PyInt_Check(op) PyLong_Check(op)
589 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
590 #define PyInt_FromString PyLong_FromString
591 #define PyInt_FromUnicode PyLong_FromUnicode
592 #define PyInt_FromLong PyLong_FromLong
593 #define PyInt_FromSize_t PyLong_FromSize_t
594 #define PyInt_FromSsize_t PyLong_FromSsize_t
595 #define PyInt_AsLong PyLong_AsLong
596 #define PyInt_AS_LONG PyLong_AS_LONG
597 #define PyInt_AsSsize_t PyLong_AsSsize_t
598 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
599 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
600 #define PyNumber_Int PyNumber_Long
602 #if PY_MAJOR_VERSION >= 3
603 #define PyBoolObject PyLongObject
605 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
606 #ifndef PyUnicode_InternFromString
607 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
610 #if PY_VERSION_HEX < 0x030200A4
611 typedef long Py_hash_t;
612 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
613 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
615 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
616 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
618 #if PY_MAJOR_VERSION >= 3
619 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
621 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
623 #if CYTHON_USE_ASYNC_SLOTS
624 #if PY_VERSION_HEX >= 0x030500B1
625 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
626 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
628 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
631 #define __Pyx_PyType_AsAsync(obj) NULL
633 #ifndef __Pyx_PyAsyncMethodsStruct
638 } __Pyx_PyAsyncMethodsStruct;
641 #if defined(WIN32) || defined(MS_WINDOWS)
642 #define _USE_MATH_DEFINES
646 #define __PYX_NAN() ((float) NAN)
648 static CYTHON_INLINE float __PYX_NAN() {
650 memset(&value, 0xFF, sizeof(value));
654 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
655 #define __Pyx_truncl trunc
657 #define __Pyx_truncl truncl
660 #define __PYX_MARK_ERR_POS(f_index, lineno) \
661 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
662 #define __PYX_ERR(f_index, lineno, Ln_error) \
663 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
665 #ifndef __PYX_EXTERN_C
667 #define __PYX_EXTERN_C extern "C"
669 #define __PYX_EXTERN_C extern
673 #define __PYX_HAVE__lxml__objectify
674 #define __PYX_HAVE_API__lxml__objectify
678 #include "lxml-version.h"
679 #include "libxml/xmlversion.h"
680 #include "libxml/xmlstring.h"
681 #include "libxml/encoding.h"
682 #include "libxml/chvalid.h"
683 #include "libxml/hash.h"
684 #include "libxml/tree.h"
685 #include "libxml/uri.h"
686 #include "libxml/HTMLtree.h"
687 #include "libxml/valid.h"
688 #include "libxml/xmlIO.h"
689 #include "libxml/xmlsave.h"
690 #include "libxml/globals.h"
691 #include "libxml/xmlmemory.h"
692 #include "etree_defs.h"
693 #include "etree_api.h"
694 #include "pythread.h"
695 #include "includes/etree_defs.h"
696 #include "lxml_endian.h"
701 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
702 #define CYTHON_WITHOUT_ASSERTIONS
705 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
706 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
708 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
709 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
710 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
711 #define __PYX_DEFAULT_STRING_ENCODING ""
712 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
713 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
714 #define __Pyx_uchar_cast(c) ((unsigned char)c)
715 #define __Pyx_long_cast(x) ((long)x)
716 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
717 (sizeof(type) < sizeof(Py_ssize_t)) ||\
718 (sizeof(type) > sizeof(Py_ssize_t) &&\
719 likely(v < (type)PY_SSIZE_T_MAX ||\
720 v == (type)PY_SSIZE_T_MAX) &&\
721 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
722 v == (type)PY_SSIZE_T_MIN))) ||\
723 (sizeof(type) == sizeof(Py_ssize_t) &&\
724 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
725 v == (type)PY_SSIZE_T_MAX))) )
726 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
727 return (size_t) i < (size_t) limit;
729 #if defined (__cplusplus) && __cplusplus >= 201103L
731 #define __Pyx_sst_abs(value) std::abs(value)
732 #elif SIZEOF_INT >= SIZEOF_SIZE_T
733 #define __Pyx_sst_abs(value) abs(value)
734 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
735 #define __Pyx_sst_abs(value) labs(value)
736 #elif defined (_MSC_VER)
737 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
738 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
739 #define __Pyx_sst_abs(value) llabs(value)
740 #elif defined (__GNUC__)
741 #define __Pyx_sst_abs(value) __builtin_llabs(value)
743 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
745 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
746 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
747 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
748 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
749 #define __Pyx_PyBytes_FromString PyBytes_FromString
750 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
751 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
752 #if PY_MAJOR_VERSION < 3
753 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
754 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
756 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
757 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
759 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
760 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
761 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
762 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
764 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
765 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
766 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
767 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
768 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
769 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
770 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
771 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
772 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
773 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
774 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
775 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
776 const Py_UNICODE *u_end = u;
778 return (size_t)(u_end - u - 1);
780 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
781 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
782 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
783 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
784 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
785 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
786 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
787 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
788 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
789 #define __Pyx_PySequence_Tuple(obj)\
790 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
791 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
792 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
793 #if CYTHON_ASSUME_SAFE_MACROS
794 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
796 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
798 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
799 #if PY_MAJOR_VERSION >= 3
800 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
802 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
804 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
805 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
806 static int __Pyx_sys_getdefaultencoding_not_ascii;
807 static int __Pyx_init_sys_getdefaultencoding_params(void) {
809 PyObject* default_encoding = NULL;
810 PyObject* ascii_chars_u = NULL;
811 PyObject* ascii_chars_b = NULL;
812 const char* default_encoding_c;
813 sys = PyImport_ImportModule("sys");
815 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
817 if (!default_encoding) goto bad;
818 default_encoding_c = PyBytes_AsString(default_encoding);
819 if (!default_encoding_c) goto bad;
820 if (strcmp(default_encoding_c, "ascii") == 0) {
821 __Pyx_sys_getdefaultencoding_not_ascii = 0;
823 char ascii_chars[128];
825 for (c = 0; c < 128; c++) {
828 __Pyx_sys_getdefaultencoding_not_ascii = 1;
829 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
830 if (!ascii_chars_u) goto bad;
831 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
832 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
835 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
839 Py_DECREF(ascii_chars_u);
840 Py_DECREF(ascii_chars_b);
842 Py_DECREF(default_encoding);
845 Py_XDECREF(default_encoding);
846 Py_XDECREF(ascii_chars_u);
847 Py_XDECREF(ascii_chars_b);
851 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
852 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
854 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
855 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
856 static char* __PYX_DEFAULT_STRING_ENCODING;
857 static int __Pyx_init_sys_getdefaultencoding_params(void) {
859 PyObject* default_encoding = NULL;
860 char* default_encoding_c;
861 sys = PyImport_ImportModule("sys");
863 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
865 if (!default_encoding) goto bad;
866 default_encoding_c = PyBytes_AsString(default_encoding);
867 if (!default_encoding_c) goto bad;
868 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
869 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
870 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
871 Py_DECREF(default_encoding);
874 Py_XDECREF(default_encoding);
881 /* Test for GCC > 2.95 */
882 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
883 #define likely(x) __builtin_expect(!!(x), 1)
884 #define unlikely(x) __builtin_expect(!!(x), 0)
885 #else /* !__GNUC__ or GCC < 2.95 */
886 #define likely(x) (x)
887 #define unlikely(x) (x)
888 #endif /* __GNUC__ */
889 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
891 static PyObject *__pyx_m = NULL;
892 static PyObject *__pyx_d;
893 static PyObject *__pyx_b;
894 static PyObject *__pyx_cython_runtime = NULL;
895 static PyObject *__pyx_empty_tuple;
896 static PyObject *__pyx_empty_bytes;
897 static PyObject *__pyx_empty_unicode;
898 static int __pyx_lineno;
899 static int __pyx_clineno = 0;
900 static const char * __pyx_cfilenm= __FILE__;
901 static const char *__pyx_filename;
904 static const char *__pyx_f[] = {
905 "src/lxml/objectify.pyx",
906 "src/lxml/objectpath.pxi",
907 "src/lxml/includes/etreepublic.pxd",
910 /*--- Type declarations ---*/
911 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement;
912 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement;
913 struct __pyx_obj_4lxml_9objectify_NumberElement;
914 struct __pyx_obj_4lxml_9objectify_IntElement;
915 struct __pyx_obj_4lxml_9objectify_LongElement;
916 struct __pyx_obj_4lxml_9objectify_FloatElement;
917 struct __pyx_obj_4lxml_9objectify_StringElement;
918 struct __pyx_obj_4lxml_9objectify_NoneElement;
919 struct __pyx_obj_4lxml_9objectify_BoolElement;
920 struct __pyx_obj_4lxml_9objectify_PyType;
921 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller;
922 struct __pyx_obj_4lxml_9objectify_ElementMaker;
923 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup;
924 struct __pyx_obj_4lxml_9objectify_ObjectPath;
925 struct __pyx_t_4lxml_9objectify__ObjectPath;
926 typedef struct __pyx_t_4lxml_9objectify__ObjectPath __pyx_t_4lxml_9objectify__ObjectPath;
928 /* "src/lxml/objectpath.pxi":4
931 * ctypedef struct _ObjectPath: # <<<<<<<<<<<<<<
932 * const_xmlChar* href
933 * const_xmlChar* name
935 struct __pyx_t_4lxml_9objectify__ObjectPath {
941 /* "lxml/objectify.pyx":133
942 * # Element class for the main API
944 * cdef class ObjectifiedElement(ElementBase): # <<<<<<<<<<<<<<
945 * u"""Main XML Element class.
948 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement {
949 struct LxmlElementBase __pyx_base;
953 /* "lxml/objectify.pyx":592
954 * # Data type support in subclasses
956 * cdef class ObjectifiedDataElement(ObjectifiedElement): # <<<<<<<<<<<<<<
957 * u"""This is the base class for all data type Elements. Subclasses should
958 * override the 'pyval' property and possibly the __str__ method.
960 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement {
961 struct __pyx_obj_4lxml_9objectify_ObjectifiedElement __pyx_base;
965 /* "lxml/objectify.pyx":612
966 * cetree.setNodeText(self._c_node, s)
968 * cdef class NumberElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
969 * cdef object _parse_value
970 * def _setValueParser(self, function):
972 struct __pyx_obj_4lxml_9objectify_NumberElement {
973 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
974 PyObject *_parse_value;
978 /* "lxml/objectify.pyx":709
979 * return _numericValueOf(self) ^ _numericValueOf(other)
981 * cdef class IntElement(NumberElement): # <<<<<<<<<<<<<<
983 * self._parse_value = int
985 struct __pyx_obj_4lxml_9objectify_IntElement {
986 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
990 /* "lxml/objectify.pyx":716
991 * return int(_parseNumber(self))
993 * cdef class LongElement(NumberElement): # <<<<<<<<<<<<<<
995 * self._parse_value = long
997 struct __pyx_obj_4lxml_9objectify_LongElement {
998 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
1002 /* "lxml/objectify.pyx":723
1003 * return int(_parseNumber(self))
1005 * cdef class FloatElement(NumberElement): # <<<<<<<<<<<<<<
1007 * self._parse_value = float
1009 struct __pyx_obj_4lxml_9objectify_FloatElement {
1010 struct __pyx_obj_4lxml_9objectify_NumberElement __pyx_base;
1014 /* "lxml/objectify.pyx":727
1015 * self._parse_value = float
1017 * cdef class StringElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
1018 * u"""String data class.
1021 struct __pyx_obj_4lxml_9objectify_StringElement {
1022 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
1026 /* "lxml/objectify.pyx":789
1027 * return complex(textOf(self._c_node))
1029 * cdef class NoneElement(ObjectifiedDataElement): # <<<<<<<<<<<<<<
1030 * def __str__(self):
1033 struct __pyx_obj_4lxml_9objectify_NoneElement {
1034 struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement __pyx_base;
1038 /* "lxml/objectify.pyx":815
1041 * cdef class BoolElement(IntElement): # <<<<<<<<<<<<<<
1042 * u"""Boolean type base on string values: 'true' or 'false'.
1045 struct __pyx_obj_4lxml_9objectify_BoolElement {
1046 struct __pyx_obj_4lxml_9objectify_IntElement __pyx_base;
1050 /* "lxml/objectify.pyx":901
1051 * # Python type registry
1053 * cdef class PyType: # <<<<<<<<<<<<<<
1054 * u"""PyType(self, name, type_check, type_class, stringify=None)
1055 * User defined type.
1057 struct __pyx_obj_4lxml_9objectify_PyType {
1060 PyObject *type_check;
1061 PyObject *stringify;
1063 PyObject *_schema_types;
1067 /* "lxml/objectify.pyx":1131
1070 * cdef class _ObjectifyElementMakerCaller: # <<<<<<<<<<<<<<
1072 * cdef object _nsmap
1074 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller {
1078 PyObject *_element_factory;
1083 /* "lxml/objectify.pyx":1221
1084 * cetree.setNodeText(elem._c_node, text)
1086 * cdef class ElementMaker: # <<<<<<<<<<<<<<
1087 * u"""ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)
1090 struct __pyx_obj_4lxml_9objectify_ElementMaker {
1092 struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker *__pyx_vtab;
1093 PyObject *_makeelement;
1094 PyObject *_namespace;
1101 /* "lxml/objectify.pyx":1377
1102 * # Element class lookup
1104 * cdef class ObjectifyElementClassLookup(ElementClassLookup): # <<<<<<<<<<<<<<
1105 * u"""ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None)
1106 * Element class lookup method that uses the objectify classes.
1108 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup {
1109 struct LxmlElementClassLookup __pyx_base;
1110 PyObject *empty_data_class;
1111 PyObject *tree_class;
1115 /* "src/lxml/objectpath.pxi":13
1118 * cdef class ObjectPath: # <<<<<<<<<<<<<<
1119 * u"""ObjectPath(path)
1120 * Immutable object that represents a compiled object path.
1122 struct __pyx_obj_4lxml_9objectify_ObjectPath {
1126 PyObject *_path_str;
1127 __pyx_t_4lxml_9objectify__ObjectPath *_c_path;
1128 Py_ssize_t _path_len;
1133 /* "lxml/objectify.pyx":1221
1134 * cetree.setNodeText(elem._c_node, text)
1136 * cdef class ElementMaker: # <<<<<<<<<<<<<<
1137 * u"""ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None)
1141 struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker {
1142 PyObject *(*_build_element_maker)(struct __pyx_obj_4lxml_9objectify_ElementMaker *, PyObject *, int);
1144 static struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker *__pyx_vtabptr_4lxml_9objectify_ElementMaker;
1145 static PyObject *__pyx_f_4lxml_9objectify_12ElementMaker__build_element_maker(struct __pyx_obj_4lxml_9objectify_ElementMaker *, PyObject *, int);
1147 /* --- Runtime support code (head) --- */
1148 /* Refnanny.proto */
1149 #ifndef CYTHON_REFNANNY
1150 #define CYTHON_REFNANNY 0
1154 void (*INCREF)(void*, PyObject*, int);
1155 void (*DECREF)(void*, PyObject*, int);
1156 void (*GOTREF)(void*, PyObject*, int);
1157 void (*GIVEREF)(void*, PyObject*, int);
1158 void* (*SetupContext)(const char*, int, const char*);
1159 void (*FinishContext)(void**);
1160 } __Pyx_RefNannyAPIStruct;
1161 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1162 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1163 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1165 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1167 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1168 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1169 PyGILState_Release(__pyx_gilstate_save);\
1171 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1174 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1175 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1177 #define __Pyx_RefNannyFinishContext()\
1178 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1179 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1180 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1181 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1182 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1183 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1184 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1185 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1186 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1188 #define __Pyx_RefNannyDeclarations
1189 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1190 #define __Pyx_RefNannyFinishContext()
1191 #define __Pyx_INCREF(r) Py_INCREF(r)
1192 #define __Pyx_DECREF(r) Py_DECREF(r)
1193 #define __Pyx_GOTREF(r)
1194 #define __Pyx_GIVEREF(r)
1195 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1196 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1197 #define __Pyx_XGOTREF(r)
1198 #define __Pyx_XGIVEREF(r)
1200 #define __Pyx_XDECREF_SET(r, v) do {\
1201 PyObject *tmp = (PyObject *) r;\
1202 r = v; __Pyx_XDECREF(tmp);\
1204 #define __Pyx_DECREF_SET(r, v) do {\
1205 PyObject *tmp = (PyObject *) r;\
1206 r = v; __Pyx_DECREF(tmp);\
1208 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1209 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1211 /* PyObjectGetAttrStr.proto */
1212 #if CYTHON_USE_TYPE_SLOTS
1213 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1215 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1218 /* GetBuiltinName.proto */
1219 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1221 /* PyCFunctionFastCall.proto */
1222 #if CYTHON_FAST_PYCCALL
1223 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1225 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1228 /* PyFunctionFastCall.proto */
1229 #if CYTHON_FAST_PYCALL
1230 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1231 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1232 #if 1 || PY_VERSION_HEX < 0x030600B1
1233 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1235 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1237 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1238 (sizeof(char [1 - 2*!(cond)]) - 1)
1239 #ifndef Py_MEMBER_SIZE
1240 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1242 static size_t __pyx_pyframe_localsplus_offset = 0;
1243 #include "frameobject.h"
1244 #define __Pxy_PyFrame_Initialize_Offsets()\
1245 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1246 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1247 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1248 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1251 /* PyObjectCall.proto */
1252 #if CYTHON_COMPILING_IN_CPYTHON
1253 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1255 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1258 /* PyObjectCall2Args.proto */
1259 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1261 /* PyObjectCallMethO.proto */
1262 #if CYTHON_COMPILING_IN_CPYTHON
1263 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1266 /* PyObjectCallOneArg.proto */
1267 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1269 /* RaiseDoubleKeywords.proto */
1270 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1272 /* ParseKeywords.proto */
1273 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1274 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1275 const char* function_name);
1277 /* RaiseArgTupleInvalid.proto */
1278 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1279 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1281 /* RaiseTooManyValuesToUnpack.proto */
1282 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1284 /* RaiseNeedMoreValuesToUnpack.proto */
1285 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1287 /* RaiseNoneIterError.proto */
1288 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1290 /* decode_c_string_utf16.proto */
1291 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1293 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1295 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1297 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1299 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1301 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1304 /* decode_c_bytes.proto */
1305 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1306 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1307 const char* encoding, const char* errors,
1308 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1310 /* decode_bytes.proto */
1311 static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
1312 PyObject* string, Py_ssize_t start, Py_ssize_t stop,
1313 const char* encoding, const char* errors,
1314 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
1315 return __Pyx_decode_c_bytes(
1316 PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
1317 start, stop, encoding, errors, decode_func);
1320 /* PyObjectCallNoArg.proto */
1321 #if CYTHON_COMPILING_IN_CPYTHON
1322 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1324 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1327 /* PyDictVersioning.proto */
1328 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1329 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1330 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1331 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1332 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1333 (cache_var) = (value);
1334 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1335 static PY_UINT64_T __pyx_dict_version = 0;\
1336 static PyObject *__pyx_dict_cached_value = NULL;\
1337 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1338 (VAR) = __pyx_dict_cached_value;\
1340 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1341 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1344 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1345 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1346 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1348 #define __PYX_GET_DICT_VERSION(dict) (0)
1349 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1350 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1353 /* GetModuleGlobalName.proto */
1354 #if CYTHON_USE_DICT_VERSIONS
1355 #define __Pyx_GetModuleGlobalName(var, name) {\
1356 static PY_UINT64_T __pyx_dict_version = 0;\
1357 static PyObject *__pyx_dict_cached_value = NULL;\
1358 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1359 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1360 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1362 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1363 PY_UINT64_T __pyx_dict_version;\
1364 PyObject *__pyx_dict_cached_value;\
1365 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1367 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1369 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1370 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1371 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1374 /* ExtTypeTest.proto */
1375 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1377 /* PyDictContains.proto */
1378 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1379 int result = PyDict_Contains(dict, item);
1380 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1383 /* ListAppend.proto */
1384 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1385 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1386 PyListObject* L = (PyListObject*) list;
1387 Py_ssize_t len = Py_SIZE(list);
1388 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1390 PyList_SET_ITEM(list, len, x);
1391 __Pyx_SET_SIZE(list, len + 1);
1394 return PyList_Append(list, x);
1397 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1400 /* IncludeStringH.proto */
1403 /* BytesEquals.proto */
1404 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1406 /* UnicodeEquals.proto */
1407 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1409 /* PyObjectFormatSimple.proto */
1410 #if CYTHON_COMPILING_IN_PYPY
1411 #define __Pyx_PyObject_FormatSimple(s, f) (\
1412 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1413 PyObject_Format(s, f))
1414 #elif PY_MAJOR_VERSION < 3
1415 #define __Pyx_PyObject_FormatSimple(s, f) (\
1416 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1417 likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
1418 PyObject_Format(s, f))
1419 #elif CYTHON_USE_TYPE_SLOTS
1420 #define __Pyx_PyObject_FormatSimple(s, f) (\
1421 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1422 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_str(s) :\
1423 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_str(s) :\
1424 PyObject_Format(s, f))
1426 #define __Pyx_PyObject_FormatSimple(s, f) (\
1427 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1428 PyObject_Format(s, f))
1431 /* JoinPyUnicode.proto */
1432 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
1435 /* PyThreadStateGet.proto */
1436 #if CYTHON_FAST_THREAD_STATE
1437 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1438 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1439 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1441 #define __Pyx_PyThreadState_declare
1442 #define __Pyx_PyThreadState_assign
1443 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1446 /* PyErrFetchRestore.proto */
1447 #if CYTHON_FAST_THREAD_STATE
1448 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1449 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1450 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1451 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1452 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1453 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1454 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1455 #if CYTHON_COMPILING_IN_CPYTHON
1456 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1458 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1461 #define __Pyx_PyErr_Clear() PyErr_Clear()
1462 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1463 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1464 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1465 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1466 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1467 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1468 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1471 /* RaiseException.proto */
1472 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1474 /* GetItemInt.proto */
1475 #define __Pyx_GetItemInt(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_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1478 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1479 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1480 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1481 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1482 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1483 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1484 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1485 int wraparound, int boundscheck);
1486 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1487 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1488 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1489 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1490 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1491 int wraparound, int boundscheck);
1492 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1493 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1494 int is_list, int wraparound, int boundscheck);
1496 /* ObjectGetItem.proto */
1497 #if CYTHON_USE_TYPE_SLOTS
1498 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1500 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1503 /* PyObject_Unicode.proto */
1504 #if PY_MAJOR_VERSION >= 3
1505 #define __Pyx_PyObject_Unicode(obj)\
1506 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
1508 #define __Pyx_PyObject_Unicode(obj)\
1509 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj))
1512 /* PyObjectSetAttrStr.proto */
1513 #if CYTHON_USE_TYPE_SLOTS
1514 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1515 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1517 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1518 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1521 /* SliceObject.proto */
1522 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1523 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1524 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1525 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1526 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1527 int has_cstart, int has_cstop, int wraparound);
1529 /* dict_getitem_default.proto */
1530 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
1532 /* UnpackUnboundCMethod.proto */
1535 PyObject **method_name;
1539 } __Pyx_CachedCFunction;
1541 /* CallUnboundCMethod1.proto */
1542 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1543 #if CYTHON_COMPILING_IN_CPYTHON
1544 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1546 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
1549 /* CallUnboundCMethod2.proto */
1550 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
1551 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
1552 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
1554 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
1557 /* BuildPyUnicode.proto */
1558 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
1559 int prepend_sign, char padding_char);
1561 /* CIntToPyUnicode.proto */
1562 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
1564 /* PyIntBinop.proto */
1565 #if !CYTHON_COMPILING_IN_PYPY
1566 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1568 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
1569 (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1573 #if CYTHON_USE_PYLONG_INTERNALS
1574 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
1575 #define __Pyx_PyNumber_Absolute(x)\
1576 ((likely(PyLong_CheckExact(x))) ?\
1577 (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
1578 PyNumber_Absolute(x))
1580 #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
1583 /* StrEquals.proto */
1584 #if PY_MAJOR_VERSION >= 3
1585 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1587 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1590 /* GetTopmostException.proto */
1591 #if CYTHON_USE_EXC_INFO_STACK
1592 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1595 /* SaveResetException.proto */
1596 #if CYTHON_FAST_THREAD_STATE
1597 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1598 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1599 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1600 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1602 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1603 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1606 /* PyErrExceptionMatches.proto */
1607 #if CYTHON_FAST_THREAD_STATE
1608 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1609 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1611 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1615 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1617 /* GetAttr3.proto */
1618 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1620 /* CallableCheck.proto */
1621 #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
1622 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL)
1624 #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
1627 /* IterFinish.proto */
1628 static CYTHON_INLINE int __Pyx_IterFinish(void);
1630 /* UnpackItemEndCheck.proto */
1631 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1633 /* PyIntBinop.proto */
1634 #if !CYTHON_COMPILING_IN_PYPY
1635 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1637 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1638 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1641 /* PyIntCompare.proto */
1642 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1644 /* PySequenceContains.proto */
1645 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1646 int result = PySequence_Contains(seq, item);
1647 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1650 /* py_dict_items.proto */
1651 static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
1653 /* CallUnboundCMethod0.proto */
1654 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
1655 #if CYTHON_COMPILING_IN_CPYTHON
1656 #define __Pyx_CallUnboundCMethod0(cfunc, self)\
1657 (likely((cfunc)->func) ?\
1658 (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
1659 (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
1660 (PY_VERSION_HEX >= 0x030700A0 ?\
1661 (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
1662 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
1663 (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
1664 (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
1665 (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
1666 ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
1667 __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
1668 __Pyx__CallUnboundCMethod0(cfunc, self))
1670 #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
1673 /* pyfrozenset_new.proto */
1674 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
1676 /* PySetContains.proto */
1677 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
1679 /* py_dict_values.proto */
1680 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
1682 /* KeywordStringCheck.proto */
1683 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1685 /* py_dict_clear.proto */
1686 #define __Pyx_PyDict_Clear(d) (PyDict_Clear(d), 0)
1688 /* ArgTypeTest.proto */
1689 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1690 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1691 __Pyx__ArgTypeTest(obj, type, name, exact))
1692 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1694 /* PyUnicode_Unicode.proto */
1695 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
1697 /* PyObjectFormatAndDecref.proto */
1698 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
1699 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
1701 /* SliceObject.proto */
1702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1703 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1704 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1705 int has_cstart, int has_cstop, int wraparound);
1708 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1710 /* GetException.proto */
1711 #if CYTHON_FAST_THREAD_STATE
1712 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1713 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1715 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1718 /* PyIntCompare.proto */
1719 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1721 /* DelItemInt.proto */
1722 #define __Pyx_DelItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1723 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1724 __Pyx_DelItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound) :\
1725 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1726 __Pyx_DelItem_Generic(o, to_py_func(i))))
1727 static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
1728 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
1729 int is_list, int wraparound);
1731 /* CallNextTpDealloc.proto */
1732 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
1734 /* CallNextTpTraverse.proto */
1735 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
1737 /* CallNextTpClear.proto */
1738 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
1740 /* PyObject_GenericGetAttrNoDict.proto */
1741 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1742 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1744 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1747 /* PyObject_GenericGetAttr.proto */
1748 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1749 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1751 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1754 /* TypeImport.proto */
1755 #ifndef __PYX_HAVE_RT_ImportType_proto
1756 #define __PYX_HAVE_RT_ImportType_proto
1757 enum __Pyx_ImportType_CheckSize {
1758 __Pyx_ImportType_CheckSize_Error = 0,
1759 __Pyx_ImportType_CheckSize_Warn = 1,
1760 __Pyx_ImportType_CheckSize_Ignore = 2
1762 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1765 /* SetVTable.proto */
1766 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1768 /* ImportFrom.proto */
1769 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1771 /* FetchCommonType.proto */
1772 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1774 /* CythonFunctionShared.proto */
1775 #define __Pyx_CyFunction_USED 1
1776 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1777 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1778 #define __Pyx_CYFUNCTION_CCLASS 0x04
1779 #define __Pyx_CyFunction_GetClosure(f)\
1780 (((__pyx_CyFunctionObject *) (f))->func_closure)
1781 #define __Pyx_CyFunction_GetClassObj(f)\
1782 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1783 #define __Pyx_CyFunction_Defaults(type, f)\
1784 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1785 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1786 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1788 PyCFunctionObject func;
1789 #if PY_VERSION_HEX < 0x030500A0
1790 PyObject *func_weakreflist;
1792 PyObject *func_dict;
1793 PyObject *func_name;
1794 PyObject *func_qualname;
1796 PyObject *func_globals;
1797 PyObject *func_code;
1798 PyObject *func_closure;
1799 PyObject *func_classobj;
1801 int defaults_pyobjects;
1802 size_t defaults_size; // used by FusedFunction for copying defaults
1804 PyObject *defaults_tuple;
1805 PyObject *defaults_kwdict;
1806 PyObject *(*defaults_getter)(PyObject *);
1807 PyObject *func_annotations;
1808 } __pyx_CyFunctionObject;
1809 static PyTypeObject *__pyx_CyFunctionType = 0;
1810 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1811 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1812 int flags, PyObject* qualname,
1814 PyObject *module, PyObject *globals,
1816 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1819 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1821 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1823 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1825 static int __pyx_CyFunction_init(void);
1827 /* CythonFunction.proto */
1828 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1829 int flags, PyObject* qualname,
1831 PyObject *module, PyObject *globals,
1834 /* RegisterModuleCleanup.proto */
1835 static void __pyx_module_cleanup(PyObject *self);
1836 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
1837 static int __Pyx_RegisterCleanup(void);
1839 #define __Pyx_RegisterCleanup() (0)
1842 /* CLineInTraceback.proto */
1843 #ifdef CYTHON_CLINE_IN_TRACEBACK
1844 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1846 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1849 /* CodeObjectCache.proto */
1851 PyCodeObject* code_object;
1853 } __Pyx_CodeObjectCacheEntry;
1854 struct __Pyx_CodeObjectCache {
1857 __Pyx_CodeObjectCacheEntry* entries;
1859 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1860 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1861 static PyCodeObject *__pyx_find_code_object(int code_line);
1862 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1864 /* AddTraceback.proto */
1865 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1866 int py_line, const char *filename);
1868 /* CIntToPy.proto */
1869 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1871 /* CIntToPy.proto */
1872 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1874 /* CIntFromPy.proto */
1875 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1877 /* CIntFromPy.proto */
1878 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1880 /* FastTypeChecks.proto */
1881 #if CYTHON_COMPILING_IN_CPYTHON
1882 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1883 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1884 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1885 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1887 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1888 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1889 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1891 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1893 /* CheckBinaryVersion.proto */
1894 static int __Pyx_check_binary_version(void);
1896 /* InitStrings.proto */
1897 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1899 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*/
1901 /* Module declarations from 'cython' */
1903 /* Module declarations from 'libc.string' */
1905 /* Module declarations from 'libc' */
1907 /* Module declarations from 'libc.stdio' */
1909 /* Module declarations from 'lxml.includes.tree' */
1911 /* Module declarations from 'lxml.etree' */
1913 /* Module declarations from 'lxml.includes' */
1915 /* Module declarations from 'lxml.includes.etreepublic' */
1916 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__Document = 0;
1917 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__Element = 0;
1918 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase = 0;
1919 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree = 0;
1920 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup = 0;
1921 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup = 0;
1922 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher = 0;
1923 static PyTypeObject *__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator = 0;
1925 /* Module declarations from 'lxml' */
1927 /* Module declarations from 'lxml.python' */
1929 /* Module declarations from 'lxml.objectify' */
1930 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifiedElement = 0;
1931 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement = 0;
1932 static PyTypeObject *__pyx_ptype_4lxml_9objectify_NumberElement = 0;
1933 static PyTypeObject *__pyx_ptype_4lxml_9objectify_IntElement = 0;
1934 static PyTypeObject *__pyx_ptype_4lxml_9objectify_LongElement = 0;
1935 static PyTypeObject *__pyx_ptype_4lxml_9objectify_FloatElement = 0;
1936 static PyTypeObject *__pyx_ptype_4lxml_9objectify_StringElement = 0;
1937 static PyTypeObject *__pyx_ptype_4lxml_9objectify_NoneElement = 0;
1938 static PyTypeObject *__pyx_ptype_4lxml_9objectify_BoolElement = 0;
1939 static PyTypeObject *__pyx_ptype_4lxml_9objectify_PyType = 0;
1940 static PyTypeObject *__pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller = 0;
1941 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ElementMaker = 0;
1942 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup = 0;
1943 static PyTypeObject *__pyx_ptype_4lxml_9objectify_ObjectPath = 0;
1944 static PyObject *__pyx_v_4lxml_9objectify_etree = 0;
1945 static PyObject *__pyx_v_4lxml_9objectify_re = 0;
1946 static PyObject *__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS = 0;
1947 static PyObject *__pyx_v_4lxml_9objectify_is_special_method = 0;
1948 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE = 0;
1949 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 = 0;
1950 static const xmlChar *__pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE;
1951 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME = 0;
1952 static PyObject *__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 = 0;
1953 static const xmlChar *__pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME;
1954 static PyObject *__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME = 0;
1955 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_NS = 0;
1956 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8 = 0;
1957 static const xmlChar *__pyx_v_4lxml_9objectify__XML_SCHEMA_NS;
1958 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS = 0;
1959 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8 = 0;
1960 static const xmlChar *__pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS;
1961 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR = 0;
1962 static PyObject *__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR = 0;
1963 static PyObject *__pyx_v_4lxml_9objectify__PYTYPE_DICT = 0;
1964 static PyObject *__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT = 0;
1965 static PyObject *__pyx_v_4lxml_9objectify__TYPE_CHECKS = 0;
1966 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_4lxml_9objectify_TREE_PYTYPE = 0;
1967 static int __pyx_v_4lxml_9objectify___RECURSIVE_STR;
1968 static PyObject *__pyx_v_4lxml_9objectify__strip_attributes = 0;
1969 static PyObject *__pyx_v_4lxml_9objectify__cleanup_namespaces = 0;
1970 static PyObject *__pyx_v_4lxml_9objectify___DEFAULT_PARSER = 0;
1971 static PyObject *__pyx_v_4lxml_9objectify_objectify_parser = 0;
1972 static PyObject *__pyx_v_4lxml_9objectify__fromstring = 0;
1973 static PyObject *__pyx_v_4lxml_9objectify__parse = 0;
1974 static PyObject *__pyx_v_4lxml_9objectify__DEFAULT_NSMAP = 0;
1975 static PyObject *__pyx_v_4lxml_9objectify__NO_DEFAULT = 0;
1976 static PyObject *__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT = 0;
1977 static PyObject *__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT = 0;
1978 static PyObject *__pyx_f_4lxml_9objectify_strrepr(PyObject *); /*proto*/
1979 static PyObject *__pyx_f_4lxml_9objectify__typename(PyObject *); /*proto*/
1980 static PyObject *__pyx_f_4lxml_9objectify__unicodeAndUtf8(PyObject *); /*proto*/
1981 static CYTHON_INLINE int __pyx_f_4lxml_9objectify__tagMatches(xmlNode *, const xmlChar *, const xmlChar *); /*proto*/
1982 static Py_ssize_t __pyx_f_4lxml_9objectify__countSiblings(xmlNode *); /*proto*/
1983 static xmlNode *__pyx_f_4lxml_9objectify__findFollowingSibling(xmlNode *, const xmlChar *, const xmlChar *, Py_ssize_t); /*proto*/
1984 static PyObject *__pyx_f_4lxml_9objectify__lookupChild(struct LxmlElement *, PyObject *); /*proto*/
1985 static PyObject *__pyx_f_4lxml_9objectify__lookupChildOrRaise(struct LxmlElement *, PyObject *); /*proto*/
1986 static PyObject *__pyx_f_4lxml_9objectify__buildChildTag(struct LxmlElement *, PyObject *); /*proto*/
1987 static PyObject *__pyx_f_4lxml_9objectify__replaceElement(struct LxmlElement *, PyObject *); /*proto*/
1988 static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
1989 static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *, PyObject *); /*proto*/
1990 static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *, struct LxmlElement *, PyObject *); /*proto*/
1991 static int __pyx_f_4lxml_9objectify___parseBool(PyObject *, int __pyx_skip_dispatch); /*proto*/
1992 static CYTHON_INLINE int __pyx_f_4lxml_9objectify___parseBoolAsInt(PyObject *); /*proto*/
1993 static PyObject *__pyx_f_4lxml_9objectify__parseNumber(struct __pyx_obj_4lxml_9objectify_NumberElement *); /*proto*/
1994 static PyObject *__pyx_f_4lxml_9objectify__strValueOf(PyObject *); /*proto*/
1995 static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *); /*proto*/
1996 static PyObject *__pyx_f_4lxml_9objectify__richcmpPyvals(PyObject *, PyObject *, int); /*proto*/
1997 static PyObject *__pyx_f_4lxml_9objectify__pytypename(PyObject *); /*proto*/
1998 static PyObject *__pyx_f_4lxml_9objectify__registerPyTypes(void); /*proto*/
1999 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__guessPyType(PyObject *, struct __pyx_obj_4lxml_9objectify_PyType *); /*proto*/
2000 static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *); /*proto*/
2001 static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *, PyObject *); /*proto*/
2002 static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *, int); /*proto*/
2003 static PyObject *__pyx_f_4lxml_9objectify__setupPickle(PyObject *); /*proto*/
2004 static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
2005 static struct __pyx_obj_4lxml_9objectify_PyType *__pyx_f_4lxml_9objectify__check_type(xmlNode *, struct __pyx_obj_4lxml_9objectify_PyType *); /*proto*/
2006 static PyObject *__pyx_f_4lxml_9objectify__annotate(struct LxmlElement *, int, int, int, int, PyObject *, PyObject *); /*proto*/
2007 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*/
2008 static struct LxmlElement *__pyx_f_4lxml_9objectify__makeElement(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
2009 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *); /*proto*/
2010 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *); /*proto*/
2011 static __pyx_t_4lxml_9objectify__ObjectPath *__pyx_f_4lxml_9objectify__build_object_path_segments(PyObject *); /*proto*/
2012 static PyObject *__pyx_f_4lxml_9objectify__find_object_path(struct LxmlElement *, __pyx_t_4lxml_9objectify__ObjectPath *, Py_ssize_t, PyObject *); /*proto*/
2013 static PyObject *__pyx_f_4lxml_9objectify__create_object_path(struct LxmlElement *, __pyx_t_4lxml_9objectify__ObjectPath *, Py_ssize_t, int, PyObject *); /*proto*/
2014 static PyObject *__pyx_f_4lxml_9objectify__build_descendant_paths(xmlNode *, PyObject *); /*proto*/
2015 static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *, PyObject *, PyObject *); /*proto*/
2016 #define __Pyx_MODULE_NAME "lxml.objectify"
2017 extern int __pyx_module_is_main_lxml__objectify;
2018 int __pyx_module_is_main_lxml__objectify = 0;
2020 /* Implementation of 'lxml.objectify' */
2021 static PyObject *__pyx_builtin_ValueError;
2022 static PyObject *__pyx_builtin_TypeError;
2023 static PyObject *__pyx_builtin_object;
2024 static PyObject *__pyx_builtin_IndexError;
2025 static PyObject *__pyx_builtin_AttributeError;
2026 static PyObject *__pyx_builtin_oct;
2027 static PyObject *__pyx_builtin_hex;
2028 static PyObject *__pyx_builtin_enumerate;
2029 static PyObject *__pyx_builtin_map;
2030 static PyObject *__pyx_builtin_MemoryError;
2031 static const char __pyx_k_[] = "";
2032 static const char __pyx_k_0[] = "0";
2033 static const char __pyx_k_1[] = "1";
2034 static const char __pyx_k_E[] = "E";
2035 static const char __pyx_k_U[] = "U";
2036 static const char __pyx_k_b[] = "b";
2037 static const char __pyx_k_c[] = "c";
2038 static const char __pyx_k_f[] = "f";
2039 static const char __pyx_k_i[] = "i";
2040 static const char __pyx_k_s[] = "{%s}*";
2041 static const char __pyx_k_ID[] = "ID";
2042 static const char __pyx_k__2[] = ".";
2043 static const char __pyx_k__4[] = "'";
2044 static const char __pyx_k__9[] = "{";
2045 static const char __pyx_k_kw[] = "kw";
2046 static const char __pyx_k_ns[] = "ns";
2047 static const char __pyx_k_of[] = "' of '";
2048 static const char __pyx_k_on[] = "on";
2049 static const char __pyx_k_py[] = "py:";
2050 static const char __pyx_k_re[] = "re";
2051 static const char __pyx_k_XML[] = "XML";
2052 static const char __pyx_k__10[] = " ";
2053 static const char __pyx_k__11[] = " = ";
2054 static const char __pyx_k__12[] = " [";
2055 static const char __pyx_k__13[] = "]\n";
2056 static const char __pyx_k__14[] = " * ";
2057 static const char __pyx_k__15[] = "\n";
2058 static const char __pyx_k__17[] = ":";
2059 static const char __pyx_k__19[] = "{}";
2060 static const char __pyx_k__20[] = "[";
2061 static const char __pyx_k__21[] = "]";
2062 static const char __pyx_k__23[] = "__.*__$";
2063 static const char __pyx_k_all[] = "__all__";
2064 static const char __pyx_k_end[] = "end";
2065 static const char __pyx_k_get[] = "get";
2066 static const char __pyx_k_got[] = ", got ";
2067 static const char __pyx_k_hex[] = "hex";
2068 static const char __pyx_k_int[] = "int";
2069 static const char __pyx_k_map[] = "map";
2070 static const char __pyx_k_obj[] = "obj";
2071 static const char __pyx_k_oct[] = "oct";
2072 static const char __pyx_k_s_2[] = "{%s}";
2073 static const char __pyx_k_s_3[] = "s";
2074 static const char __pyx_k_set[] = "__set__";
2075 static const char __pyx_k_str[] = "str";
2076 static const char __pyx_k_tag[] = "tag";
2077 static const char __pyx_k_xml[] = "xml";
2078 static const char __pyx_k_xsd[] = "xsd:";
2079 static const char __pyx_k_xsi[] = "xsi:";
2080 static const char __pyx_k_Name[] = "Name";
2081 static const char __pyx_k_None[] = "None";
2082 static const char __pyx_k_TREE[] = "TREE";
2083 static const char __pyx_k_base[] = "base";
2084 static const char __pyx_k_bool[] = "bool";
2085 static const char __pyx_k_byte[] = "byte";
2086 static const char __pyx_k_call[] = "__call__";
2087 static const char __pyx_k_copy[] = "__copy__";
2088 static const char __pyx_k_data[] = "data";
2089 static const char __pyx_k_dump[] = "dump";
2090 static const char __pyx_k_init[] = "_init";
2091 static const char __pyx_k_item[] = "item";
2092 static const char __pyx_k_long[] = "long";
2093 static const char __pyx_k_lxml[] = "lxml";
2094 static const char __pyx_k_main[] = "__main__";
2095 static const char __pyx_k_name[] = "name";
2096 static const char __pyx_k_none[] = "none";
2097 static const char __pyx_k_path[] = "path";
2098 static const char __pyx_k_py_2[] = "py";
2099 static const char __pyx_k_repr[] = "repr";
2100 static const char __pyx_k_root[] = "root";
2101 static const char __pyx_k_self[] = "self";
2102 static const char __pyx_k_tail[] = "tail";
2103 static const char __pyx_k_temp[] = "temp";
2104 static const char __pyx_k_test[] = "__test__";
2105 static const char __pyx_k_text[] = "text";
2106 static const char __pyx_k_true[] = "true";
2107 static const char __pyx_k_IDREF[] = "IDREF";
2108 static const char __pyx_k_after[] = "after";
2109 static const char __pyx_k_check[] = "check";
2110 static const char __pyx_k_entry[] = "entry";
2111 static const char __pyx_k_etree[] = "etree";
2112 static const char __pyx_k_false[] = "false";
2113 static const char __pyx_k_float[] = "float";
2114 static const char __pyx_k_items[] = "items";
2115 static const char __pyx_k_known[] = "known";
2116 static const char __pyx_k_match[] = "match";
2117 static const char __pyx_k_nsmap[] = "nsmap";
2118 static const char __pyx_k_parse[] = "parse";
2119 static const char __pyx_k_pyval[] = "pyval";
2120 static const char __pyx_k_s_nil[] = "{%s}nil";
2121 static const char __pyx_k_short[] = "short";
2122 static const char __pyx_k_split[] = "split";
2123 static const char __pyx_k_strip[] = "strip";
2124 static const char __pyx_k_tag_2[] = "_tag";
2125 static const char __pyx_k_token[] = "token";
2126 static const char __pyx_k_types[] = "types";
2127 static const char __pyx_k_value[] = "value";
2128 static const char __pyx_k_xsd_2[] = "xsd";
2129 static const char __pyx_k_xsi_2[] = "xsi";
2130 static const char __pyx_k_xsi_3[] = "_xsi";
2131 static const char __pyx_k_ENTITY[] = "ENTITY";
2132 static const char __pyx_k_NCName[] = "NCName";
2133 static const char __pyx_k_PyType[] = "PyType";
2134 static const char __pyx_k_attrib[] = "attrib";
2135 static const char __pyx_k_before[] = "before";
2136 static const char __pyx_k_c_node[] = "c_node";
2137 static const char __pyx_k_double[] = "double";
2138 static const char __pyx_k_encode[] = "encode";
2139 static const char __pyx_k_groups[] = "groups";
2140 static const char __pyx_k_import[] = "__import__";
2141 static const char __pyx_k_name_2[] = "__name__";
2142 static const char __pyx_k_object[] = "object";
2143 static const char __pyx_k_parser[] = "parser";
2144 static const char __pyx_k_pickle[] = "pickle";
2145 static const char __pyx_k_prefix[] = "prefix";
2146 static const char __pyx_k_pytype[] = "pytype";
2147 static const char __pyx_k_reduce[] = "__reduce__";
2148 static const char __pyx_k_remove[] = "remove";
2149 static const char __pyx_k_result[] = "result";
2150 static const char __pyx_k_s_type[] = "{%s}type";
2151 static const char __pyx_k_string[] = "string";
2152 static const char __pyx_k_strlen[] = "strlen";
2153 static const char __pyx_k_strval[] = "strval";
2154 static const char __pyx_k_update[] = "update";
2155 static const char __pyx_k_values[] = "values";
2156 static const char __pyx_k_Element[] = "Element";
2157 static const char __pyx_k_NMTOKEN[] = "NMTOKEN";
2158 static const char __pyx_k_addattr[] = "addattr";
2159 static const char __pyx_k_addnext[] = "addnext";
2160 static const char __pyx_k_boolean[] = "boolean";
2161 static const char __pyx_k_compile[] = "compile";
2162 static const char __pyx_k_complex[] = "__complex__";
2163 static const char __pyx_k_copyreg[] = "copyreg";
2164 static const char __pyx_k_element[] = "element";
2165 static const char __pyx_k_getattr[] = "__getattr__";
2166 static const char __pyx_k_getitem[] = "__getitem__";
2167 static const char __pyx_k_hasattr[] = "hasattr";
2168 static const char __pyx_k_integer[] = "integer";
2169 static const char __pyx_k_py_type[] = "py_type";
2170 static const char __pyx_k_replace[] = "replace";
2171 static const char __pyx_k_setText[] = "_setText";
2172 static const char __pyx_k_setattr[] = "setattr";
2173 static const char __pyx_k_value_2[] = "_value";
2174 static const char __pyx_k_version[] = "__version__";
2175 static const char __pyx_k_xs_type[] = "xs_type";
2176 static const char __pyx_k_xsi_nil[] = "xsi_nil";
2177 static const char __pyx_k_NoneType[] = "NoneType";
2178 static const char __pyx_k_annotate[] = "annotate";
2179 static const char __pyx_k_base_url[] = "base_url";
2180 static const char __pyx_k_copy_reg[] = "copy_reg";
2181 static const char __pyx_k_function[] = "function";
2182 static const char __pyx_k_language[] = "language";
2183 static const char __pyx_k_last_pos[] = "last_pos";
2184 static const char __pyx_k_pytype_2[] = "_pytype";
2185 static const char __pyx_k_register[] = "register";
2186 static const char __pyx_k_tostring[] = "tostring";
2187 static const char __pyx_k_TypeError[] = "TypeError";
2188 static const char __pyx_k_XMLParser[] = "XMLParser";
2189 static const char __pyx_k_attribute[] = "attribute '";
2190 static const char __pyx_k_checkBool[] = "__checkBool";
2191 static const char __pyx_k_enumerate[] = "enumerate";
2192 static const char __pyx_k_first_pos[] = "first_pos";
2193 static const char __pyx_k_getparent[] = "getparent";
2194 static const char __pyx_k_namespace[] = "namespace";
2195 static const char __pyx_k_parseBool[] = "__parseBool";
2196 static const char __pyx_k_stringify[] = "stringify";
2197 static const char __pyx_k_IndexError[] = "IndexError";
2198 static const char __pyx_k_IntElement[] = "IntElement";
2199 static const char __pyx_k_ObjectPath[] = "ObjectPath";
2200 static const char __pyx_k_PyType_s_s[] = "PyType(%s, %s)";
2201 static const char __pyx_k_SubElement[] = "SubElement";
2202 static const char __pyx_k_ValueError[] = "ValueError";
2203 static const char __pyx_k_attributes[] = "_attributes";
2204 static const char __pyx_k_deannotate[] = "deannotate";
2205 static const char __pyx_k_empty_type[] = "empty_type";
2206 static const char __pyx_k_fromstring[] = "fromstring";
2207 static const char __pyx_k_ignore_old[] = "ignore_old";
2208 static const char __pyx_k_ignore_xsi[] = "ignore_xsi";
2209 static const char __pyx_k_lower_bool[] = "__lower_bool";
2210 static const char __pyx_k_makeparser[] = "makeparser";
2211 static const char __pyx_k_new_parser[] = "new_parser";
2212 static const char __pyx_k_pyannotate[] = "pyannotate";
2213 static const char __pyx_k_pytypename[] = "pytypename";
2214 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2215 static const char __pyx_k_tree_class[] = "tree_class";
2216 static const char __pyx_k_type_check[] = "type_check";
2217 static const char __pyx_k_type_class[] = "type_class";
2218 static const char __pyx_k_unregister[] = "unregister";
2219 static const char __pyx_k_BoolElement[] = "BoolElement";
2220 static const char __pyx_k_DataElement[] = "DataElement";
2221 static const char __pyx_k_ElementTree[] = "ElementTree";
2222 static const char __pyx_k_LongElement[] = "LongElement";
2223 static const char __pyx_k_MemoryError[] = "MemoryError";
2224 static const char __pyx_k_NoneElement[] = "NoneElement";
2225 static const char __pyx_k_getchildren[] = "getchildren";
2226 static const char __pyx_k_makeelement[] = "makeelement";
2227 static const char __pyx_k_unsignedInt[] = "unsignedInt";
2228 static const char __pyx_k_xsiannotate[] = "xsiannotate";
2229 static const char __pyx_k_ElementMaker[] = "ElementMaker";
2230 static const char __pyx_k_FloatElement[] = "FloatElement";
2231 static const char __pyx_k_annotate_xsi[] = "annotate_xsi";
2232 static const char __pyx_k_empty_pytype[] = "empty_pytype";
2233 static const char __pyx_k_invalid_path[] = "invalid path";
2234 static const char __pyx_k_iterchildren[] = "iterchildren";
2235 static const char __pyx_k_unsignedByte[] = "unsignedByte";
2236 static const char __pyx_k_unsignedLong[] = "unsignedLong";
2237 static const char __pyx_k_ElementTree_2[] = "_ElementTree";
2238 static const char __pyx_k_Invalid_slice[] = "Invalid slice";
2239 static const char __pyx_k_NumberElement[] = "NumberElement";
2240 static const char __pyx_k_StringElement[] = "StringElement";
2241 static const char __pyx_k_attribute_tag[] = "attribute_tag";
2242 static const char __pyx_k_countchildren[] = "countchildren";
2243 static const char __pyx_k_ignore_pytype[] = "ignore_pytype";
2244 static const char __pyx_k_no_such_child[] = "no such child: ";
2245 static const char __pyx_k_unsignedShort[] = "unsignedShort";
2246 static const char __pyx_k_AttributeError[] = "AttributeError";
2247 static const char __pyx_k_lxml_objectify[] = "lxml.objectify";
2248 static const char __pyx_k_setValueParser[] = "_setValueParser";
2249 static const char __pyx_k_unicode_escape[] = "unicode-escape";
2250 static const char __pyx_k_xmlSchemaTypes[] = "xmlSchemaTypes";
2251 static const char __pyx_k_PyType_register[] = "PyType.register";
2252 static const char __pyx_k_annotate_pytype[] = "annotate_pytype";
2253 static const char __pyx_k_attribute_names[] = "attribute_names";
2254 static const char __pyx_k_descendantpaths[] = "descendantpaths";
2255 static const char __pyx_k_element_or_tree[] = "element_or_tree";
2256 static const char __pyx_k_negativeInteger[] = "negativeInteger";
2257 static const char __pyx_k_positiveInteger[] = "positiveInteger";
2258 static const char __pyx_k_s_s_s_s_s_0_9_s[] = "(\\.?)\\s*(?:\\{([^}]*)\\})?\\s*([^.{}\\[\\]\\s]+)\\s*(?:\\[\\s*([-0-9]+)\\s*\\])?";
2259 static const char __pyx_k_IntElement__init[] = "IntElement._init";
2260 static const char __pyx_k_PYTYPE_ATTRIBUTE[] = "PYTYPE_ATTRIBUTE";
2261 static const char __pyx_k_empty_data_class[] = "empty_data_class";
2262 static const char __pyx_k_normalizedString[] = "normalizedString";
2263 static const char __pyx_k_strip_attributes[] = "strip_attributes";
2264 static const char __pyx_k_BoolElement__init[] = "BoolElement._init";
2265 static const char __pyx_k_LongElement__init[] = "LongElement._init";
2266 static const char __pyx_k_PyType_unregister[] = "PyType.unregister";
2267 static const char __pyx_k_remove_blank_text[] = "remove_blank_text";
2268 static const char __pyx_k_FloatElement__init[] = "FloatElement._init";
2269 static const char __pyx_k_ObjectPath_addattr[] = "ObjectPath.addattr";
2270 static const char __pyx_k_ObjectPath_hasattr[] = "ObjectPath.hasattr";
2271 static const char __pyx_k_ObjectPath_setattr[] = "ObjectPath.setattr";
2272 static const char __pyx_k_ObjectifiedElement[] = "ObjectifiedElement";
2273 static const char __pyx_k_cleanup_namespaces[] = "cleanup_namespaces";
2274 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2275 static const char __pyx_k_getRegisteredTypes[] = "getRegisteredTypes";
2276 static const char __pyx_k_nonNegativeInteger[] = "nonNegativeInteger";
2277 static const char __pyx_k_nonPositiveInteger[] = "nonPositiveInteger";
2278 static const char __pyx_k_set_default_parser[] = "set_default_parser";
2279 static const char __pyx_k_unpickleElementTree[] = "__unpickleElementTree";
2280 static const char __pyx_k_ElementChildIterator[] = "ElementChildIterator";
2281 static const char __pyx_k_StringElement_strlen[] = "StringElement.strlen";
2282 static const char __pyx_k_enable_recursive_str[] = "enable_recursive_str";
2283 static const char __pyx_k_Invalid_boolean_value[] = "Invalid boolean value: '";
2284 static const char __pyx_k_ObjectifiedDataElement[] = "ObjectifiedDataElement";
2285 static const char __pyx_k_src_lxml_objectify_pyx[] = "src/lxml/objectify.pyx";
2286 static const char __pyx_k_NumberElement___complex[] = "NumberElement.__complex__";
2287 static const char __pyx_k_StringElement___complex[] = "StringElement.__complex__";
2288 static const char __pyx_k_cannot_update_root_node[] = "cannot update root node";
2289 static const char __pyx_k_objects_is_not_writable[] = "' objects is not writable";
2290 static const char __pyx_k_pickleReduceElementTree[] = "pickleReduceElementTree";
2291 static const char __pyx_k_src_lxml_objectpath_pxi[] = "src/lxml/objectpath.pxi";
2292 static const char __pyx_k_set_element_class_lookup[] = "set_element_class_lookup";
2293 static const char __pyx_k_set_pytype_attribute_tag[] = "set_pytype_attribute_tag";
2294 static const char __pyx_k_Cannot_register_tree_type[] = "Cannot register tree type";
2295 static const char __pyx_k_index_must_be_enclosed_in[] = "index must be enclosed in []";
2296 static const char __pyx_k_to_extended_slice_of_size[] = " to extended slice of size ";
2297 static const char __pyx_k_ObjectifiedElement_addattr[] = "ObjectifiedElement.addattr";
2298 static const char __pyx_k_Type_name_must_be_a_string[] = "Type name must be a string";
2299 static const char __pyx_k_invalid_types_for_operator[] = "invalid types for * operator";
2300 static const char __pyx_k_ObjectifiedElement___reduce[] = "ObjectifiedElement.__reduce__";
2301 static const char __pyx_k_ObjectifyElementClassLookup[] = "ObjectifyElementClassLookup";
2302 static const char __pyx_k_NumberElement__setValueParser[] = "NumberElement._setValueParser";
2303 static const char __pyx_k_ObjectifiedElement_getchildren[] = "ObjectifiedElement.getchildren";
2304 static const char __pyx_k_http_www_w3_org_2001_XMLSchema[] = "http://www.w3.org/2001/XMLSchema";
2305 static const char __pyx_k_index_not_allowed_on_root_node[] = "index not allowed on root node";
2306 static const char __pyx_k_ObjectifiedDataElement__setText[] = "ObjectifiedDataElement._setText";
2307 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";
2308 static const char __pyx_k_deleting_items_not_supported_by[] = "deleting items not supported by root element";
2309 static const char __pyx_k_Data_classes_must_inherit_from_O[] = "Data classes must inherit from ObjectifiedDataElement";
2310 static const char __pyx_k_ObjectifiedElement_countchildren[] = "ObjectifiedElement.countchildren";
2311 static const char __pyx_k_ObjectifiedElement_descendantpat[] = "ObjectifiedElement.descendantpaths";
2312 static const char __pyx_k_Type_check_function_must_be_call[] = "Type check function must be callable (or None)";
2313 static const char __pyx_k_XSD_types_require_the_XSD_namesp[] = "XSD types require the XSD namespace";
2314 static const char __pyx_k_argument_of_makeelement_paramete[] = "argument of 'makeelement' parameter must be callable, got ";
2315 static const char __pyx_k_assignment_to_root_element_is_in[] = "assignment to root element is invalid";
2316 static const char __pyx_k_attempt_to_assign_sequence_of_si[] = "attempt to assign sequence of size ";
2317 static const char __pyx_k_creating_indexed_path_attributes[] = "creating indexed path attributes is not supported";
2318 static const char __pyx_k_http_codespeak_net_lxml_objectif[] = "http://codespeak.net/lxml/objectify/pytype";
2319 static const char __pyx_k_http_www_w3_org_2001_XMLSchema_i[] = "http://www.w3.org/2001/XMLSchema-instance";
2320 static const char __pyx_k_inconsistent_before_after_depend[] = "inconsistent before/after dependencies";
2321 static const char __pyx_k_invalid_number_of_arguments_need[] = "invalid number of arguments: needs one or two";
2322 static const char __pyx_k_parser_must_inherit_from_lxml_et[] = "parser must inherit from lxml.etree.XMLParser";
2323 static const char __pyx_k_root_element_does_not_match_need[] = "root element does not match: need ";
2324 static PyObject *__pyx_kp_s_;
2325 static PyObject *__pyx_kp_u_;
2326 static PyObject *__pyx_kp_s_0;
2327 static PyObject *__pyx_kp_s_1;
2328 static PyObject *__pyx_n_s_AttributeError;
2329 static PyObject *__pyx_n_s_BoolElement;
2330 static PyObject *__pyx_n_u_BoolElement;
2331 static PyObject *__pyx_n_s_BoolElement__init;
2332 static PyObject *__pyx_kp_u_Cannot_register_tree_type;
2333 static PyObject *__pyx_n_s_DataElement;
2334 static PyObject *__pyx_n_u_DataElement;
2335 static PyObject *__pyx_kp_u_Data_classes_must_inherit_from_O;
2336 static PyObject *__pyx_n_s_E;
2337 static PyObject *__pyx_n_u_E;
2338 static PyObject *__pyx_n_u_ENTITY;
2339 static PyObject *__pyx_n_s_Element;
2340 static PyObject *__pyx_n_u_Element;
2341 static PyObject *__pyx_n_s_ElementChildIterator;
2342 static PyObject *__pyx_n_s_ElementMaker;
2343 static PyObject *__pyx_n_u_ElementMaker;
2344 static PyObject *__pyx_n_s_ElementTree;
2345 static PyObject *__pyx_n_s_ElementTree_2;
2346 static PyObject *__pyx_n_s_FloatElement;
2347 static PyObject *__pyx_n_u_FloatElement;
2348 static PyObject *__pyx_n_s_FloatElement__init;
2349 static PyObject *__pyx_n_u_ID;
2350 static PyObject *__pyx_n_u_IDREF;
2351 static PyObject *__pyx_n_s_IndexError;
2352 static PyObject *__pyx_n_s_IntElement;
2353 static PyObject *__pyx_n_u_IntElement;
2354 static PyObject *__pyx_n_s_IntElement__init;
2355 static PyObject *__pyx_kp_u_Invalid_boolean_value;
2356 static PyObject *__pyx_kp_u_Invalid_slice;
2357 static PyObject *__pyx_n_s_LongElement;
2358 static PyObject *__pyx_n_u_LongElement;
2359 static PyObject *__pyx_n_s_LongElement__init;
2360 static PyObject *__pyx_n_s_MemoryError;
2361 static PyObject *__pyx_n_u_NCName;
2362 static PyObject *__pyx_n_u_NMTOKEN;
2363 static PyObject *__pyx_n_u_Name;
2364 static PyObject *__pyx_n_s_None;
2365 static PyObject *__pyx_n_u_None;
2366 static PyObject *__pyx_n_s_NoneElement;
2367 static PyObject *__pyx_n_u_NoneElement;
2368 static PyObject *__pyx_n_s_NoneType;
2369 static PyObject *__pyx_n_u_NoneType;
2370 static PyObject *__pyx_n_s_NumberElement;
2371 static PyObject *__pyx_n_u_NumberElement;
2372 static PyObject *__pyx_n_s_NumberElement___complex;
2373 static PyObject *__pyx_n_s_NumberElement__setValueParser;
2374 static PyObject *__pyx_n_s_ObjectPath;
2375 static PyObject *__pyx_n_u_ObjectPath;
2376 static PyObject *__pyx_n_s_ObjectPath_addattr;
2377 static PyObject *__pyx_n_s_ObjectPath_hasattr;
2378 static PyObject *__pyx_n_s_ObjectPath_setattr;
2379 static PyObject *__pyx_n_s_ObjectifiedDataElement;
2380 static PyObject *__pyx_n_u_ObjectifiedDataElement;
2381 static PyObject *__pyx_n_s_ObjectifiedDataElement__setText;
2382 static PyObject *__pyx_n_s_ObjectifiedElement;
2383 static PyObject *__pyx_n_u_ObjectifiedElement;
2384 static PyObject *__pyx_n_s_ObjectifiedElement___reduce;
2385 static PyObject *__pyx_n_s_ObjectifiedElement_addattr;
2386 static PyObject *__pyx_n_s_ObjectifiedElement_countchildren;
2387 static PyObject *__pyx_n_s_ObjectifiedElement_descendantpat;
2388 static PyObject *__pyx_n_s_ObjectifiedElement_getchildren;
2389 static PyObject *__pyx_n_s_ObjectifyElementClassLookup;
2390 static PyObject *__pyx_n_u_ObjectifyElementClassLookup;
2391 static PyObject *__pyx_n_s_PYTYPE_ATTRIBUTE;
2392 static PyObject *__pyx_n_u_PYTYPE_ATTRIBUTE;
2393 static PyObject *__pyx_n_s_PyType;
2394 static PyObject *__pyx_n_u_PyType;
2395 static PyObject *__pyx_n_s_PyType_register;
2396 static PyObject *__pyx_kp_s_PyType_s_s;
2397 static PyObject *__pyx_n_s_PyType_unregister;
2398 static PyObject *__pyx_n_s_StringElement;
2399 static PyObject *__pyx_n_u_StringElement;
2400 static PyObject *__pyx_n_s_StringElement___complex;
2401 static PyObject *__pyx_n_s_StringElement_strlen;
2402 static PyObject *__pyx_n_s_SubElement;
2403 static PyObject *__pyx_n_u_SubElement;
2404 static PyObject *__pyx_n_u_TREE;
2405 static PyObject *__pyx_n_s_TypeError;
2406 static PyObject *__pyx_kp_u_Type_check_function_must_be_call;
2407 static PyObject *__pyx_kp_u_Type_name_must_be_a_string;
2408 static PyObject *__pyx_n_s_U;
2409 static PyObject *__pyx_n_s_ValueError;
2410 static PyObject *__pyx_n_s_XML;
2411 static PyObject *__pyx_n_u_XML;
2412 static PyObject *__pyx_n_s_XMLParser;
2413 static PyObject *__pyx_kp_u_XSD_types_require_the_XSD_namesp;
2414 static PyObject *__pyx_kp_u__10;
2415 static PyObject *__pyx_kp_u__11;
2416 static PyObject *__pyx_kp_u__12;
2417 static PyObject *__pyx_kp_u__13;
2418 static PyObject *__pyx_kp_u__14;
2419 static PyObject *__pyx_kp_u__15;
2420 static PyObject *__pyx_kp_b__17;
2421 static PyObject *__pyx_kp_u__17;
2422 static PyObject *__pyx_kp_u__19;
2423 static PyObject *__pyx_kp_u__2;
2424 static PyObject *__pyx_kp_u__20;
2425 static PyObject *__pyx_kp_u__21;
2426 static PyObject *__pyx_kp_u__23;
2427 static PyObject *__pyx_kp_u__4;
2428 static PyObject *__pyx_kp_u__9;
2429 static PyObject *__pyx_n_s_addattr;
2430 static PyObject *__pyx_n_s_addnext;
2431 static PyObject *__pyx_n_s_after;
2432 static PyObject *__pyx_n_s_all;
2433 static PyObject *__pyx_n_s_annotate;
2434 static PyObject *__pyx_n_u_annotate;
2435 static PyObject *__pyx_n_s_annotate_pytype;
2436 static PyObject *__pyx_n_s_annotate_xsi;
2437 static PyObject *__pyx_kp_u_argument_of_makeelement_paramete;
2438 static PyObject *__pyx_kp_u_assignment_to_root_element_is_in;
2439 static PyObject *__pyx_kp_u_attempt_to_assign_sequence_of_si;
2440 static PyObject *__pyx_n_s_attrib;
2441 static PyObject *__pyx_kp_u_attribute;
2442 static PyObject *__pyx_n_s_attribute_names;
2443 static PyObject *__pyx_n_s_attribute_tag;
2444 static PyObject *__pyx_n_s_attributes;
2445 static PyObject *__pyx_n_s_b;
2446 static PyObject *__pyx_n_s_base;
2447 static PyObject *__pyx_n_u_base;
2448 static PyObject *__pyx_n_s_base_url;
2449 static PyObject *__pyx_n_s_before;
2450 static PyObject *__pyx_n_u_bool;
2451 static PyObject *__pyx_n_u_boolean;
2452 static PyObject *__pyx_n_u_byte;
2453 static PyObject *__pyx_n_s_c;
2454 static PyObject *__pyx_n_s_c_node;
2455 static PyObject *__pyx_n_s_call;
2456 static PyObject *__pyx_kp_u_cannot_update_root_node;
2457 static PyObject *__pyx_n_s_check;
2458 static PyObject *__pyx_n_s_checkBool;
2459 static PyObject *__pyx_n_s_cleanup_namespaces;
2460 static PyObject *__pyx_n_s_cline_in_traceback;
2461 static PyObject *__pyx_n_s_compile;
2462 static PyObject *__pyx_n_s_complex;
2463 static PyObject *__pyx_n_s_copy;
2464 static PyObject *__pyx_n_s_copy_reg;
2465 static PyObject *__pyx_n_s_copyreg;
2466 static PyObject *__pyx_n_s_countchildren;
2467 static PyObject *__pyx_kp_u_creating_indexed_path_attributes;
2468 static PyObject *__pyx_n_s_data;
2469 static PyObject *__pyx_n_s_deannotate;
2470 static PyObject *__pyx_n_u_deannotate;
2471 static PyObject *__pyx_kp_u_deleting_items_not_supported_by;
2472 static PyObject *__pyx_n_s_descendantpaths;
2473 static PyObject *__pyx_n_u_double;
2474 static PyObject *__pyx_n_s_dump;
2475 static PyObject *__pyx_n_u_dump;
2476 static PyObject *__pyx_n_s_element;
2477 static PyObject *__pyx_n_s_element_or_tree;
2478 static PyObject *__pyx_n_s_empty_data_class;
2479 static PyObject *__pyx_n_s_empty_pytype;
2480 static PyObject *__pyx_n_s_empty_type;
2481 static PyObject *__pyx_n_s_enable_recursive_str;
2482 static PyObject *__pyx_n_u_enable_recursive_str;
2483 static PyObject *__pyx_n_s_encode;
2484 static PyObject *__pyx_n_s_end;
2485 static PyObject *__pyx_n_s_entry;
2486 static PyObject *__pyx_n_s_enumerate;
2487 static PyObject *__pyx_n_s_etree;
2488 static PyObject *__pyx_n_s_f;
2489 static PyObject *__pyx_n_s_false;
2490 static PyObject *__pyx_n_u_false;
2491 static PyObject *__pyx_n_s_first_pos;
2492 static PyObject *__pyx_n_u_float;
2493 static PyObject *__pyx_n_s_fromstring;
2494 static PyObject *__pyx_n_u_fromstring;
2495 static PyObject *__pyx_n_s_function;
2496 static PyObject *__pyx_n_s_get;
2497 static PyObject *__pyx_n_s_getRegisteredTypes;
2498 static PyObject *__pyx_n_u_getRegisteredTypes;
2499 static PyObject *__pyx_n_s_getattr;
2500 static PyObject *__pyx_n_s_getchildren;
2501 static PyObject *__pyx_n_s_getitem;
2502 static PyObject *__pyx_n_s_getparent;
2503 static PyObject *__pyx_kp_u_got;
2504 static PyObject *__pyx_n_s_groups;
2505 static PyObject *__pyx_n_s_hasattr;
2506 static PyObject *__pyx_n_s_hex;
2507 static PyObject *__pyx_kp_u_http_codespeak_net_lxml_objectif;
2508 static PyObject *__pyx_kp_u_http_www_w3_org_2001_XMLSchema;
2509 static PyObject *__pyx_kp_u_http_www_w3_org_2001_XMLSchema_i;
2510 static PyObject *__pyx_n_s_i;
2511 static PyObject *__pyx_n_s_ignore_old;
2512 static PyObject *__pyx_n_s_ignore_pytype;
2513 static PyObject *__pyx_n_s_ignore_xsi;
2514 static PyObject *__pyx_n_s_import;
2515 static PyObject *__pyx_kp_u_inconsistent_before_after_depend;
2516 static PyObject *__pyx_kp_u_index_must_be_enclosed_in;
2517 static PyObject *__pyx_kp_u_index_not_allowed_on_root_node;
2518 static PyObject *__pyx_n_s_init;
2519 static PyObject *__pyx_n_u_int;
2520 static PyObject *__pyx_n_u_integer;
2521 static PyObject *__pyx_kp_u_invalid_number_of_arguments_need;
2522 static PyObject *__pyx_kp_u_invalid_path;
2523 static PyObject *__pyx_kp_u_invalid_types_for_operator;
2524 static PyObject *__pyx_n_s_item;
2525 static PyObject *__pyx_n_s_items;
2526 static PyObject *__pyx_n_s_iterchildren;
2527 static PyObject *__pyx_n_s_known;
2528 static PyObject *__pyx_n_s_kw;
2529 static PyObject *__pyx_n_u_language;
2530 static PyObject *__pyx_n_s_last_pos;
2531 static PyObject *__pyx_n_u_long;
2532 static PyObject *__pyx_n_s_lower_bool;
2533 static PyObject *__pyx_n_s_lxml;
2534 static PyObject *__pyx_n_s_lxml_objectify;
2535 static PyObject *__pyx_n_s_main;
2536 static PyObject *__pyx_n_s_makeelement;
2537 static PyObject *__pyx_n_s_makeparser;
2538 static PyObject *__pyx_n_u_makeparser;
2539 static PyObject *__pyx_n_s_map;
2540 static PyObject *__pyx_n_s_match;
2541 static PyObject *__pyx_n_s_name;
2542 static PyObject *__pyx_n_s_name_2;
2543 static PyObject *__pyx_n_s_namespace;
2544 static PyObject *__pyx_n_u_negativeInteger;
2545 static PyObject *__pyx_n_s_new_parser;
2546 static PyObject *__pyx_kp_u_no_such_child;
2547 static PyObject *__pyx_n_u_nonNegativeInteger;
2548 static PyObject *__pyx_n_u_nonPositiveInteger;
2549 static PyObject *__pyx_n_s_none;
2550 static PyObject *__pyx_n_u_none;
2551 static PyObject *__pyx_n_u_normalizedString;
2552 static PyObject *__pyx_n_s_ns;
2553 static PyObject *__pyx_n_s_nsmap;
2554 static PyObject *__pyx_n_s_obj;
2555 static PyObject *__pyx_n_s_object;
2556 static PyObject *__pyx_kp_u_objects_is_not_writable;
2557 static PyObject *__pyx_n_s_oct;
2558 static PyObject *__pyx_kp_u_of;
2559 static PyObject *__pyx_n_s_on;
2560 static PyObject *__pyx_n_s_parse;
2561 static PyObject *__pyx_n_u_parse;
2562 static PyObject *__pyx_n_s_parseBool;
2563 static PyObject *__pyx_n_s_parser;
2564 static PyObject *__pyx_kp_u_parser_must_inherit_from_lxml_et;
2565 static PyObject *__pyx_n_s_path;
2566 static PyObject *__pyx_n_s_pickle;
2567 static PyObject *__pyx_n_s_pickleReduceElementTree;
2568 static PyObject *__pyx_n_u_positiveInteger;
2569 static PyObject *__pyx_n_s_prefix;
2570 static PyObject *__pyx_kp_u_py;
2571 static PyObject *__pyx_n_s_py_2;
2572 static PyObject *__pyx_n_s_py_type;
2573 static PyObject *__pyx_n_s_pyannotate;
2574 static PyObject *__pyx_n_u_pyannotate;
2575 static PyObject *__pyx_n_s_pytype;
2576 static PyObject *__pyx_n_u_pytype;
2577 static PyObject *__pyx_n_s_pytype_2;
2578 static PyObject *__pyx_n_s_pytypename;
2579 static PyObject *__pyx_n_u_pytypename;
2580 static PyObject *__pyx_n_s_pyval;
2581 static PyObject *__pyx_n_u_pyval;
2582 static PyObject *__pyx_n_s_pyx_vtable;
2583 static PyObject *__pyx_n_s_re;
2584 static PyObject *__pyx_n_s_reduce;
2585 static PyObject *__pyx_n_s_register;
2586 static PyObject *__pyx_n_s_remove;
2587 static PyObject *__pyx_n_s_remove_blank_text;
2588 static PyObject *__pyx_n_s_replace;
2589 static PyObject *__pyx_n_s_repr;
2590 static PyObject *__pyx_n_s_result;
2591 static PyObject *__pyx_n_s_root;
2592 static PyObject *__pyx_kp_u_root_element_does_not_match_need;
2593 static PyObject *__pyx_kp_u_s;
2594 static PyObject *__pyx_kp_u_s_2;
2595 static PyObject *__pyx_n_s_s_3;
2596 static PyObject *__pyx_kp_u_s_nil;
2597 static PyObject *__pyx_kp_u_s_s_s_s_s_0_9_s;
2598 static PyObject *__pyx_kp_u_s_type;
2599 static PyObject *__pyx_n_s_self;
2600 static PyObject *__pyx_n_s_set;
2601 static PyObject *__pyx_n_s_setText;
2602 static PyObject *__pyx_n_s_setValueParser;
2603 static PyObject *__pyx_n_s_set_default_parser;
2604 static PyObject *__pyx_n_u_set_default_parser;
2605 static PyObject *__pyx_n_s_set_element_class_lookup;
2606 static PyObject *__pyx_n_s_set_pytype_attribute_tag;
2607 static PyObject *__pyx_n_u_set_pytype_attribute_tag;
2608 static PyObject *__pyx_n_s_setattr;
2609 static PyObject *__pyx_n_u_short;
2610 static PyObject *__pyx_n_s_split;
2611 static PyObject *__pyx_kp_s_src_lxml_objectify_pyx;
2612 static PyObject *__pyx_kp_s_src_lxml_objectpath_pxi;
2613 static PyObject *__pyx_n_u_str;
2614 static PyObject *__pyx_n_u_string;
2615 static PyObject *__pyx_n_s_stringify;
2616 static PyObject *__pyx_n_s_strip;
2617 static PyObject *__pyx_n_s_strip_attributes;
2618 static PyObject *__pyx_n_s_strlen;
2619 static PyObject *__pyx_n_s_strval;
2620 static PyObject *__pyx_n_s_tag;
2621 static PyObject *__pyx_n_u_tag;
2622 static PyObject *__pyx_n_s_tag_2;
2623 static PyObject *__pyx_n_u_tail;
2624 static PyObject *__pyx_n_s_temp;
2625 static PyObject *__pyx_n_s_test;
2626 static PyObject *__pyx_n_s_text;
2627 static PyObject *__pyx_n_u_text;
2628 static PyObject *__pyx_kp_u_to_extended_slice_of_size;
2629 static PyObject *__pyx_n_u_token;
2630 static PyObject *__pyx_n_s_tostring;
2631 static PyObject *__pyx_n_s_tree_class;
2632 static PyObject *__pyx_n_s_true;
2633 static PyObject *__pyx_n_u_true;
2634 static PyObject *__pyx_n_s_type_check;
2635 static PyObject *__pyx_n_s_type_class;
2636 static PyObject *__pyx_n_s_types;
2637 static PyObject *__pyx_kp_s_unicode_escape;
2638 static PyObject *__pyx_n_s_unpickleElementTree;
2639 static PyObject *__pyx_n_s_unregister;
2640 static PyObject *__pyx_n_u_unsignedByte;
2641 static PyObject *__pyx_n_u_unsignedInt;
2642 static PyObject *__pyx_n_u_unsignedLong;
2643 static PyObject *__pyx_n_u_unsignedShort;
2644 static PyObject *__pyx_n_s_update;
2645 static PyObject *__pyx_n_s_value;
2646 static PyObject *__pyx_n_u_value;
2647 static PyObject *__pyx_n_s_value_2;
2648 static PyObject *__pyx_n_s_values;
2649 static PyObject *__pyx_n_s_version;
2650 static PyObject *__pyx_n_s_xml;
2651 static PyObject *__pyx_n_s_xmlSchemaTypes;
2652 static PyObject *__pyx_n_s_xs_type;
2653 static PyObject *__pyx_kp_u_xsd;
2654 static PyObject *__pyx_n_s_xsd_2;
2655 static PyObject *__pyx_kp_u_xsi;
2656 static PyObject *__pyx_n_s_xsi_2;
2657 static PyObject *__pyx_n_s_xsi_3;
2658 static PyObject *__pyx_n_s_xsi_nil;
2659 static PyObject *__pyx_n_s_xsiannotate;
2660 static PyObject *__pyx_n_u_xsiannotate;
2661 static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attribute_tag); /* proto */
2662 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2663 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2664 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2665 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2666 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2667 static Py_ssize_t __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2668 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2669 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self); /* proto */
2670 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2671 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 */
2672 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2673 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 */
2674 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
2675 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 */
2676 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
2677 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
2678 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2679 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2680 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self); /* proto */
2681 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
2682 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_function); /* proto */
2683 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2684 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_2__int__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2685 #if PY_MAJOR_VERSION < 3
2686 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_4__long__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2688 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_6__float__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2689 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2690 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_10__str__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2691 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2692 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2693 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2695 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2696 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2698 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 */
2699 static Py_hash_t __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2700 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_22__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2701 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2702 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2703 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
2704 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_28__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2706 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2707 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2708 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo); /* proto */
2709 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2710 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2711 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2712 static int __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2713 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self); /* proto */
2714 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2715 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2716 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_50__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2717 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_52__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2718 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2719 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement__init(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self); /* proto */
2720 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement_2__index__(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self); /* proto */
2721 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement__init(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self); /* proto */
2722 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement_2__index__(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self); /* proto */
2723 static PyObject *__pyx_pf_4lxml_9objectify_12FloatElement__init(struct __pyx_obj_4lxml_9objectify_FloatElement *__pyx_v_self); /* proto */
2724 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2725 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement___repr__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2726 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_2strlen(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2727 static int __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2728 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 */
2729 static Py_hash_t __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2730 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_10__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2731 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_12__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2732 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_14__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
2733 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_16__int__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2734 #if PY_MAJOR_VERSION < 3
2735 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_18__long__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_20__float__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2738 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_22__complex__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self); /* proto */
2739 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement___str__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2740 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2741 static int __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2742 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 */
2743 static Py_hash_t __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2744 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self); /* proto */
2745 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement__init(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2746 static int __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2747 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 */
2748 static Py_hash_t __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2749 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_8__str__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2750 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2751 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self); /* proto */
2752 static PyObject *__pyx_pf_4lxml_9objectify_2__checkBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
2753 static PyObject *__pyx_pf_4lxml_9objectify_4__parseBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s); /* proto */
2754 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 */
2755 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_2__repr__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2756 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 */
2757 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2758 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2759 static int __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_types); /* proto */
2760 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4name___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2761 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2762 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self); /* proto */
2763 static PyObject *__pyx_pf_4lxml_9objectify_6__lower_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */
2764 static PyObject *__pyx_pf_4lxml_9objectify_8pytypename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
2765 static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
2766 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 */
2767 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 */
2768 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag); /* proto */
2769 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 */
2770 static PyObject *__pyx_pf_4lxml_9objectify_12enable_recursive_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on); /* proto */
2771 static PyObject *__pyx_pf_4lxml_9objectify_14dump(CYTHON_UNUSED PyObject *__pyx_self, struct LxmlElement *__pyx_v_element); /* proto */
2772 static PyObject *__pyx_pf_4lxml_9objectify_16__unpickleElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
2773 static PyObject *__pyx_pf_4lxml_9objectify_18pickleReduceElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
2774 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 */
2775 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 */
2776 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 */
2777 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 */
2778 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 */
2779 static PyObject *__pyx_pf_4lxml_9objectify_28set_default_parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_new_parser); /* proto */
2780 static PyObject *__pyx_pf_4lxml_9objectify_30makeparser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kw); /* proto */
2781 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 */
2782 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 */
2783 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 */
2784 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 */
2785 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 */
2786 static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
2787 static void __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2788 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2789 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 */
2790 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root); /* proto */
2791 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 */
2792 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 */
2793 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self); /* proto */
2794 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2795 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2796 static PyObject *__pyx_tp_new_4lxml_9objectify_NumberElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2797 static PyObject *__pyx_tp_new_4lxml_9objectify_IntElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2798 static PyObject *__pyx_tp_new_4lxml_9objectify_LongElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2799 static PyObject *__pyx_tp_new_4lxml_9objectify_FloatElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2800 static PyObject *__pyx_tp_new_4lxml_9objectify_StringElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2801 static PyObject *__pyx_tp_new_4lxml_9objectify_NoneElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2802 static PyObject *__pyx_tp_new_4lxml_9objectify_BoolElement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2803 static PyObject *__pyx_tp_new_4lxml_9objectify_PyType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2804 static PyObject *__pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2805 static PyObject *__pyx_tp_new_4lxml_9objectify_ElementMaker(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2806 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2807 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectPath(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2808 static __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type_split = {0, &__pyx_n_s_split, 0, 0, 0};
2809 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
2810 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
2811 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, &__pyx_n_s_values, 0, 0, 0};
2812 static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_remove = {0, &__pyx_n_s_remove, 0, 0, 0};
2813 static __Pyx_CachedCFunction __pyx_umethod_PyUnicode_Type_strip = {0, &__pyx_n_s_strip, 0, 0, 0};
2814 static PyObject *__pyx_int_0;
2815 static PyObject *__pyx_int_1;
2816 static PyObject *__pyx_int_neg_1;
2817 static PyObject *__pyx_slice__3;
2818 static PyObject *__pyx_tuple__5;
2819 static PyObject *__pyx_tuple__6;
2820 static PyObject *__pyx_tuple__7;
2821 static PyObject *__pyx_tuple__8;
2822 static PyObject *__pyx_slice__16;
2823 static PyObject *__pyx_tuple__18;
2824 static PyObject *__pyx_tuple__22;
2825 static PyObject *__pyx_tuple__24;
2826 static PyObject *__pyx_tuple__25;
2827 static PyObject *__pyx_tuple__27;
2828 static PyObject *__pyx_tuple__28;
2829 static PyObject *__pyx_tuple__30;
2830 static PyObject *__pyx_tuple__32;
2831 static PyObject *__pyx_tuple__34;
2832 static PyObject *__pyx_tuple__36;
2833 static PyObject *__pyx_tuple__38;
2834 static PyObject *__pyx_tuple__40;
2835 static PyObject *__pyx_tuple__42;
2836 static PyObject *__pyx_tuple__44;
2837 static PyObject *__pyx_tuple__46;
2838 static PyObject *__pyx_tuple__48;
2839 static PyObject *__pyx_tuple__50;
2840 static PyObject *__pyx_tuple__52;
2841 static PyObject *__pyx_tuple__54;
2842 static PyObject *__pyx_tuple__56;
2843 static PyObject *__pyx_tuple__58;
2844 static PyObject *__pyx_tuple__60;
2845 static PyObject *__pyx_tuple__62;
2846 static PyObject *__pyx_tuple__64;
2847 static PyObject *__pyx_tuple__66;
2848 static PyObject *__pyx_tuple__68;
2849 static PyObject *__pyx_tuple__70;
2850 static PyObject *__pyx_tuple__72;
2851 static PyObject *__pyx_tuple__73;
2852 static PyObject *__pyx_tuple__75;
2853 static PyObject *__pyx_tuple__77;
2854 static PyObject *__pyx_tuple__79;
2855 static PyObject *__pyx_tuple__81;
2856 static PyObject *__pyx_tuple__83;
2857 static PyObject *__pyx_tuple__85;
2858 static PyObject *__pyx_tuple__87;
2859 static PyObject *__pyx_tuple__89;
2860 static PyObject *__pyx_tuple__90;
2861 static PyObject *__pyx_tuple__92;
2862 static PyObject *__pyx_tuple__94;
2863 static PyObject *__pyx_tuple__95;
2864 static PyObject *__pyx_tuple__97;
2865 static PyObject *__pyx_tuple__98;
2866 static PyObject *__pyx_tuple__100;
2867 static PyObject *__pyx_tuple__101;
2868 static PyObject *__pyx_tuple__103;
2869 static PyObject *__pyx_tuple__104;
2870 static PyObject *__pyx_tuple__106;
2871 static PyObject *__pyx_tuple__107;
2872 static PyObject *__pyx_tuple__109;
2873 static PyObject *__pyx_tuple__111;
2874 static PyObject *__pyx_tuple__113;
2875 static PyObject *__pyx_codeobj__26;
2876 static PyObject *__pyx_codeobj__29;
2877 static PyObject *__pyx_codeobj__31;
2878 static PyObject *__pyx_codeobj__33;
2879 static PyObject *__pyx_codeobj__35;
2880 static PyObject *__pyx_codeobj__37;
2881 static PyObject *__pyx_codeobj__39;
2882 static PyObject *__pyx_codeobj__41;
2883 static PyObject *__pyx_codeobj__43;
2884 static PyObject *__pyx_codeobj__45;
2885 static PyObject *__pyx_codeobj__47;
2886 static PyObject *__pyx_codeobj__49;
2887 static PyObject *__pyx_codeobj__51;
2888 static PyObject *__pyx_codeobj__53;
2889 static PyObject *__pyx_codeobj__55;
2890 static PyObject *__pyx_codeobj__57;
2891 static PyObject *__pyx_codeobj__59;
2892 static PyObject *__pyx_codeobj__61;
2893 static PyObject *__pyx_codeobj__63;
2894 static PyObject *__pyx_codeobj__65;
2895 static PyObject *__pyx_codeobj__67;
2896 static PyObject *__pyx_codeobj__69;
2897 static PyObject *__pyx_codeobj__71;
2898 static PyObject *__pyx_codeobj__74;
2899 static PyObject *__pyx_codeobj__76;
2900 static PyObject *__pyx_codeobj__78;
2901 static PyObject *__pyx_codeobj__80;
2902 static PyObject *__pyx_codeobj__82;
2903 static PyObject *__pyx_codeobj__84;
2904 static PyObject *__pyx_codeobj__86;
2905 static PyObject *__pyx_codeobj__88;
2906 static PyObject *__pyx_codeobj__91;
2907 static PyObject *__pyx_codeobj__93;
2908 static PyObject *__pyx_codeobj__96;
2909 static PyObject *__pyx_codeobj__99;
2910 static PyObject *__pyx_codeobj__102;
2911 static PyObject *__pyx_codeobj__105;
2912 static PyObject *__pyx_codeobj__108;
2913 static PyObject *__pyx_codeobj__110;
2914 static PyObject *__pyx_codeobj__112;
2917 /* "lxml/objectify.pyx":50
2918 * # Duplicated from apihelpers.pxi, since dependencies obstruct
2919 * # including apihelpers.pxi.
2920 * cdef strrepr(s): # <<<<<<<<<<<<<<
2921 * """Build a representation of strings which we can use in __repr__
2922 * methods, e.g. _Element.__repr__().
2925 static PyObject *__pyx_f_4lxml_9objectify_strrepr(PyObject *__pyx_v_s) {
2926 PyObject *__pyx_r = NULL;
2927 __Pyx_RefNannyDeclarations
2928 PyObject *__pyx_t_1 = NULL;
2929 PyObject *__pyx_t_2 = NULL;
2930 PyObject *__pyx_t_3 = NULL;
2931 PyObject *__pyx_t_4 = NULL;
2932 int __pyx_lineno = 0;
2933 const char *__pyx_filename = NULL;
2934 int __pyx_clineno = 0;
2935 __Pyx_RefNannySetupContext("strrepr", 0);
2937 /* "lxml/objectify.pyx":54
2938 * methods, e.g. _Element.__repr__().
2940 * return s.encode('unicode-escape') if python.IS_PYTHON2 else s # <<<<<<<<<<<<<<
2944 __Pyx_XDECREF(__pyx_r);
2945 if ((IS_PYTHON2 != 0)) {
2946 __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)
2947 __Pyx_GOTREF(__pyx_t_3);
2949 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
2950 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2951 if (likely(__pyx_t_4)) {
2952 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2953 __Pyx_INCREF(__pyx_t_4);
2954 __Pyx_INCREF(function);
2955 __Pyx_DECREF_SET(__pyx_t_3, function);
2958 __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);
2959 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2960 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
2961 __Pyx_GOTREF(__pyx_t_2);
2962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2963 __pyx_t_1 = __pyx_t_2;
2966 __Pyx_INCREF(__pyx_v_s);
2967 __pyx_t_1 = __pyx_v_s;
2969 __pyx_r = __pyx_t_1;
2973 /* "lxml/objectify.pyx":50
2974 * # Duplicated from apihelpers.pxi, since dependencies obstruct
2975 * # including apihelpers.pxi.
2976 * cdef strrepr(s): # <<<<<<<<<<<<<<
2977 * """Build a representation of strings which we can use in __repr__
2978 * methods, e.g. _Element.__repr__().
2981 /* function exit code */
2983 __Pyx_XDECREF(__pyx_t_1);
2984 __Pyx_XDECREF(__pyx_t_2);
2985 __Pyx_XDECREF(__pyx_t_3);
2986 __Pyx_XDECREF(__pyx_t_4);
2987 __Pyx_AddTraceback("lxml.objectify.strrepr", __pyx_clineno, __pyx_lineno, __pyx_filename);
2990 __Pyx_XGIVEREF(__pyx_r);
2991 __Pyx_RefNannyFinishContext();
2995 /* "lxml/objectify.pyx":57
2998 * cdef object _typename(object t): # <<<<<<<<<<<<<<
2999 * cdef const_char* c_name
3000 * c_name = python._fqtypename(t)
3003 static PyObject *__pyx_f_4lxml_9objectify__typename(PyObject *__pyx_v_t) {
3004 const char *__pyx_v_c_name;
3006 PyObject *__pyx_r = NULL;
3007 __Pyx_RefNannyDeclarations
3009 PyObject *__pyx_t_2 = NULL;
3010 int __pyx_lineno = 0;
3011 const char *__pyx_filename = NULL;
3012 int __pyx_clineno = 0;
3013 __Pyx_RefNannySetupContext("_typename", 0);
3015 /* "lxml/objectify.pyx":59
3016 * cdef object _typename(object t):
3017 * cdef const_char* c_name
3018 * c_name = python._fqtypename(t) # <<<<<<<<<<<<<<
3019 * s = cstring_h.strrchr(c_name, c'.')
3022 __pyx_v_c_name = _fqtypename(__pyx_v_t);
3024 /* "lxml/objectify.pyx":60
3025 * cdef const_char* c_name
3026 * c_name = python._fqtypename(t)
3027 * s = cstring_h.strrchr(c_name, c'.') # <<<<<<<<<<<<<<
3031 __pyx_v_s = strrchr(__pyx_v_c_name, '.');
3033 /* "lxml/objectify.pyx":61
3034 * c_name = python._fqtypename(t)
3035 * s = cstring_h.strrchr(c_name, c'.')
3036 * if s is not NULL: # <<<<<<<<<<<<<<
3038 * return pyunicode(<const_xmlChar*>c_name)
3040 __pyx_t_1 = ((__pyx_v_s != NULL) != 0);
3043 /* "lxml/objectify.pyx":62
3044 * s = cstring_h.strrchr(c_name, c'.')
3046 * c_name = s + 1 # <<<<<<<<<<<<<<
3047 * return pyunicode(<const_xmlChar*>c_name)
3050 __pyx_v_c_name = (__pyx_v_s + 1);
3052 /* "lxml/objectify.pyx":61
3053 * c_name = python._fqtypename(t)
3054 * s = cstring_h.strrchr(c_name, c'.')
3055 * if s is not NULL: # <<<<<<<<<<<<<<
3057 * return pyunicode(<const_xmlChar*>c_name)
3061 /* "lxml/objectify.pyx":63
3064 * return pyunicode(<const_xmlChar*>c_name) # <<<<<<<<<<<<<<
3068 __Pyx_XDECREF(__pyx_r);
3069 __pyx_t_2 = pyunicode(((const xmlChar *)__pyx_v_c_name)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3070 __Pyx_GOTREF(__pyx_t_2);
3071 __pyx_r = __pyx_t_2;
3075 /* "lxml/objectify.pyx":57
3078 * cdef object _typename(object t): # <<<<<<<<<<<<<<
3079 * cdef const_char* c_name
3080 * c_name = python._fqtypename(t)
3083 /* function exit code */
3085 __Pyx_XDECREF(__pyx_t_2);
3086 __Pyx_AddTraceback("lxml.objectify._typename", __pyx_clineno, __pyx_lineno, __pyx_filename);
3089 __Pyx_XGIVEREF(__pyx_r);
3090 __Pyx_RefNannyFinishContext();
3094 /* "lxml/objectify.pyx":79
3095 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
3097 * cdef tuple _unicodeAndUtf8(s): # <<<<<<<<<<<<<<
3098 * return s, python.PyUnicode_AsUTF8String(s)
3102 static PyObject *__pyx_f_4lxml_9objectify__unicodeAndUtf8(PyObject *__pyx_v_s) {
3103 PyObject *__pyx_r = NULL;
3104 __Pyx_RefNannyDeclarations
3105 PyObject *__pyx_t_1 = NULL;
3106 PyObject *__pyx_t_2 = NULL;
3107 int __pyx_lineno = 0;
3108 const char *__pyx_filename = NULL;
3109 int __pyx_clineno = 0;
3110 __Pyx_RefNannySetupContext("_unicodeAndUtf8", 0);
3112 /* "lxml/objectify.pyx":80
3114 * cdef tuple _unicodeAndUtf8(s):
3115 * return s, python.PyUnicode_AsUTF8String(s) # <<<<<<<<<<<<<<
3117 * def set_pytype_attribute_tag(attribute_tag=None):
3119 __Pyx_XDECREF(__pyx_r);
3120 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
3121 __Pyx_GOTREF(__pyx_t_1);
3122 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
3123 __Pyx_GOTREF(__pyx_t_2);
3124 __Pyx_INCREF(__pyx_v_s);
3125 __Pyx_GIVEREF(__pyx_v_s);
3126 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
3127 __Pyx_GIVEREF(__pyx_t_1);
3128 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
3130 __pyx_r = ((PyObject*)__pyx_t_2);
3134 /* "lxml/objectify.pyx":79
3135 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
3137 * cdef tuple _unicodeAndUtf8(s): # <<<<<<<<<<<<<<
3138 * return s, python.PyUnicode_AsUTF8String(s)
3142 /* function exit code */
3144 __Pyx_XDECREF(__pyx_t_1);
3145 __Pyx_XDECREF(__pyx_t_2);
3146 __Pyx_AddTraceback("lxml.objectify._unicodeAndUtf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
3149 __Pyx_XGIVEREF(__pyx_r);
3150 __Pyx_RefNannyFinishContext();
3154 /* "lxml/objectify.pyx":82
3155 * return s, python.PyUnicode_AsUTF8String(s)
3157 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
3158 * u"""set_pytype_attribute_tag(attribute_tag=None)
3159 * Change name and namespace of the XML attribute that holds Python type
3162 /* Python wrapper */
3163 static PyObject *__pyx_pw_4lxml_9objectify_1set_pytype_attribute_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3164 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 ";
3165 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};
3166 static PyObject *__pyx_pw_4lxml_9objectify_1set_pytype_attribute_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3167 PyObject *__pyx_v_attribute_tag = 0;
3168 int __pyx_lineno = 0;
3169 const char *__pyx_filename = NULL;
3170 int __pyx_clineno = 0;
3171 PyObject *__pyx_r = 0;
3172 __Pyx_RefNannyDeclarations
3173 __Pyx_RefNannySetupContext("set_pytype_attribute_tag (wrapper)", 0);
3175 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_attribute_tag,0};
3176 PyObject* values[1] = {0};
3177 values[0] = ((PyObject *)((PyObject *)Py_None));
3178 if (unlikely(__pyx_kwds)) {
3180 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3182 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3185 default: goto __pyx_L5_argtuple_error;
3187 kw_args = PyDict_Size(__pyx_kwds);
3191 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attribute_tag);
3192 if (value) { values[0] = value; kw_args--; }
3195 if (unlikely(kw_args > 0)) {
3196 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_pytype_attribute_tag") < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
3199 switch (PyTuple_GET_SIZE(__pyx_args)) {
3200 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3203 default: goto __pyx_L5_argtuple_error;
3206 __pyx_v_attribute_tag = values[0];
3208 goto __pyx_L4_argument_unpacking_done;
3209 __pyx_L5_argtuple_error:;
3210 __Pyx_RaiseArgtupleInvalid("set_pytype_attribute_tag", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 82, __pyx_L3_error)
3212 __Pyx_AddTraceback("lxml.objectify.set_pytype_attribute_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
3213 __Pyx_RefNannyFinishContext();
3215 __pyx_L4_argument_unpacking_done:;
3216 __pyx_r = __pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(__pyx_self, __pyx_v_attribute_tag);
3218 /* function exit code */
3219 __Pyx_RefNannyFinishContext();
3223 static PyObject *__pyx_pf_4lxml_9objectify_set_pytype_attribute_tag(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_attribute_tag) {
3224 PyObject *__pyx_r = NULL;
3225 __Pyx_RefNannyDeclarations
3228 PyObject *__pyx_t_3 = NULL;
3229 PyObject *__pyx_t_4 = NULL;
3230 PyObject *__pyx_t_5 = NULL;
3231 const xmlChar *__pyx_t_6;
3232 int __pyx_lineno = 0;
3233 const char *__pyx_filename = NULL;
3234 int __pyx_clineno = 0;
3235 __Pyx_RefNannySetupContext("set_pytype_attribute_tag", 0);
3237 /* "lxml/objectify.pyx":96
3238 * global PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8
3239 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3240 * if attribute_tag is None: # <<<<<<<<<<<<<<
3241 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3242 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3244 __pyx_t_1 = (__pyx_v_attribute_tag == Py_None);
3245 __pyx_t_2 = (__pyx_t_1 != 0);
3248 /* "lxml/objectify.pyx":98
3249 * if attribute_tag is None:
3250 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3251 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype") # <<<<<<<<<<<<<<
3252 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3253 * _unicodeAndUtf8(u"pytype")
3255 __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)
3256 __Pyx_GOTREF(__pyx_t_3);
3257 if (likely(__pyx_t_3 != Py_None)) {
3258 PyObject* sequence = __pyx_t_3;
3259 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3260 if (unlikely(size != 2)) {
3261 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3262 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3263 __PYX_ERR(0, 97, __pyx_L1_error)
3265 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3266 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
3267 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3268 __Pyx_INCREF(__pyx_t_4);
3269 __Pyx_INCREF(__pyx_t_5);
3271 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
3272 __Pyx_GOTREF(__pyx_t_4);
3273 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
3274 __Pyx_GOTREF(__pyx_t_5);
3276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3278 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 97, __pyx_L1_error)
3281 /* "lxml/objectify.pyx":97
3282 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3283 * if attribute_tag is None:
3284 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \ # <<<<<<<<<<<<<<
3285 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3286 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3288 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)
3289 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
3290 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE, __pyx_t_4);
3291 __Pyx_GIVEREF(__pyx_t_4);
3293 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
3294 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, ((PyObject*)__pyx_t_5));
3295 __Pyx_GIVEREF(__pyx_t_5);
3298 /* "lxml/objectify.pyx":100
3299 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3300 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3301 * _unicodeAndUtf8(u"pytype") # <<<<<<<<<<<<<<
3303 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3305 __pyx_t_3 = __pyx_f_4lxml_9objectify__unicodeAndUtf8(__pyx_n_u_pytype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
3306 __Pyx_GOTREF(__pyx_t_3);
3307 if (likely(__pyx_t_3 != Py_None)) {
3308 PyObject* sequence = __pyx_t_3;
3309 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3310 if (unlikely(size != 2)) {
3311 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3312 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3313 __PYX_ERR(0, 99, __pyx_L1_error)
3315 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3316 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3317 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
3318 __Pyx_INCREF(__pyx_t_5);
3319 __Pyx_INCREF(__pyx_t_4);
3321 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error)
3322 __Pyx_GOTREF(__pyx_t_5);
3323 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
3324 __Pyx_GOTREF(__pyx_t_4);
3326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3328 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 99, __pyx_L1_error)
3331 /* "lxml/objectify.pyx":99
3332 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3333 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3334 * PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3335 * _unicodeAndUtf8(u"pytype")
3338 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)
3339 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
3340 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME, __pyx_t_5);
3341 __Pyx_GIVEREF(__pyx_t_5);
3343 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
3344 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, ((PyObject*)__pyx_t_4));
3345 __Pyx_GIVEREF(__pyx_t_4);
3348 /* "lxml/objectify.pyx":96
3349 * global PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8
3350 * global PYTYPE_ATTRIBUTE_NAME, PYTYPE_ATTRIBUTE_NAME_UTF8
3351 * if attribute_tag is None: # <<<<<<<<<<<<<<
3352 * PYTYPE_NAMESPACE, PYTYPE_NAMESPACE_UTF8 = \
3353 * _unicodeAndUtf8(u"http://codespeak.net/lxml/objectify/pytype")
3358 /* "lxml/objectify.pyx":102
3359 * _unicodeAndUtf8(u"pytype")
3361 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3362 * cetree.getNsTag(attribute_tag)
3363 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3367 /* "lxml/objectify.pyx":103
3369 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3370 * cetree.getNsTag(attribute_tag) # <<<<<<<<<<<<<<
3371 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3372 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3374 __pyx_t_3 = getNsTag(__pyx_v_attribute_tag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
3375 __Pyx_GOTREF(__pyx_t_3);
3376 if (likely(__pyx_t_3 != Py_None)) {
3377 PyObject* sequence = __pyx_t_3;
3378 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3379 if (unlikely(size != 2)) {
3380 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3381 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3382 __PYX_ERR(0, 102, __pyx_L1_error)
3384 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3385 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
3386 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3387 __Pyx_INCREF(__pyx_t_4);
3388 __Pyx_INCREF(__pyx_t_5);
3390 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
3391 __Pyx_GOTREF(__pyx_t_4);
3392 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error)
3393 __Pyx_GOTREF(__pyx_t_5);
3395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3397 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 102, __pyx_L1_error)
3400 /* "lxml/objectify.pyx":102
3401 * _unicodeAndUtf8(u"pytype")
3403 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \ # <<<<<<<<<<<<<<
3404 * cetree.getNsTag(attribute_tag)
3405 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3407 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)
3408 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)
3409 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
3410 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8, ((PyObject*)__pyx_t_4));
3411 __Pyx_GIVEREF(__pyx_t_4);
3413 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
3414 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8, ((PyObject*)__pyx_t_5));
3415 __Pyx_GIVEREF(__pyx_t_5);
3418 /* "lxml/objectify.pyx":104
3419 * PYTYPE_NAMESPACE_UTF8, PYTYPE_ATTRIBUTE_NAME_UTF8 = \
3420 * cetree.getNsTag(attribute_tag)
3421 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8') # <<<<<<<<<<<<<<
3422 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3425 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
3426 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
3427 __PYX_ERR(0, 104, __pyx_L1_error)
3429 __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)
3430 __Pyx_GOTREF(__pyx_t_3);
3431 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
3432 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE, __pyx_t_3);
3433 __Pyx_GIVEREF(__pyx_t_3);
3436 /* "lxml/objectify.pyx":105
3437 * cetree.getNsTag(attribute_tag)
3438 * PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8.decode('utf8')
3439 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8') # <<<<<<<<<<<<<<
3441 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3443 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
3444 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
3445 __PYX_ERR(0, 105, __pyx_L1_error)
3447 __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)
3448 __Pyx_GOTREF(__pyx_t_3);
3449 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
3450 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME, __pyx_t_3);
3451 __Pyx_GIVEREF(__pyx_t_3);
3456 /* "lxml/objectify.pyx":107
3457 * PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8.decode('utf8')
3459 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8 # <<<<<<<<<<<<<<
3460 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8
3461 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
3463 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 == Py_None)) {
3464 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
3465 __PYX_ERR(0, 107, __pyx_L1_error)
3467 __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)
3468 __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE = __pyx_t_6;
3470 /* "lxml/objectify.pyx":108
3472 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3473 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8 # <<<<<<<<<<<<<<
3474 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName(
3475 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
3477 if (unlikely(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 == Py_None)) {
3478 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
3479 __PYX_ERR(0, 108, __pyx_L1_error)
3481 __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)
3482 __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME = __pyx_t_6;
3484 /* "lxml/objectify.pyx":109
3485 * _PYTYPE_NAMESPACE = PYTYPE_NAMESPACE_UTF8
3486 * _PYTYPE_ATTRIBUTE_NAME = PYTYPE_ATTRIBUTE_NAME_UTF8
3487 * PYTYPE_ATTRIBUTE = cetree.namespacedNameFromNsName( # <<<<<<<<<<<<<<
3488 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
3491 __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)
3492 __Pyx_GOTREF(__pyx_t_3);
3493 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYTYPE_ATTRIBUTE, __pyx_t_3) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
3494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3496 /* "lxml/objectify.pyx":82
3497 * return s, python.PyUnicode_AsUTF8String(s)
3499 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
3500 * u"""set_pytype_attribute_tag(attribute_tag=None)
3501 * Change name and namespace of the XML attribute that holds Python type
3504 /* function exit code */
3505 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3508 __Pyx_XDECREF(__pyx_t_3);
3509 __Pyx_XDECREF(__pyx_t_4);
3510 __Pyx_XDECREF(__pyx_t_5);
3511 __Pyx_AddTraceback("lxml.objectify.set_pytype_attribute_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
3514 __Pyx_XGIVEREF(__pyx_r);
3515 __Pyx_RefNannyFinishContext();
3519 /* "lxml/objectify.pyx":147
3522 * def __iter__(self): # <<<<<<<<<<<<<<
3523 * u"""Iterate over self and all siblings with the same tag.
3527 /* Python wrapper */
3528 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__(PyObject *__pyx_v_self); /*proto*/
3529 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement___iter__[] = "Iterate over self and all siblings with the same tag.\n ";
3530 #if CYTHON_COMPILING_IN_CPYTHON
3531 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__;
3533 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__(PyObject *__pyx_v_self) {
3534 PyObject *__pyx_r = 0;
3535 __Pyx_RefNannyDeclarations
3536 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
3537 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3539 /* function exit code */
3540 __Pyx_RefNannyFinishContext();
3544 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement___iter__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3545 PyObject *__pyx_v_parent = NULL;
3546 PyObject *__pyx_r = NULL;
3547 __Pyx_RefNannyDeclarations
3548 PyObject *__pyx_t_1 = NULL;
3549 PyObject *__pyx_t_2 = NULL;
3550 PyObject *__pyx_t_3 = NULL;
3553 PyObject *__pyx_t_6 = NULL;
3554 int __pyx_lineno = 0;
3555 const char *__pyx_filename = NULL;
3556 int __pyx_clineno = 0;
3557 __Pyx_RefNannySetupContext("__iter__", 0);
3559 /* "lxml/objectify.pyx":150
3560 * u"""Iterate over self and all siblings with the same tag.
3562 * parent = self.getparent() # <<<<<<<<<<<<<<
3563 * if parent is None:
3564 * return iter([self])
3566 __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)
3567 __Pyx_GOTREF(__pyx_t_2);
3569 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3570 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3571 if (likely(__pyx_t_3)) {
3572 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3573 __Pyx_INCREF(__pyx_t_3);
3574 __Pyx_INCREF(function);
3575 __Pyx_DECREF_SET(__pyx_t_2, function);
3578 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
3579 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3580 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
3581 __Pyx_GOTREF(__pyx_t_1);
3582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3583 __pyx_v_parent = __pyx_t_1;
3586 /* "lxml/objectify.pyx":151
3588 * parent = self.getparent()
3589 * if parent is None: # <<<<<<<<<<<<<<
3590 * return iter([self])
3591 * return etree.ElementChildIterator(parent, tag=self.tag)
3593 __pyx_t_4 = (__pyx_v_parent == Py_None);
3594 __pyx_t_5 = (__pyx_t_4 != 0);
3597 /* "lxml/objectify.pyx":152
3598 * parent = self.getparent()
3599 * if parent is None:
3600 * return iter([self]) # <<<<<<<<<<<<<<
3601 * return etree.ElementChildIterator(parent, tag=self.tag)
3604 __Pyx_XDECREF(__pyx_r);
3605 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
3606 __Pyx_GOTREF(__pyx_t_1);
3607 __Pyx_INCREF(((PyObject *)__pyx_v_self));
3608 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
3609 PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
3610 __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
3611 __Pyx_GOTREF(__pyx_t_2);
3612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3613 __pyx_r = __pyx_t_2;
3617 /* "lxml/objectify.pyx":151
3619 * parent = self.getparent()
3620 * if parent is None: # <<<<<<<<<<<<<<
3621 * return iter([self])
3622 * return etree.ElementChildIterator(parent, tag=self.tag)
3626 /* "lxml/objectify.pyx":153
3627 * if parent is None:
3628 * return iter([self])
3629 * return etree.ElementChildIterator(parent, tag=self.tag) # <<<<<<<<<<<<<<
3631 * def __str__(self):
3633 __Pyx_XDECREF(__pyx_r);
3634 __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)
3635 __Pyx_GOTREF(__pyx_t_2);
3636 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
3637 __Pyx_GOTREF(__pyx_t_1);
3638 __Pyx_INCREF(__pyx_v_parent);
3639 __Pyx_GIVEREF(__pyx_v_parent);
3640 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_parent);
3641 __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3642 __Pyx_GOTREF(__pyx_t_3);
3643 __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)
3644 __Pyx_GOTREF(__pyx_t_6);
3645 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tag, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
3646 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3647 __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)
3648 __Pyx_GOTREF(__pyx_t_6);
3649 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3650 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3652 __pyx_r = __pyx_t_6;
3656 /* "lxml/objectify.pyx":147
3659 * def __iter__(self): # <<<<<<<<<<<<<<
3660 * u"""Iterate over self and all siblings with the same tag.
3664 /* function exit code */
3666 __Pyx_XDECREF(__pyx_t_1);
3667 __Pyx_XDECREF(__pyx_t_2);
3668 __Pyx_XDECREF(__pyx_t_3);
3669 __Pyx_XDECREF(__pyx_t_6);
3670 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3673 __Pyx_XDECREF(__pyx_v_parent);
3674 __Pyx_XGIVEREF(__pyx_r);
3675 __Pyx_RefNannyFinishContext();
3679 /* "lxml/objectify.pyx":155
3680 * return etree.ElementChildIterator(parent, tag=self.tag)
3682 * def __str__(self): # <<<<<<<<<<<<<<
3683 * if __RECURSIVE_STR:
3684 * return _dump(self, 0)
3687 /* Python wrapper */
3688 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__(PyObject *__pyx_v_self); /*proto*/
3689 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__(PyObject *__pyx_v_self) {
3690 PyObject *__pyx_r = 0;
3691 __Pyx_RefNannyDeclarations
3692 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
3693 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3695 /* function exit code */
3696 __Pyx_RefNannyFinishContext();
3700 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_2__str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3701 PyObject *__pyx_r = NULL;
3702 __Pyx_RefNannyDeclarations
3704 PyObject *__pyx_t_2 = NULL;
3705 PyObject *__pyx_t_3 = NULL;
3706 int __pyx_lineno = 0;
3707 const char *__pyx_filename = NULL;
3708 int __pyx_clineno = 0;
3709 __Pyx_RefNannySetupContext("__str__", 0);
3711 /* "lxml/objectify.pyx":156
3713 * def __str__(self):
3714 * if __RECURSIVE_STR: # <<<<<<<<<<<<<<
3715 * return _dump(self, 0)
3718 __pyx_t_1 = (__pyx_v_4lxml_9objectify___RECURSIVE_STR != 0);
3721 /* "lxml/objectify.pyx":157
3722 * def __str__(self):
3723 * if __RECURSIVE_STR:
3724 * return _dump(self, 0) # <<<<<<<<<<<<<<
3726 * return textOf(self._c_node) or u''
3728 __Pyx_XDECREF(__pyx_r);
3729 __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)
3730 __Pyx_GOTREF(__pyx_t_2);
3731 __pyx_r = __pyx_t_2;
3735 /* "lxml/objectify.pyx":156
3737 * def __str__(self):
3738 * if __RECURSIVE_STR: # <<<<<<<<<<<<<<
3739 * return _dump(self, 0)
3744 /* "lxml/objectify.pyx":159
3745 * return _dump(self, 0)
3747 * return textOf(self._c_node) or u'' # <<<<<<<<<<<<<<
3749 * # pickle support for objectified Element
3752 __Pyx_XDECREF(__pyx_r);
3753 __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)
3754 __Pyx_GOTREF(__pyx_t_3);
3755 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3759 __Pyx_INCREF(__pyx_t_3);
3760 __pyx_t_2 = __pyx_t_3;
3761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3762 goto __pyx_L4_bool_binop_done;
3764 __Pyx_INCREF(__pyx_kp_u_);
3765 __pyx_t_2 = __pyx_kp_u_;
3766 __pyx_L4_bool_binop_done:;
3767 __pyx_r = __pyx_t_2;
3772 /* "lxml/objectify.pyx":155
3773 * return etree.ElementChildIterator(parent, tag=self.tag)
3775 * def __str__(self): # <<<<<<<<<<<<<<
3776 * if __RECURSIVE_STR:
3777 * return _dump(self, 0)
3780 /* function exit code */
3782 __Pyx_XDECREF(__pyx_t_2);
3783 __Pyx_XDECREF(__pyx_t_3);
3784 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3787 __Pyx_XGIVEREF(__pyx_r);
3788 __Pyx_RefNannyFinishContext();
3792 /* "lxml/objectify.pyx":162
3794 * # pickle support for objectified Element
3795 * def __reduce__(self): # <<<<<<<<<<<<<<
3796 * return fromstring, (etree.tostring(self),)
3800 /* Python wrapper */
3801 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3802 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__, METH_NOARGS, 0};
3803 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3804 PyObject *__pyx_r = 0;
3805 __Pyx_RefNannyDeclarations
3806 __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
3807 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3809 /* function exit code */
3810 __Pyx_RefNannyFinishContext();
3814 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4__reduce__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3815 PyObject *__pyx_r = NULL;
3816 __Pyx_RefNannyDeclarations
3817 PyObject *__pyx_t_1 = NULL;
3818 PyObject *__pyx_t_2 = NULL;
3819 PyObject *__pyx_t_3 = NULL;
3820 PyObject *__pyx_t_4 = NULL;
3821 int __pyx_lineno = 0;
3822 const char *__pyx_filename = NULL;
3823 int __pyx_clineno = 0;
3824 __Pyx_RefNannySetupContext("__reduce__", 0);
3826 /* "lxml/objectify.pyx":163
3827 * # pickle support for objectified Element
3828 * def __reduce__(self):
3829 * return fromstring, (etree.tostring(self),) # <<<<<<<<<<<<<<
3833 __Pyx_XDECREF(__pyx_r);
3834 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
3835 __Pyx_GOTREF(__pyx_t_1);
3836 __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)
3837 __Pyx_GOTREF(__pyx_t_3);
3839 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3840 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3841 if (likely(__pyx_t_4)) {
3842 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3843 __Pyx_INCREF(__pyx_t_4);
3844 __Pyx_INCREF(function);
3845 __Pyx_DECREF_SET(__pyx_t_3, function);
3848 __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));
3849 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3850 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
3851 __Pyx_GOTREF(__pyx_t_2);
3852 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3853 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3854 __Pyx_GOTREF(__pyx_t_3);
3855 __Pyx_GIVEREF(__pyx_t_2);
3856 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3858 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
3859 __Pyx_GOTREF(__pyx_t_2);
3860 __Pyx_GIVEREF(__pyx_t_1);
3861 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3862 __Pyx_GIVEREF(__pyx_t_3);
3863 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3866 __pyx_r = __pyx_t_2;
3870 /* "lxml/objectify.pyx":162
3872 * # pickle support for objectified Element
3873 * def __reduce__(self): # <<<<<<<<<<<<<<
3874 * return fromstring, (etree.tostring(self),)
3878 /* function exit code */
3880 __Pyx_XDECREF(__pyx_t_1);
3881 __Pyx_XDECREF(__pyx_t_2);
3882 __Pyx_XDECREF(__pyx_t_3);
3883 __Pyx_XDECREF(__pyx_t_4);
3884 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3887 __Pyx_XGIVEREF(__pyx_r);
3888 __Pyx_RefNannyFinishContext();
3892 /* "lxml/objectify.pyx":166
3895 * def text(self): # <<<<<<<<<<<<<<
3896 * return textOf(self._c_node)
3900 /* Python wrapper */
3901 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(PyObject *__pyx_v_self); /*proto*/
3902 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(PyObject *__pyx_v_self) {
3903 PyObject *__pyx_r = 0;
3904 __Pyx_RefNannyDeclarations
3905 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3906 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3908 /* function exit code */
3909 __Pyx_RefNannyFinishContext();
3913 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_4text___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3914 PyObject *__pyx_r = NULL;
3915 __Pyx_RefNannyDeclarations
3916 PyObject *__pyx_t_1 = NULL;
3917 int __pyx_lineno = 0;
3918 const char *__pyx_filename = NULL;
3919 int __pyx_clineno = 0;
3920 __Pyx_RefNannySetupContext("__get__", 0);
3922 /* "lxml/objectify.pyx":167
3925 * return textOf(self._c_node) # <<<<<<<<<<<<<<
3929 __Pyx_XDECREF(__pyx_r);
3930 __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)
3931 __Pyx_GOTREF(__pyx_t_1);
3932 __pyx_r = __pyx_t_1;
3936 /* "lxml/objectify.pyx":166
3939 * def text(self): # <<<<<<<<<<<<<<
3940 * return textOf(self._c_node)
3944 /* function exit code */
3946 __Pyx_XDECREF(__pyx_t_1);
3947 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.text.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3950 __Pyx_XGIVEREF(__pyx_r);
3951 __Pyx_RefNannyFinishContext();
3955 /* "lxml/objectify.pyx":170
3958 * def __dict__(self): # <<<<<<<<<<<<<<
3959 * """A fake implementation for __dict__ to support dir() etc.
3963 /* Python wrapper */
3964 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(PyObject *__pyx_v_self); /*proto*/
3965 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(PyObject *__pyx_v_self) {
3966 PyObject *__pyx_r = 0;
3967 __Pyx_RefNannyDeclarations
3968 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3969 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
3971 /* function exit code */
3972 __Pyx_RefNannyFinishContext();
3976 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8__dict_____get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
3977 struct LxmlElement *__pyx_v_child = 0;
3978 PyObject *__pyx_v_children = 0;
3979 const xmlChar *__pyx_v_c_ns;
3980 PyObject *__pyx_v_tag = NULL;
3981 PyObject *__pyx_v_name = NULL;
3982 PyObject *__pyx_r = NULL;
3983 __Pyx_RefNannyDeclarations
3984 PyObject *__pyx_t_1 = NULL;
3985 PyObject *__pyx_t_2 = NULL;
3986 PyObject *__pyx_t_3 = NULL;
3987 PyObject *__pyx_t_4 = NULL;
3988 Py_ssize_t __pyx_t_5;
3989 PyObject *(*__pyx_t_6)(PyObject *);
3992 int __pyx_lineno = 0;
3993 const char *__pyx_filename = NULL;
3994 int __pyx_clineno = 0;
3995 __Pyx_RefNannySetupContext("__get__", 0);
3997 /* "lxml/objectify.pyx":177
3998 * cdef _Element child
3999 * cdef dict children
4000 * c_ns = tree._getNs(self._c_node) # <<<<<<<<<<<<<<
4001 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4004 __pyx_v_c_ns = _getNs(__pyx_v_self->__pyx_base.__pyx_base._c_node);
4006 /* "lxml/objectify.pyx":178
4007 * cdef dict children
4008 * c_ns = tree._getNs(self._c_node)
4009 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None # <<<<<<<<<<<<<<
4011 * for child in etree.ElementChildIterator(self, tag=tag):
4013 if (((__pyx_v_c_ns != NULL) != 0)) {
4014 __pyx_t_2 = pyunicode(__pyx_v_c_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
4015 __Pyx_GOTREF(__pyx_t_2);
4016 __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)
4017 __Pyx_GOTREF(__pyx_t_3);
4018 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4019 __pyx_t_1 = __pyx_t_3;
4022 __Pyx_INCREF(Py_None);
4023 __pyx_t_1 = Py_None;
4025 __pyx_v_tag = __pyx_t_1;
4028 /* "lxml/objectify.pyx":179
4029 * c_ns = tree._getNs(self._c_node)
4030 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4031 * children = {} # <<<<<<<<<<<<<<
4032 * for child in etree.ElementChildIterator(self, tag=tag):
4033 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4035 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
4036 __Pyx_GOTREF(__pyx_t_1);
4037 __pyx_v_children = ((PyObject*)__pyx_t_1);
4040 /* "lxml/objectify.pyx":180
4041 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4043 * for child in etree.ElementChildIterator(self, tag=tag): # <<<<<<<<<<<<<<
4044 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4047 __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)
4048 __Pyx_GOTREF(__pyx_t_1);
4049 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
4050 __Pyx_GOTREF(__pyx_t_3);
4051 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4052 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4053 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
4054 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
4055 __Pyx_GOTREF(__pyx_t_2);
4056 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
4057 __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)
4058 __Pyx_GOTREF(__pyx_t_4);
4059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4060 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4061 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4062 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
4063 __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
4066 __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
4067 __Pyx_GOTREF(__pyx_t_2);
4068 __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error)
4070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4072 if (likely(!__pyx_t_6)) {
4073 if (likely(PyList_CheckExact(__pyx_t_2))) {
4074 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
4075 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4076 __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)
4078 __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)
4079 __Pyx_GOTREF(__pyx_t_4);
4082 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
4083 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4084 __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)
4086 __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)
4087 __Pyx_GOTREF(__pyx_t_4);
4091 __pyx_t_4 = __pyx_t_6(__pyx_t_2);
4092 if (unlikely(!__pyx_t_4)) {
4093 PyObject* exc_type = PyErr_Occurred();
4095 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4096 else __PYX_ERR(0, 180, __pyx_L1_error)
4100 __Pyx_GOTREF(__pyx_t_4);
4102 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)
4103 __Pyx_XDECREF_SET(__pyx_v_child, ((struct LxmlElement *)__pyx_t_4));
4106 /* "lxml/objectify.pyx":181
4108 * for child in etree.ElementChildIterator(self, tag=tag):
4109 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL: # <<<<<<<<<<<<<<
4111 * name = pyunicode(child._c_node.name)
4113 __pyx_t_8 = ((__pyx_v_c_ns == NULL) != 0);
4116 __pyx_t_7 = __pyx_t_8;
4117 goto __pyx_L6_bool_binop_done;
4119 __pyx_t_8 = ((_getNs(__pyx_v_child->_c_node) != NULL) != 0);
4120 __pyx_t_7 = __pyx_t_8;
4121 __pyx_L6_bool_binop_done:;
4124 /* "lxml/objectify.pyx":182
4125 * for child in etree.ElementChildIterator(self, tag=tag):
4126 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4127 * continue # <<<<<<<<<<<<<<
4128 * name = pyunicode(child._c_node.name)
4129 * if name not in children:
4131 goto __pyx_L3_continue;
4133 /* "lxml/objectify.pyx":181
4135 * for child in etree.ElementChildIterator(self, tag=tag):
4136 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL: # <<<<<<<<<<<<<<
4138 * name = pyunicode(child._c_node.name)
4142 /* "lxml/objectify.pyx":183
4143 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4145 * name = pyunicode(child._c_node.name) # <<<<<<<<<<<<<<
4146 * if name not in children:
4147 * children[name] = child
4149 __pyx_t_4 = pyunicode(__pyx_v_child->_c_node->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
4150 __Pyx_GOTREF(__pyx_t_4);
4151 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
4154 /* "lxml/objectify.pyx":184
4156 * name = pyunicode(child._c_node.name)
4157 * if name not in children: # <<<<<<<<<<<<<<
4158 * children[name] = child
4161 __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)
4162 __pyx_t_8 = (__pyx_t_7 != 0);
4165 /* "lxml/objectify.pyx":185
4166 * name = pyunicode(child._c_node.name)
4167 * if name not in children:
4168 * children[name] = child # <<<<<<<<<<<<<<
4172 if (unlikely(PyDict_SetItem(__pyx_v_children, __pyx_v_name, ((PyObject *)__pyx_v_child)) < 0)) __PYX_ERR(0, 185, __pyx_L1_error)
4174 /* "lxml/objectify.pyx":184
4176 * name = pyunicode(child._c_node.name)
4177 * if name not in children: # <<<<<<<<<<<<<<
4178 * children[name] = child
4183 /* "lxml/objectify.pyx":180
4184 * tag = u"{%s}*" % pyunicode(c_ns) if c_ns is not NULL else None
4186 * for child in etree.ElementChildIterator(self, tag=tag): # <<<<<<<<<<<<<<
4187 * if c_ns is NULL and tree._getNs(child._c_node) is not NULL:
4192 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4194 /* "lxml/objectify.pyx":186
4195 * if name not in children:
4196 * children[name] = child
4197 * return children # <<<<<<<<<<<<<<
4199 * def __len__(self):
4201 __Pyx_XDECREF(__pyx_r);
4202 __Pyx_INCREF(__pyx_v_children);
4203 __pyx_r = __pyx_v_children;
4206 /* "lxml/objectify.pyx":170
4209 * def __dict__(self): # <<<<<<<<<<<<<<
4210 * """A fake implementation for __dict__ to support dir() etc.
4214 /* function exit code */
4216 __Pyx_XDECREF(__pyx_t_1);
4217 __Pyx_XDECREF(__pyx_t_2);
4218 __Pyx_XDECREF(__pyx_t_3);
4219 __Pyx_XDECREF(__pyx_t_4);
4220 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__dict__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4223 __Pyx_XDECREF((PyObject *)__pyx_v_child);
4224 __Pyx_XDECREF(__pyx_v_children);
4225 __Pyx_XDECREF(__pyx_v_tag);
4226 __Pyx_XDECREF(__pyx_v_name);
4227 __Pyx_XGIVEREF(__pyx_r);
4228 __Pyx_RefNannyFinishContext();
4232 /* "lxml/objectify.pyx":188
4235 * def __len__(self): # <<<<<<<<<<<<<<
4236 * u"""Count self and siblings with the same tag.
4240 /* Python wrapper */
4241 static Py_ssize_t __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__(PyObject *__pyx_v_self); /*proto*/
4242 static char __pyx_doc_4lxml_9objectify_18ObjectifiedElement_6__len__[] = "Count self and siblings with the same tag.\n ";
4243 #if CYTHON_COMPILING_IN_CPYTHON
4244 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__;
4246 static Py_ssize_t __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__(PyObject *__pyx_v_self) {
4248 __Pyx_RefNannyDeclarations
4249 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
4250 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4252 /* function exit code */
4253 __Pyx_RefNannyFinishContext();
4257 static Py_ssize_t __pyx_pf_4lxml_9objectify_18ObjectifiedElement_6__len__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4259 __Pyx_RefNannyDeclarations
4260 __Pyx_RefNannySetupContext("__len__", 0);
4262 /* "lxml/objectify.pyx":191
4263 * u"""Count self and siblings with the same tag.
4265 * return _countSiblings(self._c_node) # <<<<<<<<<<<<<<
4267 * def countchildren(self):
4269 __pyx_r = __pyx_f_4lxml_9objectify__countSiblings(__pyx_v_self->__pyx_base.__pyx_base._c_node);
4272 /* "lxml/objectify.pyx":188
4275 * def __len__(self): # <<<<<<<<<<<<<<
4276 * u"""Count self and siblings with the same tag.
4280 /* function exit code */
4282 __Pyx_RefNannyFinishContext();
4286 /* "lxml/objectify.pyx":193
4287 * return _countSiblings(self._c_node)
4289 * def countchildren(self): # <<<<<<<<<<<<<<
4290 * u"""countchildren(self)
4294 /* Python wrapper */
4295 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4296 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 ";
4297 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_9countchildren = {"countchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_8countchildren};
4298 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4299 PyObject *__pyx_r = 0;
4300 __Pyx_RefNannyDeclarations
4301 __Pyx_RefNannySetupContext("countchildren (wrapper)", 0);
4302 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4304 /* function exit code */
4305 __Pyx_RefNannyFinishContext();
4309 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_8countchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4310 Py_ssize_t __pyx_v_c;
4311 xmlNode *__pyx_v_c_node;
4312 PyObject *__pyx_r = NULL;
4313 __Pyx_RefNannyDeclarations
4316 PyObject *__pyx_t_3 = NULL;
4317 int __pyx_lineno = 0;
4318 const char *__pyx_filename = NULL;
4319 int __pyx_clineno = 0;
4320 __Pyx_RefNannySetupContext("countchildren", 0);
4322 /* "lxml/objectify.pyx":202
4324 * cdef tree.xmlNode* c_node
4325 * c = 0 # <<<<<<<<<<<<<<
4326 * c_node = self._c_node.children
4327 * while c_node is not NULL:
4331 /* "lxml/objectify.pyx":203
4332 * cdef tree.xmlNode* c_node
4334 * c_node = self._c_node.children # <<<<<<<<<<<<<<
4335 * while c_node is not NULL:
4336 * if tree._isElement(c_node):
4338 __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._c_node->children;
4339 __pyx_v_c_node = __pyx_t_1;
4341 /* "lxml/objectify.pyx":204
4343 * c_node = self._c_node.children
4344 * while c_node is not NULL: # <<<<<<<<<<<<<<
4345 * if tree._isElement(c_node):
4349 __pyx_t_2 = ((__pyx_v_c_node != NULL) != 0);
4350 if (!__pyx_t_2) break;
4352 /* "lxml/objectify.pyx":205
4353 * c_node = self._c_node.children
4354 * while c_node is not NULL:
4355 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4357 * c_node = c_node.next
4359 __pyx_t_2 = (_isElement(__pyx_v_c_node) != 0);
4362 /* "lxml/objectify.pyx":206
4363 * while c_node is not NULL:
4364 * if tree._isElement(c_node):
4365 * c += 1 # <<<<<<<<<<<<<<
4366 * c_node = c_node.next
4369 __pyx_v_c = (__pyx_v_c + 1);
4371 /* "lxml/objectify.pyx":205
4372 * c_node = self._c_node.children
4373 * while c_node is not NULL:
4374 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4376 * c_node = c_node.next
4380 /* "lxml/objectify.pyx":207
4381 * if tree._isElement(c_node):
4383 * c_node = c_node.next # <<<<<<<<<<<<<<
4387 __pyx_t_1 = __pyx_v_c_node->next;
4388 __pyx_v_c_node = __pyx_t_1;
4391 /* "lxml/objectify.pyx":208
4393 * c_node = c_node.next
4394 * return c # <<<<<<<<<<<<<<
4396 * def getchildren(self):
4398 __Pyx_XDECREF(__pyx_r);
4399 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
4400 __Pyx_GOTREF(__pyx_t_3);
4401 __pyx_r = __pyx_t_3;
4405 /* "lxml/objectify.pyx":193
4406 * return _countSiblings(self._c_node)
4408 * def countchildren(self): # <<<<<<<<<<<<<<
4409 * u"""countchildren(self)
4413 /* function exit code */
4415 __Pyx_XDECREF(__pyx_t_3);
4416 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.countchildren", __pyx_clineno, __pyx_lineno, __pyx_filename);
4419 __Pyx_XGIVEREF(__pyx_r);
4420 __Pyx_RefNannyFinishContext();
4424 /* "lxml/objectify.pyx":210
4427 * def getchildren(self): # <<<<<<<<<<<<<<
4428 * u"""getchildren(self)
4432 /* Python wrapper */
4433 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4434 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 ";
4435 static PyMethodDef __pyx_mdef_4lxml_9objectify_18ObjectifiedElement_11getchildren = {"getchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_10getchildren};
4436 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4437 PyObject *__pyx_r = 0;
4438 __Pyx_RefNannyDeclarations
4439 __Pyx_RefNannySetupContext("getchildren (wrapper)", 0);
4440 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self));
4442 /* function exit code */
4443 __Pyx_RefNannyFinishContext();
4447 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_10getchildren(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self) {
4448 xmlNode *__pyx_v_c_node;
4449 PyObject *__pyx_v_result = NULL;
4450 PyObject *__pyx_r = NULL;
4451 __Pyx_RefNannyDeclarations
4452 PyObject *__pyx_t_1 = NULL;
4455 PyObject *__pyx_t_4 = NULL;
4457 int __pyx_lineno = 0;
4458 const char *__pyx_filename = NULL;
4459 int __pyx_clineno = 0;
4460 __Pyx_RefNannySetupContext("getchildren", 0);
4462 /* "lxml/objectify.pyx":217
4464 * cdef tree.xmlNode* c_node
4465 * result = [] # <<<<<<<<<<<<<<
4466 * c_node = self._c_node.children
4467 * while c_node is not NULL:
4469 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
4470 __Pyx_GOTREF(__pyx_t_1);
4471 __pyx_v_result = ((PyObject*)__pyx_t_1);
4474 /* "lxml/objectify.pyx":218
4475 * cdef tree.xmlNode* c_node
4477 * c_node = self._c_node.children # <<<<<<<<<<<<<<
4478 * while c_node is not NULL:
4479 * if tree._isElement(c_node):
4481 __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._c_node->children;
4482 __pyx_v_c_node = __pyx_t_2;
4484 /* "lxml/objectify.pyx":219
4486 * c_node = self._c_node.children
4487 * while c_node is not NULL: # <<<<<<<<<<<<<<
4488 * if tree._isElement(c_node):
4489 * result.append(cetree.elementFactory(self._doc, c_node))
4492 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
4493 if (!__pyx_t_3) break;
4495 /* "lxml/objectify.pyx":220
4496 * c_node = self._c_node.children
4497 * while c_node is not NULL:
4498 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4499 * result.append(cetree.elementFactory(self._doc, c_node))
4500 * c_node = c_node.next
4502 __pyx_t_3 = (_isElement(__pyx_v_c_node) != 0);
4505 /* "lxml/objectify.pyx":221
4506 * while c_node is not NULL:
4507 * if tree._isElement(c_node):
4508 * result.append(cetree.elementFactory(self._doc, c_node)) # <<<<<<<<<<<<<<
4509 * c_node = c_node.next
4512 __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
4513 __Pyx_INCREF(__pyx_t_1);
4514 __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)
4515 __Pyx_GOTREF(__pyx_t_4);
4516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4517 __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)
4518 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4520 /* "lxml/objectify.pyx":220
4521 * c_node = self._c_node.children
4522 * while c_node is not NULL:
4523 * if tree._isElement(c_node): # <<<<<<<<<<<<<<
4524 * result.append(cetree.elementFactory(self._doc, c_node))
4525 * c_node = c_node.next
4529 /* "lxml/objectify.pyx":222
4530 * if tree._isElement(c_node):
4531 * result.append(cetree.elementFactory(self._doc, c_node))
4532 * c_node = c_node.next # <<<<<<<<<<<<<<
4536 __pyx_t_2 = __pyx_v_c_node->next;
4537 __pyx_v_c_node = __pyx_t_2;
4540 /* "lxml/objectify.pyx":223
4541 * result.append(cetree.elementFactory(self._doc, c_node))
4542 * c_node = c_node.next
4543 * return result # <<<<<<<<<<<<<<
4545 * def __getattr__(self, tag):
4547 __Pyx_XDECREF(__pyx_r);
4548 __Pyx_INCREF(__pyx_v_result);
4549 __pyx_r = __pyx_v_result;
4552 /* "lxml/objectify.pyx":210
4555 * def getchildren(self): # <<<<<<<<<<<<<<
4556 * u"""getchildren(self)
4560 /* function exit code */
4562 __Pyx_XDECREF(__pyx_t_1);
4563 __Pyx_XDECREF(__pyx_t_4);
4564 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.getchildren", __pyx_clineno, __pyx_lineno, __pyx_filename);
4567 __Pyx_XDECREF(__pyx_v_result);
4568 __Pyx_XGIVEREF(__pyx_r);
4569 __Pyx_RefNannyFinishContext();
4573 /* "lxml/objectify.pyx":225
4576 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
4577 * u"""Return the (first) child with the given tag name. If no namespace
4578 * is provided, the child will be looked up in the same one as self.
4581 /* Python wrapper */
4582 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
4583 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 ";
4584 #if CYTHON_COMPILING_IN_CPYTHON
4585 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
4587 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
4588 PyObject *__pyx_r = 0;
4589 __Pyx_RefNannyDeclarations
4590 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
4591 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
4593 /* function exit code */
4594 __Pyx_RefNannyFinishContext();
4598 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_12__getattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag) {
4599 PyObject *__pyx_r = NULL;
4600 __Pyx_RefNannyDeclarations
4601 PyObject *__pyx_t_1 = NULL;
4602 PyObject *__pyx_t_2 = NULL;
4603 PyObject *__pyx_t_3 = NULL;
4606 PyObject *__pyx_t_6 = NULL;
4607 int __pyx_lineno = 0;
4608 const char *__pyx_filename = NULL;
4609 int __pyx_clineno = 0;
4610 __Pyx_RefNannySetupContext("__getattr__", 0);
4612 /* "lxml/objectify.pyx":229
4613 * is provided, the child will be looked up in the same one as self.
4615 * if is_special_method(tag): # <<<<<<<<<<<<<<
4616 * return object.__getattr__(self, tag)
4617 * return _lookupChildOrRaise(self, tag)
4619 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
4620 __pyx_t_2 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_3 = NULL;
4621 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4622 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4623 if (likely(__pyx_t_3)) {
4624 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4625 __Pyx_INCREF(__pyx_t_3);
4626 __Pyx_INCREF(function);
4627 __Pyx_DECREF_SET(__pyx_t_2, function);
4630 __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);
4631 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4632 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
4633 __Pyx_GOTREF(__pyx_t_1);
4634 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4635 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
4636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4639 /* "lxml/objectify.pyx":230
4641 * if is_special_method(tag):
4642 * return object.__getattr__(self, tag) # <<<<<<<<<<<<<<
4643 * return _lookupChildOrRaise(self, tag)
4646 __Pyx_XDECREF(__pyx_r);
4647 __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)
4648 __Pyx_GOTREF(__pyx_t_2);
4651 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4652 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4653 if (likely(__pyx_t_3)) {
4654 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4655 __Pyx_INCREF(__pyx_t_3);
4656 __Pyx_INCREF(function);
4657 __Pyx_DECREF_SET(__pyx_t_2, function);
4661 #if CYTHON_FAST_PYCALL
4662 if (PyFunction_Check(__pyx_t_2)) {
4663 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_tag};
4664 __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)
4665 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4666 __Pyx_GOTREF(__pyx_t_1);
4669 #if CYTHON_FAST_PYCCALL
4670 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4671 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_tag};
4672 __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)
4673 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4674 __Pyx_GOTREF(__pyx_t_1);
4678 __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
4679 __Pyx_GOTREF(__pyx_t_6);
4681 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
4683 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4684 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4685 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
4686 __Pyx_INCREF(__pyx_v_tag);
4687 __Pyx_GIVEREF(__pyx_v_tag);
4688 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_tag);
4689 __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)
4690 __Pyx_GOTREF(__pyx_t_1);
4691 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4694 __pyx_r = __pyx_t_1;
4698 /* "lxml/objectify.pyx":229
4699 * is provided, the child will be looked up in the same one as self.
4701 * if is_special_method(tag): # <<<<<<<<<<<<<<
4702 * return object.__getattr__(self, tag)
4703 * return _lookupChildOrRaise(self, tag)
4707 /* "lxml/objectify.pyx":231
4708 * if is_special_method(tag):
4709 * return object.__getattr__(self, tag)
4710 * return _lookupChildOrRaise(self, tag) # <<<<<<<<<<<<<<
4712 * def __setattr__(self, tag, value):
4714 __Pyx_XDECREF(__pyx_r);
4715 __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)
4716 __Pyx_GOTREF(__pyx_t_1);
4717 __pyx_r = __pyx_t_1;
4721 /* "lxml/objectify.pyx":225
4724 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
4725 * u"""Return the (first) child with the given tag name. If no namespace
4726 * is provided, the child will be looked up in the same one as self.
4729 /* function exit code */
4731 __Pyx_XDECREF(__pyx_t_1);
4732 __Pyx_XDECREF(__pyx_t_2);
4733 __Pyx_XDECREF(__pyx_t_3);
4734 __Pyx_XDECREF(__pyx_t_6);
4735 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4738 __Pyx_XGIVEREF(__pyx_r);
4739 __Pyx_RefNannyFinishContext();
4743 /* "lxml/objectify.pyx":233
4744 * return _lookupChildOrRaise(self, tag)
4746 * def __setattr__(self, tag, value): # <<<<<<<<<<<<<<
4747 * u"""Set the value of the (first) child with the given tag name. If no
4748 * namespace is provided, the child will be looked up in the same one as
4751 /* Python wrapper */
4752 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value); /*proto*/
4753 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 ";
4754 #if CYTHON_COMPILING_IN_CPYTHON
4755 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
4757 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
4759 __Pyx_RefNannyDeclarations
4760 __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
4761 __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));
4763 /* function exit code */
4764 __Pyx_RefNannyFinishContext();
4768 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) {
4769 struct LxmlElement *__pyx_v_element = 0;
4771 __Pyx_RefNannyDeclarations
4774 PyObject *__pyx_t_3 = NULL;
4775 Py_ssize_t __pyx_t_4;
4777 PyObject *__pyx_t_6 = NULL;
4778 PyObject *__pyx_t_7 = NULL;
4780 PyObject *__pyx_t_9 = NULL;
4781 int __pyx_lineno = 0;
4782 const char *__pyx_filename = NULL;
4783 int __pyx_clineno = 0;
4784 __Pyx_RefNannySetupContext("__setattr__", 0);
4785 __Pyx_INCREF(__pyx_v_tag);
4787 /* "lxml/objectify.pyx":240
4788 * cdef _Element element
4789 * # properties are looked up /after/ __setattr__, so we must emulate them
4790 * if tag == u'text' or tag == u'pyval': # <<<<<<<<<<<<<<
4792 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4794 __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)
4797 __pyx_t_1 = __pyx_t_2;
4798 goto __pyx_L4_bool_binop_done;
4800 __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)
4801 __pyx_t_1 = __pyx_t_2;
4802 __pyx_L4_bool_binop_done:;
4803 if (unlikely(__pyx_t_1)) {
4805 /* "lxml/objectify.pyx":242
4806 * if tag == u'text' or tag == u'pyval':
4808 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable" # <<<<<<<<<<<<<<
4809 * elif tag == u'tail':
4810 * cetree.setTailText(self._c_node, value)
4812 __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
4813 __Pyx_GOTREF(__pyx_t_3);
4816 __Pyx_INCREF(__pyx_kp_u_attribute);
4818 __Pyx_GIVEREF(__pyx_kp_u_attribute);
4819 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_attribute);
4820 __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
4821 __Pyx_GOTREF(__pyx_t_6);
4822 __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;
4823 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
4824 __Pyx_GIVEREF(__pyx_t_6);
4825 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
4827 __Pyx_INCREF(__pyx_kp_u_of);
4829 __Pyx_GIVEREF(__pyx_kp_u_of);
4830 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_of);
4831 __pyx_t_6 = __pyx_f_4lxml_9objectify__typename(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
4832 __Pyx_GOTREF(__pyx_t_6);
4833 __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
4834 __Pyx_GOTREF(__pyx_t_7);
4835 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4836 __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;
4837 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
4838 __Pyx_GIVEREF(__pyx_t_7);
4839 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_7);
4841 __Pyx_INCREF(__pyx_kp_u_objects_is_not_writable);
4843 __Pyx_GIVEREF(__pyx_kp_u_objects_is_not_writable);
4844 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_kp_u_objects_is_not_writable);
4845 __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)
4846 __Pyx_GOTREF(__pyx_t_7);
4847 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4848 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
4849 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4850 __PYX_ERR(0, 242, __pyx_L1_error)
4852 /* "lxml/objectify.pyx":240
4853 * cdef _Element element
4854 * # properties are looked up /after/ __setattr__, so we must emulate them
4855 * if tag == u'text' or tag == u'pyval': # <<<<<<<<<<<<<<
4857 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4861 /* "lxml/objectify.pyx":243
4863 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4864 * elif tag == u'tail': # <<<<<<<<<<<<<<
4865 * cetree.setTailText(self._c_node, value)
4868 __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)
4871 /* "lxml/objectify.pyx":244
4872 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4873 * elif tag == u'tail':
4874 * cetree.setTailText(self._c_node, value) # <<<<<<<<<<<<<<
4876 * elif tag == u'tag':
4878 __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)
4880 /* "lxml/objectify.pyx":245
4881 * elif tag == u'tail':
4882 * cetree.setTailText(self._c_node, value)
4883 * return # <<<<<<<<<<<<<<
4884 * elif tag == u'tag':
4885 * ElementBase.tag.__set__(self, value)
4890 /* "lxml/objectify.pyx":243
4892 * raise TypeError, f"attribute '{tag}' of '{_typename(self)}' objects is not writable"
4893 * elif tag == u'tail': # <<<<<<<<<<<<<<
4894 * cetree.setTailText(self._c_node, value)
4899 /* "lxml/objectify.pyx":246
4900 * cetree.setTailText(self._c_node, value)
4902 * elif tag == u'tag': # <<<<<<<<<<<<<<
4903 * ElementBase.tag.__set__(self, value)
4906 __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)
4909 /* "lxml/objectify.pyx":247
4911 * elif tag == u'tag':
4912 * ElementBase.tag.__set__(self, value) # <<<<<<<<<<<<<<
4914 * elif tag == u'base':
4916 __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)
4917 __Pyx_GOTREF(__pyx_t_3);
4918 __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)
4919 __Pyx_GOTREF(__pyx_t_6);
4920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4923 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4924 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
4925 if (likely(__pyx_t_3)) {
4926 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4927 __Pyx_INCREF(__pyx_t_3);
4928 __Pyx_INCREF(function);
4929 __Pyx_DECREF_SET(__pyx_t_6, function);
4933 #if CYTHON_FAST_PYCALL
4934 if (PyFunction_Check(__pyx_t_6)) {
4935 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_value};
4936 __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)
4937 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4938 __Pyx_GOTREF(__pyx_t_7);
4941 #if CYTHON_FAST_PYCCALL
4942 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4943 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_value};
4944 __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)
4945 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4946 __Pyx_GOTREF(__pyx_t_7);
4950 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error)
4951 __Pyx_GOTREF(__pyx_t_9);
4953 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
4955 __Pyx_INCREF(((PyObject *)__pyx_v_self));
4956 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4957 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
4958 __Pyx_INCREF(__pyx_v_value);
4959 __Pyx_GIVEREF(__pyx_v_value);
4960 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_value);
4961 __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)
4962 __Pyx_GOTREF(__pyx_t_7);
4963 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4965 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4966 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4968 /* "lxml/objectify.pyx":248
4969 * elif tag == u'tag':
4970 * ElementBase.tag.__set__(self, value)
4971 * return # <<<<<<<<<<<<<<
4972 * elif tag == u'base':
4973 * ElementBase.base.__set__(self, value)
4978 /* "lxml/objectify.pyx":246
4979 * cetree.setTailText(self._c_node, value)
4981 * elif tag == u'tag': # <<<<<<<<<<<<<<
4982 * ElementBase.tag.__set__(self, value)
4987 /* "lxml/objectify.pyx":249
4988 * ElementBase.tag.__set__(self, value)
4990 * elif tag == u'base': # <<<<<<<<<<<<<<
4991 * ElementBase.base.__set__(self, value)
4994 __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)
4997 /* "lxml/objectify.pyx":250
4999 * elif tag == u'base':
5000 * ElementBase.base.__set__(self, value) # <<<<<<<<<<<<<<
5002 * tag = _buildChildTag(self, tag)
5004 __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)
5005 __Pyx_GOTREF(__pyx_t_6);
5006 __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)
5007 __Pyx_GOTREF(__pyx_t_9);
5008 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5011 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5012 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
5013 if (likely(__pyx_t_6)) {
5014 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
5015 __Pyx_INCREF(__pyx_t_6);
5016 __Pyx_INCREF(function);
5017 __Pyx_DECREF_SET(__pyx_t_9, function);
5021 #if CYTHON_FAST_PYCALL
5022 if (PyFunction_Check(__pyx_t_9)) {
5023 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_value};
5024 __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)
5025 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5026 __Pyx_GOTREF(__pyx_t_7);
5029 #if CYTHON_FAST_PYCCALL
5030 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5031 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_v_value};
5032 __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)
5033 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5034 __Pyx_GOTREF(__pyx_t_7);
5038 __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
5039 __Pyx_GOTREF(__pyx_t_3);
5041 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
5043 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5044 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5045 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, ((PyObject *)__pyx_v_self));
5046 __Pyx_INCREF(__pyx_v_value);
5047 __Pyx_GIVEREF(__pyx_v_value);
5048 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_value);
5049 __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)
5050 __Pyx_GOTREF(__pyx_t_7);
5051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5053 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5054 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5056 /* "lxml/objectify.pyx":251
5057 * elif tag == u'base':
5058 * ElementBase.base.__set__(self, value)
5059 * return # <<<<<<<<<<<<<<
5060 * tag = _buildChildTag(self, tag)
5061 * element = _lookupChild(self, tag)
5066 /* "lxml/objectify.pyx":249
5067 * ElementBase.tag.__set__(self, value)
5069 * elif tag == u'base': # <<<<<<<<<<<<<<
5070 * ElementBase.base.__set__(self, value)
5075 /* "lxml/objectify.pyx":252
5076 * ElementBase.base.__set__(self, value)
5078 * tag = _buildChildTag(self, tag) # <<<<<<<<<<<<<<
5079 * element = _lookupChild(self, tag)
5080 * if element is None:
5082 __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)
5083 __Pyx_GOTREF(__pyx_t_7);
5084 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_7);
5087 /* "lxml/objectify.pyx":253
5089 * tag = _buildChildTag(self, tag)
5090 * element = _lookupChild(self, tag) # <<<<<<<<<<<<<<
5091 * if element is None:
5092 * _appendValue(self, tag, value)
5094 __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)
5095 __Pyx_GOTREF(__pyx_t_7);
5096 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)
5097 __pyx_v_element = ((struct LxmlElement *)__pyx_t_7);
5100 /* "lxml/objectify.pyx":254
5101 * tag = _buildChildTag(self, tag)
5102 * element = _lookupChild(self, tag)
5103 * if element is None: # <<<<<<<<<<<<<<
5104 * _appendValue(self, tag, value)
5107 __pyx_t_1 = (((PyObject *)__pyx_v_element) == Py_None);
5108 __pyx_t_2 = (__pyx_t_1 != 0);
5111 /* "lxml/objectify.pyx":255
5112 * element = _lookupChild(self, tag)
5113 * if element is None:
5114 * _appendValue(self, tag, value) # <<<<<<<<<<<<<<
5116 * _replaceElement(element, value)
5118 __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)
5119 __Pyx_GOTREF(__pyx_t_7);
5120 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5122 /* "lxml/objectify.pyx":254
5123 * tag = _buildChildTag(self, tag)
5124 * element = _lookupChild(self, tag)
5125 * if element is None: # <<<<<<<<<<<<<<
5126 * _appendValue(self, tag, value)
5132 /* "lxml/objectify.pyx":257
5133 * _appendValue(self, tag, value)
5135 * _replaceElement(element, value) # <<<<<<<<<<<<<<
5137 * def __delattr__(self, tag):
5140 __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)
5141 __Pyx_GOTREF(__pyx_t_7);
5142 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5146 /* "lxml/objectify.pyx":233
5147 * return _lookupChildOrRaise(self, tag)
5149 * def __setattr__(self, tag, value): # <<<<<<<<<<<<<<
5150 * u"""Set the value of the (first) child with the given tag name. If no
5151 * namespace is provided, the child will be looked up in the same one as
5154 /* function exit code */
5158 __Pyx_XDECREF(__pyx_t_3);
5159 __Pyx_XDECREF(__pyx_t_6);
5160 __Pyx_XDECREF(__pyx_t_7);
5161 __Pyx_XDECREF(__pyx_t_9);
5162 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5165 __Pyx_XDECREF((PyObject *)__pyx_v_element);
5166 __Pyx_XDECREF(__pyx_v_tag);
5167 __Pyx_RefNannyFinishContext();
5171 /* "lxml/objectify.pyx":259
5172 * _replaceElement(element, value)
5174 * def __delattr__(self, tag): # <<<<<<<<<<<<<<
5175 * child = _lookupChildOrRaise(self, tag)
5176 * self.remove(child)
5179 /* Python wrapper */
5180 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
5181 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
5183 __Pyx_RefNannyDeclarations
5184 __Pyx_RefNannySetupContext("__delattr__ (wrapper)", 0);
5185 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
5187 /* function exit code */
5188 __Pyx_RefNannyFinishContext();
5192 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_16__delattr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_tag) {
5193 PyObject *__pyx_v_child = NULL;
5195 __Pyx_RefNannyDeclarations
5196 PyObject *__pyx_t_1 = NULL;
5197 PyObject *__pyx_t_2 = NULL;
5198 PyObject *__pyx_t_3 = NULL;
5199 int __pyx_lineno = 0;
5200 const char *__pyx_filename = NULL;
5201 int __pyx_clineno = 0;
5202 __Pyx_RefNannySetupContext("__delattr__", 0);
5204 /* "lxml/objectify.pyx":260
5206 * def __delattr__(self, tag):
5207 * child = _lookupChildOrRaise(self, tag) # <<<<<<<<<<<<<<
5208 * self.remove(child)
5211 __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)
5212 __Pyx_GOTREF(__pyx_t_1);
5213 __pyx_v_child = __pyx_t_1;
5216 /* "lxml/objectify.pyx":261
5217 * def __delattr__(self, tag):
5218 * child = _lookupChildOrRaise(self, tag)
5219 * self.remove(child) # <<<<<<<<<<<<<<
5221 * def addattr(self, tag, value):
5223 __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)
5224 __Pyx_GOTREF(__pyx_t_2);
5226 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5227 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5228 if (likely(__pyx_t_3)) {
5229 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5230 __Pyx_INCREF(__pyx_t_3);
5231 __Pyx_INCREF(function);
5232 __Pyx_DECREF_SET(__pyx_t_2, function);
5235 __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);
5236 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5237 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
5238 __Pyx_GOTREF(__pyx_t_1);
5239 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5240 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5242 /* "lxml/objectify.pyx":259
5243 * _replaceElement(element, value)
5245 * def __delattr__(self, tag): # <<<<<<<<<<<<<<
5246 * child = _lookupChildOrRaise(self, tag)
5247 * self.remove(child)
5250 /* function exit code */
5254 __Pyx_XDECREF(__pyx_t_1);
5255 __Pyx_XDECREF(__pyx_t_2);
5256 __Pyx_XDECREF(__pyx_t_3);
5257 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__delattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5260 __Pyx_XDECREF(__pyx_v_child);
5261 __Pyx_RefNannyFinishContext();
5265 /* "lxml/objectify.pyx":263
5266 * self.remove(child)
5268 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
5269 * u"""addattr(self, tag, value)
5273 /* Python wrapper */
5274 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5275 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 ";
5276 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};
5277 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5278 PyObject *__pyx_v_tag = 0;
5279 PyObject *__pyx_v_value = 0;
5280 int __pyx_lineno = 0;
5281 const char *__pyx_filename = NULL;
5282 int __pyx_clineno = 0;
5283 PyObject *__pyx_r = 0;
5284 __Pyx_RefNannyDeclarations
5285 __Pyx_RefNannySetupContext("addattr (wrapper)", 0);
5287 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag,&__pyx_n_s_value,0};
5288 PyObject* values[2] = {0,0};
5289 if (unlikely(__pyx_kwds)) {
5291 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5293 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5295 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5298 default: goto __pyx_L5_argtuple_error;
5300 kw_args = PyDict_Size(__pyx_kwds);
5303 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
5304 else goto __pyx_L5_argtuple_error;
5307 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5309 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, 1); __PYX_ERR(0, 263, __pyx_L3_error)
5312 if (unlikely(kw_args > 0)) {
5313 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addattr") < 0)) __PYX_ERR(0, 263, __pyx_L3_error)
5315 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5316 goto __pyx_L5_argtuple_error;
5318 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5319 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5321 __pyx_v_tag = values[0];
5322 __pyx_v_value = values[1];
5324 goto __pyx_L4_argument_unpacking_done;
5325 __pyx_L5_argtuple_error:;
5326 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 263, __pyx_L3_error)
5328 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5329 __Pyx_RefNannyFinishContext();
5331 __pyx_L4_argument_unpacking_done:;
5332 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_18addattr(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), __pyx_v_tag, __pyx_v_value);
5334 /* function exit code */
5335 __Pyx_RefNannyFinishContext();
5339 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) {
5340 PyObject *__pyx_r = NULL;
5341 __Pyx_RefNannyDeclarations
5342 PyObject *__pyx_t_1 = NULL;
5343 PyObject *__pyx_t_2 = NULL;
5344 int __pyx_lineno = 0;
5345 const char *__pyx_filename = NULL;
5346 int __pyx_clineno = 0;
5347 __Pyx_RefNannySetupContext("addattr", 0);
5349 /* "lxml/objectify.pyx":270
5350 * As opposed to append(), it sets a data value, not an element.
5352 * _appendValue(self, _buildChildTag(self, tag), value) # <<<<<<<<<<<<<<
5354 * def __getitem__(self, key):
5356 __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)
5357 __Pyx_GOTREF(__pyx_t_1);
5358 __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)
5359 __Pyx_GOTREF(__pyx_t_2);
5360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5363 /* "lxml/objectify.pyx":263
5364 * self.remove(child)
5366 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
5367 * u"""addattr(self, tag, value)
5371 /* function exit code */
5372 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5375 __Pyx_XDECREF(__pyx_t_1);
5376 __Pyx_XDECREF(__pyx_t_2);
5377 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
5380 __Pyx_XGIVEREF(__pyx_r);
5381 __Pyx_RefNannyFinishContext();
5385 /* "lxml/objectify.pyx":272
5386 * _appendValue(self, _buildChildTag(self, tag), value)
5388 * def __getitem__(self, key): # <<<<<<<<<<<<<<
5389 * u"""Return a sibling, counting from the first child of the parent. The
5390 * method behaves like both a dict and a sequence.
5393 /* Python wrapper */
5394 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
5395 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 ";
5396 #if CYTHON_COMPILING_IN_CPYTHON
5397 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
5399 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
5400 PyObject *__pyx_r = 0;
5401 __Pyx_RefNannyDeclarations
5402 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
5403 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_key));
5405 /* function exit code */
5406 __Pyx_RefNannyFinishContext();
5410 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_20__getitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key) {
5411 xmlNode *__pyx_v_c_self_node;
5412 xmlNode *__pyx_v_c_parent;
5413 xmlNode *__pyx_v_c_node;
5414 Py_ssize_t __pyx_v_c_index;
5415 PyObject *__pyx_r = NULL;
5416 __Pyx_RefNannyDeclarations
5418 PyObject *__pyx_t_2 = NULL;
5420 PyObject *__pyx_t_4 = NULL;
5421 Py_ssize_t __pyx_t_5;
5423 int __pyx_lineno = 0;
5424 const char *__pyx_filename = NULL;
5425 int __pyx_clineno = 0;
5426 __Pyx_RefNannySetupContext("__getitem__", 0);
5428 /* "lxml/objectify.pyx":288
5429 * cdef tree.xmlNode* c_node
5430 * cdef Py_ssize_t c_index
5431 * if python._isString(key): # <<<<<<<<<<<<<<
5432 * return _lookupChildOrRaise(self, key)
5433 * elif isinstance(key, slice):
5435 __pyx_t_1 = (_isString(__pyx_v_key) != 0);
5438 /* "lxml/objectify.pyx":289
5439 * cdef Py_ssize_t c_index
5440 * if python._isString(key):
5441 * return _lookupChildOrRaise(self, key) # <<<<<<<<<<<<<<
5442 * elif isinstance(key, slice):
5443 * return list(self)[key]
5445 __Pyx_XDECREF(__pyx_r);
5446 __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)
5447 __Pyx_GOTREF(__pyx_t_2);
5448 __pyx_r = __pyx_t_2;
5452 /* "lxml/objectify.pyx":288
5453 * cdef tree.xmlNode* c_node
5454 * cdef Py_ssize_t c_index
5455 * if python._isString(key): # <<<<<<<<<<<<<<
5456 * return _lookupChildOrRaise(self, key)
5457 * elif isinstance(key, slice):
5461 /* "lxml/objectify.pyx":290
5462 * if python._isString(key):
5463 * return _lookupChildOrRaise(self, key)
5464 * elif isinstance(key, slice): # <<<<<<<<<<<<<<
5465 * return list(self)[key]
5466 * # normal item access
5468 __pyx_t_1 = PySlice_Check(__pyx_v_key);
5469 __pyx_t_3 = (__pyx_t_1 != 0);
5472 /* "lxml/objectify.pyx":291
5473 * return _lookupChildOrRaise(self, key)
5474 * elif isinstance(key, slice):
5475 * return list(self)[key] # <<<<<<<<<<<<<<
5476 * # normal item access
5477 * c_index = key # raises TypeError if necessary
5479 __Pyx_XDECREF(__pyx_r);
5480 __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
5481 __Pyx_GOTREF(__pyx_t_2);
5482 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
5483 __Pyx_GOTREF(__pyx_t_4);
5484 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5485 __pyx_r = __pyx_t_4;
5489 /* "lxml/objectify.pyx":290
5490 * if python._isString(key):
5491 * return _lookupChildOrRaise(self, key)
5492 * elif isinstance(key, slice): # <<<<<<<<<<<<<<
5493 * return list(self)[key]
5494 * # normal item access
5498 /* "lxml/objectify.pyx":293
5499 * return list(self)[key]
5500 * # normal item access
5501 * c_index = key # raises TypeError if necessary # <<<<<<<<<<<<<<
5502 * c_self_node = self._c_node
5503 * c_parent = c_self_node.parent
5505 __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)
5506 __pyx_v_c_index = __pyx_t_5;
5508 /* "lxml/objectify.pyx":294
5509 * # normal item access
5510 * c_index = key # raises TypeError if necessary
5511 * c_self_node = self._c_node # <<<<<<<<<<<<<<
5512 * c_parent = c_self_node.parent
5513 * if c_parent is NULL:
5515 __pyx_t_6 = __pyx_v_self->__pyx_base.__pyx_base._c_node;
5516 __pyx_v_c_self_node = __pyx_t_6;
5518 /* "lxml/objectify.pyx":295
5519 * c_index = key # raises TypeError if necessary
5520 * c_self_node = self._c_node
5521 * c_parent = c_self_node.parent # <<<<<<<<<<<<<<
5522 * if c_parent is NULL:
5523 * if c_index == 0 or c_index == -1:
5525 __pyx_t_6 = __pyx_v_c_self_node->parent;
5526 __pyx_v_c_parent = __pyx_t_6;
5528 /* "lxml/objectify.pyx":296
5529 * c_self_node = self._c_node
5530 * c_parent = c_self_node.parent
5531 * if c_parent is NULL: # <<<<<<<<<<<<<<
5532 * if c_index == 0 or c_index == -1:
5535 __pyx_t_3 = ((__pyx_v_c_parent == NULL) != 0);
5538 /* "lxml/objectify.pyx":297
5539 * c_parent = c_self_node.parent
5540 * if c_parent is NULL:
5541 * if c_index == 0 or c_index == -1: # <<<<<<<<<<<<<<
5543 * raise IndexError, unicode(key)
5545 switch (__pyx_v_c_index) {
5549 /* "lxml/objectify.pyx":298
5550 * if c_parent is NULL:
5551 * if c_index == 0 or c_index == -1:
5552 * return self # <<<<<<<<<<<<<<
5553 * raise IndexError, unicode(key)
5556 __Pyx_XDECREF(__pyx_r);
5557 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5558 __pyx_r = ((PyObject *)__pyx_v_self);
5561 /* "lxml/objectify.pyx":297
5562 * c_parent = c_self_node.parent
5563 * if c_parent is NULL:
5564 * if c_index == 0 or c_index == -1: # <<<<<<<<<<<<<<
5566 * raise IndexError, unicode(key)
5572 /* "lxml/objectify.pyx":299
5573 * if c_index == 0 or c_index == -1:
5575 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5577 * c_node = c_parent.last
5579 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
5580 __Pyx_GOTREF(__pyx_t_4);
5581 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0, 0);
5582 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5583 __PYX_ERR(0, 299, __pyx_L1_error)
5585 /* "lxml/objectify.pyx":296
5586 * c_self_node = self._c_node
5587 * c_parent = c_self_node.parent
5588 * if c_parent is NULL: # <<<<<<<<<<<<<<
5589 * if c_index == 0 or c_index == -1:
5594 /* "lxml/objectify.pyx":300
5596 * raise IndexError, unicode(key)
5597 * if c_index < 0: # <<<<<<<<<<<<<<
5598 * c_node = c_parent.last
5601 __pyx_t_3 = ((__pyx_v_c_index < 0) != 0);
5604 /* "lxml/objectify.pyx":301
5605 * raise IndexError, unicode(key)
5607 * c_node = c_parent.last # <<<<<<<<<<<<<<
5609 * c_node = c_parent.children
5611 __pyx_t_6 = __pyx_v_c_parent->last;
5612 __pyx_v_c_node = __pyx_t_6;
5614 /* "lxml/objectify.pyx":300
5616 * raise IndexError, unicode(key)
5617 * if c_index < 0: # <<<<<<<<<<<<<<
5618 * c_node = c_parent.last
5624 /* "lxml/objectify.pyx":303
5625 * c_node = c_parent.last
5627 * c_node = c_parent.children # <<<<<<<<<<<<<<
5628 * c_node = _findFollowingSibling(
5629 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5632 __pyx_t_6 = __pyx_v_c_parent->children;
5633 __pyx_v_c_node = __pyx_t_6;
5637 /* "lxml/objectify.pyx":304
5639 * c_node = c_parent.children
5640 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
5641 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5642 * if c_node is NULL:
5644 __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);
5646 /* "lxml/objectify.pyx":306
5647 * c_node = _findFollowingSibling(
5648 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5649 * if c_node is NULL: # <<<<<<<<<<<<<<
5650 * raise IndexError, unicode(key)
5651 * return elementFactory(self._doc, c_node)
5653 __pyx_t_3 = ((__pyx_v_c_node == NULL) != 0);
5654 if (unlikely(__pyx_t_3)) {
5656 /* "lxml/objectify.pyx":307
5657 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5658 * if c_node is NULL:
5659 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5660 * return elementFactory(self._doc, c_node)
5663 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
5664 __Pyx_GOTREF(__pyx_t_4);
5665 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0, 0);
5666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5667 __PYX_ERR(0, 307, __pyx_L1_error)
5669 /* "lxml/objectify.pyx":306
5670 * c_node = _findFollowingSibling(
5671 * c_node, tree._getNs(c_self_node), c_self_node.name, c_index)
5672 * if c_node is NULL: # <<<<<<<<<<<<<<
5673 * raise IndexError, unicode(key)
5674 * return elementFactory(self._doc, c_node)
5678 /* "lxml/objectify.pyx":308
5679 * if c_node is NULL:
5680 * raise IndexError, unicode(key)
5681 * return elementFactory(self._doc, c_node) # <<<<<<<<<<<<<<
5683 * def __setitem__(self, key, value):
5685 __Pyx_XDECREF(__pyx_r);
5686 __pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
5687 __Pyx_INCREF(__pyx_t_4);
5688 __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)
5689 __Pyx_GOTREF(__pyx_t_2);
5690 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5691 __pyx_r = __pyx_t_2;
5695 /* "lxml/objectify.pyx":272
5696 * _appendValue(self, _buildChildTag(self, tag), value)
5698 * def __getitem__(self, key): # <<<<<<<<<<<<<<
5699 * u"""Return a sibling, counting from the first child of the parent. The
5700 * method behaves like both a dict and a sequence.
5703 /* function exit code */
5705 __Pyx_XDECREF(__pyx_t_2);
5706 __Pyx_XDECREF(__pyx_t_4);
5707 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5710 __Pyx_XGIVEREF(__pyx_r);
5711 __Pyx_RefNannyFinishContext();
5715 /* "lxml/objectify.pyx":310
5716 * return elementFactory(self._doc, c_node)
5718 * def __setitem__(self, key, value): # <<<<<<<<<<<<<<
5719 * u"""Set the value of a sibling, counting from the first child of the
5720 * parent. Implements key assignment, item assignment and slice
5723 /* Python wrapper */
5724 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
5725 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 ";
5726 #if CYTHON_COMPILING_IN_CPYTHON
5727 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
5729 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
5731 __Pyx_RefNannyDeclarations
5732 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
5733 __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));
5735 /* function exit code */
5736 __Pyx_RefNannyFinishContext();
5740 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) {
5741 struct LxmlElement *__pyx_v_element = 0;
5742 xmlNode *__pyx_v_c_node;
5744 __Pyx_RefNannyDeclarations
5746 PyObject *__pyx_t_2 = NULL;
5749 Py_ssize_t __pyx_t_5;
5750 PyObject *__pyx_t_6 = NULL;
5751 int __pyx_lineno = 0;
5752 const char *__pyx_filename = NULL;
5753 int __pyx_clineno = 0;
5754 __Pyx_RefNannySetupContext("__setitem__", 0);
5755 __Pyx_INCREF(__pyx_v_key);
5757 /* "lxml/objectify.pyx":325
5758 * cdef _Element element
5759 * cdef tree.xmlNode* c_node
5760 * if python._isString(key): # <<<<<<<<<<<<<<
5761 * key = _buildChildTag(self, key)
5762 * element = _lookupChild(self, key)
5764 __pyx_t_1 = (_isString(__pyx_v_key) != 0);
5767 /* "lxml/objectify.pyx":326
5768 * cdef tree.xmlNode* c_node
5769 * if python._isString(key):
5770 * key = _buildChildTag(self, key) # <<<<<<<<<<<<<<
5771 * element = _lookupChild(self, key)
5772 * if element is None:
5774 __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)
5775 __Pyx_GOTREF(__pyx_t_2);
5776 __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_2);
5779 /* "lxml/objectify.pyx":327
5780 * if python._isString(key):
5781 * key = _buildChildTag(self, key)
5782 * element = _lookupChild(self, key) # <<<<<<<<<<<<<<
5783 * if element is None:
5784 * _appendValue(self, key, value)
5786 __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)
5787 __Pyx_GOTREF(__pyx_t_2);
5788 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)
5789 __pyx_v_element = ((struct LxmlElement *)__pyx_t_2);
5792 /* "lxml/objectify.pyx":328
5793 * key = _buildChildTag(self, key)
5794 * element = _lookupChild(self, key)
5795 * if element is None: # <<<<<<<<<<<<<<
5796 * _appendValue(self, key, value)
5799 __pyx_t_1 = (((PyObject *)__pyx_v_element) == Py_None);
5800 __pyx_t_3 = (__pyx_t_1 != 0);
5803 /* "lxml/objectify.pyx":329
5804 * element = _lookupChild(self, key)
5805 * if element is None:
5806 * _appendValue(self, key, value) # <<<<<<<<<<<<<<
5808 * _replaceElement(element, value)
5810 __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)
5811 __Pyx_GOTREF(__pyx_t_2);
5812 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5814 /* "lxml/objectify.pyx":328
5815 * key = _buildChildTag(self, key)
5816 * element = _lookupChild(self, key)
5817 * if element is None: # <<<<<<<<<<<<<<
5818 * _appendValue(self, key, value)
5824 /* "lxml/objectify.pyx":331
5825 * _appendValue(self, key, value)
5827 * _replaceElement(element, value) # <<<<<<<<<<<<<<
5832 __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)
5833 __Pyx_GOTREF(__pyx_t_2);
5834 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5838 /* "lxml/objectify.pyx":332
5840 * _replaceElement(element, value)
5841 * return # <<<<<<<<<<<<<<
5843 * if self._c_node.parent is NULL:
5848 /* "lxml/objectify.pyx":325
5849 * cdef _Element element
5850 * cdef tree.xmlNode* c_node
5851 * if python._isString(key): # <<<<<<<<<<<<<<
5852 * key = _buildChildTag(self, key)
5853 * element = _lookupChild(self, key)
5857 /* "lxml/objectify.pyx":334
5860 * if self._c_node.parent is NULL: # <<<<<<<<<<<<<<
5861 * # the 'root[i] = ...' case
5862 * raise TypeError, u"assignment to root element is invalid"
5864 __pyx_t_3 = ((__pyx_v_self->__pyx_base.__pyx_base._c_node->parent == NULL) != 0);
5865 if (unlikely(__pyx_t_3)) {
5867 /* "lxml/objectify.pyx":336
5868 * if self._c_node.parent is NULL:
5869 * # the 'root[i] = ...' case
5870 * raise TypeError, u"assignment to root element is invalid" # <<<<<<<<<<<<<<
5872 * if isinstance(key, slice):
5874 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_assignment_to_root_element_is_in, 0, 0);
5875 __PYX_ERR(0, 336, __pyx_L1_error)
5877 /* "lxml/objectify.pyx":334
5880 * if self._c_node.parent is NULL: # <<<<<<<<<<<<<<
5881 * # the 'root[i] = ...' case
5882 * raise TypeError, u"assignment to root element is invalid"
5886 /* "lxml/objectify.pyx":338
5887 * raise TypeError, u"assignment to root element is invalid"
5889 * if isinstance(key, slice): # <<<<<<<<<<<<<<
5890 * # slice assignment
5891 * _setSlice(key, self, value)
5893 __pyx_t_3 = PySlice_Check(__pyx_v_key);
5894 __pyx_t_1 = (__pyx_t_3 != 0);
5897 /* "lxml/objectify.pyx":340
5898 * if isinstance(key, slice):
5899 * # slice assignment
5900 * _setSlice(key, self, value) # <<<<<<<<<<<<<<
5902 * # normal index assignment
5904 __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)
5905 __Pyx_GOTREF(__pyx_t_2);
5906 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5908 /* "lxml/objectify.pyx":338
5909 * raise TypeError, u"assignment to root element is invalid"
5911 * if isinstance(key, slice): # <<<<<<<<<<<<<<
5912 * # slice assignment
5913 * _setSlice(key, self, value)
5918 /* "lxml/objectify.pyx":343
5920 * # normal index assignment
5921 * if key < 0: # <<<<<<<<<<<<<<
5922 * c_node = self._c_node.parent.last
5926 __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)
5927 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
5928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5931 /* "lxml/objectify.pyx":344
5932 * # normal index assignment
5934 * c_node = self._c_node.parent.last # <<<<<<<<<<<<<<
5936 * c_node = self._c_node.parent.children
5938 __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base._c_node->parent->last;
5939 __pyx_v_c_node = __pyx_t_4;
5941 /* "lxml/objectify.pyx":343
5943 * # normal index assignment
5944 * if key < 0: # <<<<<<<<<<<<<<
5945 * c_node = self._c_node.parent.last
5951 /* "lxml/objectify.pyx":346
5952 * c_node = self._c_node.parent.last
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)
5959 __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx_base._c_node->parent->children;
5960 __pyx_v_c_node = __pyx_t_4;
5964 /* "lxml/objectify.pyx":348
5965 * c_node = self._c_node.parent.children
5966 * c_node = _findFollowingSibling(
5967 * c_node, tree._getNs(self._c_node), self._c_node.name, key) # <<<<<<<<<<<<<<
5968 * if c_node is NULL:
5969 * raise IndexError, unicode(key)
5971 __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)
5973 /* "lxml/objectify.pyx":347
5975 * c_node = self._c_node.parent.children
5976 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
5977 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5978 * if c_node is NULL:
5980 __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);
5982 /* "lxml/objectify.pyx":349
5983 * c_node = _findFollowingSibling(
5984 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5985 * if c_node is NULL: # <<<<<<<<<<<<<<
5986 * raise IndexError, unicode(key)
5987 * element = elementFactory(self._doc, c_node)
5989 __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
5990 if (unlikely(__pyx_t_1)) {
5992 /* "lxml/objectify.pyx":350
5993 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
5994 * if c_node is NULL:
5995 * raise IndexError, unicode(key) # <<<<<<<<<<<<<<
5996 * element = elementFactory(self._doc, c_node)
5997 * _replaceElement(element, value)
5999 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
6000 __Pyx_GOTREF(__pyx_t_2);
6001 __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_2, 0, 0);
6002 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6003 __PYX_ERR(0, 350, __pyx_L1_error)
6005 /* "lxml/objectify.pyx":349
6006 * c_node = _findFollowingSibling(
6007 * c_node, tree._getNs(self._c_node), self._c_node.name, key)
6008 * if c_node is NULL: # <<<<<<<<<<<<<<
6009 * raise IndexError, unicode(key)
6010 * element = elementFactory(self._doc, c_node)
6014 /* "lxml/objectify.pyx":351
6015 * if c_node is NULL:
6016 * raise IndexError, unicode(key)
6017 * element = elementFactory(self._doc, c_node) # <<<<<<<<<<<<<<
6018 * _replaceElement(element, value)
6021 __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._doc);
6022 __Pyx_INCREF(__pyx_t_2);
6023 __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)
6024 __Pyx_GOTREF(__pyx_t_6);
6025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6026 __pyx_v_element = ((struct LxmlElement *)__pyx_t_6);
6029 /* "lxml/objectify.pyx":352
6030 * raise IndexError, unicode(key)
6031 * element = elementFactory(self._doc, c_node)
6032 * _replaceElement(element, value) # <<<<<<<<<<<<<<
6034 * def __delitem__(self, key):
6036 __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)
6037 __Pyx_GOTREF(__pyx_t_6);
6038 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6042 /* "lxml/objectify.pyx":310
6043 * return elementFactory(self._doc, c_node)
6045 * def __setitem__(self, key, value): # <<<<<<<<<<<<<<
6046 * u"""Set the value of a sibling, counting from the first child of the
6047 * parent. Implements key assignment, item assignment and slice
6050 /* function exit code */
6054 __Pyx_XDECREF(__pyx_t_2);
6055 __Pyx_XDECREF(__pyx_t_6);
6056 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6059 __Pyx_XDECREF((PyObject *)__pyx_v_element);
6060 __Pyx_XDECREF(__pyx_v_key);
6061 __Pyx_RefNannyFinishContext();
6065 /* "lxml/objectify.pyx":354
6066 * _replaceElement(element, value)
6068 * def __delitem__(self, key): # <<<<<<<<<<<<<<
6069 * parent = self.getparent()
6070 * if parent is None:
6073 /* Python wrapper */
6074 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
6075 static int __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
6077 __Pyx_RefNannyDeclarations
6078 __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0);
6079 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), ((PyObject *)__pyx_v_key));
6081 /* function exit code */
6082 __Pyx_RefNannyFinishContext();
6086 static int __pyx_pf_4lxml_9objectify_18ObjectifiedElement_24__delitem__(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_key) {
6087 PyObject *__pyx_v_parent = NULL;
6088 PyObject *__pyx_v_del_items = NULL;
6089 PyObject *__pyx_v_remove = NULL;
6090 PyObject *__pyx_v_el = NULL;
6091 PyObject *__pyx_v_sibling = NULL;
6093 __Pyx_RefNannyDeclarations
6094 PyObject *__pyx_t_1 = NULL;
6095 PyObject *__pyx_t_2 = NULL;
6096 PyObject *__pyx_t_3 = NULL;
6099 Py_ssize_t __pyx_t_6;
6100 PyObject *(*__pyx_t_7)(PyObject *);
6101 PyObject *__pyx_t_8 = NULL;
6102 int __pyx_lineno = 0;
6103 const char *__pyx_filename = NULL;
6104 int __pyx_clineno = 0;
6105 __Pyx_RefNannySetupContext("__delitem__", 0);
6107 /* "lxml/objectify.pyx":355
6109 * def __delitem__(self, key):
6110 * parent = self.getparent() # <<<<<<<<<<<<<<
6111 * if parent is None:
6112 * raise TypeError, u"deleting items not supported by root element"
6114 __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)
6115 __Pyx_GOTREF(__pyx_t_2);
6117 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6118 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6119 if (likely(__pyx_t_3)) {
6120 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6121 __Pyx_INCREF(__pyx_t_3);
6122 __Pyx_INCREF(function);
6123 __Pyx_DECREF_SET(__pyx_t_2, function);
6126 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6127 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6128 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
6129 __Pyx_GOTREF(__pyx_t_1);
6130 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6131 __pyx_v_parent = __pyx_t_1;
6134 /* "lxml/objectify.pyx":356
6135 * def __delitem__(self, key):
6136 * parent = self.getparent()
6137 * if parent is None: # <<<<<<<<<<<<<<
6138 * raise TypeError, u"deleting items not supported by root element"
6139 * if isinstance(key, slice):
6141 __pyx_t_4 = (__pyx_v_parent == Py_None);
6142 __pyx_t_5 = (__pyx_t_4 != 0);
6143 if (unlikely(__pyx_t_5)) {
6145 /* "lxml/objectify.pyx":357
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):
6152 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_deleting_items_not_supported_by, 0, 0);
6153 __PYX_ERR(0, 357, __pyx_L1_error)
6155 /* "lxml/objectify.pyx":356
6156 * def __delitem__(self, key):
6157 * parent = self.getparent()
6158 * if parent is None: # <<<<<<<<<<<<<<
6159 * raise TypeError, u"deleting items not supported by root element"
6160 * if isinstance(key, slice):
6164 /* "lxml/objectify.pyx":358
6165 * if parent is None:
6166 * raise TypeError, u"deleting items not supported by root element"
6167 * if isinstance(key, slice): # <<<<<<<<<<<<<<
6169 * del_items = list(self)[key]
6171 __pyx_t_5 = PySlice_Check(__pyx_v_key);
6172 __pyx_t_4 = (__pyx_t_5 != 0);
6175 /* "lxml/objectify.pyx":360
6176 * if isinstance(key, slice):
6178 * del_items = list(self)[key] # <<<<<<<<<<<<<<
6179 * remove = parent.remove
6180 * for el in del_items:
6182 __pyx_t_1 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
6183 __Pyx_GOTREF(__pyx_t_1);
6184 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
6185 __Pyx_GOTREF(__pyx_t_2);
6186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6187 __pyx_v_del_items = __pyx_t_2;
6190 /* "lxml/objectify.pyx":361
6192 * del_items = list(self)[key]
6193 * remove = parent.remove # <<<<<<<<<<<<<<
6194 * for el in del_items:
6197 __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)
6198 __Pyx_GOTREF(__pyx_t_2);
6199 __pyx_v_remove = __pyx_t_2;
6202 /* "lxml/objectify.pyx":362
6203 * del_items = list(self)[key]
6204 * remove = parent.remove
6205 * for el in del_items: # <<<<<<<<<<<<<<
6209 if (likely(PyList_CheckExact(__pyx_v_del_items)) || PyTuple_CheckExact(__pyx_v_del_items)) {
6210 __pyx_t_2 = __pyx_v_del_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
6213 __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)
6214 __Pyx_GOTREF(__pyx_t_2);
6215 __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
6218 if (likely(!__pyx_t_7)) {
6219 if (likely(PyList_CheckExact(__pyx_t_2))) {
6220 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
6221 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6222 __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)
6224 __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)
6225 __Pyx_GOTREF(__pyx_t_1);
6228 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
6229 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6230 __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)
6232 __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)
6233 __Pyx_GOTREF(__pyx_t_1);
6237 __pyx_t_1 = __pyx_t_7(__pyx_t_2);
6238 if (unlikely(!__pyx_t_1)) {
6239 PyObject* exc_type = PyErr_Occurred();
6241 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6242 else __PYX_ERR(0, 362, __pyx_L1_error)
6246 __Pyx_GOTREF(__pyx_t_1);
6248 __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
6251 /* "lxml/objectify.pyx":363
6252 * remove = parent.remove
6253 * for el in del_items:
6254 * remove(el) # <<<<<<<<<<<<<<
6256 * # normal index deletion
6258 __Pyx_INCREF(__pyx_v_remove);
6259 __pyx_t_3 = __pyx_v_remove; __pyx_t_8 = NULL;
6260 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6261 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
6262 if (likely(__pyx_t_8)) {
6263 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6264 __Pyx_INCREF(__pyx_t_8);
6265 __Pyx_INCREF(function);
6266 __Pyx_DECREF_SET(__pyx_t_3, function);
6269 __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);
6270 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6271 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
6272 __Pyx_GOTREF(__pyx_t_1);
6273 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6276 /* "lxml/objectify.pyx":362
6277 * del_items = list(self)[key]
6278 * remove = parent.remove
6279 * for el in del_items: # <<<<<<<<<<<<<<
6284 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6286 /* "lxml/objectify.pyx":358
6287 * if parent is None:
6288 * raise TypeError, u"deleting items not supported by root element"
6289 * if isinstance(key, slice): # <<<<<<<<<<<<<<
6291 * del_items = list(self)[key]
6296 /* "lxml/objectify.pyx":366
6298 * # normal index deletion
6299 * sibling = self.__getitem__(key) # <<<<<<<<<<<<<<
6300 * parent.remove(sibling)
6304 __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)
6305 __Pyx_GOTREF(__pyx_t_1);
6307 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6308 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
6309 if (likely(__pyx_t_3)) {
6310 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6311 __Pyx_INCREF(__pyx_t_3);
6312 __Pyx_INCREF(function);
6313 __Pyx_DECREF_SET(__pyx_t_1, function);
6316 __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);
6317 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6318 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
6319 __Pyx_GOTREF(__pyx_t_2);
6320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6321 __pyx_v_sibling = __pyx_t_2;
6324 /* "lxml/objectify.pyx":367
6325 * # normal index deletion
6326 * sibling = self.__getitem__(key)
6327 * parent.remove(sibling) # <<<<<<<<<<<<<<
6329 * def descendantpaths(self, prefix=None):
6331 __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)
6332 __Pyx_GOTREF(__pyx_t_1);
6334 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
6335 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
6336 if (likely(__pyx_t_3)) {
6337 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6338 __Pyx_INCREF(__pyx_t_3);
6339 __Pyx_INCREF(function);
6340 __Pyx_DECREF_SET(__pyx_t_1, function);
6343 __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);
6344 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6345 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
6346 __Pyx_GOTREF(__pyx_t_2);
6347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6348 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6352 /* "lxml/objectify.pyx":354
6353 * _replaceElement(element, value)
6355 * def __delitem__(self, key): # <<<<<<<<<<<<<<
6356 * parent = self.getparent()
6357 * if parent is None:
6360 /* function exit code */
6364 __Pyx_XDECREF(__pyx_t_1);
6365 __Pyx_XDECREF(__pyx_t_2);
6366 __Pyx_XDECREF(__pyx_t_3);
6367 __Pyx_XDECREF(__pyx_t_8);
6368 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6371 __Pyx_XDECREF(__pyx_v_parent);
6372 __Pyx_XDECREF(__pyx_v_del_items);
6373 __Pyx_XDECREF(__pyx_v_remove);
6374 __Pyx_XDECREF(__pyx_v_el);
6375 __Pyx_XDECREF(__pyx_v_sibling);
6376 __Pyx_RefNannyFinishContext();
6380 /* "lxml/objectify.pyx":369
6381 * parent.remove(sibling)
6383 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
6384 * u"""descendantpaths(self, prefix=None)
6388 /* Python wrapper */
6389 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6390 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 ";
6391 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};
6392 static PyObject *__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6393 PyObject *__pyx_v_prefix = 0;
6394 int __pyx_lineno = 0;
6395 const char *__pyx_filename = NULL;
6396 int __pyx_clineno = 0;
6397 PyObject *__pyx_r = 0;
6398 __Pyx_RefNannyDeclarations
6399 __Pyx_RefNannySetupContext("descendantpaths (wrapper)", 0);
6401 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prefix,0};
6402 PyObject* values[1] = {0};
6403 values[0] = ((PyObject *)Py_None);
6404 if (unlikely(__pyx_kwds)) {
6406 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6408 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6411 default: goto __pyx_L5_argtuple_error;
6413 kw_args = PyDict_Size(__pyx_kwds);
6417 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prefix);
6418 if (value) { values[0] = value; kw_args--; }
6421 if (unlikely(kw_args > 0)) {
6422 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "descendantpaths") < 0)) __PYX_ERR(0, 369, __pyx_L3_error)
6425 switch (PyTuple_GET_SIZE(__pyx_args)) {
6426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6429 default: goto __pyx_L5_argtuple_error;
6432 __pyx_v_prefix = values[0];
6434 goto __pyx_L4_argument_unpacking_done;
6435 __pyx_L5_argtuple_error:;
6436 __Pyx_RaiseArgtupleInvalid("descendantpaths", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 369, __pyx_L3_error)
6438 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.descendantpaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
6439 __Pyx_RefNannyFinishContext();
6441 __pyx_L4_argument_unpacking_done:;
6442 __pyx_r = __pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(((struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *)__pyx_v_self), __pyx_v_prefix);
6444 /* function exit code */
6445 __Pyx_RefNannyFinishContext();
6449 static PyObject *__pyx_pf_4lxml_9objectify_18ObjectifiedElement_26descendantpaths(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement *__pyx_v_self, PyObject *__pyx_v_prefix) {
6450 PyObject *__pyx_r = NULL;
6451 __Pyx_RefNannyDeclarations
6455 PyObject *__pyx_t_4 = NULL;
6456 int __pyx_lineno = 0;
6457 const char *__pyx_filename = NULL;
6458 int __pyx_clineno = 0;
6459 __Pyx_RefNannySetupContext("descendantpaths", 0);
6460 __Pyx_INCREF(__pyx_v_prefix);
6462 /* "lxml/objectify.pyx":374
6463 * Returns a list of object path expressions for all descendants.
6465 * if prefix is not None and not python._isString(prefix): # <<<<<<<<<<<<<<
6466 * prefix = u'.'.join(prefix)
6467 * return _build_descendant_paths(self._c_node, prefix)
6469 __pyx_t_2 = (__pyx_v_prefix != Py_None);
6470 __pyx_t_3 = (__pyx_t_2 != 0);
6473 __pyx_t_1 = __pyx_t_3;
6474 goto __pyx_L4_bool_binop_done;
6476 __pyx_t_3 = ((!(_isString(__pyx_v_prefix) != 0)) != 0);
6477 __pyx_t_1 = __pyx_t_3;
6478 __pyx_L4_bool_binop_done:;
6481 /* "lxml/objectify.pyx":375
6483 * if prefix is not None and not python._isString(prefix):
6484 * prefix = u'.'.join(prefix) # <<<<<<<<<<<<<<
6485 * return _build_descendant_paths(self._c_node, prefix)
6488 __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error)
6489 __Pyx_GOTREF(__pyx_t_4);
6490 __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_4);
6493 /* "lxml/objectify.pyx":374
6494 * Returns a list of object path expressions for all descendants.
6496 * if prefix is not None and not python._isString(prefix): # <<<<<<<<<<<<<<
6497 * prefix = u'.'.join(prefix)
6498 * return _build_descendant_paths(self._c_node, prefix)
6502 /* "lxml/objectify.pyx":376
6503 * if prefix is not None and not python._isString(prefix):
6504 * prefix = u'.'.join(prefix)
6505 * return _build_descendant_paths(self._c_node, prefix) # <<<<<<<<<<<<<<
6509 __Pyx_XDECREF(__pyx_r);
6510 __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)
6511 __Pyx_GOTREF(__pyx_t_4);
6512 __pyx_r = __pyx_t_4;
6516 /* "lxml/objectify.pyx":369
6517 * parent.remove(sibling)
6519 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
6520 * u"""descendantpaths(self, prefix=None)
6524 /* function exit code */
6526 __Pyx_XDECREF(__pyx_t_4);
6527 __Pyx_AddTraceback("lxml.objectify.ObjectifiedElement.descendantpaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
6530 __Pyx_XDECREF(__pyx_v_prefix);
6531 __Pyx_XGIVEREF(__pyx_r);
6532 __Pyx_RefNannyFinishContext();
6536 /* "lxml/objectify.pyx":379
6539 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name): # <<<<<<<<<<<<<<
6540 * if c_node.name != c_name:
6544 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) {
6545 const xmlChar *__pyx_v_c_node_href;
6547 __Pyx_RefNannyDeclarations
6549 __Pyx_RefNannySetupContext("_tagMatches", 0);
6551 /* "lxml/objectify.pyx":380
6553 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6554 * if c_node.name != c_name: # <<<<<<<<<<<<<<
6556 * if c_href == NULL:
6558 __pyx_t_1 = ((__pyx_v_c_node->name != __pyx_v_c_name) != 0);
6561 /* "lxml/objectify.pyx":381
6562 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6563 * if c_node.name != c_name:
6564 * return 0 # <<<<<<<<<<<<<<
6565 * if c_href == NULL:
6571 /* "lxml/objectify.pyx":380
6573 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name):
6574 * if c_node.name != c_name: # <<<<<<<<<<<<<<
6576 * if c_href == NULL:
6580 /* "lxml/objectify.pyx":382
6581 * if c_node.name != c_name:
6583 * if c_href == NULL: # <<<<<<<<<<<<<<
6585 * c_node_href = tree._getNs(c_node)
6587 __pyx_t_1 = ((__pyx_v_c_href == NULL) != 0);
6590 /* "lxml/objectify.pyx":383
6592 * if c_href == NULL:
6593 * return 1 # <<<<<<<<<<<<<<
6594 * c_node_href = tree._getNs(c_node)
6595 * if c_node_href == NULL:
6600 /* "lxml/objectify.pyx":382
6601 * if c_node.name != c_name:
6603 * if c_href == NULL: # <<<<<<<<<<<<<<
6605 * c_node_href = tree._getNs(c_node)
6609 /* "lxml/objectify.pyx":384
6610 * if c_href == NULL:
6612 * c_node_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
6613 * if c_node_href == NULL:
6614 * return c_href[0] == c'\0'
6616 __pyx_v_c_node_href = _getNs(__pyx_v_c_node);
6618 /* "lxml/objectify.pyx":385
6620 * c_node_href = tree._getNs(c_node)
6621 * if c_node_href == NULL: # <<<<<<<<<<<<<<
6622 * return c_href[0] == c'\0'
6623 * return tree.xmlStrcmp(c_node_href, c_href) == 0
6625 __pyx_t_1 = ((__pyx_v_c_node_href == NULL) != 0);
6628 /* "lxml/objectify.pyx":386
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
6635 __pyx_r = ((__pyx_v_c_href[0]) == '\x00');
6638 /* "lxml/objectify.pyx":385
6640 * c_node_href = tree._getNs(c_node)
6641 * if c_node_href == NULL: # <<<<<<<<<<<<<<
6642 * return c_href[0] == c'\0'
6643 * return tree.xmlStrcmp(c_node_href, c_href) == 0
6647 /* "lxml/objectify.pyx":387
6648 * if c_node_href == NULL:
6649 * return c_href[0] == c'\0'
6650 * return tree.xmlStrcmp(c_node_href, c_href) == 0 # <<<<<<<<<<<<<<
6654 __pyx_r = (xmlStrcmp(__pyx_v_c_node_href, __pyx_v_c_href) == 0);
6657 /* "lxml/objectify.pyx":379
6660 * cdef inline bint _tagMatches(tree.xmlNode* c_node, const_xmlChar* c_href, const_xmlChar* c_name): # <<<<<<<<<<<<<<
6661 * if c_node.name != c_name:
6665 /* function exit code */
6667 __Pyx_RefNannyFinishContext();
6671 /* "lxml/objectify.pyx":390
6674 * cdef Py_ssize_t _countSiblings(tree.xmlNode* c_start_node): # <<<<<<<<<<<<<<
6675 * cdef tree.xmlNode* c_node
6676 * cdef Py_ssize_t count
6679 static Py_ssize_t __pyx_f_4lxml_9objectify__countSiblings(xmlNode *__pyx_v_c_start_node) {
6680 xmlNode *__pyx_v_c_node;
6681 Py_ssize_t __pyx_v_count;
6682 const xmlChar *__pyx_v_c_tag;
6683 const xmlChar *__pyx_v_c_href;
6685 __Pyx_RefNannyDeclarations
6686 const xmlChar *__pyx_t_1;
6690 __Pyx_RefNannySetupContext("_countSiblings", 0);
6692 /* "lxml/objectify.pyx":393
6693 * cdef tree.xmlNode* c_node
6694 * cdef Py_ssize_t count
6695 * c_tag = c_start_node.name # <<<<<<<<<<<<<<
6696 * c_href = tree._getNs(c_start_node)
6699 __pyx_t_1 = __pyx_v_c_start_node->name;
6700 __pyx_v_c_tag = __pyx_t_1;
6702 /* "lxml/objectify.pyx":394
6703 * cdef Py_ssize_t count
6704 * c_tag = c_start_node.name
6705 * c_href = tree._getNs(c_start_node) # <<<<<<<<<<<<<<
6707 * c_node = c_start_node.next
6709 __pyx_v_c_href = _getNs(__pyx_v_c_start_node);
6711 /* "lxml/objectify.pyx":395
6712 * c_tag = c_start_node.name
6713 * c_href = tree._getNs(c_start_node)
6714 * count = 1 # <<<<<<<<<<<<<<
6715 * c_node = c_start_node.next
6716 * while c_node is not NULL:
6720 /* "lxml/objectify.pyx":396
6721 * c_href = tree._getNs(c_start_node)
6723 * c_node = c_start_node.next # <<<<<<<<<<<<<<
6724 * while c_node is not NULL:
6725 * if c_node.type == tree.XML_ELEMENT_NODE and \
6727 __pyx_t_2 = __pyx_v_c_start_node->next;
6728 __pyx_v_c_node = __pyx_t_2;
6730 /* "lxml/objectify.pyx":397
6732 * c_node = c_start_node.next
6733 * while c_node is not NULL: # <<<<<<<<<<<<<<
6734 * if c_node.type == tree.XML_ELEMENT_NODE and \
6735 * _tagMatches(c_node, c_href, c_tag):
6738 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
6739 if (!__pyx_t_3) break;
6741 /* "lxml/objectify.pyx":398
6742 * c_node = c_start_node.next
6743 * while c_node is not NULL:
6744 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6745 * _tagMatches(c_node, c_href, c_tag):
6748 __pyx_t_4 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6751 __pyx_t_3 = __pyx_t_4;
6752 goto __pyx_L6_bool_binop_done;
6755 /* "lxml/objectify.pyx":399
6756 * while c_node is not NULL:
6757 * if c_node.type == tree.XML_ELEMENT_NODE and \
6758 * _tagMatches(c_node, c_href, c_tag): # <<<<<<<<<<<<<<
6760 * c_node = c_node.next
6762 __pyx_t_4 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_tag) != 0);
6763 __pyx_t_3 = __pyx_t_4;
6764 __pyx_L6_bool_binop_done:;
6766 /* "lxml/objectify.pyx":398
6767 * c_node = c_start_node.next
6768 * while c_node is not NULL:
6769 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6770 * _tagMatches(c_node, c_href, c_tag):
6775 /* "lxml/objectify.pyx":400
6776 * if c_node.type == tree.XML_ELEMENT_NODE and \
6777 * _tagMatches(c_node, c_href, c_tag):
6778 * count += 1 # <<<<<<<<<<<<<<
6779 * c_node = c_node.next
6780 * c_node = c_start_node.prev
6782 __pyx_v_count = (__pyx_v_count + 1);
6784 /* "lxml/objectify.pyx":398
6785 * c_node = c_start_node.next
6786 * while c_node is not NULL:
6787 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6788 * _tagMatches(c_node, c_href, c_tag):
6793 /* "lxml/objectify.pyx":401
6794 * _tagMatches(c_node, c_href, c_tag):
6796 * c_node = c_node.next # <<<<<<<<<<<<<<
6797 * c_node = c_start_node.prev
6798 * while c_node is not NULL:
6800 __pyx_t_2 = __pyx_v_c_node->next;
6801 __pyx_v_c_node = __pyx_t_2;
6804 /* "lxml/objectify.pyx":402
6806 * c_node = c_node.next
6807 * c_node = c_start_node.prev # <<<<<<<<<<<<<<
6808 * while c_node is not NULL:
6809 * if c_node.type == tree.XML_ELEMENT_NODE and \
6811 __pyx_t_2 = __pyx_v_c_start_node->prev;
6812 __pyx_v_c_node = __pyx_t_2;
6814 /* "lxml/objectify.pyx":403
6815 * c_node = c_node.next
6816 * c_node = c_start_node.prev
6817 * while c_node is not NULL: # <<<<<<<<<<<<<<
6818 * if c_node.type == tree.XML_ELEMENT_NODE and \
6819 * _tagMatches(c_node, c_href, c_tag):
6822 __pyx_t_3 = ((__pyx_v_c_node != NULL) != 0);
6823 if (!__pyx_t_3) break;
6825 /* "lxml/objectify.pyx":404
6826 * c_node = c_start_node.prev
6827 * while c_node is not NULL:
6828 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6829 * _tagMatches(c_node, c_href, c_tag):
6832 __pyx_t_4 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6835 __pyx_t_3 = __pyx_t_4;
6836 goto __pyx_L11_bool_binop_done;
6839 /* "lxml/objectify.pyx":405
6840 * while c_node is not NULL:
6841 * if c_node.type == tree.XML_ELEMENT_NODE and \
6842 * _tagMatches(c_node, c_href, c_tag): # <<<<<<<<<<<<<<
6844 * c_node = c_node.prev
6846 __pyx_t_4 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_tag) != 0);
6847 __pyx_t_3 = __pyx_t_4;
6848 __pyx_L11_bool_binop_done:;
6850 /* "lxml/objectify.pyx":404
6851 * c_node = c_start_node.prev
6852 * while c_node is not NULL:
6853 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6854 * _tagMatches(c_node, c_href, c_tag):
6859 /* "lxml/objectify.pyx":406
6860 * if c_node.type == tree.XML_ELEMENT_NODE and \
6861 * _tagMatches(c_node, c_href, c_tag):
6862 * count += 1 # <<<<<<<<<<<<<<
6863 * c_node = c_node.prev
6866 __pyx_v_count = (__pyx_v_count + 1);
6868 /* "lxml/objectify.pyx":404
6869 * c_node = c_start_node.prev
6870 * while c_node is not NULL:
6871 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6872 * _tagMatches(c_node, c_href, c_tag):
6877 /* "lxml/objectify.pyx":407
6878 * _tagMatches(c_node, c_href, c_tag):
6880 * c_node = c_node.prev # <<<<<<<<<<<<<<
6884 __pyx_t_2 = __pyx_v_c_node->prev;
6885 __pyx_v_c_node = __pyx_t_2;
6888 /* "lxml/objectify.pyx":408
6890 * c_node = c_node.prev
6891 * return count # <<<<<<<<<<<<<<
6893 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node,
6895 __pyx_r = __pyx_v_count;
6898 /* "lxml/objectify.pyx":390
6901 * cdef Py_ssize_t _countSiblings(tree.xmlNode* c_start_node): # <<<<<<<<<<<<<<
6902 * cdef tree.xmlNode* c_node
6903 * cdef Py_ssize_t count
6906 /* function exit code */
6908 __Pyx_RefNannyFinishContext();
6912 /* "lxml/objectify.pyx":410
6915 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
6916 * const_xmlChar* href, const_xmlChar* name,
6917 * Py_ssize_t index):
6920 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) {
6921 xmlNode *(*__pyx_v_next)(xmlNode *);
6923 __Pyx_RefNannyDeclarations
6926 __Pyx_RefNannySetupContext("_findFollowingSibling", 0);
6928 /* "lxml/objectify.pyx":414
6929 * Py_ssize_t index):
6930 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6931 * if index >= 0: # <<<<<<<<<<<<<<
6932 * next = cetree.nextElement
6935 __pyx_t_1 = ((__pyx_v_index >= 0) != 0);
6938 /* "lxml/objectify.pyx":415
6939 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6941 * next = cetree.nextElement # <<<<<<<<<<<<<<
6943 * index = -1 - index
6945 __pyx_v_next = nextElement;
6947 /* "lxml/objectify.pyx":414
6948 * Py_ssize_t index):
6949 * cdef tree.xmlNode* (*next)(tree.xmlNode*)
6950 * if index >= 0: # <<<<<<<<<<<<<<
6951 * next = cetree.nextElement
6957 /* "lxml/objectify.pyx":417
6958 * next = cetree.nextElement
6960 * index = -1 - index # <<<<<<<<<<<<<<
6961 * next = cetree.previousElement
6962 * while c_node is not NULL:
6965 __pyx_v_index = (-1L - __pyx_v_index);
6967 /* "lxml/objectify.pyx":418
6969 * index = -1 - index
6970 * next = cetree.previousElement # <<<<<<<<<<<<<<
6971 * while c_node is not NULL:
6972 * if c_node.type == tree.XML_ELEMENT_NODE and \
6974 __pyx_v_next = previousElement;
6978 /* "lxml/objectify.pyx":419
6979 * index = -1 - index
6980 * next = cetree.previousElement
6981 * while c_node is not NULL: # <<<<<<<<<<<<<<
6982 * if c_node.type == tree.XML_ELEMENT_NODE and \
6983 * _tagMatches(c_node, href, name):
6986 __pyx_t_1 = ((__pyx_v_c_node != NULL) != 0);
6987 if (!__pyx_t_1) break;
6989 /* "lxml/objectify.pyx":420
6990 * next = cetree.previousElement
6991 * while c_node is not NULL:
6992 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
6993 * _tagMatches(c_node, href, name):
6996 __pyx_t_2 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
6999 __pyx_t_1 = __pyx_t_2;
7000 goto __pyx_L7_bool_binop_done;
7003 /* "lxml/objectify.pyx":421
7004 * while c_node is not NULL:
7005 * if c_node.type == tree.XML_ELEMENT_NODE and \
7006 * _tagMatches(c_node, href, name): # <<<<<<<<<<<<<<
7010 __pyx_t_2 = (__pyx_f_4lxml_9objectify__tagMatches(__pyx_v_c_node, __pyx_v_href, __pyx_v_name) != 0);
7011 __pyx_t_1 = __pyx_t_2;
7012 __pyx_L7_bool_binop_done:;
7014 /* "lxml/objectify.pyx":420
7015 * next = cetree.previousElement
7016 * while c_node is not NULL:
7017 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
7018 * _tagMatches(c_node, href, name):
7023 /* "lxml/objectify.pyx":422
7024 * if c_node.type == tree.XML_ELEMENT_NODE and \
7025 * _tagMatches(c_node, href, name):
7026 * index = index - 1 # <<<<<<<<<<<<<<
7030 __pyx_v_index = (__pyx_v_index - 1);
7032 /* "lxml/objectify.pyx":423
7033 * _tagMatches(c_node, href, name):
7035 * if index < 0: # <<<<<<<<<<<<<<
7037 * c_node = next(c_node)
7039 __pyx_t_1 = ((__pyx_v_index < 0) != 0);
7042 /* "lxml/objectify.pyx":424
7045 * return c_node # <<<<<<<<<<<<<<
7046 * c_node = next(c_node)
7049 __pyx_r = __pyx_v_c_node;
7052 /* "lxml/objectify.pyx":423
7053 * _tagMatches(c_node, href, name):
7055 * if index < 0: # <<<<<<<<<<<<<<
7057 * c_node = next(c_node)
7061 /* "lxml/objectify.pyx":420
7062 * next = cetree.previousElement
7063 * while c_node is not NULL:
7064 * if c_node.type == tree.XML_ELEMENT_NODE and \ # <<<<<<<<<<<<<<
7065 * _tagMatches(c_node, href, name):
7070 /* "lxml/objectify.pyx":425
7073 * c_node = next(c_node) # <<<<<<<<<<<<<<
7077 __pyx_v_c_node = __pyx_v_next(__pyx_v_c_node);
7080 /* "lxml/objectify.pyx":426
7082 * c_node = next(c_node)
7083 * return NULL # <<<<<<<<<<<<<<
7085 * cdef object _lookupChild(_Element parent, tag):
7090 /* "lxml/objectify.pyx":410
7093 * cdef tree.xmlNode* _findFollowingSibling(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
7094 * const_xmlChar* href, const_xmlChar* name,
7095 * Py_ssize_t index):
7098 /* function exit code */
7100 __Pyx_RefNannyFinishContext();
7104 /* "lxml/objectify.pyx":428
7107 * cdef object _lookupChild(_Element parent, tag): # <<<<<<<<<<<<<<
7108 * cdef tree.xmlNode* c_result
7109 * cdef tree.xmlNode* c_node
7112 static PyObject *__pyx_f_4lxml_9objectify__lookupChild(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7113 xmlNode *__pyx_v_c_result;
7114 xmlNode *__pyx_v_c_node;
7115 PyObject *__pyx_v_ns = NULL;
7116 const xmlChar *__pyx_v_c_tag;
7117 const xmlChar *__pyx_v_c_href;
7118 PyObject *__pyx_r = NULL;
7119 __Pyx_RefNannyDeclarations
7121 PyObject *__pyx_t_2 = NULL;
7122 PyObject *__pyx_t_3 = NULL;
7123 PyObject *__pyx_t_4 = NULL;
7126 const xmlChar *__pyx_t_7;
7127 const xmlChar *__pyx_t_8;
7128 int __pyx_lineno = 0;
7129 const char *__pyx_filename = NULL;
7130 int __pyx_clineno = 0;
7131 __Pyx_RefNannySetupContext("_lookupChild", 0);
7132 __Pyx_INCREF(__pyx_v_tag);
7134 /* "lxml/objectify.pyx":431
7135 * cdef tree.xmlNode* c_result
7136 * cdef tree.xmlNode* c_node
7137 * c_node = parent._c_node # <<<<<<<<<<<<<<
7138 * ns, tag = cetree.getNsTagWithEmptyNs(tag)
7139 * c_tag = tree.xmlDictExists(
7141 __pyx_t_1 = __pyx_v_parent->_c_node;
7142 __pyx_v_c_node = __pyx_t_1;
7144 /* "lxml/objectify.pyx":432
7145 * cdef tree.xmlNode* c_node
7146 * c_node = parent._c_node
7147 * ns, tag = cetree.getNsTagWithEmptyNs(tag) # <<<<<<<<<<<<<<
7148 * c_tag = tree.xmlDictExists(
7149 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7151 __pyx_t_2 = getNsTagWithEmptyNs(__pyx_v_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
7152 __Pyx_GOTREF(__pyx_t_2);
7153 if (likely(__pyx_t_2 != Py_None)) {
7154 PyObject* sequence = __pyx_t_2;
7155 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7156 if (unlikely(size != 2)) {
7157 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7158 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7159 __PYX_ERR(0, 432, __pyx_L1_error)
7161 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7162 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7163 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7164 __Pyx_INCREF(__pyx_t_3);
7165 __Pyx_INCREF(__pyx_t_4);
7167 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
7168 __Pyx_GOTREF(__pyx_t_3);
7169 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error)
7170 __Pyx_GOTREF(__pyx_t_4);
7172 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7174 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 432, __pyx_L1_error)
7176 __pyx_v_ns = __pyx_t_3;
7178 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_4);
7181 /* "lxml/objectify.pyx":433
7182 * c_node = parent._c_node
7183 * ns, tag = cetree.getNsTagWithEmptyNs(tag)
7184 * c_tag = tree.xmlDictExists( # <<<<<<<<<<<<<<
7185 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7188 __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));
7190 /* "lxml/objectify.pyx":435
7191 * c_tag = tree.xmlDictExists(
7192 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7193 * if c_tag is NULL: # <<<<<<<<<<<<<<
7194 * return None # not in the hash map => not in the tree
7197 __pyx_t_5 = ((__pyx_v_c_tag == NULL) != 0);
7200 /* "lxml/objectify.pyx":436
7201 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7203 * return None # not in the hash map => not in the tree # <<<<<<<<<<<<<<
7205 * # either inherit ns from parent or use empty (i.e. no) namespace
7207 __Pyx_XDECREF(__pyx_r);
7208 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7211 /* "lxml/objectify.pyx":435
7212 * c_tag = tree.xmlDictExists(
7213 * c_node.doc.dict, _xcstr(tag), python.PyBytes_GET_SIZE(tag))
7214 * if c_tag is NULL: # <<<<<<<<<<<<<<
7215 * return None # not in the hash map => not in the tree
7220 /* "lxml/objectify.pyx":437
7222 * return None # not in the hash map => not in the tree
7223 * if ns is None: # <<<<<<<<<<<<<<
7224 * # either inherit ns from parent or use empty (i.e. no) namespace
7225 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
7227 __pyx_t_5 = (__pyx_v_ns == Py_None);
7228 __pyx_t_6 = (__pyx_t_5 != 0);
7231 /* "lxml/objectify.pyx":439
7233 * # either inherit ns from parent or use empty (i.e. no) namespace
7234 * c_href = tree._getNs(c_node) or <const_xmlChar*>'' # <<<<<<<<<<<<<<
7236 * c_href = _xcstr(ns)
7238 __pyx_t_8 = _getNs(__pyx_v_c_node);
7241 __pyx_t_7 = __pyx_t_8;
7242 goto __pyx_L5_bool_binop_done;
7244 __pyx_t_8 = ((const xmlChar *)((const xmlChar *)((char const *)"")));
7245 __pyx_t_7 = __pyx_t_8;
7246 __pyx_L5_bool_binop_done:;
7247 __pyx_v_c_href = __pyx_t_7;
7249 /* "lxml/objectify.pyx":437
7251 * return None # not in the hash map => not in the tree
7252 * if ns is None: # <<<<<<<<<<<<<<
7253 * # either inherit ns from parent or use empty (i.e. no) namespace
7254 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
7259 /* "lxml/objectify.pyx":441
7260 * c_href = tree._getNs(c_node) or <const_xmlChar*>''
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_href = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns);
7271 /* "lxml/objectify.pyx":442
7273 * c_href = _xcstr(ns)
7274 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0) # <<<<<<<<<<<<<<
7275 * if c_result is NULL:
7278 __pyx_v_c_result = __pyx_f_4lxml_9objectify__findFollowingSibling(__pyx_v_c_node->children, __pyx_v_c_href, __pyx_v_c_tag, 0);
7280 /* "lxml/objectify.pyx":443
7281 * c_href = _xcstr(ns)
7282 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7283 * if c_result is NULL: # <<<<<<<<<<<<<<
7285 * return elementFactory(parent._doc, c_result)
7287 __pyx_t_6 = ((__pyx_v_c_result == NULL) != 0);
7290 /* "lxml/objectify.pyx":444
7291 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7292 * if c_result is NULL:
7293 * return None # <<<<<<<<<<<<<<
7294 * return elementFactory(parent._doc, c_result)
7297 __Pyx_XDECREF(__pyx_r);
7298 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7301 /* "lxml/objectify.pyx":443
7302 * c_href = _xcstr(ns)
7303 * c_result = _findFollowingSibling(c_node.children, c_href, c_tag, 0)
7304 * if c_result is NULL: # <<<<<<<<<<<<<<
7306 * return elementFactory(parent._doc, c_result)
7310 /* "lxml/objectify.pyx":445
7311 * if c_result is NULL:
7313 * return elementFactory(parent._doc, c_result) # <<<<<<<<<<<<<<
7315 * cdef object _lookupChildOrRaise(_Element parent, tag):
7317 __Pyx_XDECREF(__pyx_r);
7318 __pyx_t_2 = ((PyObject *)__pyx_v_parent->_doc);
7319 __Pyx_INCREF(__pyx_t_2);
7320 __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)
7321 __Pyx_GOTREF(__pyx_t_4);
7322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7323 __pyx_r = __pyx_t_4;
7327 /* "lxml/objectify.pyx":428
7330 * cdef object _lookupChild(_Element parent, tag): # <<<<<<<<<<<<<<
7331 * cdef tree.xmlNode* c_result
7332 * cdef tree.xmlNode* c_node
7335 /* function exit code */
7337 __Pyx_XDECREF(__pyx_t_2);
7338 __Pyx_XDECREF(__pyx_t_3);
7339 __Pyx_XDECREF(__pyx_t_4);
7340 __Pyx_AddTraceback("lxml.objectify._lookupChild", __pyx_clineno, __pyx_lineno, __pyx_filename);
7343 __Pyx_XDECREF(__pyx_v_ns);
7344 __Pyx_XDECREF(__pyx_v_tag);
7345 __Pyx_XGIVEREF(__pyx_r);
7346 __Pyx_RefNannyFinishContext();
7350 /* "lxml/objectify.pyx":447
7351 * return elementFactory(parent._doc, c_result)
7353 * cdef object _lookupChildOrRaise(_Element parent, tag): # <<<<<<<<<<<<<<
7354 * element = _lookupChild(parent, tag)
7355 * if element is None:
7358 static PyObject *__pyx_f_4lxml_9objectify__lookupChildOrRaise(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7359 PyObject *__pyx_v_element = NULL;
7360 PyObject *__pyx_r = NULL;
7361 __Pyx_RefNannyDeclarations
7362 PyObject *__pyx_t_1 = NULL;
7365 PyObject *__pyx_t_4 = NULL;
7366 int __pyx_lineno = 0;
7367 const char *__pyx_filename = NULL;
7368 int __pyx_clineno = 0;
7369 __Pyx_RefNannySetupContext("_lookupChildOrRaise", 0);
7371 /* "lxml/objectify.pyx":448
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)
7378 __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)
7379 __Pyx_GOTREF(__pyx_t_1);
7380 __pyx_v_element = __pyx_t_1;
7383 /* "lxml/objectify.pyx":449
7384 * cdef object _lookupChildOrRaise(_Element parent, tag):
7385 * element = _lookupChild(parent, tag)
7386 * if element is None: # <<<<<<<<<<<<<<
7387 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7390 __pyx_t_2 = (__pyx_v_element == Py_None);
7391 __pyx_t_3 = (__pyx_t_2 != 0);
7392 if (unlikely(__pyx_t_3)) {
7394 /* "lxml/objectify.pyx":450
7395 * element = _lookupChild(parent, tag)
7396 * if element is None:
7397 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag) # <<<<<<<<<<<<<<
7401 __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)
7402 __Pyx_GOTREF(__pyx_t_1);
7403 __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)
7404 __Pyx_GOTREF(__pyx_t_4);
7405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7406 __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_t_4, 0, 0);
7407 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7408 __PYX_ERR(0, 450, __pyx_L1_error)
7410 /* "lxml/objectify.pyx":449
7411 * cdef object _lookupChildOrRaise(_Element parent, tag):
7412 * element = _lookupChild(parent, tag)
7413 * if element is None: # <<<<<<<<<<<<<<
7414 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7419 /* "lxml/objectify.pyx":451
7420 * if element is None:
7421 * raise AttributeError, u"no such child: " + _buildChildTag(parent, tag)
7422 * return element # <<<<<<<<<<<<<<
7424 * cdef object _buildChildTag(_Element parent, tag):
7426 __Pyx_XDECREF(__pyx_r);
7427 __Pyx_INCREF(__pyx_v_element);
7428 __pyx_r = __pyx_v_element;
7431 /* "lxml/objectify.pyx":447
7432 * return elementFactory(parent._doc, c_result)
7434 * cdef object _lookupChildOrRaise(_Element parent, tag): # <<<<<<<<<<<<<<
7435 * element = _lookupChild(parent, tag)
7436 * if element is None:
7439 /* function exit code */
7441 __Pyx_XDECREF(__pyx_t_1);
7442 __Pyx_XDECREF(__pyx_t_4);
7443 __Pyx_AddTraceback("lxml.objectify._lookupChildOrRaise", __pyx_clineno, __pyx_lineno, __pyx_filename);
7446 __Pyx_XDECREF(__pyx_v_element);
7447 __Pyx_XGIVEREF(__pyx_r);
7448 __Pyx_RefNannyFinishContext();
7452 /* "lxml/objectify.pyx":453
7455 * cdef object _buildChildTag(_Element parent, tag): # <<<<<<<<<<<<<<
7456 * ns, tag = cetree.getNsTag(tag)
7457 * c_tag = _xcstr(tag)
7460 static PyObject *__pyx_f_4lxml_9objectify__buildChildTag(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag) {
7461 PyObject *__pyx_v_ns = NULL;
7462 const xmlChar *__pyx_v_c_tag;
7463 const xmlChar *__pyx_v_c_href;
7464 PyObject *__pyx_r = NULL;
7465 __Pyx_RefNannyDeclarations
7466 PyObject *__pyx_t_1 = NULL;
7467 PyObject *__pyx_t_2 = NULL;
7468 PyObject *__pyx_t_3 = NULL;
7469 const xmlChar *__pyx_t_4;
7471 int __pyx_lineno = 0;
7472 const char *__pyx_filename = NULL;
7473 int __pyx_clineno = 0;
7474 __Pyx_RefNannySetupContext("_buildChildTag", 0);
7475 __Pyx_INCREF(__pyx_v_tag);
7477 /* "lxml/objectify.pyx":454
7479 * cdef object _buildChildTag(_Element parent, tag):
7480 * ns, tag = cetree.getNsTag(tag) # <<<<<<<<<<<<<<
7481 * c_tag = _xcstr(tag)
7482 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7484 __pyx_t_1 = getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
7485 __Pyx_GOTREF(__pyx_t_1);
7486 if (likely(__pyx_t_1 != Py_None)) {
7487 PyObject* sequence = __pyx_t_1;
7488 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7489 if (unlikely(size != 2)) {
7490 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7491 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7492 __PYX_ERR(0, 454, __pyx_L1_error)
7494 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7495 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
7496 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
7497 __Pyx_INCREF(__pyx_t_2);
7498 __Pyx_INCREF(__pyx_t_3);
7500 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
7501 __Pyx_GOTREF(__pyx_t_2);
7502 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
7503 __Pyx_GOTREF(__pyx_t_3);
7505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7507 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 454, __pyx_L1_error)
7509 __pyx_v_ns = __pyx_t_2;
7511 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_3);
7514 /* "lxml/objectify.pyx":455
7515 * cdef object _buildChildTag(_Element parent, tag):
7516 * ns, tag = cetree.getNsTag(tag)
7517 * c_tag = _xcstr(tag) # <<<<<<<<<<<<<<
7518 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7519 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7521 __pyx_v_c_tag = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag);
7523 /* "lxml/objectify.pyx":456
7524 * ns, tag = cetree.getNsTag(tag)
7525 * c_tag = _xcstr(tag)
7526 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns) # <<<<<<<<<<<<<<
7527 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7530 __pyx_t_5 = (__pyx_v_ns == Py_None);
7531 if ((__pyx_t_5 != 0)) {
7532 __pyx_t_4 = _getNs(__pyx_v_parent->_c_node);
7534 __pyx_t_4 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns);
7536 __pyx_v_c_href = __pyx_t_4;
7538 /* "lxml/objectify.pyx":457
7539 * c_tag = _xcstr(tag)
7540 * c_href = tree._getNs(parent._c_node) if ns is None else _xcstr(ns)
7541 * return cetree.namespacedNameFromNsName(c_href, c_tag) # <<<<<<<<<<<<<<
7543 * cdef _replaceElement(_Element element, value):
7545 __Pyx_XDECREF(__pyx_r);
7546 __pyx_t_1 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
7547 __Pyx_GOTREF(__pyx_t_1);
7548 __pyx_r = __pyx_t_1;
7552 /* "lxml/objectify.pyx":453
7555 * cdef object _buildChildTag(_Element parent, tag): # <<<<<<<<<<<<<<
7556 * ns, tag = cetree.getNsTag(tag)
7557 * c_tag = _xcstr(tag)
7560 /* function exit code */
7562 __Pyx_XDECREF(__pyx_t_1);
7563 __Pyx_XDECREF(__pyx_t_2);
7564 __Pyx_XDECREF(__pyx_t_3);
7565 __Pyx_AddTraceback("lxml.objectify._buildChildTag", __pyx_clineno, __pyx_lineno, __pyx_filename);
7568 __Pyx_XDECREF(__pyx_v_ns);
7569 __Pyx_XDECREF(__pyx_v_tag);
7570 __Pyx_XGIVEREF(__pyx_r);
7571 __Pyx_RefNannyFinishContext();
7575 /* "lxml/objectify.pyx":459
7576 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7578 * cdef _replaceElement(_Element element, value): # <<<<<<<<<<<<<<
7579 * cdef _Element new_element
7580 * if isinstance(value, _Element):
7583 static PyObject *__pyx_f_4lxml_9objectify__replaceElement(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_value) {
7584 struct LxmlElement *__pyx_v_new_element = 0;
7585 PyObject *__pyx_r = NULL;
7586 __Pyx_RefNannyDeclarations
7589 PyObject *__pyx_t_3 = NULL;
7590 PyObject *__pyx_t_4 = NULL;
7592 PyObject *__pyx_t_6 = NULL;
7593 PyObject *__pyx_t_7 = NULL;
7595 int __pyx_lineno = 0;
7596 const char *__pyx_filename = NULL;
7597 int __pyx_clineno = 0;
7598 __Pyx_RefNannySetupContext("_replaceElement", 0);
7600 /* "lxml/objectify.pyx":461
7601 * cdef _replaceElement(_Element element, value):
7602 * cdef _Element new_element
7603 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7604 * # deep copy the new element
7605 * new_element = cetree.deepcopyNodeToDocument(
7607 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
7608 __pyx_t_2 = (__pyx_t_1 != 0);
7611 /* "lxml/objectify.pyx":464
7612 * # deep copy the new element
7613 * new_element = cetree.deepcopyNodeToDocument(
7614 * element._doc, (<_Element>value)._c_node) # <<<<<<<<<<<<<<
7615 * new_element.tag = element.tag
7616 * elif isinstance(value, (list, tuple)):
7618 __pyx_t_3 = ((PyObject *)__pyx_v_element->_doc);
7619 __Pyx_INCREF(__pyx_t_3);
7621 /* "lxml/objectify.pyx":463
7622 * if isinstance(value, _Element):
7623 * # deep copy the new element
7624 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
7625 * element._doc, (<_Element>value)._c_node)
7626 * new_element.tag = element.tag
7628 __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)
7629 __Pyx_GOTREF(__pyx_t_4);
7630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7631 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7634 /* "lxml/objectify.pyx":465
7635 * new_element = cetree.deepcopyNodeToDocument(
7636 * element._doc, (<_Element>value)._c_node)
7637 * new_element.tag = element.tag # <<<<<<<<<<<<<<
7638 * elif isinstance(value, (list, tuple)):
7639 * element[:] = value
7641 __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)
7642 __Pyx_GOTREF(__pyx_t_4);
7643 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_t_4) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
7644 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7646 /* "lxml/objectify.pyx":461
7647 * cdef _replaceElement(_Element element, value):
7648 * cdef _Element new_element
7649 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7650 * # deep copy the new element
7651 * new_element = cetree.deepcopyNodeToDocument(
7656 /* "lxml/objectify.pyx":466
7657 * element._doc, (<_Element>value)._c_node)
7658 * new_element.tag = element.tag
7659 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7660 * element[:] = value
7663 __pyx_t_1 = PyList_Check(__pyx_v_value);
7664 __pyx_t_5 = (__pyx_t_1 != 0);
7667 __pyx_t_2 = __pyx_t_5;
7668 goto __pyx_L4_bool_binop_done;
7670 __pyx_t_5 = PyTuple_Check(__pyx_v_value);
7671 __pyx_t_1 = (__pyx_t_5 != 0);
7672 __pyx_t_2 = __pyx_t_1;
7673 __pyx_L4_bool_binop_done:;
7674 __pyx_t_1 = (__pyx_t_2 != 0);
7677 /* "lxml/objectify.pyx":467
7678 * new_element.tag = element.tag
7679 * elif isinstance(value, (list, tuple)):
7680 * element[:] = value # <<<<<<<<<<<<<<
7684 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)
7686 /* "lxml/objectify.pyx":468
7687 * elif isinstance(value, (list, tuple)):
7688 * element[:] = value
7689 * return # <<<<<<<<<<<<<<
7691 * new_element = element.makeelement(element.tag)
7693 __Pyx_XDECREF(__pyx_r);
7694 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7697 /* "lxml/objectify.pyx":466
7698 * element._doc, (<_Element>value)._c_node)
7699 * new_element.tag = element.tag
7700 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7701 * element[:] = value
7706 /* "lxml/objectify.pyx":470
7709 * new_element = element.makeelement(element.tag) # <<<<<<<<<<<<<<
7710 * _setElementValue(new_element, value)
7711 * element.getparent().replace(element, new_element)
7714 __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)
7715 __Pyx_GOTREF(__pyx_t_3);
7716 __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)
7717 __Pyx_GOTREF(__pyx_t_6);
7719 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7720 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
7721 if (likely(__pyx_t_7)) {
7722 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7723 __Pyx_INCREF(__pyx_t_7);
7724 __Pyx_INCREF(function);
7725 __Pyx_DECREF_SET(__pyx_t_3, function);
7728 __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);
7729 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7730 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7731 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
7732 __Pyx_GOTREF(__pyx_t_4);
7733 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7734 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)
7735 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7738 /* "lxml/objectify.pyx":471
7740 * new_element = element.makeelement(element.tag)
7741 * _setElementValue(new_element, value) # <<<<<<<<<<<<<<
7742 * element.getparent().replace(element, new_element)
7745 __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)
7746 __Pyx_GOTREF(__pyx_t_4);
7747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7751 /* "lxml/objectify.pyx":472
7752 * new_element = element.makeelement(element.tag)
7753 * _setElementValue(new_element, value)
7754 * element.getparent().replace(element, new_element) # <<<<<<<<<<<<<<
7756 * cdef _appendValue(_Element parent, tag, value):
7758 __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)
7759 __Pyx_GOTREF(__pyx_t_6);
7761 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7762 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
7763 if (likely(__pyx_t_7)) {
7764 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7765 __Pyx_INCREF(__pyx_t_7);
7766 __Pyx_INCREF(function);
7767 __Pyx_DECREF_SET(__pyx_t_6, function);
7770 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
7771 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7772 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
7773 __Pyx_GOTREF(__pyx_t_3);
7774 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7775 __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)
7776 __Pyx_GOTREF(__pyx_t_6);
7777 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7780 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7781 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
7782 if (likely(__pyx_t_3)) {
7783 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7784 __Pyx_INCREF(__pyx_t_3);
7785 __Pyx_INCREF(function);
7786 __Pyx_DECREF_SET(__pyx_t_6, function);
7790 #if CYTHON_FAST_PYCALL
7791 if (PyFunction_Check(__pyx_t_6)) {
7792 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_new_element)};
7793 __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)
7794 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7795 __Pyx_GOTREF(__pyx_t_4);
7798 #if CYTHON_FAST_PYCCALL
7799 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7800 PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_element), ((PyObject *)__pyx_v_new_element)};
7801 __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)
7802 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7803 __Pyx_GOTREF(__pyx_t_4);
7807 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error)
7808 __Pyx_GOTREF(__pyx_t_7);
7810 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
7812 __Pyx_INCREF(((PyObject *)__pyx_v_element));
7813 __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
7814 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, ((PyObject *)__pyx_v_element));
7815 __Pyx_INCREF(((PyObject *)__pyx_v_new_element));
7816 __Pyx_GIVEREF(((PyObject *)__pyx_v_new_element));
7817 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, ((PyObject *)__pyx_v_new_element));
7818 __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)
7819 __Pyx_GOTREF(__pyx_t_4);
7820 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7822 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7823 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7825 /* "lxml/objectify.pyx":459
7826 * return cetree.namespacedNameFromNsName(c_href, c_tag)
7828 * cdef _replaceElement(_Element element, value): # <<<<<<<<<<<<<<
7829 * cdef _Element new_element
7830 * if isinstance(value, _Element):
7833 /* function exit code */
7834 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7837 __Pyx_XDECREF(__pyx_t_3);
7838 __Pyx_XDECREF(__pyx_t_4);
7839 __Pyx_XDECREF(__pyx_t_6);
7840 __Pyx_XDECREF(__pyx_t_7);
7841 __Pyx_AddTraceback("lxml.objectify._replaceElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
7844 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
7845 __Pyx_XGIVEREF(__pyx_r);
7846 __Pyx_RefNannyFinishContext();
7850 /* "lxml/objectify.pyx":474
7851 * element.getparent().replace(element, new_element)
7853 * cdef _appendValue(_Element parent, tag, value): # <<<<<<<<<<<<<<
7854 * cdef _Element new_element
7855 * if isinstance(value, _Element):
7858 static PyObject *__pyx_f_4lxml_9objectify__appendValue(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag, PyObject *__pyx_v_value) {
7859 struct LxmlElement *__pyx_v_new_element = 0;
7860 PyObject *__pyx_v_item = NULL;
7861 PyObject *__pyx_r = NULL;
7862 __Pyx_RefNannyDeclarations
7865 PyObject *__pyx_t_3 = NULL;
7866 PyObject *__pyx_t_4 = NULL;
7869 Py_ssize_t __pyx_t_7;
7870 PyObject *(*__pyx_t_8)(PyObject *);
7871 int __pyx_lineno = 0;
7872 const char *__pyx_filename = NULL;
7873 int __pyx_clineno = 0;
7874 __Pyx_RefNannySetupContext("_appendValue", 0);
7876 /* "lxml/objectify.pyx":476
7877 * cdef _appendValue(_Element parent, tag, value):
7878 * cdef _Element new_element
7879 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7880 * # deep copy the new element
7881 * new_element = cetree.deepcopyNodeToDocument(
7883 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
7884 __pyx_t_2 = (__pyx_t_1 != 0);
7887 /* "lxml/objectify.pyx":479
7888 * # deep copy the new element
7889 * new_element = cetree.deepcopyNodeToDocument(
7890 * parent._doc, (<_Element>value)._c_node) # <<<<<<<<<<<<<<
7891 * new_element.tag = tag
7892 * cetree.appendChildToElement(parent, new_element)
7894 __pyx_t_3 = ((PyObject *)__pyx_v_parent->_doc);
7895 __Pyx_INCREF(__pyx_t_3);
7897 /* "lxml/objectify.pyx":478
7898 * if isinstance(value, _Element):
7899 * # deep copy the new element
7900 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
7901 * parent._doc, (<_Element>value)._c_node)
7902 * new_element.tag = tag
7904 __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)
7905 __Pyx_GOTREF(__pyx_t_4);
7906 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7907 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_4);
7910 /* "lxml/objectify.pyx":480
7911 * new_element = cetree.deepcopyNodeToDocument(
7912 * parent._doc, (<_Element>value)._c_node)
7913 * new_element.tag = tag # <<<<<<<<<<<<<<
7914 * cetree.appendChildToElement(parent, new_element)
7915 * elif isinstance(value, (list, tuple)):
7917 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
7919 /* "lxml/objectify.pyx":481
7920 * parent._doc, (<_Element>value)._c_node)
7921 * new_element.tag = tag
7922 * cetree.appendChildToElement(parent, new_element) # <<<<<<<<<<<<<<
7923 * elif isinstance(value, (list, tuple)):
7924 * for item in value:
7926 __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)
7928 /* "lxml/objectify.pyx":476
7929 * cdef _appendValue(_Element parent, tag, value):
7930 * cdef _Element new_element
7931 * if isinstance(value, _Element): # <<<<<<<<<<<<<<
7932 * # deep copy the new element
7933 * new_element = cetree.deepcopyNodeToDocument(
7938 /* "lxml/objectify.pyx":482
7939 * new_element.tag = tag
7940 * cetree.appendChildToElement(parent, new_element)
7941 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
7942 * for item in value:
7943 * _appendValue(parent, tag, item)
7945 __pyx_t_1 = PyList_Check(__pyx_v_value);
7946 __pyx_t_6 = (__pyx_t_1 != 0);
7949 __pyx_t_2 = __pyx_t_6;
7950 goto __pyx_L4_bool_binop_done;
7952 __pyx_t_6 = PyTuple_Check(__pyx_v_value);
7953 __pyx_t_1 = (__pyx_t_6 != 0);
7954 __pyx_t_2 = __pyx_t_1;
7955 __pyx_L4_bool_binop_done:;
7956 __pyx_t_1 = (__pyx_t_2 != 0);
7959 /* "lxml/objectify.pyx":483
7960 * cetree.appendChildToElement(parent, new_element)
7961 * elif isinstance(value, (list, tuple)):
7962 * for item in value: # <<<<<<<<<<<<<<
7963 * _appendValue(parent, tag, item)
7966 if (likely(PyList_CheckExact(__pyx_v_value)) || PyTuple_CheckExact(__pyx_v_value)) {
7967 __pyx_t_4 = __pyx_v_value; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
7970 __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __pyx_L1_error)
7971 __Pyx_GOTREF(__pyx_t_4);
7972 __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error)
7975 if (likely(!__pyx_t_8)) {
7976 if (likely(PyList_CheckExact(__pyx_t_4))) {
7977 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
7978 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7979 __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)
7981 __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)
7982 __Pyx_GOTREF(__pyx_t_3);
7985 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
7986 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7987 __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)
7989 __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)
7990 __Pyx_GOTREF(__pyx_t_3);
7994 __pyx_t_3 = __pyx_t_8(__pyx_t_4);
7995 if (unlikely(!__pyx_t_3)) {
7996 PyObject* exc_type = PyErr_Occurred();
7998 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7999 else __PYX_ERR(0, 483, __pyx_L1_error)
8003 __Pyx_GOTREF(__pyx_t_3);
8005 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
8008 /* "lxml/objectify.pyx":484
8009 * elif isinstance(value, (list, tuple)):
8010 * for item in value:
8011 * _appendValue(parent, tag, item) # <<<<<<<<<<<<<<
8013 * new_element = cetree.makeElement(
8015 __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)
8016 __Pyx_GOTREF(__pyx_t_3);
8017 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8019 /* "lxml/objectify.pyx":483
8020 * cetree.appendChildToElement(parent, new_element)
8021 * elif isinstance(value, (list, tuple)):
8022 * for item in value: # <<<<<<<<<<<<<<
8023 * _appendValue(parent, tag, item)
8027 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8029 /* "lxml/objectify.pyx":482
8030 * new_element.tag = tag
8031 * cetree.appendChildToElement(parent, new_element)
8032 * elif isinstance(value, (list, tuple)): # <<<<<<<<<<<<<<
8033 * for item in value:
8034 * _appendValue(parent, tag, item)
8039 /* "lxml/objectify.pyx":486
8040 * _appendValue(parent, tag, item)
8042 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8043 * tag, parent._doc, None, None, None, None, None)
8044 * _setElementValue(new_element, value)
8048 /* "lxml/objectify.pyx":487
8050 * new_element = cetree.makeElement(
8051 * tag, parent._doc, None, None, None, None, None) # <<<<<<<<<<<<<<
8052 * _setElementValue(new_element, value)
8053 * cetree.appendChildToElement(parent, new_element)
8055 __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
8056 __Pyx_INCREF(__pyx_t_4);
8058 /* "lxml/objectify.pyx":486
8059 * _appendValue(parent, tag, item)
8061 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8062 * tag, parent._doc, None, None, None, None, None)
8063 * _setElementValue(new_element, value)
8065 __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)
8066 __Pyx_GOTREF(__pyx_t_3);
8067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8068 __pyx_v_new_element = ((struct LxmlElement *)__pyx_t_3);
8071 /* "lxml/objectify.pyx":488
8072 * new_element = cetree.makeElement(
8073 * tag, parent._doc, None, None, None, None, None)
8074 * _setElementValue(new_element, value) # <<<<<<<<<<<<<<
8075 * cetree.appendChildToElement(parent, new_element)
8078 __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)
8079 __Pyx_GOTREF(__pyx_t_3);
8080 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8082 /* "lxml/objectify.pyx":489
8083 * tag, parent._doc, None, None, None, None, None)
8084 * _setElementValue(new_element, value)
8085 * cetree.appendChildToElement(parent, new_element) # <<<<<<<<<<<<<<
8087 * cdef _setElementValue(_Element element, value):
8089 __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)
8093 /* "lxml/objectify.pyx":474
8094 * element.getparent().replace(element, new_element)
8096 * cdef _appendValue(_Element parent, tag, value): # <<<<<<<<<<<<<<
8097 * cdef _Element new_element
8098 * if isinstance(value, _Element):
8101 /* function exit code */
8102 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8105 __Pyx_XDECREF(__pyx_t_3);
8106 __Pyx_XDECREF(__pyx_t_4);
8107 __Pyx_AddTraceback("lxml.objectify._appendValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
8110 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
8111 __Pyx_XDECREF(__pyx_v_item);
8112 __Pyx_XGIVEREF(__pyx_r);
8113 __Pyx_RefNannyFinishContext();
8117 /* "lxml/objectify.pyx":491
8118 * cetree.appendChildToElement(parent, new_element)
8120 * cdef _setElementValue(_Element element, value): # <<<<<<<<<<<<<<
8122 * cetree.setAttributeValue(
8125 static PyObject *__pyx_f_4lxml_9objectify__setElementValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_value) {
8126 PyObject *__pyx_v_pytype_name = NULL;
8127 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
8128 PyObject *__pyx_r = NULL;
8129 __Pyx_RefNannyDeclarations
8132 PyObject *__pyx_t_3 = NULL;
8134 PyObject *__pyx_t_5 = NULL;
8135 PyObject *__pyx_t_6 = NULL;
8136 int __pyx_lineno = 0;
8137 const char *__pyx_filename = NULL;
8138 int __pyx_clineno = 0;
8139 __Pyx_RefNannySetupContext("_setElementValue", 0);
8140 __Pyx_INCREF(__pyx_v_value);
8142 /* "lxml/objectify.pyx":492
8144 * cdef _setElementValue(_Element element, value):
8145 * if value is None: # <<<<<<<<<<<<<<
8146 * cetree.setAttributeValue(
8147 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8149 __pyx_t_1 = (__pyx_v_value == Py_None);
8150 __pyx_t_2 = (__pyx_t_1 != 0);
8153 /* "lxml/objectify.pyx":494
8155 * cetree.setAttributeValue(
8156 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true") # <<<<<<<<<<<<<<
8157 * elif isinstance(value, _Element):
8158 * _replaceElement(element, value)
8160 __pyx_t_3 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
8161 __Pyx_INCREF(__pyx_t_3);
8163 /* "lxml/objectify.pyx":493
8164 * cdef _setElementValue(_Element element, value):
8166 * cetree.setAttributeValue( # <<<<<<<<<<<<<<
8167 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8168 * elif isinstance(value, _Element):
8170 __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)
8171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8173 /* "lxml/objectify.pyx":492
8175 * cdef _setElementValue(_Element element, value):
8176 * if value is None: # <<<<<<<<<<<<<<
8177 * cetree.setAttributeValue(
8178 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8183 /* "lxml/objectify.pyx":495
8184 * cetree.setAttributeValue(
8185 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8186 * elif isinstance(value, _Element): # <<<<<<<<<<<<<<
8187 * _replaceElement(element, value)
8190 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_value, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
8191 __pyx_t_1 = (__pyx_t_2 != 0);
8194 /* "lxml/objectify.pyx":496
8195 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8196 * elif isinstance(value, _Element):
8197 * _replaceElement(element, value) # <<<<<<<<<<<<<<
8201 __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)
8202 __Pyx_GOTREF(__pyx_t_3);
8203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8205 /* "lxml/objectify.pyx":497
8206 * elif isinstance(value, _Element):
8207 * _replaceElement(element, value)
8208 * return # <<<<<<<<<<<<<<
8210 * cetree.delAttributeFromNsName(
8212 __Pyx_XDECREF(__pyx_r);
8213 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8216 /* "lxml/objectify.pyx":495
8217 * cetree.setAttributeValue(
8218 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
8219 * elif isinstance(value, _Element): # <<<<<<<<<<<<<<
8220 * _replaceElement(element, value)
8225 /* "lxml/objectify.pyx":499
8228 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
8229 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8230 * if python._isString(value):
8234 /* "lxml/objectify.pyx":500
8236 * cetree.delAttributeFromNsName(
8237 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") # <<<<<<<<<<<<<<
8238 * if python._isString(value):
8239 * pytype_name = u"str"
8241 (void)(delAttributeFromNsName(__pyx_v_element->_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"nil")))));
8243 /* "lxml/objectify.pyx":501
8244 * cetree.delAttributeFromNsName(
8245 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8246 * if python._isString(value): # <<<<<<<<<<<<<<
8247 * pytype_name = u"str"
8248 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8250 __pyx_t_1 = (_isString(__pyx_v_value) != 0);
8253 /* "lxml/objectify.pyx":502
8254 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8255 * if python._isString(value):
8256 * pytype_name = u"str" # <<<<<<<<<<<<<<
8257 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8260 __Pyx_INCREF(__pyx_n_u_str);
8261 __pyx_v_pytype_name = __pyx_n_u_str;
8263 /* "lxml/objectify.pyx":503
8264 * if python._isString(value):
8265 * pytype_name = u"str"
8266 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name) # <<<<<<<<<<<<<<
8268 * pytype_name = _typename(value)
8270 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
8271 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
8272 __PYX_ERR(0, 503, __pyx_L1_error)
8274 __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)
8275 __Pyx_GOTREF(__pyx_t_3);
8276 __pyx_t_5 = __pyx_t_3;
8277 __Pyx_INCREF(__pyx_t_5);
8278 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8279 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_5);
8282 /* "lxml/objectify.pyx":501
8283 * cetree.delAttributeFromNsName(
8284 * element._c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil")
8285 * if python._isString(value): # <<<<<<<<<<<<<<
8286 * pytype_name = u"str"
8287 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8292 /* "lxml/objectify.pyx":505
8293 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8295 * pytype_name = _typename(value) # <<<<<<<<<<<<<<
8296 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8297 * if py_type is not None:
8300 __pyx_t_5 = __pyx_f_4lxml_9objectify__typename(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
8301 __Pyx_GOTREF(__pyx_t_5);
8302 __pyx_v_pytype_name = __pyx_t_5;
8305 /* "lxml/objectify.pyx":506
8307 * pytype_name = _typename(value)
8308 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name) # <<<<<<<<<<<<<<
8309 * if py_type is not None:
8310 * value = py_type.stringify(value)
8312 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
8313 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
8314 __PYX_ERR(0, 506, __pyx_L1_error)
8316 __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)
8317 __Pyx_GOTREF(__pyx_t_5);
8318 __pyx_t_3 = __pyx_t_5;
8319 __Pyx_INCREF(__pyx_t_3);
8320 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8321 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
8324 /* "lxml/objectify.pyx":507
8325 * pytype_name = _typename(value)
8326 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8327 * if py_type is not None: # <<<<<<<<<<<<<<
8328 * value = py_type.stringify(value)
8331 __pyx_t_1 = (((PyObject *)__pyx_v_py_type) != Py_None);
8332 __pyx_t_2 = (__pyx_t_1 != 0);
8335 /* "lxml/objectify.pyx":508
8336 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8337 * if py_type is not None:
8338 * value = py_type.stringify(value) # <<<<<<<<<<<<<<
8340 * value = unicode(value)
8342 __Pyx_INCREF(__pyx_v_py_type->stringify);
8343 __pyx_t_5 = __pyx_v_py_type->stringify; __pyx_t_6 = NULL;
8344 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8345 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8346 if (likely(__pyx_t_6)) {
8347 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8348 __Pyx_INCREF(__pyx_t_6);
8349 __Pyx_INCREF(function);
8350 __Pyx_DECREF_SET(__pyx_t_5, function);
8353 __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);
8354 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8355 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
8356 __Pyx_GOTREF(__pyx_t_3);
8357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8358 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
8361 /* "lxml/objectify.pyx":507
8362 * pytype_name = _typename(value)
8363 * py_type = <PyType>_PYTYPE_DICT.get(pytype_name)
8364 * if py_type is not None: # <<<<<<<<<<<<<<
8365 * value = py_type.stringify(value)
8371 /* "lxml/objectify.pyx":510
8372 * value = py_type.stringify(value)
8374 * value = unicode(value) # <<<<<<<<<<<<<<
8375 * if py_type is not None:
8376 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8379 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
8380 __Pyx_GOTREF(__pyx_t_3);
8381 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
8388 /* "lxml/objectify.pyx":511
8390 * value = unicode(value)
8391 * if py_type is not None: # <<<<<<<<<<<<<<
8392 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8395 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
8396 __pyx_t_1 = (__pyx_t_2 != 0);
8399 /* "lxml/objectify.pyx":512
8400 * value = unicode(value)
8401 * if py_type is not None:
8402 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name) # <<<<<<<<<<<<<<
8404 * cetree.delAttributeFromNsName(
8406 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
8407 __Pyx_GOTREF(__pyx_t_3);
8408 __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)
8409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8411 /* "lxml/objectify.pyx":511
8413 * value = unicode(value)
8414 * if py_type is not None: # <<<<<<<<<<<<<<
8415 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8421 /* "lxml/objectify.pyx":514
8422 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
8424 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
8425 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
8426 * cetree.setNodeText(element._c_node, value)
8430 /* "lxml/objectify.pyx":515
8432 * cetree.delAttributeFromNsName(
8433 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME) # <<<<<<<<<<<<<<
8434 * cetree.setNodeText(element._c_node, value)
8437 (void)(delAttributeFromNsName(__pyx_v_element->_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME));
8443 /* "lxml/objectify.pyx":516
8444 * cetree.delAttributeFromNsName(
8445 * element._c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
8446 * cetree.setNodeText(element._c_node, value) # <<<<<<<<<<<<<<
8448 * cdef _setSlice(sliceobject, _Element target, items):
8450 __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)
8452 /* "lxml/objectify.pyx":491
8453 * cetree.appendChildToElement(parent, new_element)
8455 * cdef _setElementValue(_Element element, value): # <<<<<<<<<<<<<<
8457 * cetree.setAttributeValue(
8460 /* function exit code */
8461 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8464 __Pyx_XDECREF(__pyx_t_3);
8465 __Pyx_XDECREF(__pyx_t_5);
8466 __Pyx_XDECREF(__pyx_t_6);
8467 __Pyx_AddTraceback("lxml.objectify._setElementValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
8470 __Pyx_XDECREF(__pyx_v_pytype_name);
8471 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
8472 __Pyx_XDECREF(__pyx_v_value);
8473 __Pyx_XGIVEREF(__pyx_r);
8474 __Pyx_RefNannyFinishContext();
8478 /* "lxml/objectify.pyx":518
8479 * cetree.setNodeText(element._c_node, value)
8481 * cdef _setSlice(sliceobject, _Element target, items): # <<<<<<<<<<<<<<
8482 * cdef _Element parent
8483 * cdef tree.xmlNode* c_node
8486 static PyObject *__pyx_f_4lxml_9objectify__setSlice(PyObject *__pyx_v_sliceobject, struct LxmlElement *__pyx_v_target, PyObject *__pyx_v_items) {
8487 struct LxmlElement *__pyx_v_parent = 0;
8488 xmlNode *__pyx_v_c_node;
8489 Py_ssize_t __pyx_v_c_step;
8490 Py_ssize_t __pyx_v_pos;
8491 PyObject *__pyx_v_del_items = 0;
8492 PyObject *__pyx_v_new_items = NULL;
8493 PyObject *__pyx_v_tag = NULL;
8494 PyObject *__pyx_v_item = NULL;
8495 struct LxmlElement *__pyx_v_new_element = NULL;
8496 PyObject *__pyx_v_replace = NULL;
8497 PyObject *__pyx_v_remove = NULL;
8498 PyObject *__pyx_v_add = NULL;
8499 PyObject *__pyx_r = NULL;
8500 __Pyx_RefNannyDeclarations
8503 Py_ssize_t __pyx_t_3;
8504 PyObject *__pyx_t_4 = NULL;
8505 PyObject *(*__pyx_t_5)(PyObject *);
8506 PyObject *__pyx_t_6 = NULL;
8507 PyObject *__pyx_t_7 = NULL;
8509 Py_ssize_t __pyx_t_9;
8511 PyObject *__pyx_t_11 = NULL;
8512 PyObject *__pyx_t_12 = NULL;
8514 PyObject *__pyx_t_14 = NULL;
8515 xmlNode *__pyx_t_15;
8516 int __pyx_lineno = 0;
8517 const char *__pyx_filename = NULL;
8518 int __pyx_clineno = 0;
8519 __Pyx_RefNannySetupContext("_setSlice", 0);
8521 /* "lxml/objectify.pyx":523
8522 * cdef Py_ssize_t c_step, c_start, pos
8523 * # collect existing slice
8524 * if (<slice>sliceobject).step is None: # <<<<<<<<<<<<<<
8528 __pyx_t_1 = (((PySliceObject*)((PyObject*)__pyx_v_sliceobject))->step == Py_None);
8529 __pyx_t_2 = (__pyx_t_1 != 0);
8532 /* "lxml/objectify.pyx":524
8533 * # collect existing slice
8534 * if (<slice>sliceobject).step is None:
8535 * c_step = 1 # <<<<<<<<<<<<<<
8537 * c_step = (<slice>sliceobject).step
8541 /* "lxml/objectify.pyx":523
8542 * cdef Py_ssize_t c_step, c_start, pos
8543 * # collect existing slice
8544 * if (<slice>sliceobject).step is None: # <<<<<<<<<<<<<<
8551 /* "lxml/objectify.pyx":526
8554 * c_step = (<slice>sliceobject).step # <<<<<<<<<<<<<<
8556 * raise ValueError, u"Invalid slice"
8559 __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)
8560 __pyx_v_c_step = __pyx_t_3;
8564 /* "lxml/objectify.pyx":527
8566 * c_step = (<slice>sliceobject).step
8567 * if c_step == 0: # <<<<<<<<<<<<<<
8568 * raise ValueError, u"Invalid slice"
8569 * cdef list del_items = target[sliceobject]
8571 __pyx_t_2 = ((__pyx_v_c_step == 0) != 0);
8572 if (unlikely(__pyx_t_2)) {
8574 /* "lxml/objectify.pyx":528
8575 * c_step = (<slice>sliceobject).step
8577 * raise ValueError, u"Invalid slice" # <<<<<<<<<<<<<<
8578 * cdef list del_items = target[sliceobject]
8581 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Invalid_slice, 0, 0);
8582 __PYX_ERR(0, 528, __pyx_L1_error)
8584 /* "lxml/objectify.pyx":527
8586 * c_step = (<slice>sliceobject).step
8587 * if c_step == 0: # <<<<<<<<<<<<<<
8588 * raise ValueError, u"Invalid slice"
8589 * cdef list del_items = target[sliceobject]
8593 /* "lxml/objectify.pyx":529
8595 * raise ValueError, u"Invalid slice"
8596 * cdef list del_items = target[sliceobject] # <<<<<<<<<<<<<<
8598 * # collect new values
8600 __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)
8601 __Pyx_GOTREF(__pyx_t_4);
8602 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)
8603 __pyx_v_del_items = ((PyObject*)__pyx_t_4);
8606 /* "lxml/objectify.pyx":532
8608 * # collect new values
8609 * new_items = [] # <<<<<<<<<<<<<<
8611 * for item in items:
8613 __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
8614 __Pyx_GOTREF(__pyx_t_4);
8615 __pyx_v_new_items = ((PyObject*)__pyx_t_4);
8618 /* "lxml/objectify.pyx":533
8619 * # collect new values
8621 * tag = target.tag # <<<<<<<<<<<<<<
8622 * for item in items:
8623 * if isinstance(item, _Element):
8625 __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)
8626 __Pyx_GOTREF(__pyx_t_4);
8627 __pyx_v_tag = __pyx_t_4;
8630 /* "lxml/objectify.pyx":534
8633 * for item in items: # <<<<<<<<<<<<<<
8634 * if isinstance(item, _Element):
8635 * # deep copy the new element
8637 if (likely(PyList_CheckExact(__pyx_v_items)) || PyTuple_CheckExact(__pyx_v_items)) {
8638 __pyx_t_4 = __pyx_v_items; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = 0;
8641 __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
8642 __Pyx_GOTREF(__pyx_t_4);
8643 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
8646 if (likely(!__pyx_t_5)) {
8647 if (likely(PyList_CheckExact(__pyx_t_4))) {
8648 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
8649 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8650 __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)
8652 __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)
8653 __Pyx_GOTREF(__pyx_t_6);
8656 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
8657 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8658 __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)
8660 __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)
8661 __Pyx_GOTREF(__pyx_t_6);
8665 __pyx_t_6 = __pyx_t_5(__pyx_t_4);
8666 if (unlikely(!__pyx_t_6)) {
8667 PyObject* exc_type = PyErr_Occurred();
8669 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8670 else __PYX_ERR(0, 534, __pyx_L1_error)
8674 __Pyx_GOTREF(__pyx_t_6);
8676 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
8679 /* "lxml/objectify.pyx":535
8681 * for item in items:
8682 * if isinstance(item, _Element): # <<<<<<<<<<<<<<
8683 * # deep copy the new element
8684 * new_element = cetree.deepcopyNodeToDocument(
8686 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_item, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
8687 __pyx_t_1 = (__pyx_t_2 != 0);
8690 /* "lxml/objectify.pyx":538
8691 * # deep copy the new element
8692 * new_element = cetree.deepcopyNodeToDocument(
8693 * target._doc, (<_Element>item)._c_node) # <<<<<<<<<<<<<<
8694 * new_element.tag = tag
8697 __pyx_t_6 = ((PyObject *)__pyx_v_target->_doc);
8698 __Pyx_INCREF(__pyx_t_6);
8700 /* "lxml/objectify.pyx":537
8701 * if isinstance(item, _Element):
8702 * # deep copy the new element
8703 * new_element = cetree.deepcopyNodeToDocument( # <<<<<<<<<<<<<<
8704 * target._doc, (<_Element>item)._c_node)
8705 * new_element.tag = tag
8707 __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)
8708 __Pyx_GOTREF(__pyx_t_7);
8709 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8710 __Pyx_XDECREF_SET(__pyx_v_new_element, ((struct LxmlElement *)__pyx_t_7));
8713 /* "lxml/objectify.pyx":539
8714 * new_element = cetree.deepcopyNodeToDocument(
8715 * target._doc, (<_Element>item)._c_node)
8716 * new_element.tag = tag # <<<<<<<<<<<<<<
8718 * new_element = cetree.makeElement(
8720 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_new_element), __pyx_n_s_tag, __pyx_v_tag) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
8722 /* "lxml/objectify.pyx":535
8724 * for item in items:
8725 * if isinstance(item, _Element): # <<<<<<<<<<<<<<
8726 * # deep copy the new element
8727 * new_element = cetree.deepcopyNodeToDocument(
8732 /* "lxml/objectify.pyx":541
8733 * new_element.tag = tag
8735 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8736 * tag, target._doc, None, None, None, None, None)
8737 * _setElementValue(new_element, item)
8741 /* "lxml/objectify.pyx":542
8743 * new_element = cetree.makeElement(
8744 * tag, target._doc, None, None, None, None, None) # <<<<<<<<<<<<<<
8745 * _setElementValue(new_element, item)
8746 * new_items.append(new_element)
8748 __pyx_t_7 = ((PyObject *)__pyx_v_target->_doc);
8749 __Pyx_INCREF(__pyx_t_7);
8751 /* "lxml/objectify.pyx":541
8752 * new_element.tag = tag
8754 * new_element = cetree.makeElement( # <<<<<<<<<<<<<<
8755 * tag, target._doc, None, None, None, None, None)
8756 * _setElementValue(new_element, item)
8758 __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)
8759 __Pyx_GOTREF(__pyx_t_6);
8760 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8761 __Pyx_XDECREF_SET(__pyx_v_new_element, ((struct LxmlElement *)__pyx_t_6));
8764 /* "lxml/objectify.pyx":543
8765 * new_element = cetree.makeElement(
8766 * tag, target._doc, None, None, None, None, None)
8767 * _setElementValue(new_element, item) # <<<<<<<<<<<<<<
8768 * new_items.append(new_element)
8771 __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)
8772 __Pyx_GOTREF(__pyx_t_6);
8773 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8777 /* "lxml/objectify.pyx":544
8778 * tag, target._doc, None, None, None, None, None)
8779 * _setElementValue(new_element, item)
8780 * new_items.append(new_element) # <<<<<<<<<<<<<<
8782 * # sanity check - raise what a list would raise
8784 __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)
8786 /* "lxml/objectify.pyx":534
8789 * for item in items: # <<<<<<<<<<<<<<
8790 * if isinstance(item, _Element):
8791 * # deep copy the new element
8794 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8796 /* "lxml/objectify.pyx":547
8798 * # sanity check - raise what a list would raise
8799 * if c_step != 1 and len(del_items) != len(new_items): # <<<<<<<<<<<<<<
8800 * raise ValueError, \
8801 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}"
8803 __pyx_t_2 = ((__pyx_v_c_step != 1) != 0);
8806 __pyx_t_1 = __pyx_t_2;
8807 goto __pyx_L9_bool_binop_done;
8809 if (unlikely(__pyx_v_del_items == Py_None)) {
8810 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8811 __PYX_ERR(0, 547, __pyx_L1_error)
8813 __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)
8814 __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)
8815 __pyx_t_2 = ((__pyx_t_3 != __pyx_t_9) != 0);
8816 __pyx_t_1 = __pyx_t_2;
8817 __pyx_L9_bool_binop_done:;
8818 if (unlikely(__pyx_t_1)) {
8820 /* "lxml/objectify.pyx":549
8821 * if c_step != 1 and len(del_items) != len(new_items):
8822 * raise ValueError, \
8823 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}" # <<<<<<<<<<<<<<
8825 * # replace existing items
8827 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
8828 __Pyx_GOTREF(__pyx_t_4);
8831 __Pyx_INCREF(__pyx_kp_u_attempt_to_assign_sequence_of_si);
8833 __Pyx_GIVEREF(__pyx_kp_u_attempt_to_assign_sequence_of_si);
8834 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_attempt_to_assign_sequence_of_si);
8835 __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)
8836 __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)
8837 __Pyx_GOTREF(__pyx_t_6);
8838 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
8839 __Pyx_GIVEREF(__pyx_t_6);
8840 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
8842 __Pyx_INCREF(__pyx_kp_u_to_extended_slice_of_size);
8844 __Pyx_GIVEREF(__pyx_kp_u_to_extended_slice_of_size);
8845 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_to_extended_slice_of_size);
8846 if (unlikely(__pyx_v_del_items == Py_None)) {
8847 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8848 __PYX_ERR(0, 549, __pyx_L1_error)
8850 __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)
8851 __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)
8852 __Pyx_GOTREF(__pyx_t_6);
8853 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
8854 __Pyx_GIVEREF(__pyx_t_6);
8855 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_6);
8857 __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)
8858 __Pyx_GOTREF(__pyx_t_6);
8859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8860 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
8861 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8862 __PYX_ERR(0, 548, __pyx_L1_error)
8864 /* "lxml/objectify.pyx":547
8866 * # sanity check - raise what a list would raise
8867 * if c_step != 1 and len(del_items) != len(new_items): # <<<<<<<<<<<<<<
8868 * raise ValueError, \
8869 * f"attempt to assign sequence of size {len(new_items)} to extended slice of size {len(del_items)}"
8873 /* "lxml/objectify.pyx":552
8875 * # replace existing items
8876 * pos = 0 # <<<<<<<<<<<<<<
8877 * parent = target.getparent()
8878 * replace = parent.replace
8882 /* "lxml/objectify.pyx":553
8883 * # replace existing items
8885 * parent = target.getparent() # <<<<<<<<<<<<<<
8886 * replace = parent.replace
8887 * while pos < len(new_items) and pos < len(del_items):
8889 __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)
8890 __Pyx_GOTREF(__pyx_t_4);
8892 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8893 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
8894 if (likely(__pyx_t_7)) {
8895 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8896 __Pyx_INCREF(__pyx_t_7);
8897 __Pyx_INCREF(function);
8898 __Pyx_DECREF_SET(__pyx_t_4, function);
8901 __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8902 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8903 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
8904 __Pyx_GOTREF(__pyx_t_6);
8905 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8906 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)
8907 __pyx_v_parent = ((struct LxmlElement *)__pyx_t_6);
8910 /* "lxml/objectify.pyx":554
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])
8917 __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)
8918 __Pyx_GOTREF(__pyx_t_6);
8919 __pyx_v_replace = __pyx_t_6;
8922 /* "lxml/objectify.pyx":555
8923 * parent = target.getparent()
8924 * replace = parent.replace
8925 * while pos < len(new_items) and pos < len(del_items): # <<<<<<<<<<<<<<
8926 * replace(del_items[pos], new_items[pos])
8930 __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)
8931 __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
8934 __pyx_t_1 = __pyx_t_2;
8935 goto __pyx_L13_bool_binop_done;
8937 if (unlikely(__pyx_v_del_items == Py_None)) {
8938 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8939 __PYX_ERR(0, 555, __pyx_L1_error)
8941 __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)
8942 __pyx_t_2 = ((__pyx_v_pos < __pyx_t_9) != 0);
8943 __pyx_t_1 = __pyx_t_2;
8944 __pyx_L13_bool_binop_done:;
8945 if (!__pyx_t_1) break;
8947 /* "lxml/objectify.pyx":556
8948 * replace = parent.replace
8949 * while pos < len(new_items) and pos < len(del_items):
8950 * replace(del_items[pos], new_items[pos]) # <<<<<<<<<<<<<<
8952 * # remove leftover items
8954 if (unlikely(__pyx_v_del_items == Py_None)) {
8955 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8956 __PYX_ERR(0, 556, __pyx_L1_error)
8958 __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)
8959 __Pyx_GOTREF(__pyx_t_4);
8960 __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)
8961 __Pyx_GOTREF(__pyx_t_7);
8962 __Pyx_INCREF(__pyx_v_replace);
8963 __pyx_t_11 = __pyx_v_replace; __pyx_t_12 = NULL;
8965 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
8966 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
8967 if (likely(__pyx_t_12)) {
8968 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
8969 __Pyx_INCREF(__pyx_t_12);
8970 __Pyx_INCREF(function);
8971 __Pyx_DECREF_SET(__pyx_t_11, function);
8975 #if CYTHON_FAST_PYCALL
8976 if (PyFunction_Check(__pyx_t_11)) {
8977 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
8978 __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)
8979 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8980 __Pyx_GOTREF(__pyx_t_6);
8981 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8982 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8985 #if CYTHON_FAST_PYCCALL
8986 if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
8987 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_4, __pyx_t_7};
8988 __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)
8989 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8990 __Pyx_GOTREF(__pyx_t_6);
8991 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8992 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8996 __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 556, __pyx_L1_error)
8997 __Pyx_GOTREF(__pyx_t_14);
8999 __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
9001 __Pyx_GIVEREF(__pyx_t_4);
9002 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_4);
9003 __Pyx_GIVEREF(__pyx_t_7);
9004 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_7);
9007 __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)
9008 __Pyx_GOTREF(__pyx_t_6);
9009 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9011 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9012 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9014 /* "lxml/objectify.pyx":557
9015 * while pos < len(new_items) and pos < len(del_items):
9016 * replace(del_items[pos], new_items[pos])
9017 * pos += 1 # <<<<<<<<<<<<<<
9018 * # remove leftover items
9019 * if pos < len(del_items):
9021 __pyx_v_pos = (__pyx_v_pos + 1);
9024 /* "lxml/objectify.pyx":559
9026 * # remove leftover items
9027 * if pos < len(del_items): # <<<<<<<<<<<<<<
9028 * remove = parent.remove
9029 * while pos < len(del_items):
9031 if (unlikely(__pyx_v_del_items == Py_None)) {
9032 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9033 __PYX_ERR(0, 559, __pyx_L1_error)
9035 __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)
9036 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9039 /* "lxml/objectify.pyx":560
9040 * # remove leftover items
9041 * if pos < len(del_items):
9042 * remove = parent.remove # <<<<<<<<<<<<<<
9043 * while pos < len(del_items):
9044 * remove(del_items[pos])
9046 __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)
9047 __Pyx_GOTREF(__pyx_t_6);
9048 __pyx_v_remove = __pyx_t_6;
9051 /* "lxml/objectify.pyx":561
9052 * if pos < len(del_items):
9053 * remove = parent.remove
9054 * while pos < len(del_items): # <<<<<<<<<<<<<<
9055 * remove(del_items[pos])
9059 if (unlikely(__pyx_v_del_items == Py_None)) {
9060 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9061 __PYX_ERR(0, 561, __pyx_L1_error)
9063 __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)
9064 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9065 if (!__pyx_t_1) break;
9067 /* "lxml/objectify.pyx":562
9068 * remove = parent.remove
9069 * while pos < len(del_items):
9070 * remove(del_items[pos]) # <<<<<<<<<<<<<<
9072 * # append remaining new items
9074 if (unlikely(__pyx_v_del_items == Py_None)) {
9075 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
9076 __PYX_ERR(0, 562, __pyx_L1_error)
9078 __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)
9079 __Pyx_GOTREF(__pyx_t_11);
9080 __Pyx_INCREF(__pyx_v_remove);
9081 __pyx_t_14 = __pyx_v_remove; __pyx_t_7 = NULL;
9082 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
9083 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
9084 if (likely(__pyx_t_7)) {
9085 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
9086 __Pyx_INCREF(__pyx_t_7);
9087 __Pyx_INCREF(function);
9088 __Pyx_DECREF_SET(__pyx_t_14, function);
9091 __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);
9092 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9093 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9094 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error)
9095 __Pyx_GOTREF(__pyx_t_6);
9096 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9097 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9099 /* "lxml/objectify.pyx":563
9100 * while pos < len(del_items):
9101 * remove(del_items[pos])
9102 * pos += 1 # <<<<<<<<<<<<<<
9103 * # append remaining new items
9104 * if pos < len(new_items):
9106 __pyx_v_pos = (__pyx_v_pos + 1);
9109 /* "lxml/objectify.pyx":559
9111 * # remove leftover items
9112 * if pos < len(del_items): # <<<<<<<<<<<<<<
9113 * remove = parent.remove
9114 * while pos < len(del_items):
9118 /* "lxml/objectify.pyx":565
9120 * # append remaining new items
9121 * if pos < len(new_items): # <<<<<<<<<<<<<<
9122 * # the sanity check above guarantees (step == 1)
9125 __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)
9126 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9129 /* "lxml/objectify.pyx":567
9130 * if pos < len(new_items):
9131 * # the sanity check above guarantees (step == 1)
9132 * if pos > 0: # <<<<<<<<<<<<<<
9133 * item = new_items[pos-1]
9136 __pyx_t_1 = ((__pyx_v_pos > 0) != 0);
9139 /* "lxml/objectify.pyx":568
9140 * # the sanity check above guarantees (step == 1)
9142 * item = new_items[pos-1] # <<<<<<<<<<<<<<
9144 * if (<slice>sliceobject).start > 0:
9146 __pyx_t_9 = (__pyx_v_pos - 1);
9147 __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)
9148 __Pyx_GOTREF(__pyx_t_6);
9149 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
9152 /* "lxml/objectify.pyx":567
9153 * if pos < len(new_items):
9154 * # the sanity check above guarantees (step == 1)
9155 * if pos > 0: # <<<<<<<<<<<<<<
9156 * item = new_items[pos-1]
9162 /* "lxml/objectify.pyx":570
9163 * item = new_items[pos-1]
9165 * if (<slice>sliceobject).start > 0: # <<<<<<<<<<<<<<
9166 * c_node = parent._c_node.children
9170 __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)
9171 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
9172 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9175 /* "lxml/objectify.pyx":571
9177 * if (<slice>sliceobject).start > 0:
9178 * c_node = parent._c_node.children # <<<<<<<<<<<<<<
9180 * c_node = parent._c_node.last
9182 __pyx_t_15 = __pyx_v_parent->_c_node->children;
9183 __pyx_v_c_node = __pyx_t_15;
9185 /* "lxml/objectify.pyx":570
9186 * item = new_items[pos-1]
9188 * if (<slice>sliceobject).start > 0: # <<<<<<<<<<<<<<
9189 * c_node = parent._c_node.children
9195 /* "lxml/objectify.pyx":573
9196 * c_node = parent._c_node.children
9198 * c_node = parent._c_node.last # <<<<<<<<<<<<<<
9199 * c_node = _findFollowingSibling(
9200 * c_node, tree._getNs(target._c_node), target._c_node.name,
9203 __pyx_t_15 = __pyx_v_parent->_c_node->last;
9204 __pyx_v_c_node = __pyx_t_15;
9208 /* "lxml/objectify.pyx":576
9209 * c_node = _findFollowingSibling(
9210 * c_node, tree._getNs(target._c_node), target._c_node.name,
9211 * (<slice>sliceobject).start - 1) # <<<<<<<<<<<<<<
9212 * if c_node is NULL:
9213 * while pos < len(new_items):
9215 __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)
9216 __Pyx_GOTREF(__pyx_t_6);
9217 __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)
9218 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9220 /* "lxml/objectify.pyx":574
9222 * c_node = parent._c_node.last
9223 * c_node = _findFollowingSibling( # <<<<<<<<<<<<<<
9224 * c_node, tree._getNs(target._c_node), target._c_node.name,
9225 * (<slice>sliceobject).start - 1)
9227 __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);
9229 /* "lxml/objectify.pyx":577
9230 * c_node, tree._getNs(target._c_node), target._c_node.name,
9231 * (<slice>sliceobject).start - 1)
9232 * if c_node is NULL: # <<<<<<<<<<<<<<
9233 * while pos < len(new_items):
9234 * cetree.appendChildToElement(parent, new_items[pos])
9236 __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
9239 /* "lxml/objectify.pyx":578
9240 * (<slice>sliceobject).start - 1)
9241 * if c_node is NULL:
9242 * while pos < len(new_items): # <<<<<<<<<<<<<<
9243 * cetree.appendChildToElement(parent, new_items[pos])
9247 __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)
9248 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9249 if (!__pyx_t_1) break;
9251 /* "lxml/objectify.pyx":579
9252 * if c_node is NULL:
9253 * while pos < len(new_items):
9254 * cetree.appendChildToElement(parent, new_items[pos]) # <<<<<<<<<<<<<<
9258 __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)
9259 __Pyx_GOTREF(__pyx_t_6);
9260 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)
9261 __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)
9262 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9264 /* "lxml/objectify.pyx":580
9265 * while pos < len(new_items):
9266 * cetree.appendChildToElement(parent, new_items[pos])
9267 * pos += 1 # <<<<<<<<<<<<<<
9269 * item = cetree.elementFactory(parent._doc, c_node)
9271 __pyx_v_pos = (__pyx_v_pos + 1);
9274 /* "lxml/objectify.pyx":581
9275 * cetree.appendChildToElement(parent, new_items[pos])
9277 * return # <<<<<<<<<<<<<<
9278 * item = cetree.elementFactory(parent._doc, c_node)
9279 * while pos < len(new_items):
9281 __Pyx_XDECREF(__pyx_r);
9282 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9285 /* "lxml/objectify.pyx":577
9286 * c_node, tree._getNs(target._c_node), target._c_node.name,
9287 * (<slice>sliceobject).start - 1)
9288 * if c_node is NULL: # <<<<<<<<<<<<<<
9289 * while pos < len(new_items):
9290 * cetree.appendChildToElement(parent, new_items[pos])
9294 /* "lxml/objectify.pyx":582
9297 * item = cetree.elementFactory(parent._doc, c_node) # <<<<<<<<<<<<<<
9298 * while pos < len(new_items):
9299 * add = item.addnext
9301 __pyx_t_6 = ((PyObject *)__pyx_v_parent->_doc);
9302 __Pyx_INCREF(__pyx_t_6);
9303 __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)
9304 __Pyx_GOTREF(__pyx_t_14);
9305 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9306 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_14);
9311 /* "lxml/objectify.pyx":583
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_9 = PyList_GET_SIZE(__pyx_v_new_items); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 583, __pyx_L1_error)
9320 __pyx_t_1 = ((__pyx_v_pos < __pyx_t_9) != 0);
9321 if (!__pyx_t_1) break;
9323 /* "lxml/objectify.pyx":584
9324 * item = cetree.elementFactory(parent._doc, c_node)
9325 * while pos < len(new_items):
9326 * add = item.addnext # <<<<<<<<<<<<<<
9327 * item = new_items[pos]
9330 __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)
9331 __Pyx_GOTREF(__pyx_t_14);
9332 __Pyx_XDECREF_SET(__pyx_v_add, __pyx_t_14);
9335 /* "lxml/objectify.pyx":585
9336 * while pos < len(new_items):
9337 * add = item.addnext
9338 * item = new_items[pos] # <<<<<<<<<<<<<<
9342 __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)
9343 __Pyx_GOTREF(__pyx_t_14);
9344 __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_14);
9347 /* "lxml/objectify.pyx":586
9348 * add = item.addnext
9349 * item = new_items[pos]
9350 * add(item) # <<<<<<<<<<<<<<
9354 __Pyx_INCREF(__pyx_v_add);
9355 __pyx_t_6 = __pyx_v_add; __pyx_t_11 = NULL;
9356 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
9357 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
9358 if (likely(__pyx_t_11)) {
9359 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9360 __Pyx_INCREF(__pyx_t_11);
9361 __Pyx_INCREF(function);
9362 __Pyx_DECREF_SET(__pyx_t_6, function);
9365 __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);
9366 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
9367 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 586, __pyx_L1_error)
9368 __Pyx_GOTREF(__pyx_t_14);
9369 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9370 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
9372 /* "lxml/objectify.pyx":587
9373 * item = new_items[pos]
9375 * pos += 1 # <<<<<<<<<<<<<<
9377 * ################################################################################
9379 __pyx_v_pos = (__pyx_v_pos + 1);
9382 /* "lxml/objectify.pyx":565
9384 * # append remaining new items
9385 * if pos < len(new_items): # <<<<<<<<<<<<<<
9386 * # the sanity check above guarantees (step == 1)
9391 /* "lxml/objectify.pyx":518
9392 * cetree.setNodeText(element._c_node, value)
9394 * cdef _setSlice(sliceobject, _Element target, items): # <<<<<<<<<<<<<<
9395 * cdef _Element parent
9396 * cdef tree.xmlNode* c_node
9399 /* function exit code */
9400 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9403 __Pyx_XDECREF(__pyx_t_4);
9404 __Pyx_XDECREF(__pyx_t_6);
9405 __Pyx_XDECREF(__pyx_t_7);
9406 __Pyx_XDECREF(__pyx_t_11);
9407 __Pyx_XDECREF(__pyx_t_12);
9408 __Pyx_XDECREF(__pyx_t_14);
9409 __Pyx_AddTraceback("lxml.objectify._setSlice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9412 __Pyx_XDECREF((PyObject *)__pyx_v_parent);
9413 __Pyx_XDECREF(__pyx_v_del_items);
9414 __Pyx_XDECREF(__pyx_v_new_items);
9415 __Pyx_XDECREF(__pyx_v_tag);
9416 __Pyx_XDECREF(__pyx_v_item);
9417 __Pyx_XDECREF((PyObject *)__pyx_v_new_element);
9418 __Pyx_XDECREF(__pyx_v_replace);
9419 __Pyx_XDECREF(__pyx_v_remove);
9420 __Pyx_XDECREF(__pyx_v_add);
9421 __Pyx_XGIVEREF(__pyx_r);
9422 __Pyx_RefNannyFinishContext();
9426 /* "lxml/objectify.pyx":597
9429 * def pyval(self): # <<<<<<<<<<<<<<
9430 * return textOf(self._c_node)
9434 /* Python wrapper */
9435 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
9436 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(PyObject *__pyx_v_self) {
9437 PyObject *__pyx_r = 0;
9438 __Pyx_RefNannyDeclarations
9439 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9440 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9442 /* function exit code */
9443 __Pyx_RefNannyFinishContext();
9447 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9448 PyObject *__pyx_r = NULL;
9449 __Pyx_RefNannyDeclarations
9450 PyObject *__pyx_t_1 = NULL;
9451 int __pyx_lineno = 0;
9452 const char *__pyx_filename = NULL;
9453 int __pyx_clineno = 0;
9454 __Pyx_RefNannySetupContext("__get__", 0);
9456 /* "lxml/objectify.pyx":598
9459 * return textOf(self._c_node) # <<<<<<<<<<<<<<
9461 * def __str__(self):
9463 __Pyx_XDECREF(__pyx_r);
9464 __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)
9465 __Pyx_GOTREF(__pyx_t_1);
9466 __pyx_r = __pyx_t_1;
9470 /* "lxml/objectify.pyx":597
9473 * def pyval(self): # <<<<<<<<<<<<<<
9474 * return textOf(self._c_node)
9478 /* function exit code */
9480 __Pyx_XDECREF(__pyx_t_1);
9481 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9484 __Pyx_XGIVEREF(__pyx_r);
9485 __Pyx_RefNannyFinishContext();
9489 /* "lxml/objectify.pyx":600
9490 * return textOf(self._c_node)
9492 * def __str__(self): # <<<<<<<<<<<<<<
9493 * return textOf(self._c_node) or ''
9497 /* Python wrapper */
9498 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__(PyObject *__pyx_v_self); /*proto*/
9499 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__(PyObject *__pyx_v_self) {
9500 PyObject *__pyx_r = 0;
9501 __Pyx_RefNannyDeclarations
9502 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
9503 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9505 /* function exit code */
9506 __Pyx_RefNannyFinishContext();
9510 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement___str__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9511 PyObject *__pyx_r = NULL;
9512 __Pyx_RefNannyDeclarations
9513 PyObject *__pyx_t_1 = NULL;
9514 PyObject *__pyx_t_2 = NULL;
9516 int __pyx_lineno = 0;
9517 const char *__pyx_filename = NULL;
9518 int __pyx_clineno = 0;
9519 __Pyx_RefNannySetupContext("__str__", 0);
9521 /* "lxml/objectify.pyx":601
9523 * def __str__(self):
9524 * return textOf(self._c_node) or '' # <<<<<<<<<<<<<<
9526 * def __repr__(self):
9528 __Pyx_XDECREF(__pyx_r);
9529 __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)
9530 __Pyx_GOTREF(__pyx_t_2);
9531 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
9533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9535 __Pyx_INCREF(__pyx_t_2);
9536 __pyx_t_1 = __pyx_t_2;
9537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9538 goto __pyx_L3_bool_binop_done;
9540 __Pyx_INCREF(__pyx_kp_s_);
9541 __pyx_t_1 = __pyx_kp_s_;
9542 __pyx_L3_bool_binop_done:;
9543 __pyx_r = __pyx_t_1;
9547 /* "lxml/objectify.pyx":600
9548 * return textOf(self._c_node)
9550 * def __str__(self): # <<<<<<<<<<<<<<
9551 * return textOf(self._c_node) or ''
9555 /* function exit code */
9557 __Pyx_XDECREF(__pyx_t_1);
9558 __Pyx_XDECREF(__pyx_t_2);
9559 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9562 __Pyx_XGIVEREF(__pyx_r);
9563 __Pyx_RefNannyFinishContext();
9567 /* "lxml/objectify.pyx":603
9568 * return textOf(self._c_node) or ''
9570 * def __repr__(self): # <<<<<<<<<<<<<<
9571 * return strrepr(textOf(self._c_node) or '')
9575 /* Python wrapper */
9576 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__(PyObject *__pyx_v_self); /*proto*/
9577 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__(PyObject *__pyx_v_self) {
9578 PyObject *__pyx_r = 0;
9579 __Pyx_RefNannyDeclarations
9580 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9581 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self));
9583 /* function exit code */
9584 __Pyx_RefNannyFinishContext();
9588 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_2__repr__(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self) {
9589 PyObject *__pyx_r = NULL;
9590 __Pyx_RefNannyDeclarations
9591 PyObject *__pyx_t_1 = NULL;
9592 PyObject *__pyx_t_2 = NULL;
9594 int __pyx_lineno = 0;
9595 const char *__pyx_filename = NULL;
9596 int __pyx_clineno = 0;
9597 __Pyx_RefNannySetupContext("__repr__", 0);
9599 /* "lxml/objectify.pyx":604
9601 * def __repr__(self):
9602 * return strrepr(textOf(self._c_node) or '') # <<<<<<<<<<<<<<
9604 * def _setText(self, s):
9606 __Pyx_XDECREF(__pyx_r);
9607 __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)
9608 __Pyx_GOTREF(__pyx_t_2);
9609 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 604, __pyx_L1_error)
9611 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9613 __Pyx_INCREF(__pyx_t_2);
9614 __pyx_t_1 = __pyx_t_2;
9615 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9616 goto __pyx_L3_bool_binop_done;
9618 __Pyx_INCREF(__pyx_kp_s_);
9619 __pyx_t_1 = __pyx_kp_s_;
9620 __pyx_L3_bool_binop_done:;
9621 __pyx_t_2 = __pyx_f_4lxml_9objectify_strrepr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error)
9622 __Pyx_GOTREF(__pyx_t_2);
9623 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9624 __pyx_r = __pyx_t_2;
9628 /* "lxml/objectify.pyx":603
9629 * return textOf(self._c_node) or ''
9631 * def __repr__(self): # <<<<<<<<<<<<<<
9632 * return strrepr(textOf(self._c_node) or '')
9636 /* function exit code */
9638 __Pyx_XDECREF(__pyx_t_1);
9639 __Pyx_XDECREF(__pyx_t_2);
9640 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9643 __Pyx_XGIVEREF(__pyx_r);
9644 __Pyx_RefNannyFinishContext();
9648 /* "lxml/objectify.pyx":606
9649 * return strrepr(textOf(self._c_node) or '')
9651 * def _setText(self, s): # <<<<<<<<<<<<<<
9652 * u"""For use in subclasses only. Don't use unless you know what you are
9656 /* Python wrapper */
9657 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText(PyObject *__pyx_v_self, PyObject *__pyx_v_s); /*proto*/
9658 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 ";
9659 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};
9660 static PyObject *__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText(PyObject *__pyx_v_self, PyObject *__pyx_v_s) {
9661 PyObject *__pyx_r = 0;
9662 __Pyx_RefNannyDeclarations
9663 __Pyx_RefNannySetupContext("_setText (wrapper)", 0);
9664 __pyx_r = __pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(((struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *)__pyx_v_self), ((PyObject *)__pyx_v_s));
9666 /* function exit code */
9667 __Pyx_RefNannyFinishContext();
9671 static PyObject *__pyx_pf_4lxml_9objectify_22ObjectifiedDataElement_4_setText(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement *__pyx_v_self, PyObject *__pyx_v_s) {
9672 PyObject *__pyx_r = NULL;
9673 __Pyx_RefNannyDeclarations
9675 int __pyx_lineno = 0;
9676 const char *__pyx_filename = NULL;
9677 int __pyx_clineno = 0;
9678 __Pyx_RefNannySetupContext("_setText", 0);
9680 /* "lxml/objectify.pyx":610
9683 * cetree.setNodeText(self._c_node, s) # <<<<<<<<<<<<<<
9685 * cdef class NumberElement(ObjectifiedDataElement):
9687 __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)
9689 /* "lxml/objectify.pyx":606
9690 * return strrepr(textOf(self._c_node) or '')
9692 * def _setText(self, s): # <<<<<<<<<<<<<<
9693 * u"""For use in subclasses only. Don't use unless you know what you are
9697 /* function exit code */
9698 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9701 __Pyx_AddTraceback("lxml.objectify.ObjectifiedDataElement._setText", __pyx_clineno, __pyx_lineno, __pyx_filename);
9704 __Pyx_XGIVEREF(__pyx_r);
9705 __Pyx_RefNannyFinishContext();
9709 /* "lxml/objectify.pyx":614
9710 * cdef class NumberElement(ObjectifiedDataElement):
9711 * cdef object _parse_value
9712 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
9713 * u"""Set the function that parses the Python value from a string.
9717 /* Python wrapper */
9718 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser(PyObject *__pyx_v_self, PyObject *__pyx_v_function); /*proto*/
9719 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 ";
9720 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};
9721 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser(PyObject *__pyx_v_self, PyObject *__pyx_v_function) {
9722 PyObject *__pyx_r = 0;
9723 __Pyx_RefNannyDeclarations
9724 __Pyx_RefNannySetupContext("_setValueParser (wrapper)", 0);
9725 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self), ((PyObject *)__pyx_v_function));
9727 /* function exit code */
9728 __Pyx_RefNannyFinishContext();
9732 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement__setValueParser(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self, PyObject *__pyx_v_function) {
9733 PyObject *__pyx_r = NULL;
9734 __Pyx_RefNannyDeclarations
9735 __Pyx_RefNannySetupContext("_setValueParser", 0);
9737 /* "lxml/objectify.pyx":619
9738 * Do not use this unless you know what you are doing.
9740 * self._parse_value = function # <<<<<<<<<<<<<<
9744 __Pyx_INCREF(__pyx_v_function);
9745 __Pyx_GIVEREF(__pyx_v_function);
9746 __Pyx_GOTREF(__pyx_v_self->_parse_value);
9747 __Pyx_DECREF(__pyx_v_self->_parse_value);
9748 __pyx_v_self->_parse_value = __pyx_v_function;
9750 /* "lxml/objectify.pyx":614
9751 * cdef class NumberElement(ObjectifiedDataElement):
9752 * cdef object _parse_value
9753 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
9754 * u"""Set the function that parses the Python value from a string.
9758 /* function exit code */
9759 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9760 __Pyx_XGIVEREF(__pyx_r);
9761 __Pyx_RefNannyFinishContext();
9765 /* "lxml/objectify.pyx":622
9768 * def pyval(self): # <<<<<<<<<<<<<<
9769 * return _parseNumber(self)
9773 /* Python wrapper */
9774 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
9775 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(PyObject *__pyx_v_self) {
9776 PyObject *__pyx_r = 0;
9777 __Pyx_RefNannyDeclarations
9778 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9779 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9781 /* function exit code */
9782 __Pyx_RefNannyFinishContext();
9786 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9787 PyObject *__pyx_r = NULL;
9788 __Pyx_RefNannyDeclarations
9789 PyObject *__pyx_t_1 = NULL;
9790 int __pyx_lineno = 0;
9791 const char *__pyx_filename = NULL;
9792 int __pyx_clineno = 0;
9793 __Pyx_RefNannySetupContext("__get__", 0);
9795 /* "lxml/objectify.pyx":623
9798 * return _parseNumber(self) # <<<<<<<<<<<<<<
9800 * def __int__(self):
9802 __Pyx_XDECREF(__pyx_r);
9803 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
9804 __Pyx_GOTREF(__pyx_t_1);
9805 __pyx_r = __pyx_t_1;
9809 /* "lxml/objectify.pyx":622
9812 * def pyval(self): # <<<<<<<<<<<<<<
9813 * return _parseNumber(self)
9817 /* function exit code */
9819 __Pyx_XDECREF(__pyx_t_1);
9820 __Pyx_AddTraceback("lxml.objectify.NumberElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9823 __Pyx_XGIVEREF(__pyx_r);
9824 __Pyx_RefNannyFinishContext();
9828 /* "lxml/objectify.pyx":625
9829 * return _parseNumber(self)
9831 * def __int__(self): # <<<<<<<<<<<<<<
9832 * return int(_parseNumber(self))
9836 /* Python wrapper */
9837 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_3__int__(PyObject *__pyx_v_self); /*proto*/
9838 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_3__int__(PyObject *__pyx_v_self) {
9839 PyObject *__pyx_r = 0;
9840 __Pyx_RefNannyDeclarations
9841 __Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
9842 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_2__int__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9844 /* function exit code */
9845 __Pyx_RefNannyFinishContext();
9849 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_2__int__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9850 PyObject *__pyx_r = NULL;
9851 __Pyx_RefNannyDeclarations
9852 PyObject *__pyx_t_1 = NULL;
9853 PyObject *__pyx_t_2 = NULL;
9854 int __pyx_lineno = 0;
9855 const char *__pyx_filename = NULL;
9856 int __pyx_clineno = 0;
9857 __Pyx_RefNannySetupContext("__int__", 0);
9859 /* "lxml/objectify.pyx":626
9861 * def __int__(self):
9862 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
9864 * def __long__(self):
9866 __Pyx_XDECREF(__pyx_r);
9867 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
9868 __Pyx_GOTREF(__pyx_t_1);
9869 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
9870 __Pyx_GOTREF(__pyx_t_2);
9871 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9872 __pyx_r = __pyx_t_2;
9876 /* "lxml/objectify.pyx":625
9877 * return _parseNumber(self)
9879 * def __int__(self): # <<<<<<<<<<<<<<
9880 * return int(_parseNumber(self))
9884 /* function exit code */
9886 __Pyx_XDECREF(__pyx_t_1);
9887 __Pyx_XDECREF(__pyx_t_2);
9888 __Pyx_AddTraceback("lxml.objectify.NumberElement.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9891 __Pyx_XGIVEREF(__pyx_r);
9892 __Pyx_RefNannyFinishContext();
9896 /* "lxml/objectify.pyx":628
9897 * return int(_parseNumber(self))
9899 * def __long__(self): # <<<<<<<<<<<<<<
9900 * return long(_parseNumber(self))
9904 /* Python wrapper */
9905 #if PY_MAJOR_VERSION < 3
9906 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5__long__(PyObject *__pyx_v_self); /*proto*/
9907 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_5__long__(PyObject *__pyx_v_self) {
9908 PyObject *__pyx_r = 0;
9909 __Pyx_RefNannyDeclarations
9910 __Pyx_RefNannySetupContext("__long__ (wrapper)", 0);
9911 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_4__long__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9913 /* function exit code */
9914 __Pyx_RefNannyFinishContext();
9917 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
9919 #if PY_MAJOR_VERSION < 3
9920 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_4__long__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9921 PyObject *__pyx_r = NULL;
9922 __Pyx_RefNannyDeclarations
9923 PyObject *__pyx_t_1 = NULL;
9924 PyObject *__pyx_t_2 = NULL;
9925 int __pyx_lineno = 0;
9926 const char *__pyx_filename = NULL;
9927 int __pyx_clineno = 0;
9928 __Pyx_RefNannySetupContext("__long__", 0);
9930 /* "lxml/objectify.pyx":629
9932 * def __long__(self):
9933 * return long(_parseNumber(self)) # <<<<<<<<<<<<<<
9935 * def __float__(self):
9937 __Pyx_XDECREF(__pyx_r);
9938 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L1_error)
9939 __Pyx_GOTREF(__pyx_t_1);
9940 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyLong_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L1_error)
9941 __Pyx_GOTREF(__pyx_t_2);
9942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9943 __pyx_r = __pyx_t_2;
9947 /* "lxml/objectify.pyx":628
9948 * return int(_parseNumber(self))
9950 * def __long__(self): # <<<<<<<<<<<<<<
9951 * return long(_parseNumber(self))
9955 /* function exit code */
9957 __Pyx_XDECREF(__pyx_t_1);
9958 __Pyx_XDECREF(__pyx_t_2);
9959 __Pyx_AddTraceback("lxml.objectify.NumberElement.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9962 __Pyx_XGIVEREF(__pyx_r);
9963 __Pyx_RefNannyFinishContext();
9966 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
9968 /* "lxml/objectify.pyx":631
9969 * return long(_parseNumber(self))
9971 * def __float__(self): # <<<<<<<<<<<<<<
9972 * return float(_parseNumber(self))
9976 /* Python wrapper */
9977 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_7__float__(PyObject *__pyx_v_self); /*proto*/
9978 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_7__float__(PyObject *__pyx_v_self) {
9979 PyObject *__pyx_r = 0;
9980 __Pyx_RefNannyDeclarations
9981 __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
9982 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_6__float__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
9984 /* function exit code */
9985 __Pyx_RefNannyFinishContext();
9989 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_6__float__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
9990 PyObject *__pyx_r = NULL;
9991 __Pyx_RefNannyDeclarations
9992 PyObject *__pyx_t_1 = NULL;
9993 PyObject *__pyx_t_2 = NULL;
9994 int __pyx_lineno = 0;
9995 const char *__pyx_filename = NULL;
9996 int __pyx_clineno = 0;
9997 __Pyx_RefNannySetupContext("__float__", 0);
9999 /* "lxml/objectify.pyx":632
10001 * def __float__(self):
10002 * return float(_parseNumber(self)) # <<<<<<<<<<<<<<
10004 * def __complex__(self):
10006 __Pyx_XDECREF(__pyx_r);
10007 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
10008 __Pyx_GOTREF(__pyx_t_1);
10009 __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error)
10010 __Pyx_GOTREF(__pyx_t_2);
10011 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10012 __pyx_r = __pyx_t_2;
10016 /* "lxml/objectify.pyx":631
10017 * return long(_parseNumber(self))
10019 * def __float__(self): # <<<<<<<<<<<<<<
10020 * return float(_parseNumber(self))
10024 /* function exit code */
10026 __Pyx_XDECREF(__pyx_t_1);
10027 __Pyx_XDECREF(__pyx_t_2);
10028 __Pyx_AddTraceback("lxml.objectify.NumberElement.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10031 __Pyx_XGIVEREF(__pyx_r);
10032 __Pyx_RefNannyFinishContext();
10036 /* "lxml/objectify.pyx":634
10037 * return float(_parseNumber(self))
10039 * def __complex__(self): # <<<<<<<<<<<<<<
10040 * return complex(_parseNumber(self))
10044 /* Python wrapper */
10045 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10046 static PyMethodDef __pyx_mdef_4lxml_9objectify_13NumberElement_9__complex__ = {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__, METH_NOARGS, 0};
10047 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10048 PyObject *__pyx_r = 0;
10049 __Pyx_RefNannyDeclarations
10050 __Pyx_RefNannySetupContext("__complex__ (wrapper)", 0);
10051 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10053 /* function exit code */
10054 __Pyx_RefNannyFinishContext();
10058 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_8__complex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10059 PyObject *__pyx_r = NULL;
10060 __Pyx_RefNannyDeclarations
10061 PyObject *__pyx_t_1 = NULL;
10062 PyObject *__pyx_t_2 = NULL;
10063 int __pyx_lineno = 0;
10064 const char *__pyx_filename = NULL;
10065 int __pyx_clineno = 0;
10066 __Pyx_RefNannySetupContext("__complex__", 0);
10068 /* "lxml/objectify.pyx":635
10070 * def __complex__(self):
10071 * return complex(_parseNumber(self)) # <<<<<<<<<<<<<<
10073 * def __str__(self):
10075 __Pyx_XDECREF(__pyx_r);
10076 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
10077 __Pyx_GOTREF(__pyx_t_1);
10078 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
10079 __Pyx_GOTREF(__pyx_t_2);
10080 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10081 __pyx_r = __pyx_t_2;
10085 /* "lxml/objectify.pyx":634
10086 * return float(_parseNumber(self))
10088 * def __complex__(self): # <<<<<<<<<<<<<<
10089 * return complex(_parseNumber(self))
10093 /* function exit code */
10095 __Pyx_XDECREF(__pyx_t_1);
10096 __Pyx_XDECREF(__pyx_t_2);
10097 __Pyx_AddTraceback("lxml.objectify.NumberElement.__complex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10100 __Pyx_XGIVEREF(__pyx_r);
10101 __Pyx_RefNannyFinishContext();
10105 /* "lxml/objectify.pyx":637
10106 * return complex(_parseNumber(self))
10108 * def __str__(self): # <<<<<<<<<<<<<<
10109 * return unicode(_parseNumber(self))
10113 /* Python wrapper */
10114 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_11__str__(PyObject *__pyx_v_self); /*proto*/
10115 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_11__str__(PyObject *__pyx_v_self) {
10116 PyObject *__pyx_r = 0;
10117 __Pyx_RefNannyDeclarations
10118 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
10119 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_10__str__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10121 /* function exit code */
10122 __Pyx_RefNannyFinishContext();
10126 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_10__str__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10127 PyObject *__pyx_r = NULL;
10128 __Pyx_RefNannyDeclarations
10129 PyObject *__pyx_t_1 = NULL;
10130 PyObject *__pyx_t_2 = NULL;
10131 int __pyx_lineno = 0;
10132 const char *__pyx_filename = NULL;
10133 int __pyx_clineno = 0;
10134 __Pyx_RefNannySetupContext("__str__", 0);
10136 /* "lxml/objectify.pyx":638
10138 * def __str__(self):
10139 * return unicode(_parseNumber(self)) # <<<<<<<<<<<<<<
10141 * def __repr__(self):
10143 __Pyx_XDECREF(__pyx_r);
10144 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
10145 __Pyx_GOTREF(__pyx_t_1);
10146 __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
10147 __Pyx_GOTREF(__pyx_t_2);
10148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10149 __pyx_r = __pyx_t_2;
10153 /* "lxml/objectify.pyx":637
10154 * return complex(_parseNumber(self))
10156 * def __str__(self): # <<<<<<<<<<<<<<
10157 * return unicode(_parseNumber(self))
10161 /* function exit code */
10163 __Pyx_XDECREF(__pyx_t_1);
10164 __Pyx_XDECREF(__pyx_t_2);
10165 __Pyx_AddTraceback("lxml.objectify.NumberElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10168 __Pyx_XGIVEREF(__pyx_r);
10169 __Pyx_RefNannyFinishContext();
10173 /* "lxml/objectify.pyx":640
10174 * return unicode(_parseNumber(self))
10176 * def __repr__(self): # <<<<<<<<<<<<<<
10177 * return repr(_parseNumber(self))
10181 /* Python wrapper */
10182 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_13__repr__(PyObject *__pyx_v_self); /*proto*/
10183 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_13__repr__(PyObject *__pyx_v_self) {
10184 PyObject *__pyx_r = 0;
10185 __Pyx_RefNannyDeclarations
10186 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10187 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10189 /* function exit code */
10190 __Pyx_RefNannyFinishContext();
10194 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_12__repr__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10195 PyObject *__pyx_r = NULL;
10196 __Pyx_RefNannyDeclarations
10197 PyObject *__pyx_t_1 = NULL;
10198 PyObject *__pyx_t_2 = NULL;
10199 int __pyx_lineno = 0;
10200 const char *__pyx_filename = NULL;
10201 int __pyx_clineno = 0;
10202 __Pyx_RefNannySetupContext("__repr__", 0);
10204 /* "lxml/objectify.pyx":641
10206 * def __repr__(self):
10207 * return repr(_parseNumber(self)) # <<<<<<<<<<<<<<
10209 * def __oct__(self):
10211 __Pyx_XDECREF(__pyx_r);
10212 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
10213 __Pyx_GOTREF(__pyx_t_1);
10214 __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error)
10215 __Pyx_GOTREF(__pyx_t_2);
10216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10217 __pyx_r = __pyx_t_2;
10221 /* "lxml/objectify.pyx":640
10222 * return unicode(_parseNumber(self))
10224 * def __repr__(self): # <<<<<<<<<<<<<<
10225 * return repr(_parseNumber(self))
10229 /* function exit code */
10231 __Pyx_XDECREF(__pyx_t_1);
10232 __Pyx_XDECREF(__pyx_t_2);
10233 __Pyx_AddTraceback("lxml.objectify.NumberElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10236 __Pyx_XGIVEREF(__pyx_r);
10237 __Pyx_RefNannyFinishContext();
10241 /* "lxml/objectify.pyx":643
10242 * return repr(_parseNumber(self))
10244 * def __oct__(self): # <<<<<<<<<<<<<<
10245 * return oct(_parseNumber(self))
10249 /* Python wrapper */
10250 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10251 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_15__oct__(PyObject *__pyx_v_self); /*proto*/
10252 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_15__oct__(PyObject *__pyx_v_self) {
10253 PyObject *__pyx_r = 0;
10254 __Pyx_RefNannyDeclarations
10255 __Pyx_RefNannySetupContext("__oct__ (wrapper)", 0);
10256 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10258 /* function exit code */
10259 __Pyx_RefNannyFinishContext();
10262 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10264 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10265 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_14__oct__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10266 PyObject *__pyx_r = NULL;
10267 __Pyx_RefNannyDeclarations
10268 PyObject *__pyx_t_1 = NULL;
10269 PyObject *__pyx_t_2 = NULL;
10270 int __pyx_lineno = 0;
10271 const char *__pyx_filename = NULL;
10272 int __pyx_clineno = 0;
10273 __Pyx_RefNannySetupContext("__oct__", 0);
10275 /* "lxml/objectify.pyx":644
10277 * def __oct__(self):
10278 * return oct(_parseNumber(self)) # <<<<<<<<<<<<<<
10280 * def __hex__(self):
10282 __Pyx_XDECREF(__pyx_r);
10283 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
10284 __Pyx_GOTREF(__pyx_t_1);
10285 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_oct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
10286 __Pyx_GOTREF(__pyx_t_2);
10287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10288 __pyx_r = __pyx_t_2;
10292 /* "lxml/objectify.pyx":643
10293 * return repr(_parseNumber(self))
10295 * def __oct__(self): # <<<<<<<<<<<<<<
10296 * return oct(_parseNumber(self))
10300 /* function exit code */
10302 __Pyx_XDECREF(__pyx_t_1);
10303 __Pyx_XDECREF(__pyx_t_2);
10304 __Pyx_AddTraceback("lxml.objectify.NumberElement.__oct__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10307 __Pyx_XGIVEREF(__pyx_r);
10308 __Pyx_RefNannyFinishContext();
10311 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10313 /* "lxml/objectify.pyx":646
10314 * return oct(_parseNumber(self))
10316 * def __hex__(self): # <<<<<<<<<<<<<<
10317 * return hex(_parseNumber(self))
10321 /* Python wrapper */
10322 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10323 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_17__hex__(PyObject *__pyx_v_self); /*proto*/
10324 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_17__hex__(PyObject *__pyx_v_self) {
10325 PyObject *__pyx_r = 0;
10326 __Pyx_RefNannyDeclarations
10327 __Pyx_RefNannySetupContext("__hex__ (wrapper)", 0);
10328 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10330 /* function exit code */
10331 __Pyx_RefNannyFinishContext();
10334 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10336 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10337 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_16__hex__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10338 PyObject *__pyx_r = NULL;
10339 __Pyx_RefNannyDeclarations
10340 PyObject *__pyx_t_1 = NULL;
10341 PyObject *__pyx_t_2 = NULL;
10342 int __pyx_lineno = 0;
10343 const char *__pyx_filename = NULL;
10344 int __pyx_clineno = 0;
10345 __Pyx_RefNannySetupContext("__hex__", 0);
10347 /* "lxml/objectify.pyx":647
10349 * def __hex__(self):
10350 * return hex(_parseNumber(self)) # <<<<<<<<<<<<<<
10352 * def __richcmp__(self, other, int op):
10354 __Pyx_XDECREF(__pyx_r);
10355 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
10356 __Pyx_GOTREF(__pyx_t_1);
10357 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
10358 __Pyx_GOTREF(__pyx_t_2);
10359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10360 __pyx_r = __pyx_t_2;
10364 /* "lxml/objectify.pyx":646
10365 * return oct(_parseNumber(self))
10367 * def __hex__(self): # <<<<<<<<<<<<<<
10368 * return hex(_parseNumber(self))
10372 /* function exit code */
10374 __Pyx_XDECREF(__pyx_t_1);
10375 __Pyx_XDECREF(__pyx_t_2);
10376 __Pyx_AddTraceback("lxml.objectify.NumberElement.__hex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10379 __Pyx_XGIVEREF(__pyx_r);
10380 __Pyx_RefNannyFinishContext();
10383 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10385 /* "lxml/objectify.pyx":649
10386 * return hex(_parseNumber(self))
10388 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
10389 * return _richcmpPyvals(self, other, op)
10393 /* Python wrapper */
10394 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
10395 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
10396 PyObject *__pyx_r = 0;
10397 __Pyx_RefNannyDeclarations
10398 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
10399 __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));
10401 /* function exit code */
10402 __Pyx_RefNannyFinishContext();
10406 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) {
10407 PyObject *__pyx_r = NULL;
10408 __Pyx_RefNannyDeclarations
10409 PyObject *__pyx_t_1 = NULL;
10410 int __pyx_lineno = 0;
10411 const char *__pyx_filename = NULL;
10412 int __pyx_clineno = 0;
10413 __Pyx_RefNannySetupContext("__richcmp__", 0);
10415 /* "lxml/objectify.pyx":650
10417 * def __richcmp__(self, other, int op):
10418 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
10420 * def __hash__(self):
10422 __Pyx_XDECREF(__pyx_r);
10423 __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)
10424 __Pyx_GOTREF(__pyx_t_1);
10425 __pyx_r = __pyx_t_1;
10429 /* "lxml/objectify.pyx":649
10430 * return hex(_parseNumber(self))
10432 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
10433 * return _richcmpPyvals(self, other, op)
10437 /* function exit code */
10439 __Pyx_XDECREF(__pyx_t_1);
10440 __Pyx_AddTraceback("lxml.objectify.NumberElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10443 __Pyx_XGIVEREF(__pyx_r);
10444 __Pyx_RefNannyFinishContext();
10448 /* "lxml/objectify.pyx":652
10449 * return _richcmpPyvals(self, other, op)
10451 * def __hash__(self): # <<<<<<<<<<<<<<
10452 * return hash(_parseNumber(self))
10456 /* Python wrapper */
10457 static Py_hash_t __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__(PyObject *__pyx_v_self); /*proto*/
10458 static Py_hash_t __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__(PyObject *__pyx_v_self) {
10460 __Pyx_RefNannyDeclarations
10461 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
10462 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
10464 /* function exit code */
10465 __Pyx_RefNannyFinishContext();
10469 static Py_hash_t __pyx_pf_4lxml_9objectify_13NumberElement_20__hash__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
10471 __Pyx_RefNannyDeclarations
10472 PyObject *__pyx_t_1 = NULL;
10473 Py_hash_t __pyx_t_2;
10474 int __pyx_lineno = 0;
10475 const char *__pyx_filename = NULL;
10476 int __pyx_clineno = 0;
10477 __Pyx_RefNannySetupContext("__hash__", 0);
10479 /* "lxml/objectify.pyx":653
10481 * def __hash__(self):
10482 * return hash(_parseNumber(self)) # <<<<<<<<<<<<<<
10484 * def __add__(self, other):
10486 __pyx_t_1 = __pyx_f_4lxml_9objectify__parseNumber(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
10487 __Pyx_GOTREF(__pyx_t_1);
10488 __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 653, __pyx_L1_error)
10489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10490 __pyx_r = __pyx_t_2;
10493 /* "lxml/objectify.pyx":652
10494 * return _richcmpPyvals(self, other, op)
10496 * def __hash__(self): # <<<<<<<<<<<<<<
10497 * return hash(_parseNumber(self))
10501 /* function exit code */
10503 __Pyx_XDECREF(__pyx_t_1);
10504 __Pyx_AddTraceback("lxml.objectify.NumberElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10507 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
10508 __Pyx_RefNannyFinishContext();
10512 /* "lxml/objectify.pyx":655
10513 * return hash(_parseNumber(self))
10515 * def __add__(self, other): # <<<<<<<<<<<<<<
10516 * return _numericValueOf(self) + _numericValueOf(other)
10520 /* Python wrapper */
10521 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_23__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10522 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_23__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10523 PyObject *__pyx_r = 0;
10524 __Pyx_RefNannyDeclarations
10525 __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
10526 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_22__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10528 /* function exit code */
10529 __Pyx_RefNannyFinishContext();
10533 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_22__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10534 PyObject *__pyx_r = NULL;
10535 __Pyx_RefNannyDeclarations
10536 PyObject *__pyx_t_1 = NULL;
10537 PyObject *__pyx_t_2 = NULL;
10538 PyObject *__pyx_t_3 = NULL;
10539 int __pyx_lineno = 0;
10540 const char *__pyx_filename = NULL;
10541 int __pyx_clineno = 0;
10542 __Pyx_RefNannySetupContext("__add__", 0);
10544 /* "lxml/objectify.pyx":656
10546 * def __add__(self, other):
10547 * return _numericValueOf(self) + _numericValueOf(other) # <<<<<<<<<<<<<<
10549 * def __sub__(self, other):
10551 __Pyx_XDECREF(__pyx_r);
10552 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
10553 __Pyx_GOTREF(__pyx_t_1);
10554 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
10555 __Pyx_GOTREF(__pyx_t_2);
10556 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
10557 __Pyx_GOTREF(__pyx_t_3);
10558 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10559 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10560 __pyx_r = __pyx_t_3;
10564 /* "lxml/objectify.pyx":655
10565 * return hash(_parseNumber(self))
10567 * def __add__(self, other): # <<<<<<<<<<<<<<
10568 * return _numericValueOf(self) + _numericValueOf(other)
10572 /* function exit code */
10574 __Pyx_XDECREF(__pyx_t_1);
10575 __Pyx_XDECREF(__pyx_t_2);
10576 __Pyx_XDECREF(__pyx_t_3);
10577 __Pyx_AddTraceback("lxml.objectify.NumberElement.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10580 __Pyx_XGIVEREF(__pyx_r);
10581 __Pyx_RefNannyFinishContext();
10585 /* "lxml/objectify.pyx":658
10586 * return _numericValueOf(self) + _numericValueOf(other)
10588 * def __sub__(self, other): # <<<<<<<<<<<<<<
10589 * return _numericValueOf(self) - _numericValueOf(other)
10593 /* Python wrapper */
10594 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10595 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_25__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10596 PyObject *__pyx_r = 0;
10597 __Pyx_RefNannyDeclarations
10598 __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
10599 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10601 /* function exit code */
10602 __Pyx_RefNannyFinishContext();
10606 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_24__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10607 PyObject *__pyx_r = NULL;
10608 __Pyx_RefNannyDeclarations
10609 PyObject *__pyx_t_1 = NULL;
10610 PyObject *__pyx_t_2 = NULL;
10611 PyObject *__pyx_t_3 = NULL;
10612 int __pyx_lineno = 0;
10613 const char *__pyx_filename = NULL;
10614 int __pyx_clineno = 0;
10615 __Pyx_RefNannySetupContext("__sub__", 0);
10617 /* "lxml/objectify.pyx":659
10619 * def __sub__(self, other):
10620 * return _numericValueOf(self) - _numericValueOf(other) # <<<<<<<<<<<<<<
10622 * def __mul__(self, other):
10624 __Pyx_XDECREF(__pyx_r);
10625 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
10626 __Pyx_GOTREF(__pyx_t_1);
10627 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
10628 __Pyx_GOTREF(__pyx_t_2);
10629 __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
10630 __Pyx_GOTREF(__pyx_t_3);
10631 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10632 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10633 __pyx_r = __pyx_t_3;
10637 /* "lxml/objectify.pyx":658
10638 * return _numericValueOf(self) + _numericValueOf(other)
10640 * def __sub__(self, other): # <<<<<<<<<<<<<<
10641 * return _numericValueOf(self) - _numericValueOf(other)
10645 /* function exit code */
10647 __Pyx_XDECREF(__pyx_t_1);
10648 __Pyx_XDECREF(__pyx_t_2);
10649 __Pyx_XDECREF(__pyx_t_3);
10650 __Pyx_AddTraceback("lxml.objectify.NumberElement.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10653 __Pyx_XGIVEREF(__pyx_r);
10654 __Pyx_RefNannyFinishContext();
10658 /* "lxml/objectify.pyx":661
10659 * return _numericValueOf(self) - _numericValueOf(other)
10661 * def __mul__(self, other): # <<<<<<<<<<<<<<
10662 * return _numericValueOf(self) * _numericValueOf(other)
10666 /* Python wrapper */
10667 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10668 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_27__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10669 PyObject *__pyx_r = 0;
10670 __Pyx_RefNannyDeclarations
10671 __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
10672 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10674 /* function exit code */
10675 __Pyx_RefNannyFinishContext();
10679 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_26__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10680 PyObject *__pyx_r = NULL;
10681 __Pyx_RefNannyDeclarations
10682 PyObject *__pyx_t_1 = NULL;
10683 PyObject *__pyx_t_2 = NULL;
10684 PyObject *__pyx_t_3 = NULL;
10685 int __pyx_lineno = 0;
10686 const char *__pyx_filename = NULL;
10687 int __pyx_clineno = 0;
10688 __Pyx_RefNannySetupContext("__mul__", 0);
10690 /* "lxml/objectify.pyx":662
10692 * def __mul__(self, other):
10693 * return _numericValueOf(self) * _numericValueOf(other) # <<<<<<<<<<<<<<
10695 * def __div__(self, other):
10697 __Pyx_XDECREF(__pyx_r);
10698 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
10699 __Pyx_GOTREF(__pyx_t_1);
10700 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
10701 __Pyx_GOTREF(__pyx_t_2);
10702 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
10703 __Pyx_GOTREF(__pyx_t_3);
10704 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10705 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10706 __pyx_r = __pyx_t_3;
10710 /* "lxml/objectify.pyx":661
10711 * return _numericValueOf(self) - _numericValueOf(other)
10713 * def __mul__(self, other): # <<<<<<<<<<<<<<
10714 * return _numericValueOf(self) * _numericValueOf(other)
10718 /* function exit code */
10720 __Pyx_XDECREF(__pyx_t_1);
10721 __Pyx_XDECREF(__pyx_t_2);
10722 __Pyx_XDECREF(__pyx_t_3);
10723 __Pyx_AddTraceback("lxml.objectify.NumberElement.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10726 __Pyx_XGIVEREF(__pyx_r);
10727 __Pyx_RefNannyFinishContext();
10731 /* "lxml/objectify.pyx":664
10732 * return _numericValueOf(self) * _numericValueOf(other)
10734 * def __div__(self, other): # <<<<<<<<<<<<<<
10735 * return _numericValueOf(self) / _numericValueOf(other)
10739 /* Python wrapper */
10740 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10741 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10742 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_29__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10743 PyObject *__pyx_r = 0;
10744 __Pyx_RefNannyDeclarations
10745 __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
10746 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_28__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10748 /* function exit code */
10749 __Pyx_RefNannyFinishContext();
10752 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10754 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
10755 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_28__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10756 PyObject *__pyx_r = NULL;
10757 __Pyx_RefNannyDeclarations
10758 PyObject *__pyx_t_1 = NULL;
10759 PyObject *__pyx_t_2 = NULL;
10760 PyObject *__pyx_t_3 = NULL;
10761 int __pyx_lineno = 0;
10762 const char *__pyx_filename = NULL;
10763 int __pyx_clineno = 0;
10764 __Pyx_RefNannySetupContext("__div__", 0);
10766 /* "lxml/objectify.pyx":665
10768 * def __div__(self, other):
10769 * return _numericValueOf(self) / _numericValueOf(other) # <<<<<<<<<<<<<<
10771 * def __truediv__(self, other):
10773 __Pyx_XDECREF(__pyx_r);
10774 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
10775 __Pyx_GOTREF(__pyx_t_1);
10776 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
10777 __Pyx_GOTREF(__pyx_t_2);
10778 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
10779 __Pyx_GOTREF(__pyx_t_3);
10780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10782 __pyx_r = __pyx_t_3;
10786 /* "lxml/objectify.pyx":664
10787 * return _numericValueOf(self) * _numericValueOf(other)
10789 * def __div__(self, other): # <<<<<<<<<<<<<<
10790 * return _numericValueOf(self) / _numericValueOf(other)
10794 /* function exit code */
10796 __Pyx_XDECREF(__pyx_t_1);
10797 __Pyx_XDECREF(__pyx_t_2);
10798 __Pyx_XDECREF(__pyx_t_3);
10799 __Pyx_AddTraceback("lxml.objectify.NumberElement.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10802 __Pyx_XGIVEREF(__pyx_r);
10803 __Pyx_RefNannyFinishContext();
10806 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
10808 /* "lxml/objectify.pyx":667
10809 * return _numericValueOf(self) / _numericValueOf(other)
10811 * def __truediv__(self, other): # <<<<<<<<<<<<<<
10812 * return _numericValueOf(self) / _numericValueOf(other)
10816 /* Python wrapper */
10817 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10818 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10819 PyObject *__pyx_r = 0;
10820 __Pyx_RefNannyDeclarations
10821 __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
10822 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10824 /* function exit code */
10825 __Pyx_RefNannyFinishContext();
10829 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_30__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10830 PyObject *__pyx_r = NULL;
10831 __Pyx_RefNannyDeclarations
10832 PyObject *__pyx_t_1 = NULL;
10833 PyObject *__pyx_t_2 = NULL;
10834 PyObject *__pyx_t_3 = NULL;
10835 int __pyx_lineno = 0;
10836 const char *__pyx_filename = NULL;
10837 int __pyx_clineno = 0;
10838 __Pyx_RefNannySetupContext("__truediv__", 0);
10840 /* "lxml/objectify.pyx":668
10842 * def __truediv__(self, other):
10843 * return _numericValueOf(self) / _numericValueOf(other) # <<<<<<<<<<<<<<
10845 * def __mod__(self, other):
10847 __Pyx_XDECREF(__pyx_r);
10848 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
10849 __Pyx_GOTREF(__pyx_t_1);
10850 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
10851 __Pyx_GOTREF(__pyx_t_2);
10852 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 668, __pyx_L1_error)
10853 __Pyx_GOTREF(__pyx_t_3);
10854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10855 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10856 __pyx_r = __pyx_t_3;
10860 /* "lxml/objectify.pyx":667
10861 * return _numericValueOf(self) / _numericValueOf(other)
10863 * def __truediv__(self, other): # <<<<<<<<<<<<<<
10864 * return _numericValueOf(self) / _numericValueOf(other)
10868 /* function exit code */
10870 __Pyx_XDECREF(__pyx_t_1);
10871 __Pyx_XDECREF(__pyx_t_2);
10872 __Pyx_XDECREF(__pyx_t_3);
10873 __Pyx_AddTraceback("lxml.objectify.NumberElement.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10876 __Pyx_XGIVEREF(__pyx_r);
10877 __Pyx_RefNannyFinishContext();
10881 /* "lxml/objectify.pyx":670
10882 * return _numericValueOf(self) / _numericValueOf(other)
10884 * def __mod__(self, other): # <<<<<<<<<<<<<<
10885 * return _numericValueOf(self) % _numericValueOf(other)
10889 /* Python wrapper */
10890 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
10891 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_33__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10892 PyObject *__pyx_r = 0;
10893 __Pyx_RefNannyDeclarations
10894 __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
10895 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
10897 /* function exit code */
10898 __Pyx_RefNannyFinishContext();
10902 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_32__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
10903 PyObject *__pyx_r = NULL;
10904 __Pyx_RefNannyDeclarations
10905 PyObject *__pyx_t_1 = NULL;
10906 PyObject *__pyx_t_2 = NULL;
10907 PyObject *__pyx_t_3 = NULL;
10908 int __pyx_lineno = 0;
10909 const char *__pyx_filename = NULL;
10910 int __pyx_clineno = 0;
10911 __Pyx_RefNannySetupContext("__mod__", 0);
10913 /* "lxml/objectify.pyx":671
10915 * def __mod__(self, other):
10916 * return _numericValueOf(self) % _numericValueOf(other) # <<<<<<<<<<<<<<
10918 * def __pow__(self, other, modulo):
10920 __Pyx_XDECREF(__pyx_r);
10921 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
10922 __Pyx_GOTREF(__pyx_t_1);
10923 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
10924 __Pyx_GOTREF(__pyx_t_2);
10925 __pyx_t_3 = PyNumber_Remainder(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
10926 __Pyx_GOTREF(__pyx_t_3);
10927 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10929 __pyx_r = __pyx_t_3;
10933 /* "lxml/objectify.pyx":670
10934 * return _numericValueOf(self) / _numericValueOf(other)
10936 * def __mod__(self, other): # <<<<<<<<<<<<<<
10937 * return _numericValueOf(self) % _numericValueOf(other)
10941 /* function exit code */
10943 __Pyx_XDECREF(__pyx_t_1);
10944 __Pyx_XDECREF(__pyx_t_2);
10945 __Pyx_XDECREF(__pyx_t_3);
10946 __Pyx_AddTraceback("lxml.objectify.NumberElement.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10949 __Pyx_XGIVEREF(__pyx_r);
10950 __Pyx_RefNannyFinishContext();
10954 /* "lxml/objectify.pyx":673
10955 * return _numericValueOf(self) % _numericValueOf(other)
10957 * def __pow__(self, other, modulo): # <<<<<<<<<<<<<<
10958 * if modulo is None:
10959 * return _numericValueOf(self) ** _numericValueOf(other)
10962 /* Python wrapper */
10963 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_35__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo); /*proto*/
10964 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_35__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo) {
10965 PyObject *__pyx_r = 0;
10966 __Pyx_RefNannyDeclarations
10967 __Pyx_RefNannySetupContext("__pow__ (wrapper)", 0);
10968 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_modulo));
10970 /* function exit code */
10971 __Pyx_RefNannyFinishContext();
10975 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_34__pow__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_modulo) {
10976 PyObject *__pyx_r = NULL;
10977 __Pyx_RefNannyDeclarations
10980 PyObject *__pyx_t_3 = NULL;
10981 PyObject *__pyx_t_4 = NULL;
10982 PyObject *__pyx_t_5 = NULL;
10983 int __pyx_lineno = 0;
10984 const char *__pyx_filename = NULL;
10985 int __pyx_clineno = 0;
10986 __Pyx_RefNannySetupContext("__pow__", 0);
10988 /* "lxml/objectify.pyx":674
10990 * def __pow__(self, other, modulo):
10991 * if modulo is None: # <<<<<<<<<<<<<<
10992 * return _numericValueOf(self) ** _numericValueOf(other)
10995 __pyx_t_1 = (__pyx_v_modulo == Py_None);
10996 __pyx_t_2 = (__pyx_t_1 != 0);
10999 /* "lxml/objectify.pyx":675
11000 * def __pow__(self, other, modulo):
11001 * if modulo is None:
11002 * return _numericValueOf(self) ** _numericValueOf(other) # <<<<<<<<<<<<<<
11004 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
11006 __Pyx_XDECREF(__pyx_r);
11007 __pyx_t_3 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
11008 __Pyx_GOTREF(__pyx_t_3);
11009 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
11010 __Pyx_GOTREF(__pyx_t_4);
11011 __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)
11012 __Pyx_GOTREF(__pyx_t_5);
11013 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11015 __pyx_r = __pyx_t_5;
11019 /* "lxml/objectify.pyx":674
11021 * def __pow__(self, other, modulo):
11022 * if modulo is None: # <<<<<<<<<<<<<<
11023 * return _numericValueOf(self) ** _numericValueOf(other)
11028 /* "lxml/objectify.pyx":677
11029 * return _numericValueOf(self) ** _numericValueOf(other)
11031 * return pow(_numericValueOf(self), _numericValueOf(other), modulo) # <<<<<<<<<<<<<<
11033 * def __neg__(self):
11036 __Pyx_XDECREF(__pyx_r);
11037 __pyx_t_5 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
11038 __Pyx_GOTREF(__pyx_t_5);
11039 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
11040 __Pyx_GOTREF(__pyx_t_4);
11041 __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)
11042 __Pyx_GOTREF(__pyx_t_3);
11043 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11044 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11045 __pyx_r = __pyx_t_3;
11050 /* "lxml/objectify.pyx":673
11051 * return _numericValueOf(self) % _numericValueOf(other)
11053 * def __pow__(self, other, modulo): # <<<<<<<<<<<<<<
11054 * if modulo is None:
11055 * return _numericValueOf(self) ** _numericValueOf(other)
11058 /* function exit code */
11060 __Pyx_XDECREF(__pyx_t_3);
11061 __Pyx_XDECREF(__pyx_t_4);
11062 __Pyx_XDECREF(__pyx_t_5);
11063 __Pyx_AddTraceback("lxml.objectify.NumberElement.__pow__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11066 __Pyx_XGIVEREF(__pyx_r);
11067 __Pyx_RefNannyFinishContext();
11071 /* "lxml/objectify.pyx":679
11072 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
11074 * def __neg__(self): # <<<<<<<<<<<<<<
11075 * return - _numericValueOf(self)
11079 /* Python wrapper */
11080 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_37__neg__(PyObject *__pyx_v_self); /*proto*/
11081 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_37__neg__(PyObject *__pyx_v_self) {
11082 PyObject *__pyx_r = 0;
11083 __Pyx_RefNannyDeclarations
11084 __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
11085 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11087 /* function exit code */
11088 __Pyx_RefNannyFinishContext();
11092 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_36__neg__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11093 PyObject *__pyx_r = NULL;
11094 __Pyx_RefNannyDeclarations
11095 PyObject *__pyx_t_1 = NULL;
11096 PyObject *__pyx_t_2 = NULL;
11097 int __pyx_lineno = 0;
11098 const char *__pyx_filename = NULL;
11099 int __pyx_clineno = 0;
11100 __Pyx_RefNannySetupContext("__neg__", 0);
11102 /* "lxml/objectify.pyx":680
11104 * def __neg__(self):
11105 * return - _numericValueOf(self) # <<<<<<<<<<<<<<
11107 * def __pos__(self):
11109 __Pyx_XDECREF(__pyx_r);
11110 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
11111 __Pyx_GOTREF(__pyx_t_1);
11112 __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
11113 __Pyx_GOTREF(__pyx_t_2);
11114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11115 __pyx_r = __pyx_t_2;
11119 /* "lxml/objectify.pyx":679
11120 * return pow(_numericValueOf(self), _numericValueOf(other), modulo)
11122 * def __neg__(self): # <<<<<<<<<<<<<<
11123 * return - _numericValueOf(self)
11127 /* function exit code */
11129 __Pyx_XDECREF(__pyx_t_1);
11130 __Pyx_XDECREF(__pyx_t_2);
11131 __Pyx_AddTraceback("lxml.objectify.NumberElement.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11134 __Pyx_XGIVEREF(__pyx_r);
11135 __Pyx_RefNannyFinishContext();
11139 /* "lxml/objectify.pyx":682
11140 * return - _numericValueOf(self)
11142 * def __pos__(self): # <<<<<<<<<<<<<<
11143 * return + _numericValueOf(self)
11147 /* Python wrapper */
11148 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_39__pos__(PyObject *__pyx_v_self); /*proto*/
11149 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_39__pos__(PyObject *__pyx_v_self) {
11150 PyObject *__pyx_r = 0;
11151 __Pyx_RefNannyDeclarations
11152 __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0);
11153 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11155 /* function exit code */
11156 __Pyx_RefNannyFinishContext();
11160 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_38__pos__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11161 PyObject *__pyx_r = NULL;
11162 __Pyx_RefNannyDeclarations
11163 PyObject *__pyx_t_1 = NULL;
11164 PyObject *__pyx_t_2 = NULL;
11165 int __pyx_lineno = 0;
11166 const char *__pyx_filename = NULL;
11167 int __pyx_clineno = 0;
11168 __Pyx_RefNannySetupContext("__pos__", 0);
11170 /* "lxml/objectify.pyx":683
11172 * def __pos__(self):
11173 * return + _numericValueOf(self) # <<<<<<<<<<<<<<
11175 * def __abs__(self):
11177 __Pyx_XDECREF(__pyx_r);
11178 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L1_error)
11179 __Pyx_GOTREF(__pyx_t_1);
11180 __pyx_t_2 = PyNumber_Positive(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
11181 __Pyx_GOTREF(__pyx_t_2);
11182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11183 __pyx_r = __pyx_t_2;
11187 /* "lxml/objectify.pyx":682
11188 * return - _numericValueOf(self)
11190 * def __pos__(self): # <<<<<<<<<<<<<<
11191 * return + _numericValueOf(self)
11195 /* function exit code */
11197 __Pyx_XDECREF(__pyx_t_1);
11198 __Pyx_XDECREF(__pyx_t_2);
11199 __Pyx_AddTraceback("lxml.objectify.NumberElement.__pos__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11202 __Pyx_XGIVEREF(__pyx_r);
11203 __Pyx_RefNannyFinishContext();
11207 /* "lxml/objectify.pyx":685
11208 * return + _numericValueOf(self)
11210 * def __abs__(self): # <<<<<<<<<<<<<<
11211 * return abs( _numericValueOf(self) )
11215 /* Python wrapper */
11216 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_41__abs__(PyObject *__pyx_v_self); /*proto*/
11217 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_41__abs__(PyObject *__pyx_v_self) {
11218 PyObject *__pyx_r = 0;
11219 __Pyx_RefNannyDeclarations
11220 __Pyx_RefNannySetupContext("__abs__ (wrapper)", 0);
11221 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11223 /* function exit code */
11224 __Pyx_RefNannyFinishContext();
11228 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_40__abs__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11229 PyObject *__pyx_r = NULL;
11230 __Pyx_RefNannyDeclarations
11231 PyObject *__pyx_t_1 = NULL;
11232 PyObject *__pyx_t_2 = NULL;
11233 int __pyx_lineno = 0;
11234 const char *__pyx_filename = NULL;
11235 int __pyx_clineno = 0;
11236 __Pyx_RefNannySetupContext("__abs__", 0);
11238 /* "lxml/objectify.pyx":686
11240 * def __abs__(self):
11241 * return abs( _numericValueOf(self) ) # <<<<<<<<<<<<<<
11243 * def __nonzero__(self):
11245 __Pyx_XDECREF(__pyx_r);
11246 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
11247 __Pyx_GOTREF(__pyx_t_1);
11248 __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
11249 __Pyx_GOTREF(__pyx_t_2);
11250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11251 __pyx_r = __pyx_t_2;
11255 /* "lxml/objectify.pyx":685
11256 * return + _numericValueOf(self)
11258 * def __abs__(self): # <<<<<<<<<<<<<<
11259 * return abs( _numericValueOf(self) )
11263 /* function exit code */
11265 __Pyx_XDECREF(__pyx_t_1);
11266 __Pyx_XDECREF(__pyx_t_2);
11267 __Pyx_AddTraceback("lxml.objectify.NumberElement.__abs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11270 __Pyx_XGIVEREF(__pyx_r);
11271 __Pyx_RefNannyFinishContext();
11275 /* "lxml/objectify.pyx":688
11276 * return abs( _numericValueOf(self) )
11278 * def __nonzero__(self): # <<<<<<<<<<<<<<
11279 * return bool(_numericValueOf(self))
11283 /* Python wrapper */
11284 static int __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__(PyObject *__pyx_v_self); /*proto*/
11285 static int __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__(PyObject *__pyx_v_self) {
11287 __Pyx_RefNannyDeclarations
11288 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
11289 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11291 /* function exit code */
11292 __Pyx_RefNannyFinishContext();
11296 static int __pyx_pf_4lxml_9objectify_13NumberElement_42__nonzero__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11298 __Pyx_RefNannyDeclarations
11299 PyObject *__pyx_t_1 = NULL;
11301 int __pyx_lineno = 0;
11302 const char *__pyx_filename = NULL;
11303 int __pyx_clineno = 0;
11304 __Pyx_RefNannySetupContext("__nonzero__", 0);
11306 /* "lxml/objectify.pyx":689
11308 * def __nonzero__(self):
11309 * return bool(_numericValueOf(self)) # <<<<<<<<<<<<<<
11311 * def __invert__(self):
11313 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
11314 __Pyx_GOTREF(__pyx_t_1);
11315 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
11316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11317 __pyx_r = (!(!__pyx_t_2));
11320 /* "lxml/objectify.pyx":688
11321 * return abs( _numericValueOf(self) )
11323 * def __nonzero__(self): # <<<<<<<<<<<<<<
11324 * return bool(_numericValueOf(self))
11328 /* function exit code */
11330 __Pyx_XDECREF(__pyx_t_1);
11331 __Pyx_AddTraceback("lxml.objectify.NumberElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11334 __Pyx_RefNannyFinishContext();
11338 /* "lxml/objectify.pyx":691
11339 * return bool(_numericValueOf(self))
11341 * def __invert__(self): # <<<<<<<<<<<<<<
11342 * return ~ _numericValueOf(self)
11346 /* Python wrapper */
11347 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_45__invert__(PyObject *__pyx_v_self); /*proto*/
11348 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_45__invert__(PyObject *__pyx_v_self) {
11349 PyObject *__pyx_r = 0;
11350 __Pyx_RefNannyDeclarations
11351 __Pyx_RefNannySetupContext("__invert__ (wrapper)", 0);
11352 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(((struct __pyx_obj_4lxml_9objectify_NumberElement *)__pyx_v_self));
11354 /* function exit code */
11355 __Pyx_RefNannyFinishContext();
11359 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_44__invert__(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_self) {
11360 PyObject *__pyx_r = NULL;
11361 __Pyx_RefNannyDeclarations
11362 PyObject *__pyx_t_1 = NULL;
11363 PyObject *__pyx_t_2 = NULL;
11364 int __pyx_lineno = 0;
11365 const char *__pyx_filename = NULL;
11366 int __pyx_clineno = 0;
11367 __Pyx_RefNannySetupContext("__invert__", 0);
11369 /* "lxml/objectify.pyx":692
11371 * def __invert__(self):
11372 * return ~ _numericValueOf(self) # <<<<<<<<<<<<<<
11374 * def __lshift__(self, other):
11376 __Pyx_XDECREF(__pyx_r);
11377 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
11378 __Pyx_GOTREF(__pyx_t_1);
11379 __pyx_t_2 = PyNumber_Invert(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
11380 __Pyx_GOTREF(__pyx_t_2);
11381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11382 __pyx_r = __pyx_t_2;
11386 /* "lxml/objectify.pyx":691
11387 * return bool(_numericValueOf(self))
11389 * def __invert__(self): # <<<<<<<<<<<<<<
11390 * return ~ _numericValueOf(self)
11394 /* function exit code */
11396 __Pyx_XDECREF(__pyx_t_1);
11397 __Pyx_XDECREF(__pyx_t_2);
11398 __Pyx_AddTraceback("lxml.objectify.NumberElement.__invert__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11401 __Pyx_XGIVEREF(__pyx_r);
11402 __Pyx_RefNannyFinishContext();
11406 /* "lxml/objectify.pyx":694
11407 * return ~ _numericValueOf(self)
11409 * def __lshift__(self, other): # <<<<<<<<<<<<<<
11410 * return _numericValueOf(self) << _numericValueOf(other)
11414 /* Python wrapper */
11415 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11416 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11417 PyObject *__pyx_r = 0;
11418 __Pyx_RefNannyDeclarations
11419 __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0);
11420 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11422 /* function exit code */
11423 __Pyx_RefNannyFinishContext();
11427 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_46__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11428 PyObject *__pyx_r = NULL;
11429 __Pyx_RefNannyDeclarations
11430 PyObject *__pyx_t_1 = NULL;
11431 PyObject *__pyx_t_2 = NULL;
11432 PyObject *__pyx_t_3 = NULL;
11433 int __pyx_lineno = 0;
11434 const char *__pyx_filename = NULL;
11435 int __pyx_clineno = 0;
11436 __Pyx_RefNannySetupContext("__lshift__", 0);
11438 /* "lxml/objectify.pyx":695
11440 * def __lshift__(self, other):
11441 * return _numericValueOf(self) << _numericValueOf(other) # <<<<<<<<<<<<<<
11443 * def __rshift__(self, other):
11445 __Pyx_XDECREF(__pyx_r);
11446 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
11447 __Pyx_GOTREF(__pyx_t_1);
11448 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
11449 __Pyx_GOTREF(__pyx_t_2);
11450 __pyx_t_3 = PyNumber_Lshift(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 695, __pyx_L1_error)
11451 __Pyx_GOTREF(__pyx_t_3);
11452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11454 __pyx_r = __pyx_t_3;
11458 /* "lxml/objectify.pyx":694
11459 * return ~ _numericValueOf(self)
11461 * def __lshift__(self, other): # <<<<<<<<<<<<<<
11462 * return _numericValueOf(self) << _numericValueOf(other)
11466 /* function exit code */
11468 __Pyx_XDECREF(__pyx_t_1);
11469 __Pyx_XDECREF(__pyx_t_2);
11470 __Pyx_XDECREF(__pyx_t_3);
11471 __Pyx_AddTraceback("lxml.objectify.NumberElement.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11474 __Pyx_XGIVEREF(__pyx_r);
11475 __Pyx_RefNannyFinishContext();
11479 /* "lxml/objectify.pyx":697
11480 * return _numericValueOf(self) << _numericValueOf(other)
11482 * def __rshift__(self, other): # <<<<<<<<<<<<<<
11483 * return _numericValueOf(self) >> _numericValueOf(other)
11487 /* Python wrapper */
11488 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11489 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11490 PyObject *__pyx_r = 0;
11491 __Pyx_RefNannyDeclarations
11492 __Pyx_RefNannySetupContext("__rshift__ (wrapper)", 0);
11493 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11495 /* function exit code */
11496 __Pyx_RefNannyFinishContext();
11500 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_48__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11501 PyObject *__pyx_r = NULL;
11502 __Pyx_RefNannyDeclarations
11503 PyObject *__pyx_t_1 = NULL;
11504 PyObject *__pyx_t_2 = NULL;
11505 PyObject *__pyx_t_3 = NULL;
11506 int __pyx_lineno = 0;
11507 const char *__pyx_filename = NULL;
11508 int __pyx_clineno = 0;
11509 __Pyx_RefNannySetupContext("__rshift__", 0);
11511 /* "lxml/objectify.pyx":698
11513 * def __rshift__(self, other):
11514 * return _numericValueOf(self) >> _numericValueOf(other) # <<<<<<<<<<<<<<
11516 * def __and__(self, other):
11518 __Pyx_XDECREF(__pyx_r);
11519 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error)
11520 __Pyx_GOTREF(__pyx_t_1);
11521 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
11522 __Pyx_GOTREF(__pyx_t_2);
11523 __pyx_t_3 = PyNumber_Rshift(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error)
11524 __Pyx_GOTREF(__pyx_t_3);
11525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11526 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11527 __pyx_r = __pyx_t_3;
11531 /* "lxml/objectify.pyx":697
11532 * return _numericValueOf(self) << _numericValueOf(other)
11534 * def __rshift__(self, other): # <<<<<<<<<<<<<<
11535 * return _numericValueOf(self) >> _numericValueOf(other)
11539 /* function exit code */
11541 __Pyx_XDECREF(__pyx_t_1);
11542 __Pyx_XDECREF(__pyx_t_2);
11543 __Pyx_XDECREF(__pyx_t_3);
11544 __Pyx_AddTraceback("lxml.objectify.NumberElement.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11547 __Pyx_XGIVEREF(__pyx_r);
11548 __Pyx_RefNannyFinishContext();
11552 /* "lxml/objectify.pyx":700
11553 * return _numericValueOf(self) >> _numericValueOf(other)
11555 * def __and__(self, other): # <<<<<<<<<<<<<<
11556 * return _numericValueOf(self) & _numericValueOf(other)
11560 /* Python wrapper */
11561 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_51__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11562 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_51__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11563 PyObject *__pyx_r = 0;
11564 __Pyx_RefNannyDeclarations
11565 __Pyx_RefNannySetupContext("__and__ (wrapper)", 0);
11566 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_50__and__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11568 /* function exit code */
11569 __Pyx_RefNannyFinishContext();
11573 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_50__and__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11574 PyObject *__pyx_r = NULL;
11575 __Pyx_RefNannyDeclarations
11576 PyObject *__pyx_t_1 = NULL;
11577 PyObject *__pyx_t_2 = NULL;
11578 PyObject *__pyx_t_3 = NULL;
11579 int __pyx_lineno = 0;
11580 const char *__pyx_filename = NULL;
11581 int __pyx_clineno = 0;
11582 __Pyx_RefNannySetupContext("__and__", 0);
11584 /* "lxml/objectify.pyx":701
11586 * def __and__(self, other):
11587 * return _numericValueOf(self) & _numericValueOf(other) # <<<<<<<<<<<<<<
11589 * def __or__(self, other):
11591 __Pyx_XDECREF(__pyx_r);
11592 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
11593 __Pyx_GOTREF(__pyx_t_1);
11594 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 701, __pyx_L1_error)
11595 __Pyx_GOTREF(__pyx_t_2);
11596 __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error)
11597 __Pyx_GOTREF(__pyx_t_3);
11598 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11600 __pyx_r = __pyx_t_3;
11604 /* "lxml/objectify.pyx":700
11605 * return _numericValueOf(self) >> _numericValueOf(other)
11607 * def __and__(self, other): # <<<<<<<<<<<<<<
11608 * return _numericValueOf(self) & _numericValueOf(other)
11612 /* function exit code */
11614 __Pyx_XDECREF(__pyx_t_1);
11615 __Pyx_XDECREF(__pyx_t_2);
11616 __Pyx_XDECREF(__pyx_t_3);
11617 __Pyx_AddTraceback("lxml.objectify.NumberElement.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11620 __Pyx_XGIVEREF(__pyx_r);
11621 __Pyx_RefNannyFinishContext();
11625 /* "lxml/objectify.pyx":703
11626 * return _numericValueOf(self) & _numericValueOf(other)
11628 * def __or__(self, other): # <<<<<<<<<<<<<<
11629 * return _numericValueOf(self) | _numericValueOf(other)
11633 /* Python wrapper */
11634 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_53__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11635 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_53__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11636 PyObject *__pyx_r = 0;
11637 __Pyx_RefNannyDeclarations
11638 __Pyx_RefNannySetupContext("__or__ (wrapper)", 0);
11639 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_52__or__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11641 /* function exit code */
11642 __Pyx_RefNannyFinishContext();
11646 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_52__or__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11647 PyObject *__pyx_r = NULL;
11648 __Pyx_RefNannyDeclarations
11649 PyObject *__pyx_t_1 = NULL;
11650 PyObject *__pyx_t_2 = NULL;
11651 PyObject *__pyx_t_3 = NULL;
11652 int __pyx_lineno = 0;
11653 const char *__pyx_filename = NULL;
11654 int __pyx_clineno = 0;
11655 __Pyx_RefNannySetupContext("__or__", 0);
11657 /* "lxml/objectify.pyx":704
11659 * def __or__(self, other):
11660 * return _numericValueOf(self) | _numericValueOf(other) # <<<<<<<<<<<<<<
11662 * def __xor__(self, other):
11664 __Pyx_XDECREF(__pyx_r);
11665 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
11666 __Pyx_GOTREF(__pyx_t_1);
11667 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
11668 __Pyx_GOTREF(__pyx_t_2);
11669 __pyx_t_3 = PyNumber_Or(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
11670 __Pyx_GOTREF(__pyx_t_3);
11671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11672 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11673 __pyx_r = __pyx_t_3;
11677 /* "lxml/objectify.pyx":703
11678 * return _numericValueOf(self) & _numericValueOf(other)
11680 * def __or__(self, other): # <<<<<<<<<<<<<<
11681 * return _numericValueOf(self) | _numericValueOf(other)
11685 /* function exit code */
11687 __Pyx_XDECREF(__pyx_t_1);
11688 __Pyx_XDECREF(__pyx_t_2);
11689 __Pyx_XDECREF(__pyx_t_3);
11690 __Pyx_AddTraceback("lxml.objectify.NumberElement.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11693 __Pyx_XGIVEREF(__pyx_r);
11694 __Pyx_RefNannyFinishContext();
11698 /* "lxml/objectify.pyx":706
11699 * return _numericValueOf(self) | _numericValueOf(other)
11701 * def __xor__(self, other): # <<<<<<<<<<<<<<
11702 * return _numericValueOf(self) ^ _numericValueOf(other)
11706 /* Python wrapper */
11707 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_55__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
11708 static PyObject *__pyx_pw_4lxml_9objectify_13NumberElement_55__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11709 PyObject *__pyx_r = 0;
11710 __Pyx_RefNannyDeclarations
11711 __Pyx_RefNannySetupContext("__xor__ (wrapper)", 0);
11712 __pyx_r = __pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
11714 /* function exit code */
11715 __Pyx_RefNannyFinishContext();
11719 static PyObject *__pyx_pf_4lxml_9objectify_13NumberElement_54__xor__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
11720 PyObject *__pyx_r = NULL;
11721 __Pyx_RefNannyDeclarations
11722 PyObject *__pyx_t_1 = NULL;
11723 PyObject *__pyx_t_2 = NULL;
11724 PyObject *__pyx_t_3 = NULL;
11725 int __pyx_lineno = 0;
11726 const char *__pyx_filename = NULL;
11727 int __pyx_clineno = 0;
11728 __Pyx_RefNannySetupContext("__xor__", 0);
11730 /* "lxml/objectify.pyx":707
11732 * def __xor__(self, other):
11733 * return _numericValueOf(self) ^ _numericValueOf(other) # <<<<<<<<<<<<<<
11735 * cdef class IntElement(NumberElement):
11737 __Pyx_XDECREF(__pyx_r);
11738 __pyx_t_1 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
11739 __Pyx_GOTREF(__pyx_t_1);
11740 __pyx_t_2 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
11741 __Pyx_GOTREF(__pyx_t_2);
11742 __pyx_t_3 = PyNumber_Xor(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error)
11743 __Pyx_GOTREF(__pyx_t_3);
11744 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11745 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11746 __pyx_r = __pyx_t_3;
11750 /* "lxml/objectify.pyx":706
11751 * return _numericValueOf(self) | _numericValueOf(other)
11753 * def __xor__(self, other): # <<<<<<<<<<<<<<
11754 * return _numericValueOf(self) ^ _numericValueOf(other)
11758 /* function exit code */
11760 __Pyx_XDECREF(__pyx_t_1);
11761 __Pyx_XDECREF(__pyx_t_2);
11762 __Pyx_XDECREF(__pyx_t_3);
11763 __Pyx_AddTraceback("lxml.objectify.NumberElement.__xor__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11766 __Pyx_XGIVEREF(__pyx_r);
11767 __Pyx_RefNannyFinishContext();
11771 /* "lxml/objectify.pyx":710
11773 * cdef class IntElement(NumberElement):
11774 * def _init(self): # <<<<<<<<<<<<<<
11775 * self._parse_value = int
11779 /* Python wrapper */
11780 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11781 static PyMethodDef __pyx_mdef_4lxml_9objectify_10IntElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_10IntElement_1_init, METH_NOARGS, 0};
11782 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11783 PyObject *__pyx_r = 0;
11784 __Pyx_RefNannyDeclarations
11785 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
11786 __pyx_r = __pyx_pf_4lxml_9objectify_10IntElement__init(((struct __pyx_obj_4lxml_9objectify_IntElement *)__pyx_v_self));
11788 /* function exit code */
11789 __Pyx_RefNannyFinishContext();
11793 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement__init(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self) {
11794 PyObject *__pyx_r = NULL;
11795 __Pyx_RefNannyDeclarations
11796 __Pyx_RefNannySetupContext("_init", 0);
11798 /* "lxml/objectify.pyx":711
11799 * cdef class IntElement(NumberElement):
11801 * self._parse_value = int # <<<<<<<<<<<<<<
11803 * def __index__(self):
11805 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
11806 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
11807 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
11808 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
11809 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyInt_Type));
11811 /* "lxml/objectify.pyx":710
11813 * cdef class IntElement(NumberElement):
11814 * def _init(self): # <<<<<<<<<<<<<<
11815 * self._parse_value = int
11819 /* function exit code */
11820 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11821 __Pyx_XGIVEREF(__pyx_r);
11822 __Pyx_RefNannyFinishContext();
11826 /* "lxml/objectify.pyx":713
11827 * self._parse_value = int
11829 * def __index__(self): # <<<<<<<<<<<<<<
11830 * return int(_parseNumber(self))
11834 /* Python wrapper */
11835 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_3__index__(PyObject *__pyx_v_self); /*proto*/
11836 static PyObject *__pyx_pw_4lxml_9objectify_10IntElement_3__index__(PyObject *__pyx_v_self) {
11837 PyObject *__pyx_r = 0;
11838 __Pyx_RefNannyDeclarations
11839 __Pyx_RefNannySetupContext("__index__ (wrapper)", 0);
11840 __pyx_r = __pyx_pf_4lxml_9objectify_10IntElement_2__index__(((struct __pyx_obj_4lxml_9objectify_IntElement *)__pyx_v_self));
11842 /* function exit code */
11843 __Pyx_RefNannyFinishContext();
11847 static PyObject *__pyx_pf_4lxml_9objectify_10IntElement_2__index__(struct __pyx_obj_4lxml_9objectify_IntElement *__pyx_v_self) {
11848 PyObject *__pyx_r = NULL;
11849 __Pyx_RefNannyDeclarations
11850 PyObject *__pyx_t_1 = NULL;
11851 PyObject *__pyx_t_2 = NULL;
11852 int __pyx_lineno = 0;
11853 const char *__pyx_filename = NULL;
11854 int __pyx_clineno = 0;
11855 __Pyx_RefNannySetupContext("__index__", 0);
11857 /* "lxml/objectify.pyx":714
11859 * def __index__(self):
11860 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
11862 * cdef class LongElement(NumberElement):
11864 __Pyx_XDECREF(__pyx_r);
11865 __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)
11866 __Pyx_GOTREF(__pyx_t_1);
11867 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11868 __Pyx_GOTREF(__pyx_t_2);
11869 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11870 __pyx_r = __pyx_t_2;
11874 /* "lxml/objectify.pyx":713
11875 * self._parse_value = int
11877 * def __index__(self): # <<<<<<<<<<<<<<
11878 * return int(_parseNumber(self))
11882 /* function exit code */
11884 __Pyx_XDECREF(__pyx_t_1);
11885 __Pyx_XDECREF(__pyx_t_2);
11886 __Pyx_AddTraceback("lxml.objectify.IntElement.__index__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11889 __Pyx_XGIVEREF(__pyx_r);
11890 __Pyx_RefNannyFinishContext();
11894 /* "lxml/objectify.pyx":717
11896 * cdef class LongElement(NumberElement):
11897 * def _init(self): # <<<<<<<<<<<<<<
11898 * self._parse_value = long
11902 /* Python wrapper */
11903 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11904 static PyMethodDef __pyx_mdef_4lxml_9objectify_11LongElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11LongElement_1_init, METH_NOARGS, 0};
11905 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11906 PyObject *__pyx_r = 0;
11907 __Pyx_RefNannyDeclarations
11908 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
11909 __pyx_r = __pyx_pf_4lxml_9objectify_11LongElement__init(((struct __pyx_obj_4lxml_9objectify_LongElement *)__pyx_v_self));
11911 /* function exit code */
11912 __Pyx_RefNannyFinishContext();
11916 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement__init(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self) {
11917 PyObject *__pyx_r = NULL;
11918 __Pyx_RefNannyDeclarations
11919 __Pyx_RefNannySetupContext("_init", 0);
11921 /* "lxml/objectify.pyx":718
11922 * cdef class LongElement(NumberElement):
11924 * self._parse_value = long # <<<<<<<<<<<<<<
11926 * def __index__(self):
11928 __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
11929 __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
11930 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
11931 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
11932 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyLong_Type));
11934 /* "lxml/objectify.pyx":717
11936 * cdef class LongElement(NumberElement):
11937 * def _init(self): # <<<<<<<<<<<<<<
11938 * self._parse_value = long
11942 /* function exit code */
11943 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11944 __Pyx_XGIVEREF(__pyx_r);
11945 __Pyx_RefNannyFinishContext();
11949 /* "lxml/objectify.pyx":720
11950 * self._parse_value = long
11952 * def __index__(self): # <<<<<<<<<<<<<<
11953 * return int(_parseNumber(self))
11957 /* Python wrapper */
11958 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_3__index__(PyObject *__pyx_v_self); /*proto*/
11959 static PyObject *__pyx_pw_4lxml_9objectify_11LongElement_3__index__(PyObject *__pyx_v_self) {
11960 PyObject *__pyx_r = 0;
11961 __Pyx_RefNannyDeclarations
11962 __Pyx_RefNannySetupContext("__index__ (wrapper)", 0);
11963 __pyx_r = __pyx_pf_4lxml_9objectify_11LongElement_2__index__(((struct __pyx_obj_4lxml_9objectify_LongElement *)__pyx_v_self));
11965 /* function exit code */
11966 __Pyx_RefNannyFinishContext();
11970 static PyObject *__pyx_pf_4lxml_9objectify_11LongElement_2__index__(struct __pyx_obj_4lxml_9objectify_LongElement *__pyx_v_self) {
11971 PyObject *__pyx_r = NULL;
11972 __Pyx_RefNannyDeclarations
11973 PyObject *__pyx_t_1 = NULL;
11974 PyObject *__pyx_t_2 = NULL;
11975 int __pyx_lineno = 0;
11976 const char *__pyx_filename = NULL;
11977 int __pyx_clineno = 0;
11978 __Pyx_RefNannySetupContext("__index__", 0);
11980 /* "lxml/objectify.pyx":721
11982 * def __index__(self):
11983 * return int(_parseNumber(self)) # <<<<<<<<<<<<<<
11985 * cdef class FloatElement(NumberElement):
11987 __Pyx_XDECREF(__pyx_r);
11988 __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)
11989 __Pyx_GOTREF(__pyx_t_1);
11990 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
11991 __Pyx_GOTREF(__pyx_t_2);
11992 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11993 __pyx_r = __pyx_t_2;
11997 /* "lxml/objectify.pyx":720
11998 * self._parse_value = long
12000 * def __index__(self): # <<<<<<<<<<<<<<
12001 * return int(_parseNumber(self))
12005 /* function exit code */
12007 __Pyx_XDECREF(__pyx_t_1);
12008 __Pyx_XDECREF(__pyx_t_2);
12009 __Pyx_AddTraceback("lxml.objectify.LongElement.__index__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12012 __Pyx_XGIVEREF(__pyx_r);
12013 __Pyx_RefNannyFinishContext();
12017 /* "lxml/objectify.pyx":724
12019 * cdef class FloatElement(NumberElement):
12020 * def _init(self): # <<<<<<<<<<<<<<
12021 * self._parse_value = float
12025 /* Python wrapper */
12026 static PyObject *__pyx_pw_4lxml_9objectify_12FloatElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12027 static PyMethodDef __pyx_mdef_4lxml_9objectify_12FloatElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_12FloatElement_1_init, METH_NOARGS, 0};
12028 static PyObject *__pyx_pw_4lxml_9objectify_12FloatElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12029 PyObject *__pyx_r = 0;
12030 __Pyx_RefNannyDeclarations
12031 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
12032 __pyx_r = __pyx_pf_4lxml_9objectify_12FloatElement__init(((struct __pyx_obj_4lxml_9objectify_FloatElement *)__pyx_v_self));
12034 /* function exit code */
12035 __Pyx_RefNannyFinishContext();
12039 static PyObject *__pyx_pf_4lxml_9objectify_12FloatElement__init(struct __pyx_obj_4lxml_9objectify_FloatElement *__pyx_v_self) {
12040 PyObject *__pyx_r = NULL;
12041 __Pyx_RefNannyDeclarations
12042 __Pyx_RefNannySetupContext("_init", 0);
12044 /* "lxml/objectify.pyx":725
12045 * cdef class FloatElement(NumberElement):
12047 * self._parse_value = float # <<<<<<<<<<<<<<
12049 * cdef class StringElement(ObjectifiedDataElement):
12051 __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
12052 __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
12053 __Pyx_GOTREF(__pyx_v_self->__pyx_base._parse_value);
12054 __Pyx_DECREF(__pyx_v_self->__pyx_base._parse_value);
12055 __pyx_v_self->__pyx_base._parse_value = ((PyObject *)(&PyFloat_Type));
12057 /* "lxml/objectify.pyx":724
12059 * cdef class FloatElement(NumberElement):
12060 * def _init(self): # <<<<<<<<<<<<<<
12061 * self._parse_value = float
12065 /* function exit code */
12066 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12067 __Pyx_XGIVEREF(__pyx_r);
12068 __Pyx_RefNannyFinishContext();
12072 /* "lxml/objectify.pyx":735
12075 * def pyval(self): # <<<<<<<<<<<<<<
12076 * return textOf(self._c_node) or u''
12080 /* Python wrapper */
12081 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
12082 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(PyObject *__pyx_v_self) {
12083 PyObject *__pyx_r = 0;
12084 __Pyx_RefNannyDeclarations
12085 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12086 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12088 /* function exit code */
12089 __Pyx_RefNannyFinishContext();
12093 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12094 PyObject *__pyx_r = NULL;
12095 __Pyx_RefNannyDeclarations
12096 PyObject *__pyx_t_1 = NULL;
12097 PyObject *__pyx_t_2 = NULL;
12099 int __pyx_lineno = 0;
12100 const char *__pyx_filename = NULL;
12101 int __pyx_clineno = 0;
12102 __Pyx_RefNannySetupContext("__get__", 0);
12104 /* "lxml/objectify.pyx":736
12107 * return textOf(self._c_node) or u'' # <<<<<<<<<<<<<<
12109 * def __repr__(self):
12111 __Pyx_XDECREF(__pyx_r);
12112 __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)
12113 __Pyx_GOTREF(__pyx_t_2);
12114 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 736, __pyx_L1_error)
12116 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12118 __Pyx_INCREF(__pyx_t_2);
12119 __pyx_t_1 = __pyx_t_2;
12120 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12121 goto __pyx_L3_bool_binop_done;
12123 __Pyx_INCREF(__pyx_kp_u_);
12124 __pyx_t_1 = __pyx_kp_u_;
12125 __pyx_L3_bool_binop_done:;
12126 __pyx_r = __pyx_t_1;
12130 /* "lxml/objectify.pyx":735
12133 * def pyval(self): # <<<<<<<<<<<<<<
12134 * return textOf(self._c_node) or u''
12138 /* function exit code */
12140 __Pyx_XDECREF(__pyx_t_1);
12141 __Pyx_XDECREF(__pyx_t_2);
12142 __Pyx_AddTraceback("lxml.objectify.StringElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12145 __Pyx_XGIVEREF(__pyx_r);
12146 __Pyx_RefNannyFinishContext();
12150 /* "lxml/objectify.pyx":738
12151 * return textOf(self._c_node) or u''
12153 * def __repr__(self): # <<<<<<<<<<<<<<
12154 * return repr(textOf(self._c_node) or u'')
12158 /* Python wrapper */
12159 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_1__repr__(PyObject *__pyx_v_self); /*proto*/
12160 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_1__repr__(PyObject *__pyx_v_self) {
12161 PyObject *__pyx_r = 0;
12162 __Pyx_RefNannyDeclarations
12163 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
12164 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement___repr__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12166 /* function exit code */
12167 __Pyx_RefNannyFinishContext();
12171 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement___repr__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12172 PyObject *__pyx_r = NULL;
12173 __Pyx_RefNannyDeclarations
12174 PyObject *__pyx_t_1 = NULL;
12175 PyObject *__pyx_t_2 = NULL;
12177 int __pyx_lineno = 0;
12178 const char *__pyx_filename = NULL;
12179 int __pyx_clineno = 0;
12180 __Pyx_RefNannySetupContext("__repr__", 0);
12182 /* "lxml/objectify.pyx":739
12184 * def __repr__(self):
12185 * return repr(textOf(self._c_node) or u'') # <<<<<<<<<<<<<<
12187 * def strlen(self):
12189 __Pyx_XDECREF(__pyx_r);
12190 __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)
12191 __Pyx_GOTREF(__pyx_t_2);
12192 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 739, __pyx_L1_error)
12194 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12196 __Pyx_INCREF(__pyx_t_2);
12197 __pyx_t_1 = __pyx_t_2;
12198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12199 goto __pyx_L3_bool_binop_done;
12201 __Pyx_INCREF(__pyx_kp_u_);
12202 __pyx_t_1 = __pyx_kp_u_;
12203 __pyx_L3_bool_binop_done:;
12204 __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
12205 __Pyx_GOTREF(__pyx_t_2);
12206 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12207 __pyx_r = __pyx_t_2;
12211 /* "lxml/objectify.pyx":738
12212 * return textOf(self._c_node) or u''
12214 * def __repr__(self): # <<<<<<<<<<<<<<
12215 * return repr(textOf(self._c_node) or u'')
12219 /* function exit code */
12221 __Pyx_XDECREF(__pyx_t_1);
12222 __Pyx_XDECREF(__pyx_t_2);
12223 __Pyx_AddTraceback("lxml.objectify.StringElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12226 __Pyx_XGIVEREF(__pyx_r);
12227 __Pyx_RefNannyFinishContext();
12231 /* "lxml/objectify.pyx":741
12232 * return repr(textOf(self._c_node) or u'')
12234 * def strlen(self): # <<<<<<<<<<<<<<
12235 * text = textOf(self._c_node)
12239 /* Python wrapper */
12240 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_3strlen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12241 static PyMethodDef __pyx_mdef_4lxml_9objectify_13StringElement_3strlen = {"strlen", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_3strlen, METH_NOARGS, 0};
12242 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_3strlen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12243 PyObject *__pyx_r = 0;
12244 __Pyx_RefNannyDeclarations
12245 __Pyx_RefNannySetupContext("strlen (wrapper)", 0);
12246 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_2strlen(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12248 /* function exit code */
12249 __Pyx_RefNannyFinishContext();
12253 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_2strlen(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12254 PyObject *__pyx_v_text = NULL;
12255 PyObject *__pyx_r = NULL;
12256 __Pyx_RefNannyDeclarations
12257 PyObject *__pyx_t_1 = NULL;
12260 Py_ssize_t __pyx_t_4;
12261 int __pyx_lineno = 0;
12262 const char *__pyx_filename = NULL;
12263 int __pyx_clineno = 0;
12264 __Pyx_RefNannySetupContext("strlen", 0);
12266 /* "lxml/objectify.pyx":742
12268 * def strlen(self):
12269 * text = textOf(self._c_node) # <<<<<<<<<<<<<<
12273 __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)
12274 __Pyx_GOTREF(__pyx_t_1);
12275 __pyx_v_text = __pyx_t_1;
12278 /* "lxml/objectify.pyx":743
12279 * def strlen(self):
12280 * text = textOf(self._c_node)
12281 * if text is None: # <<<<<<<<<<<<<<
12285 __pyx_t_2 = (__pyx_v_text == Py_None);
12286 __pyx_t_3 = (__pyx_t_2 != 0);
12289 /* "lxml/objectify.pyx":744
12290 * text = textOf(self._c_node)
12292 * return 0 # <<<<<<<<<<<<<<
12296 __Pyx_XDECREF(__pyx_r);
12297 __Pyx_INCREF(__pyx_int_0);
12298 __pyx_r = __pyx_int_0;
12301 /* "lxml/objectify.pyx":743
12302 * def strlen(self):
12303 * text = textOf(self._c_node)
12304 * if text is None: # <<<<<<<<<<<<<<
12310 /* "lxml/objectify.pyx":746
12313 * return len(text) # <<<<<<<<<<<<<<
12315 * def __nonzero__(self):
12318 __Pyx_XDECREF(__pyx_r);
12319 __pyx_t_4 = PyObject_Length(__pyx_v_text); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 746, __pyx_L1_error)
12320 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
12321 __Pyx_GOTREF(__pyx_t_1);
12322 __pyx_r = __pyx_t_1;
12327 /* "lxml/objectify.pyx":741
12328 * return repr(textOf(self._c_node) or u'')
12330 * def strlen(self): # <<<<<<<<<<<<<<
12331 * text = textOf(self._c_node)
12335 /* function exit code */
12337 __Pyx_XDECREF(__pyx_t_1);
12338 __Pyx_AddTraceback("lxml.objectify.StringElement.strlen", __pyx_clineno, __pyx_lineno, __pyx_filename);
12341 __Pyx_XDECREF(__pyx_v_text);
12342 __Pyx_XGIVEREF(__pyx_r);
12343 __Pyx_RefNannyFinishContext();
12347 /* "lxml/objectify.pyx":748
12350 * def __nonzero__(self): # <<<<<<<<<<<<<<
12351 * return bool(textOf(self._c_node))
12355 /* Python wrapper */
12356 static int __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
12357 static int __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__(PyObject *__pyx_v_self) {
12359 __Pyx_RefNannyDeclarations
12360 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
12361 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12363 /* function exit code */
12364 __Pyx_RefNannyFinishContext();
12368 static int __pyx_pf_4lxml_9objectify_13StringElement_4__nonzero__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12370 __Pyx_RefNannyDeclarations
12371 PyObject *__pyx_t_1 = NULL;
12373 int __pyx_lineno = 0;
12374 const char *__pyx_filename = NULL;
12375 int __pyx_clineno = 0;
12376 __Pyx_RefNannySetupContext("__nonzero__", 0);
12378 /* "lxml/objectify.pyx":749
12380 * def __nonzero__(self):
12381 * return bool(textOf(self._c_node)) # <<<<<<<<<<<<<<
12383 * def __richcmp__(self, other, int op):
12385 __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)
12386 __Pyx_GOTREF(__pyx_t_1);
12387 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 749, __pyx_L1_error)
12388 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12389 __pyx_r = (!(!__pyx_t_2));
12392 /* "lxml/objectify.pyx":748
12395 * def __nonzero__(self): # <<<<<<<<<<<<<<
12396 * return bool(textOf(self._c_node))
12400 /* function exit code */
12402 __Pyx_XDECREF(__pyx_t_1);
12403 __Pyx_AddTraceback("lxml.objectify.StringElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12406 __Pyx_RefNannyFinishContext();
12410 /* "lxml/objectify.pyx":751
12411 * return bool(textOf(self._c_node))
12413 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
12414 * return _richcmpPyvals(self, other, op)
12418 /* Python wrapper */
12419 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
12420 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
12421 PyObject *__pyx_r = 0;
12422 __Pyx_RefNannyDeclarations
12423 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
12424 __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));
12426 /* function exit code */
12427 __Pyx_RefNannyFinishContext();
12431 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) {
12432 PyObject *__pyx_r = NULL;
12433 __Pyx_RefNannyDeclarations
12434 PyObject *__pyx_t_1 = NULL;
12435 int __pyx_lineno = 0;
12436 const char *__pyx_filename = NULL;
12437 int __pyx_clineno = 0;
12438 __Pyx_RefNannySetupContext("__richcmp__", 0);
12440 /* "lxml/objectify.pyx":752
12442 * def __richcmp__(self, other, int op):
12443 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
12445 * def __hash__(self):
12447 __Pyx_XDECREF(__pyx_r);
12448 __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)
12449 __Pyx_GOTREF(__pyx_t_1);
12450 __pyx_r = __pyx_t_1;
12454 /* "lxml/objectify.pyx":751
12455 * return bool(textOf(self._c_node))
12457 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
12458 * return _richcmpPyvals(self, other, op)
12462 /* function exit code */
12464 __Pyx_XDECREF(__pyx_t_1);
12465 __Pyx_AddTraceback("lxml.objectify.StringElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12468 __Pyx_XGIVEREF(__pyx_r);
12469 __Pyx_RefNannyFinishContext();
12473 /* "lxml/objectify.pyx":754
12474 * return _richcmpPyvals(self, other, op)
12476 * def __hash__(self): # <<<<<<<<<<<<<<
12477 * return hash(textOf(self._c_node) or u'')
12481 /* Python wrapper */
12482 static Py_hash_t __pyx_pw_4lxml_9objectify_13StringElement_9__hash__(PyObject *__pyx_v_self); /*proto*/
12483 static Py_hash_t __pyx_pw_4lxml_9objectify_13StringElement_9__hash__(PyObject *__pyx_v_self) {
12485 __Pyx_RefNannyDeclarations
12486 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
12487 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12489 /* function exit code */
12490 __Pyx_RefNannyFinishContext();
12494 static Py_hash_t __pyx_pf_4lxml_9objectify_13StringElement_8__hash__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12496 __Pyx_RefNannyDeclarations
12497 PyObject *__pyx_t_1 = NULL;
12498 PyObject *__pyx_t_2 = NULL;
12500 Py_hash_t __pyx_t_4;
12501 int __pyx_lineno = 0;
12502 const char *__pyx_filename = NULL;
12503 int __pyx_clineno = 0;
12504 __Pyx_RefNannySetupContext("__hash__", 0);
12506 /* "lxml/objectify.pyx":755
12508 * def __hash__(self):
12509 * return hash(textOf(self._c_node) or u'') # <<<<<<<<<<<<<<
12511 * def __add__(self, other):
12513 __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)
12514 __Pyx_GOTREF(__pyx_t_2);
12515 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
12517 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12519 __Pyx_INCREF(__pyx_t_2);
12520 __pyx_t_1 = __pyx_t_2;
12521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12522 goto __pyx_L3_bool_binop_done;
12524 __Pyx_INCREF(__pyx_kp_u_);
12525 __pyx_t_1 = __pyx_kp_u_;
12526 __pyx_L3_bool_binop_done:;
12527 __pyx_t_4 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_hash_t)-1))) __PYX_ERR(0, 755, __pyx_L1_error)
12528 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12529 __pyx_r = __pyx_t_4;
12532 /* "lxml/objectify.pyx":754
12533 * return _richcmpPyvals(self, other, op)
12535 * def __hash__(self): # <<<<<<<<<<<<<<
12536 * return hash(textOf(self._c_node) or u'')
12540 /* function exit code */
12542 __Pyx_XDECREF(__pyx_t_1);
12543 __Pyx_XDECREF(__pyx_t_2);
12544 __Pyx_AddTraceback("lxml.objectify.StringElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12547 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
12548 __Pyx_RefNannyFinishContext();
12552 /* "lxml/objectify.pyx":757
12553 * return hash(textOf(self._c_node) or u'')
12555 * def __add__(self, other): # <<<<<<<<<<<<<<
12556 * text = _strValueOf(self)
12557 * other = _strValueOf(other)
12560 /* Python wrapper */
12561 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12562 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_11__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12563 PyObject *__pyx_r = 0;
12564 __Pyx_RefNannyDeclarations
12565 __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
12566 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_10__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12568 /* function exit code */
12569 __Pyx_RefNannyFinishContext();
12573 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_10__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12574 PyObject *__pyx_v_text = NULL;
12575 PyObject *__pyx_r = NULL;
12576 __Pyx_RefNannyDeclarations
12577 PyObject *__pyx_t_1 = NULL;
12580 int __pyx_lineno = 0;
12581 const char *__pyx_filename = NULL;
12582 int __pyx_clineno = 0;
12583 __Pyx_RefNannySetupContext("__add__", 0);
12584 __Pyx_INCREF(__pyx_v_other);
12586 /* "lxml/objectify.pyx":758
12588 * def __add__(self, other):
12589 * text = _strValueOf(self) # <<<<<<<<<<<<<<
12590 * other = _strValueOf(other)
12593 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
12594 __Pyx_GOTREF(__pyx_t_1);
12595 __pyx_v_text = __pyx_t_1;
12598 /* "lxml/objectify.pyx":759
12599 * def __add__(self, other):
12600 * text = _strValueOf(self)
12601 * other = _strValueOf(other) # <<<<<<<<<<<<<<
12605 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
12606 __Pyx_GOTREF(__pyx_t_1);
12607 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_1);
12610 /* "lxml/objectify.pyx":760
12611 * text = _strValueOf(self)
12612 * other = _strValueOf(other)
12613 * if text is None: # <<<<<<<<<<<<<<
12615 * if other is None:
12617 __pyx_t_2 = (__pyx_v_text == Py_None);
12618 __pyx_t_3 = (__pyx_t_2 != 0);
12621 /* "lxml/objectify.pyx":761
12622 * other = _strValueOf(other)
12624 * return other # <<<<<<<<<<<<<<
12625 * if other is None:
12628 __Pyx_XDECREF(__pyx_r);
12629 __Pyx_INCREF(__pyx_v_other);
12630 __pyx_r = __pyx_v_other;
12633 /* "lxml/objectify.pyx":760
12634 * text = _strValueOf(self)
12635 * other = _strValueOf(other)
12636 * if text is None: # <<<<<<<<<<<<<<
12638 * if other is None:
12642 /* "lxml/objectify.pyx":762
12645 * if other is None: # <<<<<<<<<<<<<<
12647 * return text + other
12649 __pyx_t_3 = (__pyx_v_other == Py_None);
12650 __pyx_t_2 = (__pyx_t_3 != 0);
12653 /* "lxml/objectify.pyx":763
12655 * if other is None:
12656 * return text # <<<<<<<<<<<<<<
12657 * return text + other
12660 __Pyx_XDECREF(__pyx_r);
12661 __Pyx_INCREF(__pyx_v_text);
12662 __pyx_r = __pyx_v_text;
12665 /* "lxml/objectify.pyx":762
12668 * if other is None: # <<<<<<<<<<<<<<
12670 * return text + other
12674 /* "lxml/objectify.pyx":764
12675 * if other is None:
12677 * return text + other # <<<<<<<<<<<<<<
12679 * def __mul__(self, other):
12681 __Pyx_XDECREF(__pyx_r);
12682 __pyx_t_1 = PyNumber_Add(__pyx_v_text, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
12683 __Pyx_GOTREF(__pyx_t_1);
12684 __pyx_r = __pyx_t_1;
12688 /* "lxml/objectify.pyx":757
12689 * return hash(textOf(self._c_node) or u'')
12691 * def __add__(self, other): # <<<<<<<<<<<<<<
12692 * text = _strValueOf(self)
12693 * other = _strValueOf(other)
12696 /* function exit code */
12698 __Pyx_XDECREF(__pyx_t_1);
12699 __Pyx_AddTraceback("lxml.objectify.StringElement.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12702 __Pyx_XDECREF(__pyx_v_text);
12703 __Pyx_XDECREF(__pyx_v_other);
12704 __Pyx_XGIVEREF(__pyx_r);
12705 __Pyx_RefNannyFinishContext();
12709 /* "lxml/objectify.pyx":766
12710 * return text + other
12712 * def __mul__(self, other): # <<<<<<<<<<<<<<
12713 * if isinstance(self, StringElement):
12714 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12717 /* Python wrapper */
12718 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_13__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12719 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_13__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12720 PyObject *__pyx_r = 0;
12721 __Pyx_RefNannyDeclarations
12722 __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
12723 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_12__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12725 /* function exit code */
12726 __Pyx_RefNannyFinishContext();
12730 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_12__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12731 PyObject *__pyx_r = NULL;
12732 __Pyx_RefNannyDeclarations
12735 PyObject *__pyx_t_3 = NULL;
12736 PyObject *__pyx_t_4 = NULL;
12737 PyObject *__pyx_t_5 = NULL;
12738 int __pyx_lineno = 0;
12739 const char *__pyx_filename = NULL;
12740 int __pyx_clineno = 0;
12741 __Pyx_RefNannySetupContext("__mul__", 0);
12743 /* "lxml/objectify.pyx":767
12745 * def __mul__(self, other):
12746 * if isinstance(self, StringElement): # <<<<<<<<<<<<<<
12747 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12748 * elif isinstance(other, StringElement):
12750 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_self, __pyx_ptype_4lxml_9objectify_StringElement);
12751 __pyx_t_2 = (__pyx_t_1 != 0);
12754 /* "lxml/objectify.pyx":768
12755 * def __mul__(self, other):
12756 * if isinstance(self, StringElement):
12757 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other) # <<<<<<<<<<<<<<
12758 * elif isinstance(other, StringElement):
12759 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12761 __Pyx_XDECREF(__pyx_r);
12762 __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)
12763 __Pyx_GOTREF(__pyx_t_3);
12764 __pyx_t_4 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error)
12765 __Pyx_GOTREF(__pyx_t_4);
12766 __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error)
12767 __Pyx_GOTREF(__pyx_t_5);
12768 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12769 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12770 __pyx_r = __pyx_t_5;
12774 /* "lxml/objectify.pyx":767
12776 * def __mul__(self, other):
12777 * if isinstance(self, StringElement): # <<<<<<<<<<<<<<
12778 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12779 * elif isinstance(other, StringElement):
12783 /* "lxml/objectify.pyx":769
12784 * if isinstance(self, StringElement):
12785 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12786 * elif isinstance(other, StringElement): # <<<<<<<<<<<<<<
12787 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12790 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_4lxml_9objectify_StringElement);
12791 __pyx_t_1 = (__pyx_t_2 != 0);
12792 if (likely(__pyx_t_1)) {
12794 /* "lxml/objectify.pyx":770
12795 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12796 * elif isinstance(other, StringElement):
12797 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node) # <<<<<<<<<<<<<<
12799 * raise TypeError, u"invalid types for * operator"
12801 __Pyx_XDECREF(__pyx_r);
12802 __pyx_t_5 = __pyx_f_4lxml_9objectify__numericValueOf(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 770, __pyx_L1_error)
12803 __Pyx_GOTREF(__pyx_t_5);
12804 __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)
12805 __Pyx_GOTREF(__pyx_t_4);
12806 __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error)
12807 __Pyx_GOTREF(__pyx_t_3);
12808 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12809 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12810 __pyx_r = __pyx_t_3;
12814 /* "lxml/objectify.pyx":769
12815 * if isinstance(self, StringElement):
12816 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12817 * elif isinstance(other, StringElement): # <<<<<<<<<<<<<<
12818 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12823 /* "lxml/objectify.pyx":772
12824 * return _numericValueOf(self) * textOf((<StringElement>other)._c_node)
12826 * raise TypeError, u"invalid types for * operator" # <<<<<<<<<<<<<<
12828 * def __mod__(self, other):
12831 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_types_for_operator, 0, 0);
12832 __PYX_ERR(0, 772, __pyx_L1_error)
12835 /* "lxml/objectify.pyx":766
12836 * return text + other
12838 * def __mul__(self, other): # <<<<<<<<<<<<<<
12839 * if isinstance(self, StringElement):
12840 * return textOf((<StringElement>self)._c_node) * _numericValueOf(other)
12843 /* function exit code */
12845 __Pyx_XDECREF(__pyx_t_3);
12846 __Pyx_XDECREF(__pyx_t_4);
12847 __Pyx_XDECREF(__pyx_t_5);
12848 __Pyx_AddTraceback("lxml.objectify.StringElement.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12851 __Pyx_XGIVEREF(__pyx_r);
12852 __Pyx_RefNannyFinishContext();
12856 /* "lxml/objectify.pyx":774
12857 * raise TypeError, u"invalid types for * operator"
12859 * def __mod__(self, other): # <<<<<<<<<<<<<<
12860 * return _strValueOf(self) % other
12864 /* Python wrapper */
12865 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_15__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
12866 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_15__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12867 PyObject *__pyx_r = 0;
12868 __Pyx_RefNannyDeclarations
12869 __Pyx_RefNannySetupContext("__mod__ (wrapper)", 0);
12870 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_14__mod__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));
12872 /* function exit code */
12873 __Pyx_RefNannyFinishContext();
12877 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_14__mod__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
12878 PyObject *__pyx_r = NULL;
12879 __Pyx_RefNannyDeclarations
12880 PyObject *__pyx_t_1 = NULL;
12881 PyObject *__pyx_t_2 = NULL;
12882 int __pyx_lineno = 0;
12883 const char *__pyx_filename = NULL;
12884 int __pyx_clineno = 0;
12885 __Pyx_RefNannySetupContext("__mod__", 0);
12887 /* "lxml/objectify.pyx":775
12889 * def __mod__(self, other):
12890 * return _strValueOf(self) % other # <<<<<<<<<<<<<<
12892 * def __int__(self):
12894 __Pyx_XDECREF(__pyx_r);
12895 __pyx_t_1 = __pyx_f_4lxml_9objectify__strValueOf(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
12896 __Pyx_GOTREF(__pyx_t_1);
12897 __pyx_t_2 = PyNumber_Remainder(__pyx_t_1, __pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
12898 __Pyx_GOTREF(__pyx_t_2);
12899 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12900 __pyx_r = __pyx_t_2;
12904 /* "lxml/objectify.pyx":774
12905 * raise TypeError, u"invalid types for * operator"
12907 * def __mod__(self, other): # <<<<<<<<<<<<<<
12908 * return _strValueOf(self) % other
12912 /* function exit code */
12914 __Pyx_XDECREF(__pyx_t_1);
12915 __Pyx_XDECREF(__pyx_t_2);
12916 __Pyx_AddTraceback("lxml.objectify.StringElement.__mod__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12919 __Pyx_XGIVEREF(__pyx_r);
12920 __Pyx_RefNannyFinishContext();
12924 /* "lxml/objectify.pyx":777
12925 * return _strValueOf(self) % other
12927 * def __int__(self): # <<<<<<<<<<<<<<
12928 * return int(textOf(self._c_node))
12932 /* Python wrapper */
12933 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_17__int__(PyObject *__pyx_v_self); /*proto*/
12934 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_17__int__(PyObject *__pyx_v_self) {
12935 PyObject *__pyx_r = 0;
12936 __Pyx_RefNannyDeclarations
12937 __Pyx_RefNannySetupContext("__int__ (wrapper)", 0);
12938 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_16__int__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
12940 /* function exit code */
12941 __Pyx_RefNannyFinishContext();
12945 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_16__int__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
12946 PyObject *__pyx_r = NULL;
12947 __Pyx_RefNannyDeclarations
12948 PyObject *__pyx_t_1 = NULL;
12949 PyObject *__pyx_t_2 = NULL;
12950 int __pyx_lineno = 0;
12951 const char *__pyx_filename = NULL;
12952 int __pyx_clineno = 0;
12953 __Pyx_RefNannySetupContext("__int__", 0);
12955 /* "lxml/objectify.pyx":778
12957 * def __int__(self):
12958 * return int(textOf(self._c_node)) # <<<<<<<<<<<<<<
12960 * def __long__(self):
12962 __Pyx_XDECREF(__pyx_r);
12963 __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)
12964 __Pyx_GOTREF(__pyx_t_1);
12965 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 778, __pyx_L1_error)
12966 __Pyx_GOTREF(__pyx_t_2);
12967 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12968 __pyx_r = __pyx_t_2;
12972 /* "lxml/objectify.pyx":777
12973 * return _strValueOf(self) % other
12975 * def __int__(self): # <<<<<<<<<<<<<<
12976 * return int(textOf(self._c_node))
12980 /* function exit code */
12982 __Pyx_XDECREF(__pyx_t_1);
12983 __Pyx_XDECREF(__pyx_t_2);
12984 __Pyx_AddTraceback("lxml.objectify.StringElement.__int__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12987 __Pyx_XGIVEREF(__pyx_r);
12988 __Pyx_RefNannyFinishContext();
12992 /* "lxml/objectify.pyx":780
12993 * return int(textOf(self._c_node))
12995 * def __long__(self): # <<<<<<<<<<<<<<
12996 * return long(textOf(self._c_node))
13000 /* Python wrapper */
13001 #if PY_MAJOR_VERSION < 3
13002 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_19__long__(PyObject *__pyx_v_self); /*proto*/
13003 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_19__long__(PyObject *__pyx_v_self) {
13004 PyObject *__pyx_r = 0;
13005 __Pyx_RefNannyDeclarations
13006 __Pyx_RefNannySetupContext("__long__ (wrapper)", 0);
13007 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_18__long__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
13009 /* function exit code */
13010 __Pyx_RefNannyFinishContext();
13013 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
13015 #if PY_MAJOR_VERSION < 3
13016 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_18__long__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13017 PyObject *__pyx_r = NULL;
13018 __Pyx_RefNannyDeclarations
13019 PyObject *__pyx_t_1 = NULL;
13020 PyObject *__pyx_t_2 = NULL;
13021 int __pyx_lineno = 0;
13022 const char *__pyx_filename = NULL;
13023 int __pyx_clineno = 0;
13024 __Pyx_RefNannySetupContext("__long__", 0);
13026 /* "lxml/objectify.pyx":781
13028 * def __long__(self):
13029 * return long(textOf(self._c_node)) # <<<<<<<<<<<<<<
13031 * def __float__(self):
13033 __Pyx_XDECREF(__pyx_r);
13034 __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)
13035 __Pyx_GOTREF(__pyx_t_1);
13036 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyLong_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
13037 __Pyx_GOTREF(__pyx_t_2);
13038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13039 __pyx_r = __pyx_t_2;
13043 /* "lxml/objectify.pyx":780
13044 * return int(textOf(self._c_node))
13046 * def __long__(self): # <<<<<<<<<<<<<<
13047 * return long(textOf(self._c_node))
13051 /* function exit code */
13053 __Pyx_XDECREF(__pyx_t_1);
13054 __Pyx_XDECREF(__pyx_t_2);
13055 __Pyx_AddTraceback("lxml.objectify.StringElement.__long__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13058 __Pyx_XGIVEREF(__pyx_r);
13059 __Pyx_RefNannyFinishContext();
13062 #endif /*!(#if PY_MAJOR_VERSION < 3)*/
13064 /* "lxml/objectify.pyx":783
13065 * return long(textOf(self._c_node))
13067 * def __float__(self): # <<<<<<<<<<<<<<
13068 * return float(textOf(self._c_node))
13072 /* Python wrapper */
13073 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_21__float__(PyObject *__pyx_v_self); /*proto*/
13074 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_21__float__(PyObject *__pyx_v_self) {
13075 PyObject *__pyx_r = 0;
13076 __Pyx_RefNannyDeclarations
13077 __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
13078 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_20__float__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
13080 /* function exit code */
13081 __Pyx_RefNannyFinishContext();
13085 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_20__float__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13086 PyObject *__pyx_r = NULL;
13087 __Pyx_RefNannyDeclarations
13088 PyObject *__pyx_t_1 = NULL;
13089 PyObject *__pyx_t_2 = NULL;
13090 int __pyx_lineno = 0;
13091 const char *__pyx_filename = NULL;
13092 int __pyx_clineno = 0;
13093 __Pyx_RefNannySetupContext("__float__", 0);
13095 /* "lxml/objectify.pyx":784
13097 * def __float__(self):
13098 * return float(textOf(self._c_node)) # <<<<<<<<<<<<<<
13100 * def __complex__(self):
13102 __Pyx_XDECREF(__pyx_r);
13103 __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)
13104 __Pyx_GOTREF(__pyx_t_1);
13105 __pyx_t_2 = __Pyx_PyNumber_Float(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
13106 __Pyx_GOTREF(__pyx_t_2);
13107 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13108 __pyx_r = __pyx_t_2;
13112 /* "lxml/objectify.pyx":783
13113 * return long(textOf(self._c_node))
13115 * def __float__(self): # <<<<<<<<<<<<<<
13116 * return float(textOf(self._c_node))
13120 /* function exit code */
13122 __Pyx_XDECREF(__pyx_t_1);
13123 __Pyx_XDECREF(__pyx_t_2);
13124 __Pyx_AddTraceback("lxml.objectify.StringElement.__float__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13127 __Pyx_XGIVEREF(__pyx_r);
13128 __Pyx_RefNannyFinishContext();
13132 /* "lxml/objectify.pyx":786
13133 * return float(textOf(self._c_node))
13135 * def __complex__(self): # <<<<<<<<<<<<<<
13136 * return complex(textOf(self._c_node))
13140 /* Python wrapper */
13141 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_23__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13142 static PyMethodDef __pyx_mdef_4lxml_9objectify_13StringElement_23__complex__ = {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_23__complex__, METH_NOARGS, 0};
13143 static PyObject *__pyx_pw_4lxml_9objectify_13StringElement_23__complex__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13144 PyObject *__pyx_r = 0;
13145 __Pyx_RefNannyDeclarations
13146 __Pyx_RefNannySetupContext("__complex__ (wrapper)", 0);
13147 __pyx_r = __pyx_pf_4lxml_9objectify_13StringElement_22__complex__(((struct __pyx_obj_4lxml_9objectify_StringElement *)__pyx_v_self));
13149 /* function exit code */
13150 __Pyx_RefNannyFinishContext();
13154 static PyObject *__pyx_pf_4lxml_9objectify_13StringElement_22__complex__(struct __pyx_obj_4lxml_9objectify_StringElement *__pyx_v_self) {
13155 PyObject *__pyx_r = NULL;
13156 __Pyx_RefNannyDeclarations
13157 PyObject *__pyx_t_1 = NULL;
13158 PyObject *__pyx_t_2 = NULL;
13159 int __pyx_lineno = 0;
13160 const char *__pyx_filename = NULL;
13161 int __pyx_clineno = 0;
13162 __Pyx_RefNannySetupContext("__complex__", 0);
13164 /* "lxml/objectify.pyx":787
13166 * def __complex__(self):
13167 * return complex(textOf(self._c_node)) # <<<<<<<<<<<<<<
13169 * cdef class NoneElement(ObjectifiedDataElement):
13171 __Pyx_XDECREF(__pyx_r);
13172 __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)
13173 __Pyx_GOTREF(__pyx_t_1);
13174 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
13175 __Pyx_GOTREF(__pyx_t_2);
13176 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13177 __pyx_r = __pyx_t_2;
13181 /* "lxml/objectify.pyx":786
13182 * return float(textOf(self._c_node))
13184 * def __complex__(self): # <<<<<<<<<<<<<<
13185 * return complex(textOf(self._c_node))
13189 /* function exit code */
13191 __Pyx_XDECREF(__pyx_t_1);
13192 __Pyx_XDECREF(__pyx_t_2);
13193 __Pyx_AddTraceback("lxml.objectify.StringElement.__complex__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13196 __Pyx_XGIVEREF(__pyx_r);
13197 __Pyx_RefNannyFinishContext();
13201 /* "lxml/objectify.pyx":790
13203 * cdef class NoneElement(ObjectifiedDataElement):
13204 * def __str__(self): # <<<<<<<<<<<<<<
13209 /* Python wrapper */
13210 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_1__str__(PyObject *__pyx_v_self); /*proto*/
13211 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_1__str__(PyObject *__pyx_v_self) {
13212 PyObject *__pyx_r = 0;
13213 __Pyx_RefNannyDeclarations
13214 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13215 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement___str__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13217 /* function exit code */
13218 __Pyx_RefNannyFinishContext();
13222 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement___str__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13223 PyObject *__pyx_r = NULL;
13224 __Pyx_RefNannyDeclarations
13225 __Pyx_RefNannySetupContext("__str__", 0);
13227 /* "lxml/objectify.pyx":791
13228 * cdef class NoneElement(ObjectifiedDataElement):
13229 * def __str__(self):
13230 * return u"None" # <<<<<<<<<<<<<<
13232 * def __repr__(self):
13234 __Pyx_XDECREF(__pyx_r);
13235 __Pyx_INCREF(__pyx_n_u_None);
13236 __pyx_r = __pyx_n_u_None;
13239 /* "lxml/objectify.pyx":790
13241 * cdef class NoneElement(ObjectifiedDataElement):
13242 * def __str__(self): # <<<<<<<<<<<<<<
13247 /* function exit code */
13249 __Pyx_XGIVEREF(__pyx_r);
13250 __Pyx_RefNannyFinishContext();
13254 /* "lxml/objectify.pyx":793
13257 * def __repr__(self): # <<<<<<<<<<<<<<
13262 /* Python wrapper */
13263 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_3__repr__(PyObject *__pyx_v_self); /*proto*/
13264 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_3__repr__(PyObject *__pyx_v_self) {
13265 PyObject *__pyx_r = 0;
13266 __Pyx_RefNannyDeclarations
13267 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13268 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13270 /* function exit code */
13271 __Pyx_RefNannyFinishContext();
13275 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_2__repr__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13276 PyObject *__pyx_r = NULL;
13277 __Pyx_RefNannyDeclarations
13278 __Pyx_RefNannySetupContext("__repr__", 0);
13280 /* "lxml/objectify.pyx":794
13282 * def __repr__(self):
13283 * return "None" # <<<<<<<<<<<<<<
13285 * def __nonzero__(self):
13287 __Pyx_XDECREF(__pyx_r);
13288 __Pyx_INCREF(__pyx_n_s_None);
13289 __pyx_r = __pyx_n_s_None;
13292 /* "lxml/objectify.pyx":793
13295 * def __repr__(self): # <<<<<<<<<<<<<<
13300 /* function exit code */
13302 __Pyx_XGIVEREF(__pyx_r);
13303 __Pyx_RefNannyFinishContext();
13307 /* "lxml/objectify.pyx":796
13310 * def __nonzero__(self): # <<<<<<<<<<<<<<
13315 /* Python wrapper */
13316 static int __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
13317 static int __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__(PyObject *__pyx_v_self) {
13319 __Pyx_RefNannyDeclarations
13320 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
13321 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13323 /* function exit code */
13324 __Pyx_RefNannyFinishContext();
13328 static int __pyx_pf_4lxml_9objectify_11NoneElement_4__nonzero__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13330 __Pyx_RefNannyDeclarations
13331 __Pyx_RefNannySetupContext("__nonzero__", 0);
13333 /* "lxml/objectify.pyx":797
13335 * def __nonzero__(self):
13336 * return False # <<<<<<<<<<<<<<
13338 * def __richcmp__(self, other, int op):
13343 /* "lxml/objectify.pyx":796
13346 * def __nonzero__(self): # <<<<<<<<<<<<<<
13351 /* function exit code */
13353 __Pyx_RefNannyFinishContext();
13357 /* "lxml/objectify.pyx":799
13360 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13361 * if other is None or self is None:
13362 * return python.PyObject_RichCompare(None, None, op)
13365 /* Python wrapper */
13366 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
13367 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13368 PyObject *__pyx_r = 0;
13369 __Pyx_RefNannyDeclarations
13370 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
13371 __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));
13373 /* function exit code */
13374 __Pyx_RefNannyFinishContext();
13378 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) {
13379 PyObject *__pyx_r = NULL;
13380 __Pyx_RefNannyDeclarations
13384 PyObject *__pyx_t_4 = NULL;
13385 int __pyx_lineno = 0;
13386 const char *__pyx_filename = NULL;
13387 int __pyx_clineno = 0;
13388 __Pyx_RefNannySetupContext("__richcmp__", 0);
13390 /* "lxml/objectify.pyx":800
13392 * def __richcmp__(self, other, int op):
13393 * if other is None or self is None: # <<<<<<<<<<<<<<
13394 * return python.PyObject_RichCompare(None, None, op)
13395 * if isinstance(self, NoneElement):
13397 __pyx_t_2 = (__pyx_v_other == Py_None);
13398 __pyx_t_3 = (__pyx_t_2 != 0);
13401 __pyx_t_1 = __pyx_t_3;
13402 goto __pyx_L4_bool_binop_done;
13404 __pyx_t_3 = (((PyObject *)__pyx_v_self) == Py_None);
13405 __pyx_t_2 = (__pyx_t_3 != 0);
13406 __pyx_t_1 = __pyx_t_2;
13407 __pyx_L4_bool_binop_done:;
13410 /* "lxml/objectify.pyx":801
13411 * def __richcmp__(self, other, int op):
13412 * if other is None or self is None:
13413 * return python.PyObject_RichCompare(None, None, op) # <<<<<<<<<<<<<<
13414 * if isinstance(self, NoneElement):
13415 * return python.PyObject_RichCompare(None, other, op)
13417 __Pyx_XDECREF(__pyx_r);
13418 __pyx_t_4 = PyObject_RichCompare(Py_None, Py_None, __pyx_v_op); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error)
13419 __Pyx_GOTREF(__pyx_t_4);
13420 __pyx_r = __pyx_t_4;
13424 /* "lxml/objectify.pyx":800
13426 * def __richcmp__(self, other, int op):
13427 * if other is None or self is None: # <<<<<<<<<<<<<<
13428 * return python.PyObject_RichCompare(None, None, op)
13429 * if isinstance(self, NoneElement):
13433 /* "lxml/objectify.pyx":802
13434 * if other is None or self is None:
13435 * return python.PyObject_RichCompare(None, None, op)
13436 * if isinstance(self, NoneElement): # <<<<<<<<<<<<<<
13437 * return python.PyObject_RichCompare(None, other, op)
13440 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_9objectify_NoneElement);
13441 __pyx_t_2 = (__pyx_t_1 != 0);
13444 /* "lxml/objectify.pyx":803
13445 * return python.PyObject_RichCompare(None, None, op)
13446 * if isinstance(self, NoneElement):
13447 * return python.PyObject_RichCompare(None, other, op) # <<<<<<<<<<<<<<
13449 * return python.PyObject_RichCompare(self, None, op)
13451 __Pyx_XDECREF(__pyx_r);
13452 __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)
13453 __Pyx_GOTREF(__pyx_t_4);
13454 __pyx_r = __pyx_t_4;
13458 /* "lxml/objectify.pyx":802
13459 * if other is None or self is None:
13460 * return python.PyObject_RichCompare(None, None, op)
13461 * if isinstance(self, NoneElement): # <<<<<<<<<<<<<<
13462 * return python.PyObject_RichCompare(None, other, op)
13467 /* "lxml/objectify.pyx":805
13468 * return python.PyObject_RichCompare(None, other, op)
13470 * return python.PyObject_RichCompare(self, None, op) # <<<<<<<<<<<<<<
13472 * def __hash__(self):
13475 __Pyx_XDECREF(__pyx_r);
13476 __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)
13477 __Pyx_GOTREF(__pyx_t_4);
13478 __pyx_r = __pyx_t_4;
13483 /* "lxml/objectify.pyx":799
13486 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13487 * if other is None or self is None:
13488 * return python.PyObject_RichCompare(None, None, op)
13491 /* function exit code */
13493 __Pyx_XDECREF(__pyx_t_4);
13494 __Pyx_AddTraceback("lxml.objectify.NoneElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13497 __Pyx_XGIVEREF(__pyx_r);
13498 __Pyx_RefNannyFinishContext();
13502 /* "lxml/objectify.pyx":807
13503 * return python.PyObject_RichCompare(self, None, op)
13505 * def __hash__(self): # <<<<<<<<<<<<<<
13506 * return hash(None)
13510 /* Python wrapper */
13511 static Py_hash_t __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__(PyObject *__pyx_v_self); /*proto*/
13512 static Py_hash_t __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__(PyObject *__pyx_v_self) {
13514 __Pyx_RefNannyDeclarations
13515 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
13516 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13518 /* function exit code */
13519 __Pyx_RefNannyFinishContext();
13523 static Py_hash_t __pyx_pf_4lxml_9objectify_11NoneElement_8__hash__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13525 __Pyx_RefNannyDeclarations
13526 Py_hash_t __pyx_t_1;
13527 int __pyx_lineno = 0;
13528 const char *__pyx_filename = NULL;
13529 int __pyx_clineno = 0;
13530 __Pyx_RefNannySetupContext("__hash__", 0);
13532 /* "lxml/objectify.pyx":808
13534 * def __hash__(self):
13535 * return hash(None) # <<<<<<<<<<<<<<
13539 __pyx_t_1 = PyObject_Hash(Py_None); if (unlikely(__pyx_t_1 == ((Py_hash_t)-1))) __PYX_ERR(0, 808, __pyx_L1_error)
13540 __pyx_r = __pyx_t_1;
13543 /* "lxml/objectify.pyx":807
13544 * return python.PyObject_RichCompare(self, None, op)
13546 * def __hash__(self): # <<<<<<<<<<<<<<
13547 * return hash(None)
13551 /* function exit code */
13553 __Pyx_AddTraceback("lxml.objectify.NoneElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13556 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
13557 __Pyx_RefNannyFinishContext();
13561 /* "lxml/objectify.pyx":811
13564 * def pyval(self): # <<<<<<<<<<<<<<
13569 /* Python wrapper */
13570 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
13571 static PyObject *__pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(PyObject *__pyx_v_self) {
13572 PyObject *__pyx_r = 0;
13573 __Pyx_RefNannyDeclarations
13574 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13575 __pyx_r = __pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_NoneElement *)__pyx_v_self));
13577 /* function exit code */
13578 __Pyx_RefNannyFinishContext();
13582 static PyObject *__pyx_pf_4lxml_9objectify_11NoneElement_5pyval___get__(CYTHON_UNUSED struct __pyx_obj_4lxml_9objectify_NoneElement *__pyx_v_self) {
13583 PyObject *__pyx_r = NULL;
13584 __Pyx_RefNannyDeclarations
13585 __Pyx_RefNannySetupContext("__get__", 0);
13587 /* "lxml/objectify.pyx":812
13590 * return None # <<<<<<<<<<<<<<
13594 __Pyx_XDECREF(__pyx_r);
13595 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13598 /* "lxml/objectify.pyx":811
13601 * def pyval(self): # <<<<<<<<<<<<<<
13606 /* function exit code */
13608 __Pyx_XGIVEREF(__pyx_r);
13609 __Pyx_RefNannyFinishContext();
13613 /* "lxml/objectify.pyx":821
13614 * Python's bool type.
13616 * def _init(self): # <<<<<<<<<<<<<<
13617 * self._parse_value = __parseBool
13621 /* Python wrapper */
13622 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13623 static PyMethodDef __pyx_mdef_4lxml_9objectify_11BoolElement_1_init = {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11BoolElement_1_init, METH_NOARGS, 0};
13624 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_1_init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13625 PyObject *__pyx_r = 0;
13626 __Pyx_RefNannyDeclarations
13627 __Pyx_RefNannySetupContext("_init (wrapper)", 0);
13628 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement__init(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13630 /* function exit code */
13631 __Pyx_RefNannyFinishContext();
13635 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement__init(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13636 PyObject *__pyx_r = NULL;
13637 __Pyx_RefNannyDeclarations
13638 PyObject *__pyx_t_1 = NULL;
13639 int __pyx_lineno = 0;
13640 const char *__pyx_filename = NULL;
13641 int __pyx_clineno = 0;
13642 __Pyx_RefNannySetupContext("_init", 0);
13644 /* "lxml/objectify.pyx":822
13647 * self._parse_value = __parseBool # <<<<<<<<<<<<<<
13649 * def __nonzero__(self):
13651 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parseBool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
13652 __Pyx_GOTREF(__pyx_t_1);
13653 __Pyx_GIVEREF(__pyx_t_1);
13654 __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base._parse_value);
13655 __Pyx_DECREF(__pyx_v_self->__pyx_base.__pyx_base._parse_value);
13656 __pyx_v_self->__pyx_base.__pyx_base._parse_value = __pyx_t_1;
13659 /* "lxml/objectify.pyx":821
13660 * Python's bool type.
13662 * def _init(self): # <<<<<<<<<<<<<<
13663 * self._parse_value = __parseBool
13667 /* function exit code */
13668 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13671 __Pyx_XDECREF(__pyx_t_1);
13672 __Pyx_AddTraceback("lxml.objectify.BoolElement._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
13675 __Pyx_XGIVEREF(__pyx_r);
13676 __Pyx_RefNannyFinishContext();
13680 /* "lxml/objectify.pyx":824
13681 * self._parse_value = __parseBool
13683 * def __nonzero__(self): # <<<<<<<<<<<<<<
13684 * return __parseBool(textOf(self._c_node))
13688 /* Python wrapper */
13689 static int __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__(PyObject *__pyx_v_self); /*proto*/
13690 static int __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__(PyObject *__pyx_v_self) {
13692 __Pyx_RefNannyDeclarations
13693 __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
13694 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13696 /* function exit code */
13697 __Pyx_RefNannyFinishContext();
13701 static int __pyx_pf_4lxml_9objectify_11BoolElement_2__nonzero__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13703 __Pyx_RefNannyDeclarations
13704 PyObject *__pyx_t_1 = NULL;
13706 int __pyx_lineno = 0;
13707 const char *__pyx_filename = NULL;
13708 int __pyx_clineno = 0;
13709 __Pyx_RefNannySetupContext("__nonzero__", 0);
13711 /* "lxml/objectify.pyx":825
13713 * def __nonzero__(self):
13714 * return __parseBool(textOf(self._c_node)) # <<<<<<<<<<<<<<
13716 * def __richcmp__(self, other, int op):
13718 __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)
13719 __Pyx_GOTREF(__pyx_t_1);
13720 __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)
13721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13722 __pyx_r = __pyx_t_2;
13725 /* "lxml/objectify.pyx":824
13726 * self._parse_value = __parseBool
13728 * def __nonzero__(self): # <<<<<<<<<<<<<<
13729 * return __parseBool(textOf(self._c_node))
13733 /* function exit code */
13735 __Pyx_XDECREF(__pyx_t_1);
13736 __Pyx_AddTraceback("lxml.objectify.BoolElement.__nonzero__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13739 __Pyx_RefNannyFinishContext();
13743 /* "lxml/objectify.pyx":827
13744 * return __parseBool(textOf(self._c_node))
13746 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13747 * return _richcmpPyvals(self, other, op)
13751 /* Python wrapper */
13752 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
13753 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
13754 PyObject *__pyx_r = 0;
13755 __Pyx_RefNannyDeclarations
13756 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
13757 __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));
13759 /* function exit code */
13760 __Pyx_RefNannyFinishContext();
13764 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) {
13765 PyObject *__pyx_r = NULL;
13766 __Pyx_RefNannyDeclarations
13767 PyObject *__pyx_t_1 = NULL;
13768 int __pyx_lineno = 0;
13769 const char *__pyx_filename = NULL;
13770 int __pyx_clineno = 0;
13771 __Pyx_RefNannySetupContext("__richcmp__", 0);
13773 /* "lxml/objectify.pyx":828
13775 * def __richcmp__(self, other, int op):
13776 * return _richcmpPyvals(self, other, op) # <<<<<<<<<<<<<<
13778 * def __hash__(self):
13780 __Pyx_XDECREF(__pyx_r);
13781 __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)
13782 __Pyx_GOTREF(__pyx_t_1);
13783 __pyx_r = __pyx_t_1;
13787 /* "lxml/objectify.pyx":827
13788 * return __parseBool(textOf(self._c_node))
13790 * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<<
13791 * return _richcmpPyvals(self, other, op)
13795 /* function exit code */
13797 __Pyx_XDECREF(__pyx_t_1);
13798 __Pyx_AddTraceback("lxml.objectify.BoolElement.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13801 __Pyx_XGIVEREF(__pyx_r);
13802 __Pyx_RefNannyFinishContext();
13806 /* "lxml/objectify.pyx":830
13807 * return _richcmpPyvals(self, other, op)
13809 * def __hash__(self): # <<<<<<<<<<<<<<
13810 * return hash(__parseBool(textOf(self._c_node)))
13814 /* Python wrapper */
13815 static Py_hash_t __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__(PyObject *__pyx_v_self); /*proto*/
13816 static Py_hash_t __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__(PyObject *__pyx_v_self) {
13818 __Pyx_RefNannyDeclarations
13819 __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0);
13820 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13822 /* function exit code */
13823 __Pyx_RefNannyFinishContext();
13827 static Py_hash_t __pyx_pf_4lxml_9objectify_11BoolElement_6__hash__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13829 __Pyx_RefNannyDeclarations
13830 PyObject *__pyx_t_1 = NULL;
13832 Py_hash_t __pyx_t_3;
13833 int __pyx_lineno = 0;
13834 const char *__pyx_filename = NULL;
13835 int __pyx_clineno = 0;
13836 __Pyx_RefNannySetupContext("__hash__", 0);
13838 /* "lxml/objectify.pyx":831
13840 * def __hash__(self):
13841 * return hash(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13843 * def __str__(self):
13845 __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)
13846 __Pyx_GOTREF(__pyx_t_1);
13847 __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)
13848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13849 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
13850 __Pyx_GOTREF(__pyx_t_1);
13851 __pyx_t_3 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_hash_t)-1))) __PYX_ERR(0, 831, __pyx_L1_error)
13852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13853 __pyx_r = __pyx_t_3;
13856 /* "lxml/objectify.pyx":830
13857 * return _richcmpPyvals(self, other, op)
13859 * def __hash__(self): # <<<<<<<<<<<<<<
13860 * return hash(__parseBool(textOf(self._c_node)))
13864 /* function exit code */
13866 __Pyx_XDECREF(__pyx_t_1);
13867 __Pyx_AddTraceback("lxml.objectify.BoolElement.__hash__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13870 if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
13871 __Pyx_RefNannyFinishContext();
13875 /* "lxml/objectify.pyx":833
13876 * return hash(__parseBool(textOf(self._c_node)))
13878 * def __str__(self): # <<<<<<<<<<<<<<
13879 * return unicode(__parseBool(textOf(self._c_node)))
13883 /* Python wrapper */
13884 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_9__str__(PyObject *__pyx_v_self); /*proto*/
13885 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_9__str__(PyObject *__pyx_v_self) {
13886 PyObject *__pyx_r = 0;
13887 __Pyx_RefNannyDeclarations
13888 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13889 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_8__str__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13891 /* function exit code */
13892 __Pyx_RefNannyFinishContext();
13896 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_8__str__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13897 PyObject *__pyx_r = NULL;
13898 __Pyx_RefNannyDeclarations
13899 PyObject *__pyx_t_1 = NULL;
13901 PyObject *__pyx_t_3 = NULL;
13902 int __pyx_lineno = 0;
13903 const char *__pyx_filename = NULL;
13904 int __pyx_clineno = 0;
13905 __Pyx_RefNannySetupContext("__str__", 0);
13907 /* "lxml/objectify.pyx":834
13909 * def __str__(self):
13910 * return unicode(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13912 * def __repr__(self):
13914 __Pyx_XDECREF(__pyx_r);
13915 __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)
13916 __Pyx_GOTREF(__pyx_t_1);
13917 __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)
13918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13919 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
13920 __Pyx_GOTREF(__pyx_t_1);
13921 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error)
13922 __Pyx_GOTREF(__pyx_t_3);
13923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13924 __pyx_r = __pyx_t_3;
13928 /* "lxml/objectify.pyx":833
13929 * return hash(__parseBool(textOf(self._c_node)))
13931 * def __str__(self): # <<<<<<<<<<<<<<
13932 * return unicode(__parseBool(textOf(self._c_node)))
13936 /* function exit code */
13938 __Pyx_XDECREF(__pyx_t_1);
13939 __Pyx_XDECREF(__pyx_t_3);
13940 __Pyx_AddTraceback("lxml.objectify.BoolElement.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13943 __Pyx_XGIVEREF(__pyx_r);
13944 __Pyx_RefNannyFinishContext();
13948 /* "lxml/objectify.pyx":836
13949 * return unicode(__parseBool(textOf(self._c_node)))
13951 * def __repr__(self): # <<<<<<<<<<<<<<
13952 * return repr(__parseBool(textOf(self._c_node)))
13956 /* Python wrapper */
13957 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_11__repr__(PyObject *__pyx_v_self); /*proto*/
13958 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_11__repr__(PyObject *__pyx_v_self) {
13959 PyObject *__pyx_r = 0;
13960 __Pyx_RefNannyDeclarations
13961 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13962 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
13964 /* function exit code */
13965 __Pyx_RefNannyFinishContext();
13969 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_10__repr__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
13970 PyObject *__pyx_r = NULL;
13971 __Pyx_RefNannyDeclarations
13972 PyObject *__pyx_t_1 = NULL;
13974 PyObject *__pyx_t_3 = NULL;
13975 int __pyx_lineno = 0;
13976 const char *__pyx_filename = NULL;
13977 int __pyx_clineno = 0;
13978 __Pyx_RefNannySetupContext("__repr__", 0);
13980 /* "lxml/objectify.pyx":837
13982 * def __repr__(self):
13983 * return repr(__parseBool(textOf(self._c_node))) # <<<<<<<<<<<<<<
13987 __Pyx_XDECREF(__pyx_r);
13988 __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)
13989 __Pyx_GOTREF(__pyx_t_1);
13990 __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)
13991 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13992 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
13993 __Pyx_GOTREF(__pyx_t_1);
13994 __pyx_t_3 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
13995 __Pyx_GOTREF(__pyx_t_3);
13996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13997 __pyx_r = __pyx_t_3;
14001 /* "lxml/objectify.pyx":836
14002 * return unicode(__parseBool(textOf(self._c_node)))
14004 * def __repr__(self): # <<<<<<<<<<<<<<
14005 * return repr(__parseBool(textOf(self._c_node)))
14009 /* function exit code */
14011 __Pyx_XDECREF(__pyx_t_1);
14012 __Pyx_XDECREF(__pyx_t_3);
14013 __Pyx_AddTraceback("lxml.objectify.BoolElement.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14016 __Pyx_XGIVEREF(__pyx_r);
14017 __Pyx_RefNannyFinishContext();
14021 /* "lxml/objectify.pyx":840
14024 * def pyval(self): # <<<<<<<<<<<<<<
14025 * return __parseBool(textOf(self._c_node))
14029 /* Python wrapper */
14030 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(PyObject *__pyx_v_self); /*proto*/
14031 static PyObject *__pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(PyObject *__pyx_v_self) {
14032 PyObject *__pyx_r = 0;
14033 __Pyx_RefNannyDeclarations
14034 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
14035 __pyx_r = __pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(((struct __pyx_obj_4lxml_9objectify_BoolElement *)__pyx_v_self));
14037 /* function exit code */
14038 __Pyx_RefNannyFinishContext();
14042 static PyObject *__pyx_pf_4lxml_9objectify_11BoolElement_5pyval___get__(struct __pyx_obj_4lxml_9objectify_BoolElement *__pyx_v_self) {
14043 PyObject *__pyx_r = NULL;
14044 __Pyx_RefNannyDeclarations
14045 PyObject *__pyx_t_1 = NULL;
14047 int __pyx_lineno = 0;
14048 const char *__pyx_filename = NULL;
14049 int __pyx_clineno = 0;
14050 __Pyx_RefNannySetupContext("__get__", 0);
14052 /* "lxml/objectify.pyx":841
14055 * return __parseBool(textOf(self._c_node)) # <<<<<<<<<<<<<<
14057 * def __checkBool(s):
14059 __Pyx_XDECREF(__pyx_r);
14060 __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)
14061 __Pyx_GOTREF(__pyx_t_1);
14062 __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)
14063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14064 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
14065 __Pyx_GOTREF(__pyx_t_1);
14066 __pyx_r = __pyx_t_1;
14070 /* "lxml/objectify.pyx":840
14073 * def pyval(self): # <<<<<<<<<<<<<<
14074 * return __parseBool(textOf(self._c_node))
14078 /* function exit code */
14080 __Pyx_XDECREF(__pyx_t_1);
14081 __Pyx_AddTraceback("lxml.objectify.BoolElement.pyval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14084 __Pyx_XGIVEREF(__pyx_r);
14085 __Pyx_RefNannyFinishContext();
14089 /* "lxml/objectify.pyx":843
14090 * return __parseBool(textOf(self._c_node))
14092 * def __checkBool(s): # <<<<<<<<<<<<<<
14093 * cdef int value = -1
14094 * if s is not None:
14097 /* Python wrapper */
14098 static PyObject *__pyx_pw_4lxml_9objectify_3__checkBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14099 static PyMethodDef __pyx_mdef_4lxml_9objectify_3__checkBool = {"__checkBool", (PyCFunction)__pyx_pw_4lxml_9objectify_3__checkBool, METH_O, 0};
14100 static PyObject *__pyx_pw_4lxml_9objectify_3__checkBool(PyObject *__pyx_self, PyObject *__pyx_v_s) {
14101 PyObject *__pyx_r = 0;
14102 __Pyx_RefNannyDeclarations
14103 __Pyx_RefNannySetupContext("__checkBool (wrapper)", 0);
14104 __pyx_r = __pyx_pf_4lxml_9objectify_2__checkBool(__pyx_self, ((PyObject *)__pyx_v_s));
14106 /* function exit code */
14107 __Pyx_RefNannyFinishContext();
14111 static PyObject *__pyx_pf_4lxml_9objectify_2__checkBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
14113 PyObject *__pyx_r = NULL;
14114 __Pyx_RefNannyDeclarations
14118 int __pyx_lineno = 0;
14119 const char *__pyx_filename = NULL;
14120 int __pyx_clineno = 0;
14121 __Pyx_RefNannySetupContext("__checkBool", 0);
14123 /* "lxml/objectify.pyx":844
14125 * def __checkBool(s):
14126 * cdef int value = -1 # <<<<<<<<<<<<<<
14127 * if s is not None:
14128 * value = __parseBoolAsInt(s)
14130 __pyx_v_value = -1;
14132 /* "lxml/objectify.pyx":845
14133 * def __checkBool(s):
14134 * cdef int value = -1
14135 * if s is not None: # <<<<<<<<<<<<<<
14136 * value = __parseBoolAsInt(s)
14139 __pyx_t_1 = (__pyx_v_s != Py_None);
14140 __pyx_t_2 = (__pyx_t_1 != 0);
14143 /* "lxml/objectify.pyx":846
14144 * cdef int value = -1
14145 * if s is not None:
14146 * value = __parseBoolAsInt(s) # <<<<<<<<<<<<<<
14150 __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)
14151 __pyx_v_value = __pyx_t_3;
14153 /* "lxml/objectify.pyx":845
14154 * def __checkBool(s):
14155 * cdef int value = -1
14156 * if s is not None: # <<<<<<<<<<<<<<
14157 * value = __parseBoolAsInt(s)
14162 /* "lxml/objectify.pyx":847
14163 * if s is not None:
14164 * value = __parseBoolAsInt(s)
14165 * if value == -1: # <<<<<<<<<<<<<<
14169 __pyx_t_2 = ((__pyx_v_value == -1L) != 0);
14170 if (unlikely(__pyx_t_2)) {
14172 /* "lxml/objectify.pyx":848
14173 * value = __parseBoolAsInt(s)
14175 * raise ValueError # <<<<<<<<<<<<<<
14177 * cpdef bint __parseBool(s) except -1:
14179 __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
14180 __PYX_ERR(0, 848, __pyx_L1_error)
14182 /* "lxml/objectify.pyx":847
14183 * if s is not None:
14184 * value = __parseBoolAsInt(s)
14185 * if value == -1: # <<<<<<<<<<<<<<
14191 /* "lxml/objectify.pyx":843
14192 * return __parseBool(textOf(self._c_node))
14194 * def __checkBool(s): # <<<<<<<<<<<<<<
14195 * cdef int value = -1
14196 * if s is not None:
14199 /* function exit code */
14200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14203 __Pyx_AddTraceback("lxml.objectify.__checkBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14206 __Pyx_XGIVEREF(__pyx_r);
14207 __Pyx_RefNannyFinishContext();
14211 /* "lxml/objectify.pyx":850
14214 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
14219 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14220 static int __pyx_f_4lxml_9objectify___parseBool(PyObject *__pyx_v_s, CYTHON_UNUSED int __pyx_skip_dispatch) {
14223 __Pyx_RefNannyDeclarations
14227 PyObject *__pyx_t_4 = NULL;
14228 Py_ssize_t __pyx_t_5;
14230 PyObject *__pyx_t_7 = NULL;
14231 int __pyx_lineno = 0;
14232 const char *__pyx_filename = NULL;
14233 int __pyx_clineno = 0;
14234 __Pyx_RefNannySetupContext("__parseBool", 0);
14236 /* "lxml/objectify.pyx":852
14237 * cpdef bint __parseBool(s) except -1:
14239 * if s is None: # <<<<<<<<<<<<<<
14241 * value = __parseBoolAsInt(s)
14243 __pyx_t_1 = (__pyx_v_s == Py_None);
14244 __pyx_t_2 = (__pyx_t_1 != 0);
14247 /* "lxml/objectify.pyx":853
14250 * return False # <<<<<<<<<<<<<<
14251 * value = __parseBoolAsInt(s)
14257 /* "lxml/objectify.pyx":852
14258 * cpdef bint __parseBool(s) except -1:
14260 * if s is None: # <<<<<<<<<<<<<<
14262 * value = __parseBoolAsInt(s)
14266 /* "lxml/objectify.pyx":854
14269 * value = __parseBoolAsInt(s) # <<<<<<<<<<<<<<
14271 * raise ValueError, f"Invalid boolean value: '{s}'"
14273 __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)
14274 __pyx_v_value = __pyx_t_3;
14276 /* "lxml/objectify.pyx":855
14278 * value = __parseBoolAsInt(s)
14279 * if value == -1: # <<<<<<<<<<<<<<
14280 * raise ValueError, f"Invalid boolean value: '{s}'"
14283 __pyx_t_2 = ((__pyx_v_value == -1L) != 0);
14284 if (unlikely(__pyx_t_2)) {
14286 /* "lxml/objectify.pyx":856
14287 * value = __parseBoolAsInt(s)
14289 * raise ValueError, f"Invalid boolean value: '{s}'" # <<<<<<<<<<<<<<
14293 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
14294 __Pyx_GOTREF(__pyx_t_4);
14297 __Pyx_INCREF(__pyx_kp_u_Invalid_boolean_value);
14299 __Pyx_GIVEREF(__pyx_kp_u_Invalid_boolean_value);
14300 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Invalid_boolean_value);
14301 __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_s, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
14302 __Pyx_GOTREF(__pyx_t_7);
14303 __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;
14304 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
14305 __Pyx_GIVEREF(__pyx_t_7);
14306 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
14308 __Pyx_INCREF(__pyx_kp_u__4);
14310 __Pyx_GIVEREF(__pyx_kp_u__4);
14311 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__4);
14312 __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)
14313 __Pyx_GOTREF(__pyx_t_7);
14314 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14315 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_7, 0, 0);
14316 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14317 __PYX_ERR(0, 856, __pyx_L1_error)
14319 /* "lxml/objectify.pyx":855
14321 * value = __parseBoolAsInt(s)
14322 * if value == -1: # <<<<<<<<<<<<<<
14323 * raise ValueError, f"Invalid boolean value: '{s}'"
14328 /* "lxml/objectify.pyx":857
14330 * raise ValueError, f"Invalid boolean value: '{s}'"
14331 * return value # <<<<<<<<<<<<<<
14333 * cdef inline int __parseBoolAsInt(text) except -2:
14335 __pyx_r = __pyx_v_value;
14338 /* "lxml/objectify.pyx":850
14341 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
14346 /* function exit code */
14348 __Pyx_XDECREF(__pyx_t_4);
14349 __Pyx_XDECREF(__pyx_t_7);
14350 __Pyx_AddTraceback("lxml.objectify.__parseBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14353 __Pyx_RefNannyFinishContext();
14357 /* Python wrapper */
14358 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
14359 static PyMethodDef __pyx_mdef_4lxml_9objectify_5__parseBool = {"__parseBool", (PyCFunction)__pyx_pw_4lxml_9objectify_5__parseBool, METH_O, 0};
14360 static PyObject *__pyx_pw_4lxml_9objectify_5__parseBool(PyObject *__pyx_self, PyObject *__pyx_v_s) {
14361 PyObject *__pyx_r = 0;
14362 __Pyx_RefNannyDeclarations
14363 __Pyx_RefNannySetupContext("__parseBool (wrapper)", 0);
14364 __pyx_r = __pyx_pf_4lxml_9objectify_4__parseBool(__pyx_self, ((PyObject *)__pyx_v_s));
14366 /* function exit code */
14367 __Pyx_RefNannyFinishContext();
14371 static PyObject *__pyx_pf_4lxml_9objectify_4__parseBool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_s) {
14372 PyObject *__pyx_r = NULL;
14373 __Pyx_RefNannyDeclarations
14375 PyObject *__pyx_t_2 = NULL;
14376 int __pyx_lineno = 0;
14377 const char *__pyx_filename = NULL;
14378 int __pyx_clineno = 0;
14379 __Pyx_RefNannySetupContext("__parseBool", 0);
14380 __Pyx_XDECREF(__pyx_r);
14381 __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)
14382 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
14383 __Pyx_GOTREF(__pyx_t_2);
14384 __pyx_r = __pyx_t_2;
14388 /* function exit code */
14390 __Pyx_XDECREF(__pyx_t_2);
14391 __Pyx_AddTraceback("lxml.objectify.__parseBool", __pyx_clineno, __pyx_lineno, __pyx_filename);
14394 __Pyx_XGIVEREF(__pyx_r);
14395 __Pyx_RefNannyFinishContext();
14399 /* "lxml/objectify.pyx":859
14402 * cdef inline int __parseBoolAsInt(text) except -2: # <<<<<<<<<<<<<<
14403 * if text == 'false':
14407 static CYTHON_INLINE int __pyx_f_4lxml_9objectify___parseBoolAsInt(PyObject *__pyx_v_text) {
14409 __Pyx_RefNannyDeclarations
14411 int __pyx_lineno = 0;
14412 const char *__pyx_filename = NULL;
14413 int __pyx_clineno = 0;
14414 __Pyx_RefNannySetupContext("__parseBoolAsInt", 0);
14416 /* "lxml/objectify.pyx":860
14418 * cdef inline int __parseBoolAsInt(text) except -2:
14419 * if text == 'false': # <<<<<<<<<<<<<<
14421 * elif text == 'true':
14423 __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)
14426 /* "lxml/objectify.pyx":861
14427 * cdef inline int __parseBoolAsInt(text) except -2:
14428 * if text == 'false':
14429 * return 0 # <<<<<<<<<<<<<<
14430 * elif text == 'true':
14436 /* "lxml/objectify.pyx":860
14438 * cdef inline int __parseBoolAsInt(text) except -2:
14439 * if text == 'false': # <<<<<<<<<<<<<<
14441 * elif text == 'true':
14445 /* "lxml/objectify.pyx":862
14446 * if text == 'false':
14448 * elif text == 'true': # <<<<<<<<<<<<<<
14450 * elif text == '0':
14452 __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)
14455 /* "lxml/objectify.pyx":863
14457 * elif text == 'true':
14458 * return 1 # <<<<<<<<<<<<<<
14459 * elif text == '0':
14465 /* "lxml/objectify.pyx":862
14466 * if text == 'false':
14468 * elif text == 'true': # <<<<<<<<<<<<<<
14470 * elif text == '0':
14474 /* "lxml/objectify.pyx":864
14475 * elif text == 'true':
14477 * elif text == '0': # <<<<<<<<<<<<<<
14479 * elif text == '1':
14481 __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)
14484 /* "lxml/objectify.pyx":865
14486 * elif text == '0':
14487 * return 0 # <<<<<<<<<<<<<<
14488 * elif text == '1':
14494 /* "lxml/objectify.pyx":864
14495 * elif text == 'true':
14497 * elif text == '0': # <<<<<<<<<<<<<<
14499 * elif text == '1':
14503 /* "lxml/objectify.pyx":866
14504 * elif text == '0':
14506 * elif text == '1': # <<<<<<<<<<<<<<
14510 __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)
14513 /* "lxml/objectify.pyx":867
14515 * elif text == '1':
14516 * return 1 # <<<<<<<<<<<<<<
14523 /* "lxml/objectify.pyx":866
14524 * elif text == '0':
14526 * elif text == '1': # <<<<<<<<<<<<<<
14532 /* "lxml/objectify.pyx":868
14533 * elif text == '1':
14535 * return -1 # <<<<<<<<<<<<<<
14537 * cdef object _parseNumber(NumberElement element):
14542 /* "lxml/objectify.pyx":859
14545 * cdef inline int __parseBoolAsInt(text) except -2: # <<<<<<<<<<<<<<
14546 * if text == 'false':
14550 /* function exit code */
14552 __Pyx_AddTraceback("lxml.objectify.__parseBoolAsInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
14555 __Pyx_RefNannyFinishContext();
14559 /* "lxml/objectify.pyx":870
14562 * cdef object _parseNumber(NumberElement element): # <<<<<<<<<<<<<<
14563 * return element._parse_value(textOf(element._c_node))
14567 static PyObject *__pyx_f_4lxml_9objectify__parseNumber(struct __pyx_obj_4lxml_9objectify_NumberElement *__pyx_v_element) {
14568 PyObject *__pyx_r = NULL;
14569 __Pyx_RefNannyDeclarations
14570 PyObject *__pyx_t_1 = NULL;
14571 PyObject *__pyx_t_2 = NULL;
14572 PyObject *__pyx_t_3 = NULL;
14573 PyObject *__pyx_t_4 = NULL;
14574 int __pyx_lineno = 0;
14575 const char *__pyx_filename = NULL;
14576 int __pyx_clineno = 0;
14577 __Pyx_RefNannySetupContext("_parseNumber", 0);
14579 /* "lxml/objectify.pyx":871
14581 * cdef object _parseNumber(NumberElement element):
14582 * return element._parse_value(textOf(element._c_node)) # <<<<<<<<<<<<<<
14584 * cdef object _strValueOf(obj):
14586 __Pyx_XDECREF(__pyx_r);
14587 __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)
14588 __Pyx_GOTREF(__pyx_t_2);
14589 __Pyx_INCREF(__pyx_v_element->_parse_value);
14590 __pyx_t_3 = __pyx_v_element->_parse_value; __pyx_t_4 = NULL;
14591 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14592 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
14593 if (likely(__pyx_t_4)) {
14594 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14595 __Pyx_INCREF(__pyx_t_4);
14596 __Pyx_INCREF(function);
14597 __Pyx_DECREF_SET(__pyx_t_3, function);
14600 __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);
14601 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14603 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
14604 __Pyx_GOTREF(__pyx_t_1);
14605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14606 __pyx_r = __pyx_t_1;
14610 /* "lxml/objectify.pyx":870
14613 * cdef object _parseNumber(NumberElement element): # <<<<<<<<<<<<<<
14614 * return element._parse_value(textOf(element._c_node))
14618 /* function exit code */
14620 __Pyx_XDECREF(__pyx_t_1);
14621 __Pyx_XDECREF(__pyx_t_2);
14622 __Pyx_XDECREF(__pyx_t_3);
14623 __Pyx_XDECREF(__pyx_t_4);
14624 __Pyx_AddTraceback("lxml.objectify._parseNumber", __pyx_clineno, __pyx_lineno, __pyx_filename);
14627 __Pyx_XGIVEREF(__pyx_r);
14628 __Pyx_RefNannyFinishContext();
14632 /* "lxml/objectify.pyx":873
14633 * return element._parse_value(textOf(element._c_node))
14635 * cdef object _strValueOf(obj): # <<<<<<<<<<<<<<
14636 * if python._isString(obj):
14640 static PyObject *__pyx_f_4lxml_9objectify__strValueOf(PyObject *__pyx_v_obj) {
14641 PyObject *__pyx_r = NULL;
14642 __Pyx_RefNannyDeclarations
14645 PyObject *__pyx_t_3 = NULL;
14646 PyObject *__pyx_t_4 = NULL;
14647 int __pyx_lineno = 0;
14648 const char *__pyx_filename = NULL;
14649 int __pyx_clineno = 0;
14650 __Pyx_RefNannySetupContext("_strValueOf", 0);
14652 /* "lxml/objectify.pyx":874
14654 * cdef object _strValueOf(obj):
14655 * if python._isString(obj): # <<<<<<<<<<<<<<
14657 * if isinstance(obj, _Element):
14659 __pyx_t_1 = (_isString(__pyx_v_obj) != 0);
14662 /* "lxml/objectify.pyx":875
14663 * cdef object _strValueOf(obj):
14664 * if python._isString(obj):
14665 * return obj # <<<<<<<<<<<<<<
14666 * if isinstance(obj, _Element):
14667 * return textOf((<_Element>obj)._c_node) or u''
14669 __Pyx_XDECREF(__pyx_r);
14670 __Pyx_INCREF(__pyx_v_obj);
14671 __pyx_r = __pyx_v_obj;
14674 /* "lxml/objectify.pyx":874
14676 * cdef object _strValueOf(obj):
14677 * if python._isString(obj): # <<<<<<<<<<<<<<
14679 * if isinstance(obj, _Element):
14683 /* "lxml/objectify.pyx":876
14684 * if python._isString(obj):
14686 * if isinstance(obj, _Element): # <<<<<<<<<<<<<<
14687 * return textOf((<_Element>obj)._c_node) or u''
14690 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
14691 __pyx_t_2 = (__pyx_t_1 != 0);
14694 /* "lxml/objectify.pyx":877
14696 * if isinstance(obj, _Element):
14697 * return textOf((<_Element>obj)._c_node) or u'' # <<<<<<<<<<<<<<
14701 __Pyx_XDECREF(__pyx_r);
14702 __pyx_t_4 = textOf(((struct LxmlElement *)__pyx_v_obj)->_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 877, __pyx_L1_error)
14703 __Pyx_GOTREF(__pyx_t_4);
14704 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 877, __pyx_L1_error)
14706 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14708 __Pyx_INCREF(__pyx_t_4);
14709 __pyx_t_3 = __pyx_t_4;
14710 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14711 goto __pyx_L5_bool_binop_done;
14713 __Pyx_INCREF(__pyx_kp_u_);
14714 __pyx_t_3 = __pyx_kp_u_;
14715 __pyx_L5_bool_binop_done:;
14716 __pyx_r = __pyx_t_3;
14720 /* "lxml/objectify.pyx":876
14721 * if python._isString(obj):
14723 * if isinstance(obj, _Element): # <<<<<<<<<<<<<<
14724 * return textOf((<_Element>obj)._c_node) or u''
14729 /* "lxml/objectify.pyx":878
14730 * if isinstance(obj, _Element):
14731 * return textOf((<_Element>obj)._c_node) or u''
14732 * if obj is None: # <<<<<<<<<<<<<<
14734 * return unicode(obj)
14736 __pyx_t_2 = (__pyx_v_obj == Py_None);
14737 __pyx_t_1 = (__pyx_t_2 != 0);
14740 /* "lxml/objectify.pyx":879
14741 * return textOf((<_Element>obj)._c_node) or u''
14743 * return u'' # <<<<<<<<<<<<<<
14744 * return unicode(obj)
14747 __Pyx_XDECREF(__pyx_r);
14748 __Pyx_INCREF(__pyx_kp_u_);
14749 __pyx_r = __pyx_kp_u_;
14752 /* "lxml/objectify.pyx":878
14753 * if isinstance(obj, _Element):
14754 * return textOf((<_Element>obj)._c_node) or u''
14755 * if obj is None: # <<<<<<<<<<<<<<
14757 * return unicode(obj)
14761 /* "lxml/objectify.pyx":880
14764 * return unicode(obj) # <<<<<<<<<<<<<<
14766 * cdef object _numericValueOf(obj):
14768 __Pyx_XDECREF(__pyx_r);
14769 __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 880, __pyx_L1_error)
14770 __Pyx_GOTREF(__pyx_t_3);
14771 __pyx_r = __pyx_t_3;
14775 /* "lxml/objectify.pyx":873
14776 * return element._parse_value(textOf(element._c_node))
14778 * cdef object _strValueOf(obj): # <<<<<<<<<<<<<<
14779 * if python._isString(obj):
14783 /* function exit code */
14785 __Pyx_XDECREF(__pyx_t_3);
14786 __Pyx_XDECREF(__pyx_t_4);
14787 __Pyx_AddTraceback("lxml.objectify._strValueOf", __pyx_clineno, __pyx_lineno, __pyx_filename);
14790 __Pyx_XGIVEREF(__pyx_r);
14791 __Pyx_RefNannyFinishContext();
14795 /* "lxml/objectify.pyx":882
14796 * return unicode(obj)
14798 * cdef object _numericValueOf(obj): # <<<<<<<<<<<<<<
14799 * if isinstance(obj, NumberElement):
14800 * return _parseNumber(<NumberElement>obj)
14803 static PyObject *__pyx_f_4lxml_9objectify__numericValueOf(PyObject *__pyx_v_obj) {
14804 PyObject *__pyx_r = NULL;
14805 __Pyx_RefNannyDeclarations
14808 PyObject *__pyx_t_3 = NULL;
14809 PyObject *__pyx_t_4 = NULL;
14810 PyObject *__pyx_t_5 = NULL;
14811 PyObject *__pyx_t_6 = NULL;
14813 int __pyx_lineno = 0;
14814 const char *__pyx_filename = NULL;
14815 int __pyx_clineno = 0;
14816 __Pyx_RefNannySetupContext("_numericValueOf", 0);
14818 /* "lxml/objectify.pyx":883
14820 * cdef object _numericValueOf(obj):
14821 * if isinstance(obj, NumberElement): # <<<<<<<<<<<<<<
14822 * return _parseNumber(<NumberElement>obj)
14825 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_4lxml_9objectify_NumberElement);
14826 __pyx_t_2 = (__pyx_t_1 != 0);
14829 /* "lxml/objectify.pyx":884
14830 * cdef object _numericValueOf(obj):
14831 * if isinstance(obj, NumberElement):
14832 * return _parseNumber(<NumberElement>obj) # <<<<<<<<<<<<<<
14834 * # not always numeric, but Python will raise the right exception
14836 __Pyx_XDECREF(__pyx_r);
14837 __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)
14838 __Pyx_GOTREF(__pyx_t_3);
14839 __pyx_r = __pyx_t_3;
14843 /* "lxml/objectify.pyx":883
14845 * cdef object _numericValueOf(obj):
14846 * if isinstance(obj, NumberElement): # <<<<<<<<<<<<<<
14847 * return _parseNumber(<NumberElement>obj)
14852 /* "lxml/objectify.pyx":885
14853 * if isinstance(obj, NumberElement):
14854 * return _parseNumber(<NumberElement>obj)
14855 * try: # <<<<<<<<<<<<<<
14856 * # not always numeric, but Python will raise the right exception
14860 __Pyx_PyThreadState_declare
14861 __Pyx_PyThreadState_assign
14862 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
14863 __Pyx_XGOTREF(__pyx_t_4);
14864 __Pyx_XGOTREF(__pyx_t_5);
14865 __Pyx_XGOTREF(__pyx_t_6);
14868 /* "lxml/objectify.pyx":887
14870 * # not always numeric, but Python will raise the right exception
14871 * return obj.pyval # <<<<<<<<<<<<<<
14872 * except AttributeError:
14875 __Pyx_XDECREF(__pyx_r);
14876 __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)
14877 __Pyx_GOTREF(__pyx_t_3);
14878 __pyx_r = __pyx_t_3;
14880 goto __pyx_L8_try_return;
14882 /* "lxml/objectify.pyx":885
14883 * if isinstance(obj, NumberElement):
14884 * return _parseNumber(<NumberElement>obj)
14885 * try: # <<<<<<<<<<<<<<
14886 * # not always numeric, but Python will raise the right exception
14891 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14893 /* "lxml/objectify.pyx":888
14894 * # not always numeric, but Python will raise the right exception
14896 * except AttributeError: # <<<<<<<<<<<<<<
14900 __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
14902 __Pyx_ErrRestore(0,0,0);
14903 goto __pyx_L5_exception_handled;
14905 goto __pyx_L6_except_error;
14906 __pyx_L6_except_error:;
14908 /* "lxml/objectify.pyx":885
14909 * if isinstance(obj, NumberElement):
14910 * return _parseNumber(<NumberElement>obj)
14911 * try: # <<<<<<<<<<<<<<
14912 * # not always numeric, but Python will raise the right exception
14915 __Pyx_XGIVEREF(__pyx_t_4);
14916 __Pyx_XGIVEREF(__pyx_t_5);
14917 __Pyx_XGIVEREF(__pyx_t_6);
14918 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14919 goto __pyx_L1_error;
14920 __pyx_L8_try_return:;
14921 __Pyx_XGIVEREF(__pyx_t_4);
14922 __Pyx_XGIVEREF(__pyx_t_5);
14923 __Pyx_XGIVEREF(__pyx_t_6);
14924 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14926 __pyx_L5_exception_handled:;
14927 __Pyx_XGIVEREF(__pyx_t_4);
14928 __Pyx_XGIVEREF(__pyx_t_5);
14929 __Pyx_XGIVEREF(__pyx_t_6);
14930 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
14933 /* "lxml/objectify.pyx":890
14934 * except AttributeError:
14936 * return obj # <<<<<<<<<<<<<<
14938 * cdef _richcmpPyvals(left, right, int op):
14940 __Pyx_XDECREF(__pyx_r);
14941 __Pyx_INCREF(__pyx_v_obj);
14942 __pyx_r = __pyx_v_obj;
14945 /* "lxml/objectify.pyx":882
14946 * return unicode(obj)
14948 * cdef object _numericValueOf(obj): # <<<<<<<<<<<<<<
14949 * if isinstance(obj, NumberElement):
14950 * return _parseNumber(<NumberElement>obj)
14953 /* function exit code */
14955 __Pyx_XDECREF(__pyx_t_3);
14956 __Pyx_AddTraceback("lxml.objectify._numericValueOf", __pyx_clineno, __pyx_lineno, __pyx_filename);
14959 __Pyx_XGIVEREF(__pyx_r);
14960 __Pyx_RefNannyFinishContext();
14964 /* "lxml/objectify.pyx":892
14967 * cdef _richcmpPyvals(left, right, int op): # <<<<<<<<<<<<<<
14968 * left = getattr(left, 'pyval', left)
14969 * right = getattr(right, 'pyval', right)
14972 static PyObject *__pyx_f_4lxml_9objectify__richcmpPyvals(PyObject *__pyx_v_left, PyObject *__pyx_v_right, int __pyx_v_op) {
14973 PyObject *__pyx_r = NULL;
14974 __Pyx_RefNannyDeclarations
14975 PyObject *__pyx_t_1 = NULL;
14976 int __pyx_lineno = 0;
14977 const char *__pyx_filename = NULL;
14978 int __pyx_clineno = 0;
14979 __Pyx_RefNannySetupContext("_richcmpPyvals", 0);
14980 __Pyx_INCREF(__pyx_v_left);
14981 __Pyx_INCREF(__pyx_v_right);
14983 /* "lxml/objectify.pyx":893
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)
14990 __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)
14991 __Pyx_GOTREF(__pyx_t_1);
14992 __Pyx_DECREF_SET(__pyx_v_left, __pyx_t_1);
14995 /* "lxml/objectify.pyx":894
14996 * cdef _richcmpPyvals(left, right, int op):
14997 * left = getattr(left, 'pyval', left)
14998 * right = getattr(right, 'pyval', right) # <<<<<<<<<<<<<<
14999 * return python.PyObject_RichCompare(left, right, op)
15002 __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)
15003 __Pyx_GOTREF(__pyx_t_1);
15004 __Pyx_DECREF_SET(__pyx_v_right, __pyx_t_1);
15007 /* "lxml/objectify.pyx":895
15008 * left = getattr(left, 'pyval', left)
15009 * right = getattr(right, 'pyval', right)
15010 * return python.PyObject_RichCompare(left, right, op) # <<<<<<<<<<<<<<
15014 __Pyx_XDECREF(__pyx_r);
15015 __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)
15016 __Pyx_GOTREF(__pyx_t_1);
15017 __pyx_r = __pyx_t_1;
15021 /* "lxml/objectify.pyx":892
15024 * cdef _richcmpPyvals(left, right, int op): # <<<<<<<<<<<<<<
15025 * left = getattr(left, 'pyval', left)
15026 * right = getattr(right, 'pyval', right)
15029 /* function exit code */
15031 __Pyx_XDECREF(__pyx_t_1);
15032 __Pyx_AddTraceback("lxml.objectify._richcmpPyvals", __pyx_clineno, __pyx_lineno, __pyx_filename);
15035 __Pyx_XDECREF(__pyx_v_left);
15036 __Pyx_XDECREF(__pyx_v_right);
15037 __Pyx_XGIVEREF(__pyx_r);
15038 __Pyx_RefNannyFinishContext();
15042 /* "lxml/objectify.pyx":926
15043 * cdef object _type
15044 * cdef list _schema_types
15045 * def __init__(self, name, type_check, type_class, stringify=None): # <<<<<<<<<<<<<<
15046 * if isinstance(name, bytes):
15047 * name = (<bytes>name).decode('ascii')
15050 /* Python wrapper */
15051 static int __pyx_pw_4lxml_9objectify_6PyType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15052 static int __pyx_pw_4lxml_9objectify_6PyType_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15053 PyObject *__pyx_v_name = 0;
15054 PyObject *__pyx_v_type_check = 0;
15055 PyObject *__pyx_v_type_class = 0;
15056 PyObject *__pyx_v_stringify = 0;
15057 int __pyx_lineno = 0;
15058 const char *__pyx_filename = NULL;
15059 int __pyx_clineno = 0;
15061 __Pyx_RefNannyDeclarations
15062 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
15064 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_type_check,&__pyx_n_s_type_class,&__pyx_n_s_stringify,0};
15065 PyObject* values[4] = {0,0,0,0};
15066 values[3] = ((PyObject *)Py_None);
15067 if (unlikely(__pyx_kwds)) {
15068 Py_ssize_t kw_args;
15069 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15070 switch (pos_args) {
15071 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15072 CYTHON_FALLTHROUGH;
15073 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15074 CYTHON_FALLTHROUGH;
15075 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15076 CYTHON_FALLTHROUGH;
15077 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15078 CYTHON_FALLTHROUGH;
15080 default: goto __pyx_L5_argtuple_error;
15082 kw_args = PyDict_Size(__pyx_kwds);
15083 switch (pos_args) {
15085 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
15086 else goto __pyx_L5_argtuple_error;
15087 CYTHON_FALLTHROUGH;
15089 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_check)) != 0)) kw_args--;
15091 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 926, __pyx_L3_error)
15093 CYTHON_FALLTHROUGH;
15095 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type_class)) != 0)) kw_args--;
15097 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 926, __pyx_L3_error)
15099 CYTHON_FALLTHROUGH;
15102 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stringify);
15103 if (value) { values[3] = value; kw_args--; }
15106 if (unlikely(kw_args > 0)) {
15107 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 926, __pyx_L3_error)
15110 switch (PyTuple_GET_SIZE(__pyx_args)) {
15111 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15112 CYTHON_FALLTHROUGH;
15113 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15114 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15115 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15117 default: goto __pyx_L5_argtuple_error;
15120 __pyx_v_name = values[0];
15121 __pyx_v_type_check = values[1];
15122 __pyx_v_type_class = values[2];
15123 __pyx_v_stringify = values[3];
15125 goto __pyx_L4_argument_unpacking_done;
15126 __pyx_L5_argtuple_error:;
15127 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 926, __pyx_L3_error)
15129 __Pyx_AddTraceback("lxml.objectify.PyType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15130 __Pyx_RefNannyFinishContext();
15132 __pyx_L4_argument_unpacking_done:;
15133 __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);
15135 /* function exit code */
15136 __Pyx_RefNannyFinishContext();
15140 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) {
15142 __Pyx_RefNannyDeclarations
15145 PyObject *__pyx_t_3 = NULL;
15147 int __pyx_lineno = 0;
15148 const char *__pyx_filename = NULL;
15149 int __pyx_clineno = 0;
15150 __Pyx_RefNannySetupContext("__init__", 0);
15151 __Pyx_INCREF(__pyx_v_name);
15152 __Pyx_INCREF(__pyx_v_stringify);
15154 /* "lxml/objectify.pyx":927
15155 * cdef list _schema_types
15156 * def __init__(self, name, type_check, type_class, stringify=None):
15157 * if isinstance(name, bytes): # <<<<<<<<<<<<<<
15158 * name = (<bytes>name).decode('ascii')
15159 * elif not isinstance(name, unicode):
15161 __pyx_t_1 = PyBytes_Check(__pyx_v_name);
15162 __pyx_t_2 = (__pyx_t_1 != 0);
15165 /* "lxml/objectify.pyx":928
15166 * def __init__(self, name, type_check, type_class, stringify=None):
15167 * if isinstance(name, bytes):
15168 * name = (<bytes>name).decode('ascii') # <<<<<<<<<<<<<<
15169 * elif not isinstance(name, unicode):
15170 * raise TypeError, u"Type name must be a string"
15172 if (unlikely(__pyx_v_name == Py_None)) {
15173 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
15174 __PYX_ERR(0, 928, __pyx_L1_error)
15176 __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)
15177 __Pyx_GOTREF(__pyx_t_3);
15178 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_3);
15181 /* "lxml/objectify.pyx":927
15182 * cdef list _schema_types
15183 * def __init__(self, name, type_check, type_class, stringify=None):
15184 * if isinstance(name, bytes): # <<<<<<<<<<<<<<
15185 * name = (<bytes>name).decode('ascii')
15186 * elif not isinstance(name, unicode):
15191 /* "lxml/objectify.pyx":929
15192 * if isinstance(name, bytes):
15193 * name = (<bytes>name).decode('ascii')
15194 * elif not isinstance(name, unicode): # <<<<<<<<<<<<<<
15195 * raise TypeError, u"Type name must be a string"
15196 * if type_check is not None and not callable(type_check):
15198 __pyx_t_2 = PyUnicode_Check(__pyx_v_name);
15199 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
15200 if (unlikely(__pyx_t_1)) {
15202 /* "lxml/objectify.pyx":930
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):
15207 * raise TypeError, u"Type check function must be callable (or None)"
15209 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Type_name_must_be_a_string, 0, 0);
15210 __PYX_ERR(0, 930, __pyx_L1_error)
15212 /* "lxml/objectify.pyx":929
15213 * if isinstance(name, bytes):
15214 * name = (<bytes>name).decode('ascii')
15215 * elif not isinstance(name, unicode): # <<<<<<<<<<<<<<
15216 * raise TypeError, u"Type name must be a string"
15217 * if type_check is not None and not callable(type_check):
15222 /* "lxml/objectify.pyx":931
15223 * elif not isinstance(name, unicode):
15224 * raise TypeError, u"Type name must be a string"
15225 * if type_check is not None and not callable(type_check): # <<<<<<<<<<<<<<
15226 * raise TypeError, u"Type check function must be callable (or None)"
15227 * if name != TREE_PYTYPE_NAME and \
15229 __pyx_t_2 = (__pyx_v_type_check != Py_None);
15230 __pyx_t_4 = (__pyx_t_2 != 0);
15233 __pyx_t_1 = __pyx_t_4;
15234 goto __pyx_L5_bool_binop_done;
15236 __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_type_check); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 931, __pyx_L1_error)
15237 __pyx_t_2 = ((!(__pyx_t_4 != 0)) != 0);
15238 __pyx_t_1 = __pyx_t_2;
15239 __pyx_L5_bool_binop_done:;
15240 if (unlikely(__pyx_t_1)) {
15242 /* "lxml/objectify.pyx":932
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 \
15247 * not issubclass(type_class, ObjectifiedDataElement):
15249 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Type_check_function_must_be_call, 0, 0);
15250 __PYX_ERR(0, 932, __pyx_L1_error)
15252 /* "lxml/objectify.pyx":931
15253 * elif not isinstance(name, unicode):
15254 * raise TypeError, u"Type name must be a string"
15255 * if type_check is not None and not callable(type_check): # <<<<<<<<<<<<<<
15256 * raise TypeError, u"Type check function must be callable (or None)"
15257 * if name != TREE_PYTYPE_NAME and \
15261 /* "lxml/objectify.pyx":933
15262 * if type_check is not None and not callable(type_check):
15263 * raise TypeError, u"Type check function must be callable (or None)"
15264 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15265 * not issubclass(type_class, ObjectifiedDataElement):
15266 * raise TypeError, \
15268 __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)
15271 __pyx_t_1 = __pyx_t_2;
15272 goto __pyx_L8_bool_binop_done;
15275 /* "lxml/objectify.pyx":934
15276 * raise TypeError, u"Type check function must be callable (or None)"
15277 * if name != TREE_PYTYPE_NAME and \
15278 * not issubclass(type_class, ObjectifiedDataElement): # <<<<<<<<<<<<<<
15279 * raise TypeError, \
15280 * u"Data classes must inherit from ObjectifiedDataElement"
15282 __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)
15283 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
15284 __pyx_t_1 = __pyx_t_4;
15285 __pyx_L8_bool_binop_done:;
15287 /* "lxml/objectify.pyx":933
15288 * if type_check is not None and not callable(type_check):
15289 * raise TypeError, u"Type check function must be callable (or None)"
15290 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15291 * not issubclass(type_class, ObjectifiedDataElement):
15292 * raise TypeError, \
15294 if (unlikely(__pyx_t_1)) {
15296 /* "lxml/objectify.pyx":935
15297 * if name != TREE_PYTYPE_NAME and \
15298 * not issubclass(type_class, ObjectifiedDataElement):
15299 * raise TypeError, \ # <<<<<<<<<<<<<<
15300 * u"Data classes must inherit from ObjectifiedDataElement"
15303 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Data_classes_must_inherit_from_O, 0, 0);
15304 __PYX_ERR(0, 935, __pyx_L1_error)
15306 /* "lxml/objectify.pyx":933
15307 * if type_check is not None and not callable(type_check):
15308 * raise TypeError, u"Type check function must be callable (or None)"
15309 * if name != TREE_PYTYPE_NAME and \ # <<<<<<<<<<<<<<
15310 * not issubclass(type_class, ObjectifiedDataElement):
15311 * raise TypeError, \
15315 /* "lxml/objectify.pyx":937
15316 * raise TypeError, \
15317 * u"Data classes must inherit from ObjectifiedDataElement"
15318 * self.name = name # <<<<<<<<<<<<<<
15319 * self._type = type_class
15320 * self.type_check = type_check
15322 __Pyx_INCREF(__pyx_v_name);
15323 __Pyx_GIVEREF(__pyx_v_name);
15324 __Pyx_GOTREF(__pyx_v_self->name);
15325 __Pyx_DECREF(__pyx_v_self->name);
15326 __pyx_v_self->name = __pyx_v_name;
15328 /* "lxml/objectify.pyx":938
15329 * u"Data classes must inherit from ObjectifiedDataElement"
15331 * self._type = type_class # <<<<<<<<<<<<<<
15332 * self.type_check = type_check
15333 * if stringify is None:
15335 __Pyx_INCREF(__pyx_v_type_class);
15336 __Pyx_GIVEREF(__pyx_v_type_class);
15337 __Pyx_GOTREF(__pyx_v_self->_type);
15338 __Pyx_DECREF(__pyx_v_self->_type);
15339 __pyx_v_self->_type = __pyx_v_type_class;
15341 /* "lxml/objectify.pyx":939
15343 * self._type = type_class
15344 * self.type_check = type_check # <<<<<<<<<<<<<<
15345 * if stringify is None:
15346 * stringify = unicode
15348 __Pyx_INCREF(__pyx_v_type_check);
15349 __Pyx_GIVEREF(__pyx_v_type_check);
15350 __Pyx_GOTREF(__pyx_v_self->type_check);
15351 __Pyx_DECREF(__pyx_v_self->type_check);
15352 __pyx_v_self->type_check = __pyx_v_type_check;
15354 /* "lxml/objectify.pyx":940
15355 * self._type = type_class
15356 * self.type_check = type_check
15357 * if stringify is None: # <<<<<<<<<<<<<<
15358 * stringify = unicode
15359 * self.stringify = stringify
15361 __pyx_t_1 = (__pyx_v_stringify == Py_None);
15362 __pyx_t_4 = (__pyx_t_1 != 0);
15365 /* "lxml/objectify.pyx":941
15366 * self.type_check = type_check
15367 * if stringify is None:
15368 * stringify = unicode # <<<<<<<<<<<<<<
15369 * self.stringify = stringify
15370 * self._schema_types = []
15372 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
15373 __Pyx_DECREF_SET(__pyx_v_stringify, ((PyObject *)(&PyUnicode_Type)));
15375 /* "lxml/objectify.pyx":940
15376 * self._type = type_class
15377 * self.type_check = type_check
15378 * if stringify is None: # <<<<<<<<<<<<<<
15379 * stringify = unicode
15380 * self.stringify = stringify
15384 /* "lxml/objectify.pyx":942
15385 * if stringify is None:
15386 * stringify = unicode
15387 * self.stringify = stringify # <<<<<<<<<<<<<<
15388 * self._schema_types = []
15391 __Pyx_INCREF(__pyx_v_stringify);
15392 __Pyx_GIVEREF(__pyx_v_stringify);
15393 __Pyx_GOTREF(__pyx_v_self->stringify);
15394 __Pyx_DECREF(__pyx_v_self->stringify);
15395 __pyx_v_self->stringify = __pyx_v_stringify;
15397 /* "lxml/objectify.pyx":943
15398 * stringify = unicode
15399 * self.stringify = stringify
15400 * self._schema_types = [] # <<<<<<<<<<<<<<
15402 * def __repr__(self):
15404 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
15405 __Pyx_GOTREF(__pyx_t_3);
15406 __Pyx_GIVEREF(__pyx_t_3);
15407 __Pyx_GOTREF(__pyx_v_self->_schema_types);
15408 __Pyx_DECREF(__pyx_v_self->_schema_types);
15409 __pyx_v_self->_schema_types = ((PyObject*)__pyx_t_3);
15412 /* "lxml/objectify.pyx":926
15413 * cdef object _type
15414 * cdef list _schema_types
15415 * def __init__(self, name, type_check, type_class, stringify=None): # <<<<<<<<<<<<<<
15416 * if isinstance(name, bytes):
15417 * name = (<bytes>name).decode('ascii')
15420 /* function exit code */
15424 __Pyx_XDECREF(__pyx_t_3);
15425 __Pyx_AddTraceback("lxml.objectify.PyType.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15428 __Pyx_XDECREF(__pyx_v_name);
15429 __Pyx_XDECREF(__pyx_v_stringify);
15430 __Pyx_RefNannyFinishContext();
15434 /* "lxml/objectify.pyx":945
15435 * self._schema_types = []
15437 * def __repr__(self): # <<<<<<<<<<<<<<
15438 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15442 /* Python wrapper */
15443 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_3__repr__(PyObject *__pyx_v_self); /*proto*/
15444 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_3__repr__(PyObject *__pyx_v_self) {
15445 PyObject *__pyx_r = 0;
15446 __Pyx_RefNannyDeclarations
15447 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
15448 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_2__repr__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
15450 /* function exit code */
15451 __Pyx_RefNannyFinishContext();
15455 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_2__repr__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
15456 PyObject *__pyx_r = NULL;
15457 __Pyx_RefNannyDeclarations
15458 PyObject *__pyx_t_1 = NULL;
15459 PyObject *__pyx_t_2 = NULL;
15460 int __pyx_lineno = 0;
15461 const char *__pyx_filename = NULL;
15462 int __pyx_clineno = 0;
15463 __Pyx_RefNannySetupContext("__repr__", 0);
15465 /* "lxml/objectify.pyx":946
15467 * def __repr__(self):
15468 * return "PyType(%s, %s)" % (self.name, self._type.__name__) # <<<<<<<<<<<<<<
15470 * def register(self, before=None, after=None):
15472 __Pyx_XDECREF(__pyx_r);
15473 __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)
15474 __Pyx_GOTREF(__pyx_t_1);
15475 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
15476 __Pyx_GOTREF(__pyx_t_2);
15477 __Pyx_INCREF(__pyx_v_self->name);
15478 __Pyx_GIVEREF(__pyx_v_self->name);
15479 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name);
15480 __Pyx_GIVEREF(__pyx_t_1);
15481 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
15483 __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)
15484 __Pyx_GOTREF(__pyx_t_1);
15485 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15486 __pyx_r = __pyx_t_1;
15490 /* "lxml/objectify.pyx":945
15491 * self._schema_types = []
15493 * def __repr__(self): # <<<<<<<<<<<<<<
15494 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15498 /* function exit code */
15500 __Pyx_XDECREF(__pyx_t_1);
15501 __Pyx_XDECREF(__pyx_t_2);
15502 __Pyx_AddTraceback("lxml.objectify.PyType.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15505 __Pyx_XGIVEREF(__pyx_r);
15506 __Pyx_RefNannyFinishContext();
15510 /* "lxml/objectify.pyx":948
15511 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
15513 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
15514 * u"""register(self, before=None, after=None)
15518 /* Python wrapper */
15519 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_5register(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15520 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 ";
15521 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};
15522 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_5register(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15523 PyObject *__pyx_v_before = 0;
15524 PyObject *__pyx_v_after = 0;
15525 int __pyx_lineno = 0;
15526 const char *__pyx_filename = NULL;
15527 int __pyx_clineno = 0;
15528 PyObject *__pyx_r = 0;
15529 __Pyx_RefNannyDeclarations
15530 __Pyx_RefNannySetupContext("register (wrapper)", 0);
15532 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_before,&__pyx_n_s_after,0};
15533 PyObject* values[2] = {0,0};
15534 values[0] = ((PyObject *)Py_None);
15535 values[1] = ((PyObject *)Py_None);
15536 if (unlikely(__pyx_kwds)) {
15537 Py_ssize_t kw_args;
15538 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15539 switch (pos_args) {
15540 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15541 CYTHON_FALLTHROUGH;
15542 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15543 CYTHON_FALLTHROUGH;
15545 default: goto __pyx_L5_argtuple_error;
15547 kw_args = PyDict_Size(__pyx_kwds);
15548 switch (pos_args) {
15551 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_before);
15552 if (value) { values[0] = value; kw_args--; }
15554 CYTHON_FALLTHROUGH;
15557 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_after);
15558 if (value) { values[1] = value; kw_args--; }
15561 if (unlikely(kw_args > 0)) {
15562 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
15565 switch (PyTuple_GET_SIZE(__pyx_args)) {
15566 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15567 CYTHON_FALLTHROUGH;
15568 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15569 CYTHON_FALLTHROUGH;
15571 default: goto __pyx_L5_argtuple_error;
15574 __pyx_v_before = values[0];
15575 __pyx_v_after = values[1];
15577 goto __pyx_L4_argument_unpacking_done;
15578 __pyx_L5_argtuple_error:;
15579 __Pyx_RaiseArgtupleInvalid("register", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 948, __pyx_L3_error)
15581 __Pyx_AddTraceback("lxml.objectify.PyType.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
15582 __Pyx_RefNannyFinishContext();
15584 __pyx_L4_argument_unpacking_done:;
15585 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_4register(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self), __pyx_v_before, __pyx_v_after);
15587 /* function exit code */
15588 __Pyx_RefNannyFinishContext();
15592 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) {
15593 PyObject *__pyx_v_item = NULL;
15594 PyObject *__pyx_v_entry = NULL;
15595 PyObject *__pyx_v_first_pos = NULL;
15596 PyObject *__pyx_v_last_pos = NULL;
15597 PyObject *__pyx_v_i = NULL;
15598 CYTHON_UNUSED PyObject *__pyx_v_check = NULL;
15599 PyObject *__pyx_v_pytype = NULL;
15600 PyObject *__pyx_v_xs_type = NULL;
15601 PyObject *__pyx_r = NULL;
15602 __Pyx_RefNannyDeclarations
15605 PyObject *__pyx_t_3 = NULL;
15606 Py_ssize_t __pyx_t_4;
15607 PyObject *__pyx_t_5 = NULL;
15608 PyObject *__pyx_t_6 = NULL;
15609 PyObject *__pyx_t_7 = NULL;
15610 PyObject *__pyx_t_8 = NULL;
15611 PyObject *__pyx_t_9 = NULL;
15612 PyObject *(*__pyx_t_10)(PyObject *);
15615 int __pyx_lineno = 0;
15616 const char *__pyx_filename = NULL;
15617 int __pyx_clineno = 0;
15618 __Pyx_RefNannySetupContext("register", 0);
15619 __Pyx_INCREF(__pyx_v_before);
15620 __Pyx_INCREF(__pyx_v_after);
15622 /* "lxml/objectify.pyx":958
15623 * ignored. Raises ValueError if the dependencies cannot be fulfilled.
15625 * if self.name == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
15626 * raise ValueError, u"Cannot register tree type"
15627 * if self.type_check is not None:
15629 __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)
15630 if (unlikely(__pyx_t_1)) {
15632 /* "lxml/objectify.pyx":959
15634 * if self.name == TREE_PYTYPE_NAME:
15635 * raise ValueError, u"Cannot register tree type" # <<<<<<<<<<<<<<
15636 * if self.type_check is not None:
15637 * for item in _TYPE_CHECKS:
15639 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Cannot_register_tree_type, 0, 0);
15640 __PYX_ERR(0, 959, __pyx_L1_error)
15642 /* "lxml/objectify.pyx":958
15643 * ignored. Raises ValueError if the dependencies cannot be fulfilled.
15645 * if self.name == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
15646 * raise ValueError, u"Cannot register tree type"
15647 * if self.type_check is not None:
15651 /* "lxml/objectify.pyx":960
15652 * if self.name == TREE_PYTYPE_NAME:
15653 * raise ValueError, u"Cannot register tree type"
15654 * if self.type_check is not None: # <<<<<<<<<<<<<<
15655 * for item in _TYPE_CHECKS:
15656 * if item[0] is self.type_check:
15658 __pyx_t_1 = (__pyx_v_self->type_check != Py_None);
15659 __pyx_t_2 = (__pyx_t_1 != 0);
15662 /* "lxml/objectify.pyx":961
15663 * raise ValueError, u"Cannot register tree type"
15664 * if self.type_check is not None:
15665 * for item in _TYPE_CHECKS: # <<<<<<<<<<<<<<
15666 * if item[0] is self.type_check:
15667 * _TYPE_CHECKS.remove(item)
15669 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
15670 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
15671 __PYX_ERR(0, 961, __pyx_L1_error)
15673 __pyx_t_3 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
15675 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
15676 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15677 __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)
15679 __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)
15680 __Pyx_GOTREF(__pyx_t_5);
15682 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
15685 /* "lxml/objectify.pyx":962
15686 * if self.type_check is not None:
15687 * for item in _TYPE_CHECKS:
15688 * if item[0] is self.type_check: # <<<<<<<<<<<<<<
15689 * _TYPE_CHECKS.remove(item)
15692 __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)
15693 __Pyx_GOTREF(__pyx_t_5);
15694 __pyx_t_2 = (__pyx_t_5 == __pyx_v_self->type_check);
15695 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15696 __pyx_t_1 = (__pyx_t_2 != 0);
15699 /* "lxml/objectify.pyx":963
15700 * for item in _TYPE_CHECKS:
15701 * if item[0] is self.type_check:
15702 * _TYPE_CHECKS.remove(item) # <<<<<<<<<<<<<<
15704 * entry = (self.type_check, self)
15706 __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)
15707 __Pyx_GOTREF(__pyx_t_5);
15708 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15710 /* "lxml/objectify.pyx":964
15711 * if item[0] is self.type_check:
15712 * _TYPE_CHECKS.remove(item)
15713 * break # <<<<<<<<<<<<<<
15714 * entry = (self.type_check, self)
15717 goto __pyx_L6_break;
15719 /* "lxml/objectify.pyx":962
15720 * if self.type_check is not None:
15721 * for item in _TYPE_CHECKS:
15722 * if item[0] is self.type_check: # <<<<<<<<<<<<<<
15723 * _TYPE_CHECKS.remove(item)
15728 /* "lxml/objectify.pyx":961
15729 * raise ValueError, u"Cannot register tree type"
15730 * if self.type_check is not None:
15731 * for item in _TYPE_CHECKS: # <<<<<<<<<<<<<<
15732 * if item[0] is self.type_check:
15733 * _TYPE_CHECKS.remove(item)
15737 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15739 /* "lxml/objectify.pyx":965
15740 * _TYPE_CHECKS.remove(item)
15742 * entry = (self.type_check, self) # <<<<<<<<<<<<<<
15746 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error)
15747 __Pyx_GOTREF(__pyx_t_3);
15748 __Pyx_INCREF(__pyx_v_self->type_check);
15749 __Pyx_GIVEREF(__pyx_v_self->type_check);
15750 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->type_check);
15751 __Pyx_INCREF(((PyObject *)__pyx_v_self));
15752 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15753 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
15754 __pyx_v_entry = ((PyObject*)__pyx_t_3);
15757 /* "lxml/objectify.pyx":966
15759 * entry = (self.type_check, self)
15760 * first_pos = 0 # <<<<<<<<<<<<<<
15762 * if before or after:
15764 __Pyx_INCREF(__pyx_int_0);
15765 __pyx_v_first_pos = __pyx_int_0;
15767 /* "lxml/objectify.pyx":967
15768 * entry = (self.type_check, self)
15770 * last_pos = -1 # <<<<<<<<<<<<<<
15771 * if before or after:
15772 * if before is None:
15774 __Pyx_INCREF(__pyx_int_neg_1);
15775 __pyx_v_last_pos = __pyx_int_neg_1;
15777 /* "lxml/objectify.pyx":968
15780 * if before or after: # <<<<<<<<<<<<<<
15781 * if before is None:
15784 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_before); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 968, __pyx_L1_error)
15787 __pyx_t_1 = __pyx_t_2;
15788 goto __pyx_L9_bool_binop_done;
15790 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_after); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 968, __pyx_L1_error)
15791 __pyx_t_1 = __pyx_t_2;
15792 __pyx_L9_bool_binop_done:;
15795 /* "lxml/objectify.pyx":969
15797 * if before or after:
15798 * if before is None: # <<<<<<<<<<<<<<
15800 * elif after is None:
15802 __pyx_t_1 = (__pyx_v_before == Py_None);
15803 __pyx_t_2 = (__pyx_t_1 != 0);
15806 /* "lxml/objectify.pyx":970
15807 * if before or after:
15808 * if before is None:
15809 * before = () # <<<<<<<<<<<<<<
15810 * elif after is None:
15813 __Pyx_INCREF(__pyx_empty_tuple);
15814 __Pyx_DECREF_SET(__pyx_v_before, __pyx_empty_tuple);
15816 /* "lxml/objectify.pyx":969
15818 * if before or after:
15819 * if before is None: # <<<<<<<<<<<<<<
15821 * elif after is None:
15826 /* "lxml/objectify.pyx":971
15827 * if before is None:
15829 * elif after is None: # <<<<<<<<<<<<<<
15831 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15833 __pyx_t_2 = (__pyx_v_after == Py_None);
15834 __pyx_t_1 = (__pyx_t_2 != 0);
15837 /* "lxml/objectify.pyx":972
15839 * elif after is None:
15840 * after = () # <<<<<<<<<<<<<<
15841 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15842 * if last_pos == -1 and pytype.name in before:
15844 __Pyx_INCREF(__pyx_empty_tuple);
15845 __Pyx_DECREF_SET(__pyx_v_after, __pyx_empty_tuple);
15847 /* "lxml/objectify.pyx":971
15848 * if before is None:
15850 * elif after is None: # <<<<<<<<<<<<<<
15852 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15857 /* "lxml/objectify.pyx":973
15858 * elif after is None:
15860 * for i, (check, pytype) in enumerate(_TYPE_CHECKS): # <<<<<<<<<<<<<<
15861 * if last_pos == -1 and pytype.name in before:
15864 __Pyx_INCREF(__pyx_int_0);
15865 __pyx_t_3 = __pyx_int_0;
15866 __pyx_t_5 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = 0;
15868 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
15869 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15870 __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)
15872 __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)
15873 __Pyx_GOTREF(__pyx_t_6);
15875 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
15876 PyObject* sequence = __pyx_t_6;
15877 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15878 if (unlikely(size != 2)) {
15879 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15880 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15881 __PYX_ERR(0, 973, __pyx_L1_error)
15883 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15884 if (likely(PyTuple_CheckExact(sequence))) {
15885 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
15886 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
15888 __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
15889 __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
15891 __Pyx_INCREF(__pyx_t_7);
15892 __Pyx_INCREF(__pyx_t_8);
15894 __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 973, __pyx_L1_error)
15895 __Pyx_GOTREF(__pyx_t_7);
15896 __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 973, __pyx_L1_error)
15897 __Pyx_GOTREF(__pyx_t_8);
15899 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15901 Py_ssize_t index = -1;
15902 __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 973, __pyx_L1_error)
15903 __Pyx_GOTREF(__pyx_t_9);
15904 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15905 __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
15906 index = 0; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L14_unpacking_failed;
15907 __Pyx_GOTREF(__pyx_t_7);
15908 index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed;
15909 __Pyx_GOTREF(__pyx_t_8);
15910 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 973, __pyx_L1_error)
15912 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15913 goto __pyx_L15_unpacking_done;
15914 __pyx_L14_unpacking_failed:;
15915 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15917 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
15918 __PYX_ERR(0, 973, __pyx_L1_error)
15919 __pyx_L15_unpacking_done:;
15921 __Pyx_XDECREF_SET(__pyx_v_check, __pyx_t_7);
15923 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_8);
15925 __Pyx_INCREF(__pyx_t_3);
15926 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
15927 __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)
15928 __Pyx_GOTREF(__pyx_t_6);
15929 __Pyx_DECREF(__pyx_t_3);
15930 __pyx_t_3 = __pyx_t_6;
15933 /* "lxml/objectify.pyx":974
15935 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15936 * if last_pos == -1 and pytype.name in before: # <<<<<<<<<<<<<<
15938 * if pytype.name in after:
15940 __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)
15941 __Pyx_GOTREF(__pyx_t_6);
15942 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
15943 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15946 __pyx_t_1 = __pyx_t_2;
15947 goto __pyx_L17_bool_binop_done;
15949 __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)
15950 __Pyx_GOTREF(__pyx_t_6);
15951 __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)
15952 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15953 __pyx_t_11 = (__pyx_t_2 != 0);
15954 __pyx_t_1 = __pyx_t_11;
15955 __pyx_L17_bool_binop_done:;
15958 /* "lxml/objectify.pyx":975
15959 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15960 * if last_pos == -1 and pytype.name in before:
15961 * last_pos = i # <<<<<<<<<<<<<<
15962 * if pytype.name in after:
15965 __Pyx_INCREF(__pyx_v_i);
15966 __Pyx_DECREF_SET(__pyx_v_last_pos, __pyx_v_i);
15968 /* "lxml/objectify.pyx":974
15970 * for i, (check, pytype) in enumerate(_TYPE_CHECKS):
15971 * if last_pos == -1 and pytype.name in before: # <<<<<<<<<<<<<<
15973 * if pytype.name in after:
15977 /* "lxml/objectify.pyx":976
15978 * if last_pos == -1 and pytype.name in before:
15980 * if pytype.name in after: # <<<<<<<<<<<<<<
15982 * if last_pos == -1:
15984 __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)
15985 __Pyx_GOTREF(__pyx_t_6);
15986 __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)
15987 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15988 __pyx_t_11 = (__pyx_t_1 != 0);
15991 /* "lxml/objectify.pyx":977
15993 * if pytype.name in after:
15994 * first_pos = i+1 # <<<<<<<<<<<<<<
15995 * if last_pos == -1:
15996 * _TYPE_CHECKS.append(entry)
15998 __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)
15999 __Pyx_GOTREF(__pyx_t_6);
16000 __Pyx_DECREF_SET(__pyx_v_first_pos, __pyx_t_6);
16003 /* "lxml/objectify.pyx":976
16004 * if last_pos == -1 and pytype.name in before:
16006 * if pytype.name in after: # <<<<<<<<<<<<<<
16008 * if last_pos == -1:
16012 /* "lxml/objectify.pyx":973
16013 * elif after is None:
16015 * for i, (check, pytype) in enumerate(_TYPE_CHECKS): # <<<<<<<<<<<<<<
16016 * if last_pos == -1 and pytype.name in before:
16020 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16021 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16023 /* "lxml/objectify.pyx":968
16026 * if before or after: # <<<<<<<<<<<<<<
16027 * if before is None:
16032 /* "lxml/objectify.pyx":978
16033 * if pytype.name in after:
16035 * if last_pos == -1: # <<<<<<<<<<<<<<
16036 * _TYPE_CHECKS.append(entry)
16037 * elif first_pos > last_pos:
16039 __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)
16040 __Pyx_GOTREF(__pyx_t_3);
16041 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 978, __pyx_L1_error)
16042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16045 /* "lxml/objectify.pyx":979
16047 * if last_pos == -1:
16048 * _TYPE_CHECKS.append(entry) # <<<<<<<<<<<<<<
16049 * elif first_pos > last_pos:
16050 * raise ValueError, u"inconsistent before/after dependencies"
16052 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
16053 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
16054 __PYX_ERR(0, 979, __pyx_L1_error)
16056 __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)
16058 /* "lxml/objectify.pyx":978
16059 * if pytype.name in after:
16061 * if last_pos == -1: # <<<<<<<<<<<<<<
16062 * _TYPE_CHECKS.append(entry)
16063 * elif first_pos > last_pos:
16068 /* "lxml/objectify.pyx":980
16069 * if last_pos == -1:
16070 * _TYPE_CHECKS.append(entry)
16071 * elif first_pos > last_pos: # <<<<<<<<<<<<<<
16072 * raise ValueError, u"inconsistent before/after dependencies"
16075 __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)
16076 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 980, __pyx_L1_error)
16077 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16078 if (unlikely(__pyx_t_11)) {
16080 /* "lxml/objectify.pyx":981
16081 * _TYPE_CHECKS.append(entry)
16082 * elif first_pos > last_pos:
16083 * raise ValueError, u"inconsistent before/after dependencies" # <<<<<<<<<<<<<<
16085 * _TYPE_CHECKS.insert(last_pos, entry)
16087 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_inconsistent_before_after_depend, 0, 0);
16088 __PYX_ERR(0, 981, __pyx_L1_error)
16090 /* "lxml/objectify.pyx":980
16091 * if last_pos == -1:
16092 * _TYPE_CHECKS.append(entry)
16093 * elif first_pos > last_pos: # <<<<<<<<<<<<<<
16094 * raise ValueError, u"inconsistent before/after dependencies"
16099 /* "lxml/objectify.pyx":983
16100 * raise ValueError, u"inconsistent before/after dependencies"
16102 * _TYPE_CHECKS.insert(last_pos, entry) # <<<<<<<<<<<<<<
16104 * _PYTYPE_DICT[self.name] = self
16107 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
16108 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "insert");
16109 __PYX_ERR(0, 983, __pyx_L1_error)
16111 __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)
16112 __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)
16116 /* "lxml/objectify.pyx":960
16117 * if self.name == TREE_PYTYPE_NAME:
16118 * raise ValueError, u"Cannot register tree type"
16119 * if self.type_check is not None: # <<<<<<<<<<<<<<
16120 * for item in _TYPE_CHECKS:
16121 * if item[0] is self.type_check:
16125 /* "lxml/objectify.pyx":985
16126 * _TYPE_CHECKS.insert(last_pos, entry)
16128 * _PYTYPE_DICT[self.name] = self # <<<<<<<<<<<<<<
16129 * for xs_type in self._schema_types:
16130 * _SCHEMA_TYPE_DICT[xs_type] = self
16132 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16133 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16134 __PYX_ERR(0, 985, __pyx_L1_error)
16136 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)
16138 /* "lxml/objectify.pyx":986
16140 * _PYTYPE_DICT[self.name] = self
16141 * for xs_type in self._schema_types: # <<<<<<<<<<<<<<
16142 * _SCHEMA_TYPE_DICT[xs_type] = self
16145 if (unlikely(__pyx_v_self->_schema_types == Py_None)) {
16146 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
16147 __PYX_ERR(0, 986, __pyx_L1_error)
16149 __pyx_t_3 = __pyx_v_self->_schema_types; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
16151 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
16152 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16153 __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)
16155 __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)
16156 __Pyx_GOTREF(__pyx_t_5);
16158 __Pyx_XDECREF_SET(__pyx_v_xs_type, __pyx_t_5);
16161 /* "lxml/objectify.pyx":987
16162 * _PYTYPE_DICT[self.name] = self
16163 * for xs_type in self._schema_types:
16164 * _SCHEMA_TYPE_DICT[xs_type] = self # <<<<<<<<<<<<<<
16166 * def unregister(self):
16168 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16169 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16170 __PYX_ERR(0, 987, __pyx_L1_error)
16172 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)
16174 /* "lxml/objectify.pyx":986
16176 * _PYTYPE_DICT[self.name] = self
16177 * for xs_type in self._schema_types: # <<<<<<<<<<<<<<
16178 * _SCHEMA_TYPE_DICT[xs_type] = self
16182 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16184 /* "lxml/objectify.pyx":948
16185 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
16187 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
16188 * u"""register(self, before=None, after=None)
16192 /* function exit code */
16193 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16196 __Pyx_XDECREF(__pyx_t_3);
16197 __Pyx_XDECREF(__pyx_t_5);
16198 __Pyx_XDECREF(__pyx_t_6);
16199 __Pyx_XDECREF(__pyx_t_7);
16200 __Pyx_XDECREF(__pyx_t_8);
16201 __Pyx_XDECREF(__pyx_t_9);
16202 __Pyx_AddTraceback("lxml.objectify.PyType.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
16205 __Pyx_XDECREF(__pyx_v_item);
16206 __Pyx_XDECREF(__pyx_v_entry);
16207 __Pyx_XDECREF(__pyx_v_first_pos);
16208 __Pyx_XDECREF(__pyx_v_last_pos);
16209 __Pyx_XDECREF(__pyx_v_i);
16210 __Pyx_XDECREF(__pyx_v_check);
16211 __Pyx_XDECREF(__pyx_v_pytype);
16212 __Pyx_XDECREF(__pyx_v_xs_type);
16213 __Pyx_XDECREF(__pyx_v_before);
16214 __Pyx_XDECREF(__pyx_v_after);
16215 __Pyx_XGIVEREF(__pyx_r);
16216 __Pyx_RefNannyFinishContext();
16220 /* "lxml/objectify.pyx":989
16221 * _SCHEMA_TYPE_DICT[xs_type] = self
16223 * def unregister(self): # <<<<<<<<<<<<<<
16224 * u"unregister(self)"
16225 * if _PYTYPE_DICT.get(self.name) is self:
16228 /* Python wrapper */
16229 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_7unregister(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16230 static char __pyx_doc_4lxml_9objectify_6PyType_6unregister[] = "unregister(self)";
16231 static PyMethodDef __pyx_mdef_4lxml_9objectify_6PyType_7unregister = {"unregister", (PyCFunction)__pyx_pw_4lxml_9objectify_6PyType_7unregister, METH_NOARGS, __pyx_doc_4lxml_9objectify_6PyType_6unregister};
16232 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_7unregister(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16233 PyObject *__pyx_r = 0;
16234 __Pyx_RefNannyDeclarations
16235 __Pyx_RefNannySetupContext("unregister (wrapper)", 0);
16236 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_6unregister(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16238 /* function exit code */
16239 __Pyx_RefNannyFinishContext();
16243 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_6unregister(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16244 PyObject *__pyx_v_xs_type = NULL;
16245 PyObject *__pyx_v_pytype = NULL;
16246 PyObject *__pyx_r = NULL;
16247 __Pyx_RefNannyDeclarations
16248 PyObject *__pyx_t_1 = NULL;
16251 PyObject *__pyx_t_4 = NULL;
16252 Py_ssize_t __pyx_t_5;
16253 PyObject *__pyx_t_6 = NULL;
16254 PyObject *__pyx_t_7 = NULL;
16255 PyObject *__pyx_t_8 = NULL;
16256 PyObject *(*__pyx_t_9)(PyObject *);
16257 PyObject *__pyx_t_10 = NULL;
16258 PyObject *__pyx_t_11 = NULL;
16259 PyObject *__pyx_t_12 = NULL;
16261 int __pyx_lineno = 0;
16262 const char *__pyx_filename = NULL;
16263 int __pyx_clineno = 0;
16264 __Pyx_RefNannySetupContext("unregister", 0);
16266 /* "lxml/objectify.pyx":991
16267 * def unregister(self):
16268 * u"unregister(self)"
16269 * if _PYTYPE_DICT.get(self.name) is self: # <<<<<<<<<<<<<<
16270 * del _PYTYPE_DICT[self.name]
16271 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16273 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16274 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
16275 __PYX_ERR(0, 991, __pyx_L1_error)
16277 __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)
16278 __Pyx_GOTREF(__pyx_t_1);
16279 __pyx_t_2 = (__pyx_t_1 == ((PyObject *)__pyx_v_self));
16280 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16281 __pyx_t_3 = (__pyx_t_2 != 0);
16284 /* "lxml/objectify.pyx":992
16285 * u"unregister(self)"
16286 * if _PYTYPE_DICT.get(self.name) is self:
16287 * del _PYTYPE_DICT[self.name] # <<<<<<<<<<<<<<
16288 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16289 * if pytype is self:
16291 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
16292 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16293 __PYX_ERR(0, 992, __pyx_L1_error)
16295 if (unlikely(PyDict_DelItem(__pyx_v_4lxml_9objectify__PYTYPE_DICT, __pyx_v_self->name) < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
16297 /* "lxml/objectify.pyx":991
16298 * def unregister(self):
16299 * u"unregister(self)"
16300 * if _PYTYPE_DICT.get(self.name) is self: # <<<<<<<<<<<<<<
16301 * del _PYTYPE_DICT[self.name]
16302 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16306 /* "lxml/objectify.pyx":993
16307 * if _PYTYPE_DICT.get(self.name) is self:
16308 * del _PYTYPE_DICT[self.name]
16309 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()): # <<<<<<<<<<<<<<
16310 * if pytype is self:
16311 * del _SCHEMA_TYPE_DICT[xs_type]
16313 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16314 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
16315 __PYX_ERR(0, 993, __pyx_L1_error)
16317 __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)
16318 __Pyx_GOTREF(__pyx_t_1);
16319 __pyx_t_4 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error)
16320 __Pyx_GOTREF(__pyx_t_4);
16321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16322 __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
16323 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16325 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
16326 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16327 __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)
16329 __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)
16330 __Pyx_GOTREF(__pyx_t_4);
16332 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
16333 PyObject* sequence = __pyx_t_4;
16334 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16335 if (unlikely(size != 2)) {
16336 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16337 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16338 __PYX_ERR(0, 993, __pyx_L1_error)
16340 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16341 if (likely(PyTuple_CheckExact(sequence))) {
16342 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
16343 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
16345 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
16346 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
16348 __Pyx_INCREF(__pyx_t_6);
16349 __Pyx_INCREF(__pyx_t_7);
16351 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 993, __pyx_L1_error)
16352 __Pyx_GOTREF(__pyx_t_6);
16353 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
16354 __Pyx_GOTREF(__pyx_t_7);
16356 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16358 Py_ssize_t index = -1;
16359 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error)
16360 __Pyx_GOTREF(__pyx_t_8);
16361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16362 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
16363 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
16364 __Pyx_GOTREF(__pyx_t_6);
16365 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
16366 __Pyx_GOTREF(__pyx_t_7);
16367 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 993, __pyx_L1_error)
16369 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16370 goto __pyx_L7_unpacking_done;
16371 __pyx_L6_unpacking_failed:;
16372 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16374 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
16375 __PYX_ERR(0, 993, __pyx_L1_error)
16376 __pyx_L7_unpacking_done:;
16378 __Pyx_XDECREF_SET(__pyx_v_xs_type, __pyx_t_6);
16380 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_7);
16383 /* "lxml/objectify.pyx":994
16384 * del _PYTYPE_DICT[self.name]
16385 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16386 * if pytype is self: # <<<<<<<<<<<<<<
16387 * del _SCHEMA_TYPE_DICT[xs_type]
16388 * if self.type_check is None:
16390 __pyx_t_3 = (__pyx_v_pytype == ((PyObject *)__pyx_v_self));
16391 __pyx_t_2 = (__pyx_t_3 != 0);
16394 /* "lxml/objectify.pyx":995
16395 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16396 * if pytype is self:
16397 * del _SCHEMA_TYPE_DICT[xs_type] # <<<<<<<<<<<<<<
16398 * if self.type_check is None:
16401 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
16402 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16403 __PYX_ERR(0, 995, __pyx_L1_error)
16405 if (unlikely(PyDict_DelItem(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, __pyx_v_xs_type) < 0)) __PYX_ERR(0, 995, __pyx_L1_error)
16407 /* "lxml/objectify.pyx":994
16408 * del _PYTYPE_DICT[self.name]
16409 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()):
16410 * if pytype is self: # <<<<<<<<<<<<<<
16411 * del _SCHEMA_TYPE_DICT[xs_type]
16412 * if self.type_check is None:
16416 /* "lxml/objectify.pyx":993
16417 * if _PYTYPE_DICT.get(self.name) is self:
16418 * del _PYTYPE_DICT[self.name]
16419 * for xs_type, pytype in list(_SCHEMA_TYPE_DICT.items()): # <<<<<<<<<<<<<<
16420 * if pytype is self:
16421 * del _SCHEMA_TYPE_DICT[xs_type]
16424 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16426 /* "lxml/objectify.pyx":996
16427 * if pytype is self:
16428 * del _SCHEMA_TYPE_DICT[xs_type]
16429 * if self.type_check is None: # <<<<<<<<<<<<<<
16433 __pyx_t_2 = (__pyx_v_self->type_check == Py_None);
16434 __pyx_t_3 = (__pyx_t_2 != 0);
16437 /* "lxml/objectify.pyx":997
16438 * del _SCHEMA_TYPE_DICT[xs_type]
16439 * if self.type_check is None:
16440 * return # <<<<<<<<<<<<<<
16442 * _TYPE_CHECKS.remove( (self.type_check, self) )
16444 __Pyx_XDECREF(__pyx_r);
16445 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16448 /* "lxml/objectify.pyx":996
16449 * if pytype is self:
16450 * del _SCHEMA_TYPE_DICT[xs_type]
16451 * if self.type_check is None: # <<<<<<<<<<<<<<
16457 /* "lxml/objectify.pyx":998
16458 * if self.type_check is None:
16460 * try: # <<<<<<<<<<<<<<
16461 * _TYPE_CHECKS.remove( (self.type_check, self) )
16462 * except ValueError:
16465 __Pyx_PyThreadState_declare
16466 __Pyx_PyThreadState_assign
16467 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
16468 __Pyx_XGOTREF(__pyx_t_10);
16469 __Pyx_XGOTREF(__pyx_t_11);
16470 __Pyx_XGOTREF(__pyx_t_12);
16473 /* "lxml/objectify.pyx":999
16476 * _TYPE_CHECKS.remove( (self.type_check, self) ) # <<<<<<<<<<<<<<
16477 * except ValueError:
16480 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L10_error)
16481 __Pyx_GOTREF(__pyx_t_1);
16482 __Pyx_INCREF(__pyx_v_self->type_check);
16483 __Pyx_GIVEREF(__pyx_v_self->type_check);
16484 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->type_check);
16485 __Pyx_INCREF(((PyObject *)__pyx_v_self));
16486 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
16487 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
16488 __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)
16489 __Pyx_GOTREF(__pyx_t_4);
16490 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16491 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16493 /* "lxml/objectify.pyx":998
16494 * if self.type_check is None:
16496 * try: # <<<<<<<<<<<<<<
16497 * _TYPE_CHECKS.remove( (self.type_check, self) )
16498 * except ValueError:
16501 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
16502 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
16503 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
16504 goto __pyx_L15_try_end;
16506 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16507 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
16508 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16509 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16510 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16512 /* "lxml/objectify.pyx":1000
16514 * _TYPE_CHECKS.remove( (self.type_check, self) )
16515 * except ValueError: # <<<<<<<<<<<<<<
16519 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
16521 __Pyx_ErrRestore(0,0,0);
16522 goto __pyx_L11_exception_handled;
16524 goto __pyx_L12_except_error;
16525 __pyx_L12_except_error:;
16527 /* "lxml/objectify.pyx":998
16528 * if self.type_check is None:
16530 * try: # <<<<<<<<<<<<<<
16531 * _TYPE_CHECKS.remove( (self.type_check, self) )
16532 * except ValueError:
16534 __Pyx_XGIVEREF(__pyx_t_10);
16535 __Pyx_XGIVEREF(__pyx_t_11);
16536 __Pyx_XGIVEREF(__pyx_t_12);
16537 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16538 goto __pyx_L1_error;
16539 __pyx_L11_exception_handled:;
16540 __Pyx_XGIVEREF(__pyx_t_10);
16541 __Pyx_XGIVEREF(__pyx_t_11);
16542 __Pyx_XGIVEREF(__pyx_t_12);
16543 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16544 __pyx_L15_try_end:;
16547 /* "lxml/objectify.pyx":989
16548 * _SCHEMA_TYPE_DICT[xs_type] = self
16550 * def unregister(self): # <<<<<<<<<<<<<<
16551 * u"unregister(self)"
16552 * if _PYTYPE_DICT.get(self.name) is self:
16555 /* function exit code */
16556 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16559 __Pyx_XDECREF(__pyx_t_1);
16560 __Pyx_XDECREF(__pyx_t_4);
16561 __Pyx_XDECREF(__pyx_t_6);
16562 __Pyx_XDECREF(__pyx_t_7);
16563 __Pyx_XDECREF(__pyx_t_8);
16564 __Pyx_AddTraceback("lxml.objectify.PyType.unregister", __pyx_clineno, __pyx_lineno, __pyx_filename);
16567 __Pyx_XDECREF(__pyx_v_xs_type);
16568 __Pyx_XDECREF(__pyx_v_pytype);
16569 __Pyx_XGIVEREF(__pyx_r);
16570 __Pyx_RefNannyFinishContext();
16574 /* "lxml/objectify.pyx":1008
16575 * Note that this must be set before registering the type!
16577 * def __get__(self): # <<<<<<<<<<<<<<
16578 * return self._schema_types
16579 * def __set__(self, types):
16582 /* Python wrapper */
16583 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(PyObject *__pyx_v_self); /*proto*/
16584 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(PyObject *__pyx_v_self) {
16585 PyObject *__pyx_r = 0;
16586 __Pyx_RefNannyDeclarations
16587 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16588 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16590 /* function exit code */
16591 __Pyx_RefNannyFinishContext();
16595 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16596 PyObject *__pyx_r = NULL;
16597 __Pyx_RefNannyDeclarations
16598 __Pyx_RefNannySetupContext("__get__", 0);
16600 /* "lxml/objectify.pyx":1009
16602 * def __get__(self):
16603 * return self._schema_types # <<<<<<<<<<<<<<
16604 * def __set__(self, types):
16605 * self._schema_types = list(map(unicode, types))
16607 __Pyx_XDECREF(__pyx_r);
16608 __Pyx_INCREF(__pyx_v_self->_schema_types);
16609 __pyx_r = __pyx_v_self->_schema_types;
16612 /* "lxml/objectify.pyx":1008
16613 * Note that this must be set before registering the type!
16615 * def __get__(self): # <<<<<<<<<<<<<<
16616 * return self._schema_types
16617 * def __set__(self, types):
16620 /* function exit code */
16622 __Pyx_XGIVEREF(__pyx_r);
16623 __Pyx_RefNannyFinishContext();
16627 /* "lxml/objectify.pyx":1010
16628 * def __get__(self):
16629 * return self._schema_types
16630 * def __set__(self, types): # <<<<<<<<<<<<<<
16631 * self._schema_types = list(map(unicode, types))
16635 /* Python wrapper */
16636 static int __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_types); /*proto*/
16637 static int __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
16639 __Pyx_RefNannyDeclarations
16640 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
16641 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self), ((PyObject *)__pyx_v_types));
16643 /* function exit code */
16644 __Pyx_RefNannyFinishContext();
16648 static int __pyx_pf_4lxml_9objectify_6PyType_14xmlSchemaTypes_2__set__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self, PyObject *__pyx_v_types) {
16650 __Pyx_RefNannyDeclarations
16651 PyObject *__pyx_t_1 = NULL;
16652 PyObject *__pyx_t_2 = NULL;
16653 int __pyx_lineno = 0;
16654 const char *__pyx_filename = NULL;
16655 int __pyx_clineno = 0;
16656 __Pyx_RefNannySetupContext("__set__", 0);
16658 /* "lxml/objectify.pyx":1011
16659 * return self._schema_types
16660 * def __set__(self, types):
16661 * self._schema_types = list(map(unicode, types)) # <<<<<<<<<<<<<<
16665 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
16666 __Pyx_GOTREF(__pyx_t_1);
16667 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
16668 __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
16669 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)));
16670 __Pyx_INCREF(__pyx_v_types);
16671 __Pyx_GIVEREF(__pyx_v_types);
16672 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_types);
16673 __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)
16674 __Pyx_GOTREF(__pyx_t_2);
16675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16676 __pyx_t_1 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
16677 __Pyx_GOTREF(__pyx_t_1);
16678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16679 __Pyx_GIVEREF(__pyx_t_1);
16680 __Pyx_GOTREF(__pyx_v_self->_schema_types);
16681 __Pyx_DECREF(__pyx_v_self->_schema_types);
16682 __pyx_v_self->_schema_types = ((PyObject*)__pyx_t_1);
16685 /* "lxml/objectify.pyx":1010
16686 * def __get__(self):
16687 * return self._schema_types
16688 * def __set__(self, types): # <<<<<<<<<<<<<<
16689 * self._schema_types = list(map(unicode, types))
16693 /* function exit code */
16697 __Pyx_XDECREF(__pyx_t_1);
16698 __Pyx_XDECREF(__pyx_t_2);
16699 __Pyx_AddTraceback("lxml.objectify.PyType.xmlSchemaTypes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16702 __Pyx_RefNannyFinishContext();
16706 /* "lxml/objectify.pyx":921
16707 * matching type will be used.
16709 * cdef readonly object name # <<<<<<<<<<<<<<
16710 * cdef readonly object type_check
16711 * cdef readonly object stringify
16714 /* Python wrapper */
16715 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
16716 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(PyObject *__pyx_v_self) {
16717 PyObject *__pyx_r = 0;
16718 __Pyx_RefNannyDeclarations
16719 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16720 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_4name___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16722 /* function exit code */
16723 __Pyx_RefNannyFinishContext();
16727 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_4name___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16728 PyObject *__pyx_r = NULL;
16729 __Pyx_RefNannyDeclarations
16730 __Pyx_RefNannySetupContext("__get__", 0);
16731 __Pyx_XDECREF(__pyx_r);
16732 __Pyx_INCREF(__pyx_v_self->name);
16733 __pyx_r = __pyx_v_self->name;
16736 /* function exit code */
16738 __Pyx_XGIVEREF(__pyx_r);
16739 __Pyx_RefNannyFinishContext();
16743 /* "lxml/objectify.pyx":922
16745 * cdef readonly object name
16746 * cdef readonly object type_check # <<<<<<<<<<<<<<
16747 * cdef readonly object stringify
16748 * cdef object _type
16751 /* Python wrapper */
16752 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(PyObject *__pyx_v_self); /*proto*/
16753 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(PyObject *__pyx_v_self) {
16754 PyObject *__pyx_r = 0;
16755 __Pyx_RefNannyDeclarations
16756 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16757 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16759 /* function exit code */
16760 __Pyx_RefNannyFinishContext();
16764 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_10type_check___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16765 PyObject *__pyx_r = NULL;
16766 __Pyx_RefNannyDeclarations
16767 __Pyx_RefNannySetupContext("__get__", 0);
16768 __Pyx_XDECREF(__pyx_r);
16769 __Pyx_INCREF(__pyx_v_self->type_check);
16770 __pyx_r = __pyx_v_self->type_check;
16773 /* function exit code */
16775 __Pyx_XGIVEREF(__pyx_r);
16776 __Pyx_RefNannyFinishContext();
16780 /* "lxml/objectify.pyx":923
16781 * cdef readonly object name
16782 * cdef readonly object type_check
16783 * cdef readonly object stringify # <<<<<<<<<<<<<<
16784 * cdef object _type
16785 * cdef list _schema_types
16788 /* Python wrapper */
16789 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(PyObject *__pyx_v_self); /*proto*/
16790 static PyObject *__pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(PyObject *__pyx_v_self) {
16791 PyObject *__pyx_r = 0;
16792 __Pyx_RefNannyDeclarations
16793 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16794 __pyx_r = __pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_self));
16796 /* function exit code */
16797 __Pyx_RefNannyFinishContext();
16801 static PyObject *__pyx_pf_4lxml_9objectify_6PyType_9stringify___get__(struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_self) {
16802 PyObject *__pyx_r = NULL;
16803 __Pyx_RefNannyDeclarations
16804 __Pyx_RefNannySetupContext("__get__", 0);
16805 __Pyx_XDECREF(__pyx_r);
16806 __Pyx_INCREF(__pyx_v_self->stringify);
16807 __pyx_r = __pyx_v_self->stringify;
16810 /* function exit code */
16812 __Pyx_XGIVEREF(__pyx_r);
16813 __Pyx_RefNannyFinishContext();
16817 /* "lxml/objectify.pyx":1018
16818 * cdef list _TYPE_CHECKS = []
16820 * def __lower_bool(b): # <<<<<<<<<<<<<<
16821 * return u"true" if b else u"false"
16825 /* Python wrapper */
16826 static PyObject *__pyx_pw_4lxml_9objectify_7__lower_bool(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/
16827 static PyMethodDef __pyx_mdef_4lxml_9objectify_7__lower_bool = {"__lower_bool", (PyCFunction)__pyx_pw_4lxml_9objectify_7__lower_bool, METH_O, 0};
16828 static PyObject *__pyx_pw_4lxml_9objectify_7__lower_bool(PyObject *__pyx_self, PyObject *__pyx_v_b) {
16829 PyObject *__pyx_r = 0;
16830 __Pyx_RefNannyDeclarations
16831 __Pyx_RefNannySetupContext("__lower_bool (wrapper)", 0);
16832 __pyx_r = __pyx_pf_4lxml_9objectify_6__lower_bool(__pyx_self, ((PyObject *)__pyx_v_b));
16834 /* function exit code */
16835 __Pyx_RefNannyFinishContext();
16839 static PyObject *__pyx_pf_4lxml_9objectify_6__lower_bool(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) {
16840 PyObject *__pyx_r = NULL;
16841 __Pyx_RefNannyDeclarations
16842 PyObject *__pyx_t_1 = NULL;
16844 int __pyx_lineno = 0;
16845 const char *__pyx_filename = NULL;
16846 int __pyx_clineno = 0;
16847 __Pyx_RefNannySetupContext("__lower_bool", 0);
16849 /* "lxml/objectify.pyx":1019
16851 * def __lower_bool(b):
16852 * return u"true" if b else u"false" # <<<<<<<<<<<<<<
16854 * cdef _pytypename(obj):
16856 __Pyx_XDECREF(__pyx_r);
16857 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_b); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1019, __pyx_L1_error)
16859 __Pyx_INCREF(__pyx_n_u_true);
16860 __pyx_t_1 = __pyx_n_u_true;
16862 __Pyx_INCREF(__pyx_n_u_false);
16863 __pyx_t_1 = __pyx_n_u_false;
16865 __pyx_r = __pyx_t_1;
16869 /* "lxml/objectify.pyx":1018
16870 * cdef list _TYPE_CHECKS = []
16872 * def __lower_bool(b): # <<<<<<<<<<<<<<
16873 * return u"true" if b else u"false"
16877 /* function exit code */
16879 __Pyx_XDECREF(__pyx_t_1);
16880 __Pyx_AddTraceback("lxml.objectify.__lower_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
16883 __Pyx_XGIVEREF(__pyx_r);
16884 __Pyx_RefNannyFinishContext();
16888 /* "lxml/objectify.pyx":1021
16889 * return u"true" if b else u"false"
16891 * cdef _pytypename(obj): # <<<<<<<<<<<<<<
16892 * return u"str" if python._isString(obj) else _typename(obj)
16896 static PyObject *__pyx_f_4lxml_9objectify__pytypename(PyObject *__pyx_v_obj) {
16897 PyObject *__pyx_r = NULL;
16898 __Pyx_RefNannyDeclarations
16899 PyObject *__pyx_t_1 = NULL;
16900 PyObject *__pyx_t_2 = NULL;
16901 int __pyx_lineno = 0;
16902 const char *__pyx_filename = NULL;
16903 int __pyx_clineno = 0;
16904 __Pyx_RefNannySetupContext("_pytypename", 0);
16906 /* "lxml/objectify.pyx":1022
16908 * cdef _pytypename(obj):
16909 * return u"str" if python._isString(obj) else _typename(obj) # <<<<<<<<<<<<<<
16911 * def pytypename(obj):
16913 __Pyx_XDECREF(__pyx_r);
16914 if ((_isString(__pyx_v_obj) != 0)) {
16915 __Pyx_INCREF(__pyx_n_u_str);
16916 __pyx_t_1 = __pyx_n_u_str;
16918 __pyx_t_2 = __pyx_f_4lxml_9objectify__typename(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
16919 __Pyx_GOTREF(__pyx_t_2);
16920 __pyx_t_1 = __pyx_t_2;
16923 __pyx_r = __pyx_t_1;
16927 /* "lxml/objectify.pyx":1021
16928 * return u"true" if b else u"false"
16930 * cdef _pytypename(obj): # <<<<<<<<<<<<<<
16931 * return u"str" if python._isString(obj) else _typename(obj)
16935 /* function exit code */
16937 __Pyx_XDECREF(__pyx_t_1);
16938 __Pyx_XDECREF(__pyx_t_2);
16939 __Pyx_AddTraceback("lxml.objectify._pytypename", __pyx_clineno, __pyx_lineno, __pyx_filename);
16942 __Pyx_XGIVEREF(__pyx_r);
16943 __Pyx_RefNannyFinishContext();
16947 /* "lxml/objectify.pyx":1024
16948 * return u"str" if python._isString(obj) else _typename(obj)
16950 * def pytypename(obj): # <<<<<<<<<<<<<<
16951 * u"""pytypename(obj)
16955 /* Python wrapper */
16956 static PyObject *__pyx_pw_4lxml_9objectify_9pytypename(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
16957 static char __pyx_doc_4lxml_9objectify_8pytypename[] = "pytypename(obj)\n\n Find the name of the corresponding PyType for a Python object.\n ";
16958 static PyMethodDef __pyx_mdef_4lxml_9objectify_9pytypename = {"pytypename", (PyCFunction)__pyx_pw_4lxml_9objectify_9pytypename, METH_O, __pyx_doc_4lxml_9objectify_8pytypename};
16959 static PyObject *__pyx_pw_4lxml_9objectify_9pytypename(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16960 PyObject *__pyx_r = 0;
16961 __Pyx_RefNannyDeclarations
16962 __Pyx_RefNannySetupContext("pytypename (wrapper)", 0);
16963 __pyx_r = __pyx_pf_4lxml_9objectify_8pytypename(__pyx_self, ((PyObject *)__pyx_v_obj));
16965 /* function exit code */
16966 __Pyx_RefNannyFinishContext();
16970 static PyObject *__pyx_pf_4lxml_9objectify_8pytypename(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
16971 PyObject *__pyx_r = NULL;
16972 __Pyx_RefNannyDeclarations
16973 PyObject *__pyx_t_1 = NULL;
16974 int __pyx_lineno = 0;
16975 const char *__pyx_filename = NULL;
16976 int __pyx_clineno = 0;
16977 __Pyx_RefNannySetupContext("pytypename", 0);
16979 /* "lxml/objectify.pyx":1029
16980 * Find the name of the corresponding PyType for a Python object.
16982 * return _pytypename(obj) # <<<<<<<<<<<<<<
16984 * cdef _registerPyTypes():
16986 __Pyx_XDECREF(__pyx_r);
16987 __pyx_t_1 = __pyx_f_4lxml_9objectify__pytypename(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
16988 __Pyx_GOTREF(__pyx_t_1);
16989 __pyx_r = __pyx_t_1;
16993 /* "lxml/objectify.pyx":1024
16994 * return u"str" if python._isString(obj) else _typename(obj)
16996 * def pytypename(obj): # <<<<<<<<<<<<<<
16997 * u"""pytypename(obj)
17001 /* function exit code */
17003 __Pyx_XDECREF(__pyx_t_1);
17004 __Pyx_AddTraceback("lxml.objectify.pytypename", __pyx_clineno, __pyx_lineno, __pyx_filename);
17007 __Pyx_XGIVEREF(__pyx_r);
17008 __Pyx_RefNannyFinishContext();
17012 /* "lxml/objectify.pyx":1031
17013 * return _pytypename(obj)
17015 * cdef _registerPyTypes(): # <<<<<<<<<<<<<<
17016 * pytype = PyType(u'int', int, IntElement)
17017 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17020 static PyObject *__pyx_f_4lxml_9objectify__registerPyTypes(void) {
17021 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_pytype = NULL;
17022 PyObject *__pyx_r = NULL;
17023 __Pyx_RefNannyDeclarations
17024 PyObject *__pyx_t_1 = NULL;
17025 PyObject *__pyx_t_2 = NULL;
17026 PyObject *__pyx_t_3 = NULL;
17027 int __pyx_lineno = 0;
17028 const char *__pyx_filename = NULL;
17029 int __pyx_clineno = 0;
17030 __Pyx_RefNannySetupContext("_registerPyTypes", 0);
17032 /* "lxml/objectify.pyx":1032
17034 * cdef _registerPyTypes():
17035 * pytype = PyType(u'int', int, IntElement) # <<<<<<<<<<<<<<
17036 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17037 * u"unsignedByte", u"nonPositiveInteger",
17039 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error)
17040 __Pyx_GOTREF(__pyx_t_1);
17041 __Pyx_INCREF(__pyx_n_u_int);
17042 __Pyx_GIVEREF(__pyx_n_u_int);
17043 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_int);
17044 __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
17045 __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
17046 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)(&PyInt_Type)));
17047 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17048 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17049 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17050 __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)
17051 __Pyx_GOTREF(__pyx_t_2);
17052 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17053 __pyx_v_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2);
17056 /* "lxml/objectify.pyx":1033
17057 * cdef _registerPyTypes():
17058 * pytype = PyType(u'int', int, IntElement)
17059 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort", # <<<<<<<<<<<<<<
17060 * u"unsignedByte", u"nonPositiveInteger",
17061 * u"negativeInteger", u"long", u"nonNegativeInteger",
17063 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__5) < 0) __PYX_ERR(0, 1033, __pyx_L1_error)
17065 /* "lxml/objectify.pyx":1037
17066 * u"negativeInteger", u"long", u"nonNegativeInteger",
17067 * u"unsignedLong", u"unsignedInt", u"positiveInteger",)
17068 * pytype.register() # <<<<<<<<<<<<<<
17070 * # 'long' type just for backwards compatibility
17072 __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)
17073 __Pyx_GOTREF(__pyx_t_1);
17075 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
17076 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
17077 if (likely(__pyx_t_3)) {
17078 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
17079 __Pyx_INCREF(__pyx_t_3);
17080 __Pyx_INCREF(function);
17081 __Pyx_DECREF_SET(__pyx_t_1, function);
17084 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
17085 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17086 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
17087 __Pyx_GOTREF(__pyx_t_2);
17088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17091 /* "lxml/objectify.pyx":1040
17093 * # 'long' type just for backwards compatibility
17094 * pytype = PyType(u'long', None, IntElement) # <<<<<<<<<<<<<<
17095 * pytype.register()
17098 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error)
17099 __Pyx_GOTREF(__pyx_t_2);
17100 __Pyx_INCREF(__pyx_n_u_long);
17101 __Pyx_GIVEREF(__pyx_n_u_long);
17102 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_long);
17103 __Pyx_INCREF(Py_None);
17104 __Pyx_GIVEREF(Py_None);
17105 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17106 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17107 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17108 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_IntElement));
17109 __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)
17110 __Pyx_GOTREF(__pyx_t_1);
17111 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17112 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
17115 /* "lxml/objectify.pyx":1041
17116 * # 'long' type just for backwards compatibility
17117 * pytype = PyType(u'long', None, IntElement)
17118 * pytype.register() # <<<<<<<<<<<<<<
17120 * pytype = PyType(u'float', float, FloatElement, repr)
17122 __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)
17123 __Pyx_GOTREF(__pyx_t_2);
17125 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17126 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
17127 if (likely(__pyx_t_3)) {
17128 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17129 __Pyx_INCREF(__pyx_t_3);
17130 __Pyx_INCREF(function);
17131 __Pyx_DECREF_SET(__pyx_t_2, function);
17134 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17135 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17136 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
17137 __Pyx_GOTREF(__pyx_t_1);
17138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17139 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17141 /* "lxml/objectify.pyx":1043
17142 * pytype.register()
17144 * pytype = PyType(u'float', float, FloatElement, repr) # <<<<<<<<<<<<<<
17145 * pytype.xmlSchemaTypes = (u"double", u"float")
17146 * pytype.register()
17148 __pyx_t_1 = __Pyx_GetBuiltinName(__pyx_n_s_repr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
17149 __Pyx_GOTREF(__pyx_t_1);
17150 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
17151 __Pyx_GOTREF(__pyx_t_2);
17152 __Pyx_INCREF(__pyx_n_u_float);
17153 __Pyx_GIVEREF(__pyx_n_u_float);
17154 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_float);
17155 __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
17156 __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
17157 PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyFloat_Type)));
17158 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17159 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17160 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_FloatElement));
17161 __Pyx_GIVEREF(__pyx_t_1);
17162 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
17164 __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)
17165 __Pyx_GOTREF(__pyx_t_1);
17166 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17167 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
17170 /* "lxml/objectify.pyx":1044
17172 * pytype = PyType(u'float', float, FloatElement, repr)
17173 * pytype.xmlSchemaTypes = (u"double", u"float") # <<<<<<<<<<<<<<
17174 * pytype.register()
17177 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__6) < 0) __PYX_ERR(0, 1044, __pyx_L1_error)
17179 /* "lxml/objectify.pyx":1045
17180 * pytype = PyType(u'float', float, FloatElement, repr)
17181 * pytype.xmlSchemaTypes = (u"double", u"float")
17182 * pytype.register() # <<<<<<<<<<<<<<
17184 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17186 __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)
17187 __Pyx_GOTREF(__pyx_t_2);
17189 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17190 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
17191 if (likely(__pyx_t_3)) {
17192 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17193 __Pyx_INCREF(__pyx_t_3);
17194 __Pyx_INCREF(function);
17195 __Pyx_DECREF_SET(__pyx_t_2, function);
17198 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17199 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
17200 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
17201 __Pyx_GOTREF(__pyx_t_1);
17202 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17205 /* "lxml/objectify.pyx":1047
17206 * pytype.register()
17208 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool) # <<<<<<<<<<<<<<
17209 * pytype.xmlSchemaTypes = (u"boolean",)
17210 * pytype.register()
17212 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkBool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
17213 __Pyx_GOTREF(__pyx_t_1);
17214 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_lower_bool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
17215 __Pyx_GOTREF(__pyx_t_2);
17216 __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error)
17217 __Pyx_GOTREF(__pyx_t_3);
17218 __Pyx_INCREF(__pyx_n_u_bool);
17219 __Pyx_GIVEREF(__pyx_n_u_bool);
17220 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_bool);
17221 __Pyx_GIVEREF(__pyx_t_1);
17222 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
17223 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17224 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17225 PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_BoolElement));
17226 __Pyx_GIVEREF(__pyx_t_2);
17227 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_2);
17230 __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)
17231 __Pyx_GOTREF(__pyx_t_2);
17232 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17233 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
17236 /* "lxml/objectify.pyx":1048
17238 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17239 * pytype.xmlSchemaTypes = (u"boolean",) # <<<<<<<<<<<<<<
17240 * pytype.register()
17243 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__7) < 0) __PYX_ERR(0, 1048, __pyx_L1_error)
17245 /* "lxml/objectify.pyx":1049
17246 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
17247 * pytype.xmlSchemaTypes = (u"boolean",)
17248 * pytype.register() # <<<<<<<<<<<<<<
17250 * pytype = PyType(u'str', None, StringElement)
17252 __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)
17253 __Pyx_GOTREF(__pyx_t_3);
17255 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
17256 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
17257 if (likely(__pyx_t_1)) {
17258 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17259 __Pyx_INCREF(__pyx_t_1);
17260 __Pyx_INCREF(function);
17261 __Pyx_DECREF_SET(__pyx_t_3, function);
17264 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
17265 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17266 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
17267 __Pyx_GOTREF(__pyx_t_2);
17268 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17271 /* "lxml/objectify.pyx":1051
17272 * pytype.register()
17274 * pytype = PyType(u'str', None, StringElement) # <<<<<<<<<<<<<<
17275 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language",
17276 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17278 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1051, __pyx_L1_error)
17279 __Pyx_GOTREF(__pyx_t_2);
17280 __Pyx_INCREF(__pyx_n_u_str);
17281 __Pyx_GIVEREF(__pyx_n_u_str);
17282 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_str);
17283 __Pyx_INCREF(Py_None);
17284 __Pyx_GIVEREF(Py_None);
17285 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17286 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17287 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17288 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
17289 __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)
17290 __Pyx_GOTREF(__pyx_t_3);
17291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17292 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3));
17295 /* "lxml/objectify.pyx":1052
17297 * pytype = PyType(u'str', None, StringElement)
17298 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language", # <<<<<<<<<<<<<<
17299 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17302 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_pytype), __pyx_n_s_xmlSchemaTypes, __pyx_tuple__8) < 0) __PYX_ERR(0, 1052, __pyx_L1_error)
17304 /* "lxml/objectify.pyx":1055
17305 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
17307 * pytype.register() # <<<<<<<<<<<<<<
17311 __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)
17312 __Pyx_GOTREF(__pyx_t_2);
17314 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17315 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
17316 if (likely(__pyx_t_1)) {
17317 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17318 __Pyx_INCREF(__pyx_t_1);
17319 __Pyx_INCREF(function);
17320 __Pyx_DECREF_SET(__pyx_t_2, function);
17323 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17324 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17325 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1055, __pyx_L1_error)
17326 __Pyx_GOTREF(__pyx_t_3);
17327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17328 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17330 /* "lxml/objectify.pyx":1058
17333 * pytype = PyType(u'NoneType', None, NoneElement) # <<<<<<<<<<<<<<
17334 * pytype.register()
17337 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error)
17338 __Pyx_GOTREF(__pyx_t_3);
17339 __Pyx_INCREF(__pyx_n_u_NoneType);
17340 __Pyx_GIVEREF(__pyx_n_u_NoneType);
17341 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_NoneType);
17342 __Pyx_INCREF(Py_None);
17343 __Pyx_GIVEREF(Py_None);
17344 PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
17345 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17346 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17347 PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17348 __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)
17349 __Pyx_GOTREF(__pyx_t_2);
17350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17351 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
17354 /* "lxml/objectify.pyx":1059
17356 * pytype = PyType(u'NoneType', None, NoneElement)
17357 * pytype.register() # <<<<<<<<<<<<<<
17359 * # backwards compatibility
17361 __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)
17362 __Pyx_GOTREF(__pyx_t_3);
17364 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
17365 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
17366 if (likely(__pyx_t_1)) {
17367 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
17368 __Pyx_INCREF(__pyx_t_1);
17369 __Pyx_INCREF(function);
17370 __Pyx_DECREF_SET(__pyx_t_3, function);
17373 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
17374 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17375 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error)
17376 __Pyx_GOTREF(__pyx_t_2);
17377 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17380 /* "lxml/objectify.pyx":1062
17382 * # backwards compatibility
17383 * pytype = PyType(u'none', None, NoneElement) # <<<<<<<<<<<<<<
17384 * pytype.register()
17387 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
17388 __Pyx_GOTREF(__pyx_t_2);
17389 __Pyx_INCREF(__pyx_n_u_none);
17390 __Pyx_GIVEREF(__pyx_n_u_none);
17391 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_none);
17392 __Pyx_INCREF(Py_None);
17393 __Pyx_GIVEREF(Py_None);
17394 PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
17395 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17396 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17397 PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
17398 __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)
17399 __Pyx_GOTREF(__pyx_t_3);
17400 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17401 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3));
17404 /* "lxml/objectify.pyx":1063
17405 * # backwards compatibility
17406 * pytype = PyType(u'none', None, NoneElement)
17407 * pytype.register() # <<<<<<<<<<<<<<
17409 * # non-registered PyType for inner tree elements
17411 __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)
17412 __Pyx_GOTREF(__pyx_t_2);
17414 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
17415 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
17416 if (likely(__pyx_t_1)) {
17417 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
17418 __Pyx_INCREF(__pyx_t_1);
17419 __Pyx_INCREF(function);
17420 __Pyx_DECREF_SET(__pyx_t_2, function);
17423 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
17424 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17425 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
17426 __Pyx_GOTREF(__pyx_t_3);
17427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17430 /* "lxml/objectify.pyx":1031
17431 * return _pytypename(obj)
17433 * cdef _registerPyTypes(): # <<<<<<<<<<<<<<
17434 * pytype = PyType(u'int', int, IntElement)
17435 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort",
17438 /* function exit code */
17439 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17442 __Pyx_XDECREF(__pyx_t_1);
17443 __Pyx_XDECREF(__pyx_t_2);
17444 __Pyx_XDECREF(__pyx_t_3);
17445 __Pyx_AddTraceback("lxml.objectify._registerPyTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17448 __Pyx_XDECREF((PyObject *)__pyx_v_pytype);
17449 __Pyx_XGIVEREF(__pyx_r);
17450 __Pyx_RefNannyFinishContext();
17454 /* "lxml/objectify.pyx":1070
17455 * _registerPyTypes()
17457 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
17458 * u"""getRegisteredTypes()
17462 /* Python wrapper */
17463 static PyObject *__pyx_pw_4lxml_9objectify_11getRegisteredTypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17464 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 ";
17465 static PyMethodDef __pyx_mdef_4lxml_9objectify_11getRegisteredTypes = {"getRegisteredTypes", (PyCFunction)__pyx_pw_4lxml_9objectify_11getRegisteredTypes, METH_NOARGS, __pyx_doc_4lxml_9objectify_10getRegisteredTypes};
17466 static PyObject *__pyx_pw_4lxml_9objectify_11getRegisteredTypes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
17467 PyObject *__pyx_r = 0;
17468 __Pyx_RefNannyDeclarations
17469 __Pyx_RefNannySetupContext("getRegisteredTypes (wrapper)", 0);
17470 __pyx_r = __pyx_pf_4lxml_9objectify_10getRegisteredTypes(__pyx_self);
17472 /* function exit code */
17473 __Pyx_RefNannyFinishContext();
17477 static PyObject *__pyx_pf_4lxml_9objectify_10getRegisteredTypes(CYTHON_UNUSED PyObject *__pyx_self) {
17478 PyObject *__pyx_v_types = 0;
17479 PyObject *__pyx_v_known = 0;
17480 CYTHON_UNUSED PyObject *__pyx_v_check = NULL;
17481 PyObject *__pyx_v_pytype = NULL;
17482 PyObject *__pyx_v_name = NULL;
17483 PyObject *__pyx_r = NULL;
17484 __Pyx_RefNannyDeclarations
17485 PyObject *__pyx_t_1 = NULL;
17486 Py_ssize_t __pyx_t_2;
17487 PyObject *__pyx_t_3 = NULL;
17488 PyObject *__pyx_t_4 = NULL;
17489 PyObject *__pyx_t_5 = NULL;
17490 PyObject *__pyx_t_6 = NULL;
17491 PyObject *(*__pyx_t_7)(PyObject *);
17495 PyObject *(*__pyx_t_11)(PyObject *);
17496 int __pyx_lineno = 0;
17497 const char *__pyx_filename = NULL;
17498 int __pyx_clineno = 0;
17499 __Pyx_RefNannySetupContext("getRegisteredTypes", 0);
17501 /* "lxml/objectify.pyx":1085
17502 * end of the type list.
17504 * cdef list types = [] # <<<<<<<<<<<<<<
17505 * cdef set known = set()
17506 * for check, pytype in _TYPE_CHECKS:
17508 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
17509 __Pyx_GOTREF(__pyx_t_1);
17510 __pyx_v_types = ((PyObject*)__pyx_t_1);
17513 /* "lxml/objectify.pyx":1086
17515 * cdef list types = []
17516 * cdef set known = set() # <<<<<<<<<<<<<<
17517 * for check, pytype in _TYPE_CHECKS:
17518 * name = pytype.name
17520 __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
17521 __Pyx_GOTREF(__pyx_t_1);
17522 __pyx_v_known = ((PyObject*)__pyx_t_1);
17525 /* "lxml/objectify.pyx":1087
17526 * cdef list types = []
17527 * cdef set known = set()
17528 * for check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17529 * name = pytype.name
17530 * if name not in known:
17532 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
17533 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
17534 __PYX_ERR(0, 1087, __pyx_L1_error)
17536 __pyx_t_1 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
17538 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
17539 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17540 __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)
17542 __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)
17543 __Pyx_GOTREF(__pyx_t_3);
17545 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
17546 PyObject* sequence = __pyx_t_3;
17547 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17548 if (unlikely(size != 2)) {
17549 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17550 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17551 __PYX_ERR(0, 1087, __pyx_L1_error)
17553 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17554 if (likely(PyTuple_CheckExact(sequence))) {
17555 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
17556 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
17558 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
17559 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
17561 __Pyx_INCREF(__pyx_t_4);
17562 __Pyx_INCREF(__pyx_t_5);
17564 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
17565 __Pyx_GOTREF(__pyx_t_4);
17566 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1087, __pyx_L1_error)
17567 __Pyx_GOTREF(__pyx_t_5);
17569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17571 Py_ssize_t index = -1;
17572 __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1087, __pyx_L1_error)
17573 __Pyx_GOTREF(__pyx_t_6);
17574 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17575 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
17576 index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
17577 __Pyx_GOTREF(__pyx_t_4);
17578 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
17579 __Pyx_GOTREF(__pyx_t_5);
17580 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1087, __pyx_L1_error)
17582 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17583 goto __pyx_L6_unpacking_done;
17584 __pyx_L5_unpacking_failed:;
17585 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17587 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17588 __PYX_ERR(0, 1087, __pyx_L1_error)
17589 __pyx_L6_unpacking_done:;
17591 __Pyx_XDECREF_SET(__pyx_v_check, __pyx_t_4);
17593 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_5);
17596 /* "lxml/objectify.pyx":1088
17597 * cdef set known = set()
17598 * for check, pytype in _TYPE_CHECKS:
17599 * name = pytype.name # <<<<<<<<<<<<<<
17600 * if name not in known:
17603 __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)
17604 __Pyx_GOTREF(__pyx_t_3);
17605 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
17608 /* "lxml/objectify.pyx":1089
17609 * for check, pytype in _TYPE_CHECKS:
17610 * name = pytype.name
17611 * if name not in known: # <<<<<<<<<<<<<<
17613 * types.append(pytype)
17615 __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)
17616 __pyx_t_9 = (__pyx_t_8 != 0);
17619 /* "lxml/objectify.pyx":1090
17620 * name = pytype.name
17621 * if name not in known:
17622 * known.add(name) # <<<<<<<<<<<<<<
17623 * types.append(pytype)
17624 * for pytype in _PYTYPE_DICT.values():
17626 __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)
17628 /* "lxml/objectify.pyx":1091
17629 * if name not in known:
17631 * types.append(pytype) # <<<<<<<<<<<<<<
17632 * for pytype in _PYTYPE_DICT.values():
17633 * name = pytype.name
17635 __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)
17637 /* "lxml/objectify.pyx":1089
17638 * for check, pytype in _TYPE_CHECKS:
17639 * name = pytype.name
17640 * if name not in known: # <<<<<<<<<<<<<<
17642 * types.append(pytype)
17646 /* "lxml/objectify.pyx":1087
17647 * cdef list types = []
17648 * cdef set known = set()
17649 * for check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17650 * name = pytype.name
17651 * if name not in known:
17654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17656 /* "lxml/objectify.pyx":1092
17658 * types.append(pytype)
17659 * for pytype in _PYTYPE_DICT.values(): # <<<<<<<<<<<<<<
17660 * name = pytype.name
17661 * if name not in known:
17663 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
17664 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
17665 __PYX_ERR(0, 1092, __pyx_L1_error)
17667 __pyx_t_1 = __Pyx_PyDict_Values(__pyx_v_4lxml_9objectify__PYTYPE_DICT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
17668 __Pyx_GOTREF(__pyx_t_1);
17669 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
17670 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
17673 __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
17674 __Pyx_GOTREF(__pyx_t_3);
17675 __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1092, __pyx_L1_error)
17677 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17679 if (likely(!__pyx_t_11)) {
17680 if (likely(PyList_CheckExact(__pyx_t_3))) {
17681 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
17682 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17683 __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)
17685 __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)
17686 __Pyx_GOTREF(__pyx_t_1);
17689 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
17690 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17691 __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)
17693 __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)
17694 __Pyx_GOTREF(__pyx_t_1);
17698 __pyx_t_1 = __pyx_t_11(__pyx_t_3);
17699 if (unlikely(!__pyx_t_1)) {
17700 PyObject* exc_type = PyErr_Occurred();
17702 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17703 else __PYX_ERR(0, 1092, __pyx_L1_error)
17707 __Pyx_GOTREF(__pyx_t_1);
17709 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_1);
17712 /* "lxml/objectify.pyx":1093
17713 * types.append(pytype)
17714 * for pytype in _PYTYPE_DICT.values():
17715 * name = pytype.name # <<<<<<<<<<<<<<
17716 * if name not in known:
17719 __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)
17720 __Pyx_GOTREF(__pyx_t_1);
17721 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
17724 /* "lxml/objectify.pyx":1094
17725 * for pytype in _PYTYPE_DICT.values():
17726 * name = pytype.name
17727 * if name not in known: # <<<<<<<<<<<<<<
17729 * types.append(pytype)
17731 __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)
17732 __pyx_t_8 = (__pyx_t_9 != 0);
17735 /* "lxml/objectify.pyx":1095
17736 * name = pytype.name
17737 * if name not in known:
17738 * known.add(name) # <<<<<<<<<<<<<<
17739 * types.append(pytype)
17742 __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)
17744 /* "lxml/objectify.pyx":1096
17745 * if name not in known:
17747 * types.append(pytype) # <<<<<<<<<<<<<<
17751 __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)
17753 /* "lxml/objectify.pyx":1094
17754 * for pytype in _PYTYPE_DICT.values():
17755 * name = pytype.name
17756 * if name not in known: # <<<<<<<<<<<<<<
17758 * types.append(pytype)
17762 /* "lxml/objectify.pyx":1092
17764 * types.append(pytype)
17765 * for pytype in _PYTYPE_DICT.values(): # <<<<<<<<<<<<<<
17766 * name = pytype.name
17767 * if name not in known:
17770 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17772 /* "lxml/objectify.pyx":1097
17774 * types.append(pytype)
17775 * return types # <<<<<<<<<<<<<<
17777 * cdef PyType _guessPyType(value, PyType defaulttype):
17779 __Pyx_XDECREF(__pyx_r);
17780 __Pyx_INCREF(__pyx_v_types);
17781 __pyx_r = __pyx_v_types;
17784 /* "lxml/objectify.pyx":1070
17785 * _registerPyTypes()
17787 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
17788 * u"""getRegisteredTypes()
17792 /* function exit code */
17794 __Pyx_XDECREF(__pyx_t_1);
17795 __Pyx_XDECREF(__pyx_t_3);
17796 __Pyx_XDECREF(__pyx_t_4);
17797 __Pyx_XDECREF(__pyx_t_5);
17798 __Pyx_XDECREF(__pyx_t_6);
17799 __Pyx_AddTraceback("lxml.objectify.getRegisteredTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
17802 __Pyx_XDECREF(__pyx_v_types);
17803 __Pyx_XDECREF(__pyx_v_known);
17804 __Pyx_XDECREF(__pyx_v_check);
17805 __Pyx_XDECREF(__pyx_v_pytype);
17806 __Pyx_XDECREF(__pyx_v_name);
17807 __Pyx_XGIVEREF(__pyx_r);
17808 __Pyx_RefNannyFinishContext();
17812 /* "lxml/objectify.pyx":1099
17815 * cdef PyType _guessPyType(value, PyType defaulttype): # <<<<<<<<<<<<<<
17816 * if value is None:
17820 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) {
17821 PyObject *__pyx_v_type_check = NULL;
17822 PyObject *__pyx_v_tested_pytype = NULL;
17823 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_r = NULL;
17824 __Pyx_RefNannyDeclarations
17827 PyObject *__pyx_t_3 = NULL;
17828 Py_ssize_t __pyx_t_4;
17829 PyObject *__pyx_t_5 = NULL;
17830 PyObject *__pyx_t_6 = NULL;
17831 PyObject *__pyx_t_7 = NULL;
17832 PyObject *__pyx_t_8 = NULL;
17833 PyObject *(*__pyx_t_9)(PyObject *);
17834 PyObject *__pyx_t_10 = NULL;
17835 PyObject *__pyx_t_11 = NULL;
17836 PyObject *__pyx_t_12 = NULL;
17838 int __pyx_lineno = 0;
17839 const char *__pyx_filename = NULL;
17840 int __pyx_clineno = 0;
17841 __Pyx_RefNannySetupContext("_guessPyType", 0);
17843 /* "lxml/objectify.pyx":1100
17845 * cdef PyType _guessPyType(value, PyType defaulttype):
17846 * if value is None: # <<<<<<<<<<<<<<
17848 * for type_check, tested_pytype in _TYPE_CHECKS:
17850 __pyx_t_1 = (__pyx_v_value == Py_None);
17851 __pyx_t_2 = (__pyx_t_1 != 0);
17854 /* "lxml/objectify.pyx":1101
17855 * cdef PyType _guessPyType(value, PyType defaulttype):
17856 * if value is None:
17857 * return None # <<<<<<<<<<<<<<
17858 * for type_check, tested_pytype in _TYPE_CHECKS:
17861 __Pyx_XDECREF(((PyObject *)__pyx_r));
17862 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
17865 /* "lxml/objectify.pyx":1100
17867 * cdef PyType _guessPyType(value, PyType defaulttype):
17868 * if value is None: # <<<<<<<<<<<<<<
17870 * for type_check, tested_pytype in _TYPE_CHECKS:
17874 /* "lxml/objectify.pyx":1102
17875 * if value is None:
17877 * for type_check, tested_pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
17879 * type_check(value)
17881 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
17882 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
17883 __PYX_ERR(0, 1102, __pyx_L1_error)
17885 __pyx_t_3 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
17887 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
17888 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17889 __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)
17891 __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)
17892 __Pyx_GOTREF(__pyx_t_5);
17894 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
17895 PyObject* sequence = __pyx_t_5;
17896 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17897 if (unlikely(size != 2)) {
17898 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17899 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17900 __PYX_ERR(0, 1102, __pyx_L1_error)
17902 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17903 if (likely(PyTuple_CheckExact(sequence))) {
17904 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
17905 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
17907 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
17908 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
17910 __Pyx_INCREF(__pyx_t_6);
17911 __Pyx_INCREF(__pyx_t_7);
17913 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1102, __pyx_L1_error)
17914 __Pyx_GOTREF(__pyx_t_6);
17915 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1102, __pyx_L1_error)
17916 __Pyx_GOTREF(__pyx_t_7);
17918 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17920 Py_ssize_t index = -1;
17921 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error)
17922 __Pyx_GOTREF(__pyx_t_8);
17923 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17924 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
17925 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
17926 __Pyx_GOTREF(__pyx_t_6);
17927 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
17928 __Pyx_GOTREF(__pyx_t_7);
17929 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1102, __pyx_L1_error)
17931 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17932 goto __pyx_L7_unpacking_done;
17933 __pyx_L6_unpacking_failed:;
17934 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17936 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17937 __PYX_ERR(0, 1102, __pyx_L1_error)
17938 __pyx_L7_unpacking_done:;
17940 __Pyx_XDECREF_SET(__pyx_v_type_check, __pyx_t_6);
17942 __Pyx_XDECREF_SET(__pyx_v_tested_pytype, __pyx_t_7);
17945 /* "lxml/objectify.pyx":1103
17947 * for type_check, tested_pytype in _TYPE_CHECKS:
17948 * try: # <<<<<<<<<<<<<<
17949 * type_check(value)
17950 * return <PyType>tested_pytype
17953 __Pyx_PyThreadState_declare
17954 __Pyx_PyThreadState_assign
17955 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
17956 __Pyx_XGOTREF(__pyx_t_10);
17957 __Pyx_XGOTREF(__pyx_t_11);
17958 __Pyx_XGOTREF(__pyx_t_12);
17961 /* "lxml/objectify.pyx":1104
17962 * for type_check, tested_pytype in _TYPE_CHECKS:
17964 * type_check(value) # <<<<<<<<<<<<<<
17965 * return <PyType>tested_pytype
17966 * except IGNORABLE_ERRORS:
17968 __Pyx_INCREF(__pyx_v_type_check);
17969 __pyx_t_7 = __pyx_v_type_check; __pyx_t_6 = NULL;
17970 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
17971 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
17972 if (likely(__pyx_t_6)) {
17973 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
17974 __Pyx_INCREF(__pyx_t_6);
17975 __Pyx_INCREF(function);
17976 __Pyx_DECREF_SET(__pyx_t_7, function);
17979 __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);
17980 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17981 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1104, __pyx_L8_error)
17982 __Pyx_GOTREF(__pyx_t_5);
17983 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17984 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17986 /* "lxml/objectify.pyx":1105
17988 * type_check(value)
17989 * return <PyType>tested_pytype # <<<<<<<<<<<<<<
17990 * except IGNORABLE_ERRORS:
17991 * # could not be parsed as the specified type => ignore
17993 __Pyx_XDECREF(((PyObject *)__pyx_r));
17994 __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_tested_pytype)));
17995 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_tested_pytype);
17996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17997 goto __pyx_L12_try_return;
17999 /* "lxml/objectify.pyx":1103
18001 * for type_check, tested_pytype in _TYPE_CHECKS:
18002 * try: # <<<<<<<<<<<<<<
18003 * type_check(value)
18004 * return <PyType>tested_pytype
18008 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18009 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18010 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18011 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18013 /* "lxml/objectify.pyx":1106
18014 * type_check(value)
18015 * return <PyType>tested_pytype
18016 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
18017 * # could not be parsed as the specified type => ignore
18020 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
18022 __Pyx_ErrRestore(0,0,0);
18023 goto __pyx_L9_exception_handled;
18025 goto __pyx_L10_except_error;
18026 __pyx_L10_except_error:;
18028 /* "lxml/objectify.pyx":1103
18030 * for type_check, tested_pytype in _TYPE_CHECKS:
18031 * try: # <<<<<<<<<<<<<<
18032 * type_check(value)
18033 * return <PyType>tested_pytype
18035 __Pyx_XGIVEREF(__pyx_t_10);
18036 __Pyx_XGIVEREF(__pyx_t_11);
18037 __Pyx_XGIVEREF(__pyx_t_12);
18038 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18039 goto __pyx_L1_error;
18040 __pyx_L12_try_return:;
18041 __Pyx_XGIVEREF(__pyx_t_10);
18042 __Pyx_XGIVEREF(__pyx_t_11);
18043 __Pyx_XGIVEREF(__pyx_t_12);
18044 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18046 __pyx_L9_exception_handled:;
18047 __Pyx_XGIVEREF(__pyx_t_10);
18048 __Pyx_XGIVEREF(__pyx_t_11);
18049 __Pyx_XGIVEREF(__pyx_t_12);
18050 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18053 /* "lxml/objectify.pyx":1102
18054 * if value is None:
18056 * for type_check, tested_pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18058 * type_check(value)
18061 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18063 /* "lxml/objectify.pyx":1109
18064 * # could not be parsed as the specified type => ignore
18066 * return defaulttype # <<<<<<<<<<<<<<
18068 * cdef object _guessElementClass(tree.xmlNode* c_node):
18070 __Pyx_XDECREF(((PyObject *)__pyx_r));
18071 __Pyx_INCREF(((PyObject *)__pyx_v_defaulttype));
18072 __pyx_r = __pyx_v_defaulttype;
18075 /* "lxml/objectify.pyx":1099
18078 * cdef PyType _guessPyType(value, PyType defaulttype): # <<<<<<<<<<<<<<
18079 * if value is None:
18083 /* function exit code */
18085 __Pyx_XDECREF(__pyx_t_3);
18086 __Pyx_XDECREF(__pyx_t_5);
18087 __Pyx_XDECREF(__pyx_t_6);
18088 __Pyx_XDECREF(__pyx_t_7);
18089 __Pyx_XDECREF(__pyx_t_8);
18090 __Pyx_AddTraceback("lxml.objectify._guessPyType", __pyx_clineno, __pyx_lineno, __pyx_filename);
18093 __Pyx_XDECREF(__pyx_v_type_check);
18094 __Pyx_XDECREF(__pyx_v_tested_pytype);
18095 __Pyx_XGIVEREF((PyObject *)__pyx_r);
18096 __Pyx_RefNannyFinishContext();
18100 /* "lxml/objectify.pyx":1111
18101 * return defaulttype
18103 * cdef object _guessElementClass(tree.xmlNode* c_node): # <<<<<<<<<<<<<<
18104 * value = textOf(c_node)
18105 * if value is None:
18108 static PyObject *__pyx_f_4lxml_9objectify__guessElementClass(xmlNode *__pyx_v_c_node) {
18109 PyObject *__pyx_v_value = NULL;
18110 PyObject *__pyx_v_type_check = NULL;
18111 PyObject *__pyx_v_pytype = NULL;
18112 PyObject *__pyx_r = NULL;
18113 __Pyx_RefNannyDeclarations
18114 PyObject *__pyx_t_1 = NULL;
18117 Py_ssize_t __pyx_t_4;
18118 PyObject *__pyx_t_5 = NULL;
18119 PyObject *__pyx_t_6 = NULL;
18120 PyObject *__pyx_t_7 = NULL;
18121 PyObject *__pyx_t_8 = NULL;
18122 PyObject *(*__pyx_t_9)(PyObject *);
18123 PyObject *__pyx_t_10 = NULL;
18124 PyObject *__pyx_t_11 = NULL;
18125 PyObject *__pyx_t_12 = NULL;
18127 int __pyx_lineno = 0;
18128 const char *__pyx_filename = NULL;
18129 int __pyx_clineno = 0;
18130 __Pyx_RefNannySetupContext("_guessElementClass", 0);
18132 /* "lxml/objectify.pyx":1112
18134 * cdef object _guessElementClass(tree.xmlNode* c_node):
18135 * value = textOf(c_node) # <<<<<<<<<<<<<<
18136 * if value is None:
18139 __pyx_t_1 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
18140 __Pyx_GOTREF(__pyx_t_1);
18141 __pyx_v_value = __pyx_t_1;
18144 /* "lxml/objectify.pyx":1113
18145 * cdef object _guessElementClass(tree.xmlNode* c_node):
18146 * value = textOf(c_node)
18147 * if value is None: # <<<<<<<<<<<<<<
18151 __pyx_t_2 = (__pyx_v_value == Py_None);
18152 __pyx_t_3 = (__pyx_t_2 != 0);
18155 /* "lxml/objectify.pyx":1114
18156 * value = textOf(c_node)
18157 * if value is None:
18158 * return None # <<<<<<<<<<<<<<
18160 * return StringElement
18162 __Pyx_XDECREF(__pyx_r);
18163 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18166 /* "lxml/objectify.pyx":1113
18167 * cdef object _guessElementClass(tree.xmlNode* c_node):
18168 * value = textOf(c_node)
18169 * if value is None: # <<<<<<<<<<<<<<
18175 /* "lxml/objectify.pyx":1115
18176 * if value is None:
18178 * if value == '': # <<<<<<<<<<<<<<
18179 * return StringElement
18182 __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)
18185 /* "lxml/objectify.pyx":1116
18188 * return StringElement # <<<<<<<<<<<<<<
18190 * for type_check, pytype in _TYPE_CHECKS:
18192 __Pyx_XDECREF(__pyx_r);
18193 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
18194 __pyx_r = ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement);
18197 /* "lxml/objectify.pyx":1115
18198 * if value is None:
18200 * if value == '': # <<<<<<<<<<<<<<
18201 * return StringElement
18206 /* "lxml/objectify.pyx":1118
18207 * return StringElement
18209 * for type_check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18211 * type_check(value)
18213 if (unlikely(__pyx_v_4lxml_9objectify__TYPE_CHECKS == Py_None)) {
18214 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
18215 __PYX_ERR(0, 1118, __pyx_L1_error)
18217 __pyx_t_1 = __pyx_v_4lxml_9objectify__TYPE_CHECKS; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
18219 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
18220 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18221 __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)
18223 __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)
18224 __Pyx_GOTREF(__pyx_t_5);
18226 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
18227 PyObject* sequence = __pyx_t_5;
18228 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18229 if (unlikely(size != 2)) {
18230 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
18231 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18232 __PYX_ERR(0, 1118, __pyx_L1_error)
18234 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18235 if (likely(PyTuple_CheckExact(sequence))) {
18236 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
18237 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
18239 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
18240 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
18242 __Pyx_INCREF(__pyx_t_6);
18243 __Pyx_INCREF(__pyx_t_7);
18245 __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1118, __pyx_L1_error)
18246 __Pyx_GOTREF(__pyx_t_6);
18247 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1118, __pyx_L1_error)
18248 __Pyx_GOTREF(__pyx_t_7);
18250 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18252 Py_ssize_t index = -1;
18253 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1118, __pyx_L1_error)
18254 __Pyx_GOTREF(__pyx_t_8);
18255 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18256 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
18257 index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
18258 __Pyx_GOTREF(__pyx_t_6);
18259 index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
18260 __Pyx_GOTREF(__pyx_t_7);
18261 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
18263 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18264 goto __pyx_L8_unpacking_done;
18265 __pyx_L7_unpacking_failed:;
18266 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18268 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
18269 __PYX_ERR(0, 1118, __pyx_L1_error)
18270 __pyx_L8_unpacking_done:;
18272 __Pyx_XDECREF_SET(__pyx_v_type_check, __pyx_t_6);
18274 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_7);
18277 /* "lxml/objectify.pyx":1119
18279 * for type_check, pytype in _TYPE_CHECKS:
18280 * try: # <<<<<<<<<<<<<<
18281 * type_check(value)
18282 * return (<PyType>pytype)._type
18285 __Pyx_PyThreadState_declare
18286 __Pyx_PyThreadState_assign
18287 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
18288 __Pyx_XGOTREF(__pyx_t_10);
18289 __Pyx_XGOTREF(__pyx_t_11);
18290 __Pyx_XGOTREF(__pyx_t_12);
18293 /* "lxml/objectify.pyx":1120
18294 * for type_check, pytype in _TYPE_CHECKS:
18296 * type_check(value) # <<<<<<<<<<<<<<
18297 * return (<PyType>pytype)._type
18298 * except IGNORABLE_ERRORS:
18300 __Pyx_INCREF(__pyx_v_type_check);
18301 __pyx_t_7 = __pyx_v_type_check; __pyx_t_6 = NULL;
18302 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
18303 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
18304 if (likely(__pyx_t_6)) {
18305 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
18306 __Pyx_INCREF(__pyx_t_6);
18307 __Pyx_INCREF(function);
18308 __Pyx_DECREF_SET(__pyx_t_7, function);
18311 __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);
18312 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18313 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1120, __pyx_L9_error)
18314 __Pyx_GOTREF(__pyx_t_5);
18315 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18316 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18318 /* "lxml/objectify.pyx":1121
18320 * type_check(value)
18321 * return (<PyType>pytype)._type # <<<<<<<<<<<<<<
18322 * except IGNORABLE_ERRORS:
18325 __Pyx_XDECREF(__pyx_r);
18326 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->_type);
18327 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->_type;
18328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18329 goto __pyx_L13_try_return;
18331 /* "lxml/objectify.pyx":1119
18333 * for type_check, pytype in _TYPE_CHECKS:
18334 * try: # <<<<<<<<<<<<<<
18335 * type_check(value)
18336 * return (<PyType>pytype)._type
18340 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18341 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18342 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18343 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18345 /* "lxml/objectify.pyx":1122
18346 * type_check(value)
18347 * return (<PyType>pytype)._type
18348 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
18352 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
18354 __Pyx_ErrRestore(0,0,0);
18355 goto __pyx_L10_exception_handled;
18357 goto __pyx_L11_except_error;
18358 __pyx_L11_except_error:;
18360 /* "lxml/objectify.pyx":1119
18362 * for type_check, pytype in _TYPE_CHECKS:
18363 * try: # <<<<<<<<<<<<<<
18364 * type_check(value)
18365 * return (<PyType>pytype)._type
18367 __Pyx_XGIVEREF(__pyx_t_10);
18368 __Pyx_XGIVEREF(__pyx_t_11);
18369 __Pyx_XGIVEREF(__pyx_t_12);
18370 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18371 goto __pyx_L1_error;
18372 __pyx_L13_try_return:;
18373 __Pyx_XGIVEREF(__pyx_t_10);
18374 __Pyx_XGIVEREF(__pyx_t_11);
18375 __Pyx_XGIVEREF(__pyx_t_12);
18376 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18378 __pyx_L10_exception_handled:;
18379 __Pyx_XGIVEREF(__pyx_t_10);
18380 __Pyx_XGIVEREF(__pyx_t_11);
18381 __Pyx_XGIVEREF(__pyx_t_12);
18382 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
18385 /* "lxml/objectify.pyx":1118
18386 * return StringElement
18388 * for type_check, pytype in _TYPE_CHECKS: # <<<<<<<<<<<<<<
18390 * type_check(value)
18393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18395 /* "lxml/objectify.pyx":1124
18396 * except IGNORABLE_ERRORS:
18398 * return None # <<<<<<<<<<<<<<
18400 * ################################################################################
18402 __Pyx_XDECREF(__pyx_r);
18403 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18406 /* "lxml/objectify.pyx":1111
18407 * return defaulttype
18409 * cdef object _guessElementClass(tree.xmlNode* c_node): # <<<<<<<<<<<<<<
18410 * value = textOf(c_node)
18411 * if value is None:
18414 /* function exit code */
18416 __Pyx_XDECREF(__pyx_t_1);
18417 __Pyx_XDECREF(__pyx_t_5);
18418 __Pyx_XDECREF(__pyx_t_6);
18419 __Pyx_XDECREF(__pyx_t_7);
18420 __Pyx_XDECREF(__pyx_t_8);
18421 __Pyx_AddTraceback("lxml.objectify._guessElementClass", __pyx_clineno, __pyx_lineno, __pyx_filename);
18424 __Pyx_XDECREF(__pyx_v_value);
18425 __Pyx_XDECREF(__pyx_v_type_check);
18426 __Pyx_XDECREF(__pyx_v_pytype);
18427 __Pyx_XGIVEREF(__pyx_r);
18428 __Pyx_RefNannyFinishContext();
18432 /* "lxml/objectify.pyx":1137
18433 * cdef bint _annotate
18435 * def __call__(self, *children, **attrib): # <<<<<<<<<<<<<<
18436 * u"__call__(self, *children, **attrib)"
18437 * cdef _ObjectifyElementMakerCaller elementMaker
18440 /* Python wrapper */
18441 static PyObject *__pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18442 static char __pyx_doc_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__[] = "__call__(self, *children, **attrib)";
18443 #if CYTHON_COMPILING_IN_CPYTHON
18444 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
18446 static PyObject *__pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18447 PyObject *__pyx_v_children = 0;
18448 PyObject *__pyx_v_attrib = 0;
18449 PyObject *__pyx_r = 0;
18450 __Pyx_RefNannyDeclarations
18451 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
18452 if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
18453 __pyx_v_attrib = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_attrib)) return NULL;
18454 __Pyx_GOTREF(__pyx_v_attrib);
18455 __Pyx_INCREF(__pyx_args);
18456 __pyx_v_children = __pyx_args;
18457 __pyx_r = __pyx_pf_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__(((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_v_self), __pyx_v_children, __pyx_v_attrib);
18459 /* function exit code */
18460 __Pyx_XDECREF(__pyx_v_children);
18461 __Pyx_XDECREF(__pyx_v_attrib);
18462 __Pyx_RefNannyFinishContext();
18466 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) {
18467 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_elementMaker = 0;
18468 struct LxmlElement *__pyx_v_element = 0;
18469 struct LxmlElement *__pyx_v_childElement = 0;
18470 int __pyx_v_has_children;
18471 int __pyx_v_has_string_value;
18472 PyObject *__pyx_v_pytype_name = NULL;
18473 PyObject *__pyx_v_child = NULL;
18474 PyObject *__pyx_v_name = NULL;
18475 PyObject *__pyx_v_value = NULL;
18476 PyObject *__pyx_v_pytype = NULL;
18477 PyObject *__pyx_r = NULL;
18478 __Pyx_RefNannyDeclarations
18481 PyObject *__pyx_t_3 = NULL;
18482 PyObject *__pyx_t_4 = NULL;
18483 PyObject *__pyx_t_5 = NULL;
18485 PyObject *__pyx_t_7 = NULL;
18486 Py_ssize_t __pyx_t_8;
18487 Py_ssize_t __pyx_t_9;
18488 PyObject *(*__pyx_t_10)(PyObject *);
18489 PyObject *__pyx_t_11 = NULL;
18490 PyObject *__pyx_t_12 = NULL;
18491 PyObject *(*__pyx_t_13)(PyObject *);
18492 int __pyx_lineno = 0;
18493 const char *__pyx_filename = NULL;
18494 int __pyx_clineno = 0;
18495 __Pyx_RefNannySetupContext("__call__", 0);
18497 /* "lxml/objectify.pyx":1144
18498 * cdef bint has_children
18499 * cdef bint has_string_value
18500 * if self._element_factory is None: # <<<<<<<<<<<<<<
18501 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18504 __pyx_t_1 = (__pyx_v_self->_element_factory == Py_None);
18505 __pyx_t_2 = (__pyx_t_1 != 0);
18508 /* "lxml/objectify.pyx":1145
18509 * cdef bint has_string_value
18510 * if self._element_factory is None:
18511 * element = _makeElement(self._tag, None, attrib, self._nsmap) # <<<<<<<<<<<<<<
18513 * element = self._element_factory(self._tag, attrib, self._nsmap)
18515 __pyx_t_3 = __pyx_v_self->_tag;
18516 __Pyx_INCREF(__pyx_t_3);
18517 __pyx_t_4 = __pyx_v_self->_nsmap;
18518 __Pyx_INCREF(__pyx_t_4);
18519 __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)
18520 __Pyx_GOTREF(__pyx_t_5);
18521 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18522 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18523 __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18526 /* "lxml/objectify.pyx":1144
18527 * cdef bint has_children
18528 * cdef bint has_string_value
18529 * if self._element_factory is None: # <<<<<<<<<<<<<<
18530 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18536 /* "lxml/objectify.pyx":1147
18537 * element = _makeElement(self._tag, None, attrib, self._nsmap)
18539 * element = self._element_factory(self._tag, attrib, self._nsmap) # <<<<<<<<<<<<<<
18541 * pytype_name = None
18544 __Pyx_INCREF(__pyx_v_self->_element_factory);
18545 __pyx_t_4 = __pyx_v_self->_element_factory; __pyx_t_3 = NULL;
18547 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18548 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18549 if (likely(__pyx_t_3)) {
18550 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18551 __Pyx_INCREF(__pyx_t_3);
18552 __Pyx_INCREF(function);
18553 __Pyx_DECREF_SET(__pyx_t_4, function);
18557 #if CYTHON_FAST_PYCALL
18558 if (PyFunction_Check(__pyx_t_4)) {
18559 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self->_tag, __pyx_v_attrib, __pyx_v_self->_nsmap};
18560 __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)
18561 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18562 __Pyx_GOTREF(__pyx_t_5);
18565 #if CYTHON_FAST_PYCCALL
18566 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
18567 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_self->_tag, __pyx_v_attrib, __pyx_v_self->_nsmap};
18568 __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)
18569 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18570 __Pyx_GOTREF(__pyx_t_5);
18574 __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1147, __pyx_L1_error)
18575 __Pyx_GOTREF(__pyx_t_7);
18577 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
18579 __Pyx_INCREF(__pyx_v_self->_tag);
18580 __Pyx_GIVEREF(__pyx_v_self->_tag);
18581 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->_tag);
18582 __Pyx_INCREF(__pyx_v_attrib);
18583 __Pyx_GIVEREF(__pyx_v_attrib);
18584 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_attrib);
18585 __Pyx_INCREF(__pyx_v_self->_nsmap);
18586 __Pyx_GIVEREF(__pyx_v_self->_nsmap);
18587 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_self->_nsmap);
18588 __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)
18589 __Pyx_GOTREF(__pyx_t_5);
18590 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18592 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18593 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)
18594 __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18599 /* "lxml/objectify.pyx":1149
18600 * element = self._element_factory(self._tag, attrib, self._nsmap)
18602 * pytype_name = None # <<<<<<<<<<<<<<
18603 * has_children = False
18604 * has_string_value = False
18606 __Pyx_INCREF(Py_None);
18607 __pyx_v_pytype_name = Py_None;
18609 /* "lxml/objectify.pyx":1150
18611 * pytype_name = None
18612 * has_children = False # <<<<<<<<<<<<<<
18613 * has_string_value = False
18614 * for child in children:
18616 __pyx_v_has_children = 0;
18618 /* "lxml/objectify.pyx":1151
18619 * pytype_name = None
18620 * has_children = False
18621 * has_string_value = False # <<<<<<<<<<<<<<
18622 * for child in children:
18623 * if child is None:
18625 __pyx_v_has_string_value = 0;
18627 /* "lxml/objectify.pyx":1152
18628 * has_children = False
18629 * has_string_value = False
18630 * for child in children: # <<<<<<<<<<<<<<
18631 * if child is None:
18632 * if len(children) == 1:
18634 __pyx_t_5 = __pyx_v_children; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
18636 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
18637 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18638 __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)
18640 __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)
18641 __Pyx_GOTREF(__pyx_t_4);
18643 __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
18646 /* "lxml/objectify.pyx":1153
18647 * has_string_value = False
18648 * for child in children:
18649 * if child is None: # <<<<<<<<<<<<<<
18650 * if len(children) == 1:
18651 * cetree.setAttributeValue(
18653 __pyx_t_2 = (__pyx_v_child == Py_None);
18654 __pyx_t_1 = (__pyx_t_2 != 0);
18657 /* "lxml/objectify.pyx":1154
18658 * for child in children:
18659 * if child is None:
18660 * if len(children) == 1: # <<<<<<<<<<<<<<
18661 * cetree.setAttributeValue(
18662 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18664 __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)
18665 __pyx_t_1 = ((__pyx_t_9 == 1) != 0);
18668 /* "lxml/objectify.pyx":1156
18669 * if len(children) == 1:
18670 * cetree.setAttributeValue(
18671 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true") # <<<<<<<<<<<<<<
18672 * elif python._isString(child):
18673 * _add_text(element, child)
18675 __pyx_t_4 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
18676 __Pyx_INCREF(__pyx_t_4);
18678 /* "lxml/objectify.pyx":1155
18679 * if child is None:
18680 * if len(children) == 1:
18681 * cetree.setAttributeValue( # <<<<<<<<<<<<<<
18682 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18683 * elif python._isString(child):
18685 __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)
18686 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18688 /* "lxml/objectify.pyx":1154
18689 * for child in children:
18690 * if child is None:
18691 * if len(children) == 1: # <<<<<<<<<<<<<<
18692 * cetree.setAttributeValue(
18693 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18697 /* "lxml/objectify.pyx":1153
18698 * has_string_value = False
18699 * for child in children:
18700 * if child is None: # <<<<<<<<<<<<<<
18701 * if len(children) == 1:
18702 * cetree.setAttributeValue(
18707 /* "lxml/objectify.pyx":1157
18708 * cetree.setAttributeValue(
18709 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18710 * elif python._isString(child): # <<<<<<<<<<<<<<
18711 * _add_text(element, child)
18712 * has_string_value = True
18714 __pyx_t_1 = (_isString(__pyx_v_child) != 0);
18717 /* "lxml/objectify.pyx":1158
18718 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18719 * elif python._isString(child):
18720 * _add_text(element, child) # <<<<<<<<<<<<<<
18721 * has_string_value = True
18722 * elif isinstance(child, _Element):
18724 __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)
18725 __Pyx_GOTREF(__pyx_t_4);
18726 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18728 /* "lxml/objectify.pyx":1159
18729 * elif python._isString(child):
18730 * _add_text(element, child)
18731 * has_string_value = True # <<<<<<<<<<<<<<
18732 * elif isinstance(child, _Element):
18733 * cetree.appendChildToElement(element, <_Element>child)
18735 __pyx_v_has_string_value = 1;
18737 /* "lxml/objectify.pyx":1157
18738 * cetree.setAttributeValue(
18739 * element, XML_SCHEMA_INSTANCE_NIL_ATTR, u"true")
18740 * elif python._isString(child): # <<<<<<<<<<<<<<
18741 * _add_text(element, child)
18742 * has_string_value = True
18747 /* "lxml/objectify.pyx":1160
18748 * _add_text(element, child)
18749 * has_string_value = True
18750 * elif isinstance(child, _Element): # <<<<<<<<<<<<<<
18751 * cetree.appendChildToElement(element, <_Element>child)
18752 * has_children = True
18754 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_child, __pyx_ptype_4lxml_8includes_11etreepublic__Element);
18755 __pyx_t_2 = (__pyx_t_1 != 0);
18758 /* "lxml/objectify.pyx":1161
18759 * has_string_value = True
18760 * elif isinstance(child, _Element):
18761 * cetree.appendChildToElement(element, <_Element>child) # <<<<<<<<<<<<<<
18762 * has_children = True
18763 * elif isinstance(child, _ObjectifyElementMakerCaller):
18765 __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)
18767 /* "lxml/objectify.pyx":1162
18768 * elif isinstance(child, _Element):
18769 * cetree.appendChildToElement(element, <_Element>child)
18770 * has_children = True # <<<<<<<<<<<<<<
18771 * elif isinstance(child, _ObjectifyElementMakerCaller):
18772 * elementMaker = <_ObjectifyElementMakerCaller>child
18774 __pyx_v_has_children = 1;
18776 /* "lxml/objectify.pyx":1160
18777 * _add_text(element, child)
18778 * has_string_value = True
18779 * elif isinstance(child, _Element): # <<<<<<<<<<<<<<
18780 * cetree.appendChildToElement(element, <_Element>child)
18781 * has_children = True
18786 /* "lxml/objectify.pyx":1163
18787 * cetree.appendChildToElement(element, <_Element>child)
18788 * has_children = True
18789 * elif isinstance(child, _ObjectifyElementMakerCaller): # <<<<<<<<<<<<<<
18790 * elementMaker = <_ObjectifyElementMakerCaller>child
18791 * if elementMaker._element_factory is None:
18793 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_child, __pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller);
18794 __pyx_t_1 = (__pyx_t_2 != 0);
18797 /* "lxml/objectify.pyx":1164
18798 * has_children = True
18799 * elif isinstance(child, _ObjectifyElementMakerCaller):
18800 * elementMaker = <_ObjectifyElementMakerCaller>child # <<<<<<<<<<<<<<
18801 * if elementMaker._element_factory is None:
18802 * cetree.makeSubElement(element, elementMaker._tag,
18804 __pyx_t_4 = __pyx_v_child;
18805 __Pyx_INCREF(__pyx_t_4);
18806 __Pyx_XDECREF_SET(__pyx_v_elementMaker, ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_t_4));
18809 /* "lxml/objectify.pyx":1165
18810 * elif isinstance(child, _ObjectifyElementMakerCaller):
18811 * elementMaker = <_ObjectifyElementMakerCaller>child
18812 * if elementMaker._element_factory is None: # <<<<<<<<<<<<<<
18813 * cetree.makeSubElement(element, elementMaker._tag,
18814 * None, None, None, None)
18816 __pyx_t_1 = (__pyx_v_elementMaker->_element_factory == Py_None);
18817 __pyx_t_2 = (__pyx_t_1 != 0);
18820 /* "lxml/objectify.pyx":1166
18821 * elementMaker = <_ObjectifyElementMakerCaller>child
18822 * if elementMaker._element_factory is None:
18823 * cetree.makeSubElement(element, elementMaker._tag, # <<<<<<<<<<<<<<
18824 * None, None, None, None)
18827 __pyx_t_4 = __pyx_v_elementMaker->_tag;
18828 __Pyx_INCREF(__pyx_t_4);
18830 /* "lxml/objectify.pyx":1167
18831 * if elementMaker._element_factory is None:
18832 * cetree.makeSubElement(element, elementMaker._tag,
18833 * None, None, None, None) # <<<<<<<<<<<<<<
18835 * childElement = elementMaker._element_factory(
18837 __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)
18838 __Pyx_GOTREF(__pyx_t_7);
18839 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18840 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18842 /* "lxml/objectify.pyx":1165
18843 * elif isinstance(child, _ObjectifyElementMakerCaller):
18844 * elementMaker = <_ObjectifyElementMakerCaller>child
18845 * if elementMaker._element_factory is None: # <<<<<<<<<<<<<<
18846 * cetree.makeSubElement(element, elementMaker._tag,
18847 * None, None, None, None)
18852 /* "lxml/objectify.pyx":1169
18853 * None, None, None, None)
18855 * childElement = elementMaker._element_factory( # <<<<<<<<<<<<<<
18856 * elementMaker._tag)
18857 * cetree.appendChildToElement(element, childElement)
18861 /* "lxml/objectify.pyx":1170
18863 * childElement = elementMaker._element_factory(
18864 * elementMaker._tag) # <<<<<<<<<<<<<<
18865 * cetree.appendChildToElement(element, childElement)
18866 * has_children = True
18868 __Pyx_INCREF(__pyx_v_elementMaker->_element_factory);
18869 __pyx_t_4 = __pyx_v_elementMaker->_element_factory; __pyx_t_3 = NULL;
18870 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18871 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18872 if (likely(__pyx_t_3)) {
18873 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18874 __Pyx_INCREF(__pyx_t_3);
18875 __Pyx_INCREF(function);
18876 __Pyx_DECREF_SET(__pyx_t_4, function);
18879 __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);
18880 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18881 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1169, __pyx_L1_error)
18882 __Pyx_GOTREF(__pyx_t_7);
18883 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18885 /* "lxml/objectify.pyx":1169
18886 * None, None, None, None)
18888 * childElement = elementMaker._element_factory( # <<<<<<<<<<<<<<
18889 * elementMaker._tag)
18890 * cetree.appendChildToElement(element, childElement)
18892 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)
18893 __Pyx_XDECREF_SET(__pyx_v_childElement, ((struct LxmlElement *)__pyx_t_7));
18896 /* "lxml/objectify.pyx":1171
18897 * childElement = elementMaker._element_factory(
18898 * elementMaker._tag)
18899 * cetree.appendChildToElement(element, childElement) # <<<<<<<<<<<<<<
18900 * has_children = True
18901 * elif isinstance(child, dict):
18903 __pyx_t_6 = appendChildToElement(__pyx_v_element, __pyx_v_childElement); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1171, __pyx_L1_error)
18907 /* "lxml/objectify.pyx":1172
18908 * elementMaker._tag)
18909 * cetree.appendChildToElement(element, childElement)
18910 * has_children = True # <<<<<<<<<<<<<<
18911 * elif isinstance(child, dict):
18912 * for name, value in child.items():
18914 __pyx_v_has_children = 1;
18916 /* "lxml/objectify.pyx":1163
18917 * cetree.appendChildToElement(element, <_Element>child)
18918 * has_children = True
18919 * elif isinstance(child, _ObjectifyElementMakerCaller): # <<<<<<<<<<<<<<
18920 * elementMaker = <_ObjectifyElementMakerCaller>child
18921 * if elementMaker._element_factory is None:
18926 /* "lxml/objectify.pyx":1173
18927 * cetree.appendChildToElement(element, childElement)
18928 * has_children = True
18929 * elif isinstance(child, dict): # <<<<<<<<<<<<<<
18930 * for name, value in child.items():
18931 * # keyword arguments in attrib take precedence
18933 __pyx_t_2 = PyDict_Check(__pyx_v_child);
18934 __pyx_t_1 = (__pyx_t_2 != 0);
18937 /* "lxml/objectify.pyx":1174
18938 * has_children = True
18939 * elif isinstance(child, dict):
18940 * for name, value in child.items(): # <<<<<<<<<<<<<<
18941 * # keyword arguments in attrib take precedence
18942 * if name in attrib:
18944 __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)
18945 __Pyx_GOTREF(__pyx_t_4);
18947 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
18948 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
18949 if (likely(__pyx_t_3)) {
18950 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18951 __Pyx_INCREF(__pyx_t_3);
18952 __Pyx_INCREF(function);
18953 __Pyx_DECREF_SET(__pyx_t_4, function);
18956 __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
18957 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18958 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
18959 __Pyx_GOTREF(__pyx_t_7);
18960 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18961 if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
18962 __pyx_t_4 = __pyx_t_7; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
18965 __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1174, __pyx_L1_error)
18966 __Pyx_GOTREF(__pyx_t_4);
18967 __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1174, __pyx_L1_error)
18969 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18971 if (likely(!__pyx_t_10)) {
18972 if (likely(PyList_CheckExact(__pyx_t_4))) {
18973 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
18974 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18975 __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)
18977 __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)
18978 __Pyx_GOTREF(__pyx_t_7);
18981 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
18982 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18983 __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)
18985 __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)
18986 __Pyx_GOTREF(__pyx_t_7);
18990 __pyx_t_7 = __pyx_t_10(__pyx_t_4);
18991 if (unlikely(!__pyx_t_7)) {
18992 PyObject* exc_type = PyErr_Occurred();
18994 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18995 else __PYX_ERR(0, 1174, __pyx_L1_error)
18999 __Pyx_GOTREF(__pyx_t_7);
19001 if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
19002 PyObject* sequence = __pyx_t_7;
19003 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
19004 if (unlikely(size != 2)) {
19005 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
19006 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
19007 __PYX_ERR(0, 1174, __pyx_L1_error)
19009 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19010 if (likely(PyTuple_CheckExact(sequence))) {
19011 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
19012 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
19014 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
19015 __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
19017 __Pyx_INCREF(__pyx_t_3);
19018 __Pyx_INCREF(__pyx_t_11);
19020 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
19021 __Pyx_GOTREF(__pyx_t_3);
19022 __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1174, __pyx_L1_error)
19023 __Pyx_GOTREF(__pyx_t_11);
19025 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19027 Py_ssize_t index = -1;
19028 __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1174, __pyx_L1_error)
19029 __Pyx_GOTREF(__pyx_t_12);
19030 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19031 __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
19032 index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
19033 __Pyx_GOTREF(__pyx_t_3);
19034 index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L11_unpacking_failed;
19035 __Pyx_GOTREF(__pyx_t_11);
19036 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1174, __pyx_L1_error)
19038 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19039 goto __pyx_L12_unpacking_done;
19040 __pyx_L11_unpacking_failed:;
19041 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19043 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
19044 __PYX_ERR(0, 1174, __pyx_L1_error)
19045 __pyx_L12_unpacking_done:;
19047 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
19049 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_11);
19052 /* "lxml/objectify.pyx":1176
19053 * for name, value in child.items():
19054 * # keyword arguments in attrib take precedence
19055 * if name in attrib: # <<<<<<<<<<<<<<
19057 * pytype = _PYTYPE_DICT.get(_typename(value))
19059 __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)
19060 __pyx_t_2 = (__pyx_t_1 != 0);
19063 /* "lxml/objectify.pyx":1177
19064 * # keyword arguments in attrib take precedence
19065 * if name in attrib:
19066 * continue # <<<<<<<<<<<<<<
19067 * pytype = _PYTYPE_DICT.get(_typename(value))
19068 * if pytype is not None:
19070 goto __pyx_L9_continue;
19072 /* "lxml/objectify.pyx":1176
19073 * for name, value in child.items():
19074 * # keyword arguments in attrib take precedence
19075 * if name in attrib: # <<<<<<<<<<<<<<
19077 * pytype = _PYTYPE_DICT.get(_typename(value))
19081 /* "lxml/objectify.pyx":1178
19082 * if name in attrib:
19084 * pytype = _PYTYPE_DICT.get(_typename(value)) # <<<<<<<<<<<<<<
19085 * if pytype is not None:
19086 * value = (<PyType>pytype).stringify(value)
19088 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
19089 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
19090 __PYX_ERR(0, 1178, __pyx_L1_error)
19092 __pyx_t_7 = __pyx_f_4lxml_9objectify__typename(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error)
19093 __Pyx_GOTREF(__pyx_t_7);
19094 __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)
19095 __Pyx_GOTREF(__pyx_t_11);
19096 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19097 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_11);
19100 /* "lxml/objectify.pyx":1179
19102 * pytype = _PYTYPE_DICT.get(_typename(value))
19103 * if pytype is not None: # <<<<<<<<<<<<<<
19104 * value = (<PyType>pytype).stringify(value)
19105 * elif not python._isString(value):
19107 __pyx_t_2 = (__pyx_v_pytype != Py_None);
19108 __pyx_t_1 = (__pyx_t_2 != 0);
19111 /* "lxml/objectify.pyx":1180
19112 * pytype = _PYTYPE_DICT.get(_typename(value))
19113 * if pytype is not None:
19114 * value = (<PyType>pytype).stringify(value) # <<<<<<<<<<<<<<
19115 * elif not python._isString(value):
19116 * value = unicode(value)
19118 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify);
19119 __pyx_t_7 = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify; __pyx_t_3 = NULL;
19120 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
19121 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
19122 if (likely(__pyx_t_3)) {
19123 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19124 __Pyx_INCREF(__pyx_t_3);
19125 __Pyx_INCREF(function);
19126 __Pyx_DECREF_SET(__pyx_t_7, function);
19129 __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);
19130 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19131 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L1_error)
19132 __Pyx_GOTREF(__pyx_t_11);
19133 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19134 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
19137 /* "lxml/objectify.pyx":1179
19139 * pytype = _PYTYPE_DICT.get(_typename(value))
19140 * if pytype is not None: # <<<<<<<<<<<<<<
19141 * value = (<PyType>pytype).stringify(value)
19142 * elif not python._isString(value):
19147 /* "lxml/objectify.pyx":1181
19148 * if pytype is not None:
19149 * value = (<PyType>pytype).stringify(value)
19150 * elif not python._isString(value): # <<<<<<<<<<<<<<
19151 * value = unicode(value)
19152 * cetree.setAttributeValue(element, name, value)
19154 __pyx_t_1 = ((!(_isString(__pyx_v_value) != 0)) != 0);
19157 /* "lxml/objectify.pyx":1182
19158 * value = (<PyType>pytype).stringify(value)
19159 * elif not python._isString(value):
19160 * value = unicode(value) # <<<<<<<<<<<<<<
19161 * cetree.setAttributeValue(element, name, value)
19164 __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error)
19165 __Pyx_GOTREF(__pyx_t_11);
19166 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_11);
19169 /* "lxml/objectify.pyx":1181
19170 * if pytype is not None:
19171 * value = (<PyType>pytype).stringify(value)
19172 * elif not python._isString(value): # <<<<<<<<<<<<<<
19173 * value = unicode(value)
19174 * cetree.setAttributeValue(element, name, value)
19179 /* "lxml/objectify.pyx":1183
19180 * elif not python._isString(value):
19181 * value = unicode(value)
19182 * cetree.setAttributeValue(element, name, value) # <<<<<<<<<<<<<<
19184 * if pytype_name is not None:
19186 __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)
19188 /* "lxml/objectify.pyx":1174
19189 * has_children = True
19190 * elif isinstance(child, dict):
19191 * for name, value in child.items(): # <<<<<<<<<<<<<<
19192 * # keyword arguments in attrib take precedence
19193 * if name in attrib:
19195 __pyx_L9_continue:;
19197 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19199 /* "lxml/objectify.pyx":1173
19200 * cetree.appendChildToElement(element, childElement)
19201 * has_children = True
19202 * elif isinstance(child, dict): # <<<<<<<<<<<<<<
19203 * for name, value in child.items():
19204 * # keyword arguments in attrib take precedence
19209 /* "lxml/objectify.pyx":1185
19210 * cetree.setAttributeValue(element, name, value)
19212 * if pytype_name is not None: # <<<<<<<<<<<<<<
19213 * # concatenation always makes the result a string
19214 * has_string_value = True
19217 __pyx_t_1 = (__pyx_v_pytype_name != Py_None);
19218 __pyx_t_2 = (__pyx_t_1 != 0);
19221 /* "lxml/objectify.pyx":1187
19222 * if pytype_name is not None:
19223 * # concatenation always makes the result a string
19224 * has_string_value = True # <<<<<<<<<<<<<<
19225 * pytype_name = _typename(child)
19226 * pytype = _PYTYPE_DICT.get(_typename(child))
19228 __pyx_v_has_string_value = 1;
19230 /* "lxml/objectify.pyx":1185
19231 * cetree.setAttributeValue(element, name, value)
19233 * if pytype_name is not None: # <<<<<<<<<<<<<<
19234 * # concatenation always makes the result a string
19235 * has_string_value = True
19239 /* "lxml/objectify.pyx":1188
19240 * # concatenation always makes the result a string
19241 * has_string_value = True
19242 * pytype_name = _typename(child) # <<<<<<<<<<<<<<
19243 * pytype = _PYTYPE_DICT.get(_typename(child))
19244 * if pytype is not None:
19246 __pyx_t_4 = __pyx_f_4lxml_9objectify__typename(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1188, __pyx_L1_error)
19247 __Pyx_GOTREF(__pyx_t_4);
19248 __Pyx_DECREF_SET(__pyx_v_pytype_name, __pyx_t_4);
19251 /* "lxml/objectify.pyx":1189
19252 * has_string_value = True
19253 * pytype_name = _typename(child)
19254 * pytype = _PYTYPE_DICT.get(_typename(child)) # <<<<<<<<<<<<<<
19255 * if pytype is not None:
19256 * _add_text(element, (<PyType>pytype).stringify(child))
19258 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
19259 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
19260 __PYX_ERR(0, 1189, __pyx_L1_error)
19262 __pyx_t_4 = __pyx_f_4lxml_9objectify__typename(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error)
19263 __Pyx_GOTREF(__pyx_t_4);
19264 __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)
19265 __Pyx_GOTREF(__pyx_t_11);
19266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19267 __Pyx_XDECREF_SET(__pyx_v_pytype, __pyx_t_11);
19270 /* "lxml/objectify.pyx":1190
19271 * pytype_name = _typename(child)
19272 * pytype = _PYTYPE_DICT.get(_typename(child))
19273 * if pytype is not None: # <<<<<<<<<<<<<<
19274 * _add_text(element, (<PyType>pytype).stringify(child))
19277 __pyx_t_2 = (__pyx_v_pytype != Py_None);
19278 __pyx_t_1 = (__pyx_t_2 != 0);
19281 /* "lxml/objectify.pyx":1191
19282 * pytype = _PYTYPE_DICT.get(_typename(child))
19283 * if pytype is not None:
19284 * _add_text(element, (<PyType>pytype).stringify(child)) # <<<<<<<<<<<<<<
19286 * has_string_value = True
19288 __Pyx_INCREF(((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify);
19289 __pyx_t_4 = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_v_pytype)->stringify; __pyx_t_7 = NULL;
19290 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
19291 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
19292 if (likely(__pyx_t_7)) {
19293 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19294 __Pyx_INCREF(__pyx_t_7);
19295 __Pyx_INCREF(function);
19296 __Pyx_DECREF_SET(__pyx_t_4, function);
19299 __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);
19300 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19301 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1191, __pyx_L1_error)
19302 __Pyx_GOTREF(__pyx_t_11);
19303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19304 __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)
19305 __Pyx_GOTREF(__pyx_t_4);
19306 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
19307 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19309 /* "lxml/objectify.pyx":1190
19310 * pytype_name = _typename(child)
19311 * pytype = _PYTYPE_DICT.get(_typename(child))
19312 * if pytype is not None: # <<<<<<<<<<<<<<
19313 * _add_text(element, (<PyType>pytype).stringify(child))
19319 /* "lxml/objectify.pyx":1193
19320 * _add_text(element, (<PyType>pytype).stringify(child))
19322 * has_string_value = True # <<<<<<<<<<<<<<
19323 * child = unicode(child)
19324 * _add_text(element, child)
19327 __pyx_v_has_string_value = 1;
19329 /* "lxml/objectify.pyx":1194
19331 * has_string_value = True
19332 * child = unicode(child) # <<<<<<<<<<<<<<
19333 * _add_text(element, child)
19336 __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_child); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1194, __pyx_L1_error)
19337 __Pyx_GOTREF(__pyx_t_4);
19338 __Pyx_DECREF_SET(__pyx_v_child, __pyx_t_4);
19341 /* "lxml/objectify.pyx":1195
19342 * has_string_value = True
19343 * child = unicode(child)
19344 * _add_text(element, child) # <<<<<<<<<<<<<<
19346 * if self._annotate and not has_children:
19348 __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)
19349 __Pyx_GOTREF(__pyx_t_4);
19350 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19356 /* "lxml/objectify.pyx":1152
19357 * has_children = False
19358 * has_string_value = False
19359 * for child in children: # <<<<<<<<<<<<<<
19360 * if child is None:
19361 * if len(children) == 1:
19364 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19366 /* "lxml/objectify.pyx":1197
19367 * _add_text(element, child)
19369 * if self._annotate and not has_children: # <<<<<<<<<<<<<<
19370 * if has_string_value:
19371 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19373 __pyx_t_2 = (__pyx_v_self->_annotate != 0);
19376 __pyx_t_1 = __pyx_t_2;
19377 goto __pyx_L18_bool_binop_done;
19379 __pyx_t_2 = ((!(__pyx_v_has_children != 0)) != 0);
19380 __pyx_t_1 = __pyx_t_2;
19381 __pyx_L18_bool_binop_done:;
19384 /* "lxml/objectify.pyx":1198
19386 * if self._annotate and not has_children:
19387 * if has_string_value: # <<<<<<<<<<<<<<
19388 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19389 * elif pytype_name is not None:
19391 __pyx_t_1 = (__pyx_v_has_string_value != 0);
19394 /* "lxml/objectify.pyx":1199
19395 * if self._annotate and not has_children:
19396 * if has_string_value:
19397 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str") # <<<<<<<<<<<<<<
19398 * elif pytype_name is not None:
19399 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19401 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1199, __pyx_L1_error)
19402 __Pyx_GOTREF(__pyx_t_5);
19403 __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)
19404 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19406 /* "lxml/objectify.pyx":1198
19408 * if self._annotate and not has_children:
19409 * if has_string_value: # <<<<<<<<<<<<<<
19410 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19411 * elif pytype_name is not None:
19416 /* "lxml/objectify.pyx":1200
19417 * if has_string_value:
19418 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19419 * elif pytype_name is not None: # <<<<<<<<<<<<<<
19420 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19423 __pyx_t_1 = (__pyx_v_pytype_name != Py_None);
19424 __pyx_t_2 = (__pyx_t_1 != 0);
19427 /* "lxml/objectify.pyx":1201
19428 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19429 * elif pytype_name is not None:
19430 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name) # <<<<<<<<<<<<<<
19434 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1201, __pyx_L1_error)
19435 __Pyx_GOTREF(__pyx_t_5);
19436 __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)
19437 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19439 /* "lxml/objectify.pyx":1200
19440 * if has_string_value:
19441 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19442 * elif pytype_name is not None: # <<<<<<<<<<<<<<
19443 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19449 /* "lxml/objectify.pyx":1197
19450 * _add_text(element, child)
19452 * if self._annotate and not has_children: # <<<<<<<<<<<<<<
19453 * if has_string_value:
19454 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, u"str")
19458 /* "lxml/objectify.pyx":1203
19459 * cetree.setAttributeValue(element, PYTYPE_ATTRIBUTE, pytype_name)
19461 * return element # <<<<<<<<<<<<<<
19463 * cdef _add_text(_Element elem, text):
19465 __Pyx_XDECREF(__pyx_r);
19466 __Pyx_INCREF(((PyObject *)__pyx_v_element));
19467 __pyx_r = ((PyObject *)__pyx_v_element);
19470 /* "lxml/objectify.pyx":1137
19471 * cdef bint _annotate
19473 * def __call__(self, *children, **attrib): # <<<<<<<<<<<<<<
19474 * u"__call__(self, *children, **attrib)"
19475 * cdef _ObjectifyElementMakerCaller elementMaker
19478 /* function exit code */
19480 __Pyx_XDECREF(__pyx_t_3);
19481 __Pyx_XDECREF(__pyx_t_4);
19482 __Pyx_XDECREF(__pyx_t_5);
19483 __Pyx_XDECREF(__pyx_t_7);
19484 __Pyx_XDECREF(__pyx_t_11);
19485 __Pyx_XDECREF(__pyx_t_12);
19486 __Pyx_AddTraceback("lxml.objectify._ObjectifyElementMakerCaller.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19489 __Pyx_XDECREF((PyObject *)__pyx_v_elementMaker);
19490 __Pyx_XDECREF((PyObject *)__pyx_v_element);
19491 __Pyx_XDECREF((PyObject *)__pyx_v_childElement);
19492 __Pyx_XDECREF(__pyx_v_pytype_name);
19493 __Pyx_XDECREF(__pyx_v_child);
19494 __Pyx_XDECREF(__pyx_v_name);
19495 __Pyx_XDECREF(__pyx_v_value);
19496 __Pyx_XDECREF(__pyx_v_pytype);
19497 __Pyx_XGIVEREF(__pyx_r);
19498 __Pyx_RefNannyFinishContext();
19502 /* "lxml/objectify.pyx":1205
19505 * cdef _add_text(_Element elem, text): # <<<<<<<<<<<<<<
19506 * # add text to the tree in construction, either as element text or
19507 * # tail text, depending on the current tree state
19510 static PyObject *__pyx_f_4lxml_9objectify__add_text(struct LxmlElement *__pyx_v_elem, PyObject *__pyx_v_text) {
19511 xmlNode *__pyx_v_c_child;
19512 PyObject *__pyx_v_old = NULL;
19513 PyObject *__pyx_r = NULL;
19514 __Pyx_RefNannyDeclarations
19516 PyObject *__pyx_t_2 = NULL;
19519 int __pyx_lineno = 0;
19520 const char *__pyx_filename = NULL;
19521 int __pyx_clineno = 0;
19522 __Pyx_RefNannySetupContext("_add_text", 0);
19523 __Pyx_INCREF(__pyx_v_text);
19525 /* "lxml/objectify.pyx":1209
19526 * # tail text, depending on the current tree state
19527 * cdef tree.xmlNode* c_child
19528 * c_child = cetree.findChildBackwards(elem._c_node, 0) # <<<<<<<<<<<<<<
19529 * if c_child is not NULL:
19530 * old = cetree.tailOf(c_child)
19532 __pyx_v_c_child = findChildBackwards(__pyx_v_elem->_c_node, 0);
19534 /* "lxml/objectify.pyx":1210
19535 * cdef tree.xmlNode* c_child
19536 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19537 * if c_child is not NULL: # <<<<<<<<<<<<<<
19538 * old = cetree.tailOf(c_child)
19539 * if old is not None:
19541 __pyx_t_1 = ((__pyx_v_c_child != NULL) != 0);
19544 /* "lxml/objectify.pyx":1211
19545 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19546 * if c_child is not NULL:
19547 * old = cetree.tailOf(c_child) # <<<<<<<<<<<<<<
19548 * if old is not None:
19549 * text = old + text
19551 __pyx_t_2 = tailOf(__pyx_v_c_child); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
19552 __Pyx_GOTREF(__pyx_t_2);
19553 __pyx_v_old = __pyx_t_2;
19556 /* "lxml/objectify.pyx":1212
19557 * if c_child is not NULL:
19558 * old = cetree.tailOf(c_child)
19559 * if old is not None: # <<<<<<<<<<<<<<
19560 * text = old + text
19561 * cetree.setTailText(c_child, text)
19563 __pyx_t_1 = (__pyx_v_old != Py_None);
19564 __pyx_t_3 = (__pyx_t_1 != 0);
19567 /* "lxml/objectify.pyx":1213
19568 * old = cetree.tailOf(c_child)
19569 * if old is not None:
19570 * text = old + text # <<<<<<<<<<<<<<
19571 * cetree.setTailText(c_child, text)
19574 __pyx_t_2 = PyNumber_Add(__pyx_v_old, __pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __pyx_L1_error)
19575 __Pyx_GOTREF(__pyx_t_2);
19576 __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2);
19579 /* "lxml/objectify.pyx":1212
19580 * if c_child is not NULL:
19581 * old = cetree.tailOf(c_child)
19582 * if old is not None: # <<<<<<<<<<<<<<
19583 * text = old + text
19584 * cetree.setTailText(c_child, text)
19588 /* "lxml/objectify.pyx":1214
19589 * if old is not None:
19590 * text = old + text
19591 * cetree.setTailText(c_child, text) # <<<<<<<<<<<<<<
19593 * old = cetree.textOf(elem._c_node)
19595 __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)
19597 /* "lxml/objectify.pyx":1210
19598 * cdef tree.xmlNode* c_child
19599 * c_child = cetree.findChildBackwards(elem._c_node, 0)
19600 * if c_child is not NULL: # <<<<<<<<<<<<<<
19601 * old = cetree.tailOf(c_child)
19602 * if old is not None:
19607 /* "lxml/objectify.pyx":1216
19608 * cetree.setTailText(c_child, text)
19610 * old = cetree.textOf(elem._c_node) # <<<<<<<<<<<<<<
19611 * if old is not None:
19612 * text = old + text
19615 __pyx_t_2 = textOf(__pyx_v_elem->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error)
19616 __Pyx_GOTREF(__pyx_t_2);
19617 __pyx_v_old = __pyx_t_2;
19620 /* "lxml/objectify.pyx":1217
19622 * old = cetree.textOf(elem._c_node)
19623 * if old is not None: # <<<<<<<<<<<<<<
19624 * text = old + text
19625 * cetree.setNodeText(elem._c_node, text)
19627 __pyx_t_3 = (__pyx_v_old != Py_None);
19628 __pyx_t_1 = (__pyx_t_3 != 0);
19631 /* "lxml/objectify.pyx":1218
19632 * old = cetree.textOf(elem._c_node)
19633 * if old is not None:
19634 * text = old + text # <<<<<<<<<<<<<<
19635 * cetree.setNodeText(elem._c_node, text)
19638 __pyx_t_2 = PyNumber_Add(__pyx_v_old, __pyx_v_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
19639 __Pyx_GOTREF(__pyx_t_2);
19640 __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_2);
19643 /* "lxml/objectify.pyx":1217
19645 * old = cetree.textOf(elem._c_node)
19646 * if old is not None: # <<<<<<<<<<<<<<
19647 * text = old + text
19648 * cetree.setNodeText(elem._c_node, text)
19652 /* "lxml/objectify.pyx":1219
19653 * if old is not None:
19654 * text = old + text
19655 * cetree.setNodeText(elem._c_node, text) # <<<<<<<<<<<<<<
19657 * cdef class ElementMaker:
19659 __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)
19663 /* "lxml/objectify.pyx":1205
19666 * cdef _add_text(_Element elem, text): # <<<<<<<<<<<<<<
19667 * # add text to the tree in construction, either as element text or
19668 * # tail text, depending on the current tree state
19671 /* function exit code */
19672 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19675 __Pyx_XDECREF(__pyx_t_2);
19676 __Pyx_AddTraceback("lxml.objectify._add_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
19679 __Pyx_XDECREF(__pyx_v_old);
19680 __Pyx_XDECREF(__pyx_v_text);
19681 __Pyx_XGIVEREF(__pyx_r);
19682 __Pyx_RefNannyFinishContext();
19686 /* "lxml/objectify.pyx":1252
19687 * cdef bint _annotate
19689 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19690 * makeelement=None):
19691 * if nsmap is None:
19694 /* Python wrapper */
19695 static int __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19696 static int __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19697 PyObject *__pyx_v_namespace = 0;
19698 PyObject *__pyx_v_nsmap = 0;
19699 PyObject *__pyx_v_annotate = 0;
19700 PyObject *__pyx_v_makeelement = 0;
19701 int __pyx_lineno = 0;
19702 const char *__pyx_filename = NULL;
19703 int __pyx_clineno = 0;
19705 __Pyx_RefNannyDeclarations
19706 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
19708 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_namespace,&__pyx_n_s_nsmap,&__pyx_n_s_annotate,&__pyx_n_s_makeelement,0};
19709 PyObject* values[4] = {0,0,0,0};
19710 values[0] = ((PyObject *)Py_None);
19711 values[1] = ((PyObject *)Py_None);
19712 values[2] = ((PyObject *)Py_True);
19714 /* "lxml/objectify.pyx":1253
19716 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19717 * makeelement=None): # <<<<<<<<<<<<<<
19718 * if nsmap is None:
19719 * nsmap = _DEFAULT_NSMAP if annotate else {}
19721 values[3] = ((PyObject *)Py_None);
19722 if (unlikely(__pyx_kwds)) {
19723 Py_ssize_t kw_args;
19724 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19725 switch (pos_args) {
19727 default: goto __pyx_L5_argtuple_error;
19729 kw_args = PyDict_Size(__pyx_kwds);
19730 if (kw_args > 0 && likely(kw_args <= 4)) {
19732 for (index = 0; index < 4 && kw_args > 0; index++) {
19733 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
19734 if (value) { values[index] = value; kw_args--; }
19737 if (unlikely(kw_args > 0)) {
19738 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(0, 1252, __pyx_L3_error)
19740 } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
19741 goto __pyx_L5_argtuple_error;
19744 __pyx_v_namespace = values[0];
19745 __pyx_v_nsmap = values[1];
19746 __pyx_v_annotate = values[2];
19747 __pyx_v_makeelement = values[3];
19749 goto __pyx_L4_argument_unpacking_done;
19750 __pyx_L5_argtuple_error:;
19751 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1252, __pyx_L3_error)
19753 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19754 __Pyx_RefNannyFinishContext();
19756 __pyx_L4_argument_unpacking_done:;
19757 __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);
19759 /* "lxml/objectify.pyx":1252
19760 * cdef bint _annotate
19762 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19763 * makeelement=None):
19764 * if nsmap is None:
19767 /* function exit code */
19768 __Pyx_RefNannyFinishContext();
19772 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) {
19774 __Pyx_RefNannyDeclarations
19777 PyObject *__pyx_t_3 = NULL;
19778 PyObject *__pyx_t_4 = NULL;
19779 int __pyx_lineno = 0;
19780 const char *__pyx_filename = NULL;
19781 int __pyx_clineno = 0;
19782 __Pyx_RefNannySetupContext("__init__", 0);
19783 __Pyx_INCREF(__pyx_v_nsmap);
19785 /* "lxml/objectify.pyx":1254
19786 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19787 * makeelement=None):
19788 * if nsmap is None: # <<<<<<<<<<<<<<
19789 * nsmap = _DEFAULT_NSMAP if annotate else {}
19790 * self._nsmap = nsmap
19792 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
19793 __pyx_t_2 = (__pyx_t_1 != 0);
19796 /* "lxml/objectify.pyx":1255
19797 * makeelement=None):
19798 * if nsmap is None:
19799 * nsmap = _DEFAULT_NSMAP if annotate else {} # <<<<<<<<<<<<<<
19800 * self._nsmap = nsmap
19801 * self._namespace = None if namespace is None else u"{%s}" % namespace
19803 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_annotate); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1255, __pyx_L1_error)
19805 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
19806 __pyx_t_3 = __pyx_v_4lxml_9objectify__DEFAULT_NSMAP;
19808 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error)
19809 __Pyx_GOTREF(__pyx_t_4);
19810 __pyx_t_3 = __pyx_t_4;
19813 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_t_3);
19816 /* "lxml/objectify.pyx":1254
19817 * def __init__(self, *, namespace=None, nsmap=None, annotate=True,
19818 * makeelement=None):
19819 * if nsmap is None: # <<<<<<<<<<<<<<
19820 * nsmap = _DEFAULT_NSMAP if annotate else {}
19821 * self._nsmap = nsmap
19825 /* "lxml/objectify.pyx":1256
19826 * if nsmap is None:
19827 * nsmap = _DEFAULT_NSMAP if annotate else {}
19828 * self._nsmap = nsmap # <<<<<<<<<<<<<<
19829 * self._namespace = None if namespace is None else u"{%s}" % namespace
19830 * self._annotate = annotate
19832 __Pyx_INCREF(__pyx_v_nsmap);
19833 __Pyx_GIVEREF(__pyx_v_nsmap);
19834 __Pyx_GOTREF(__pyx_v_self->_nsmap);
19835 __Pyx_DECREF(__pyx_v_self->_nsmap);
19836 __pyx_v_self->_nsmap = __pyx_v_nsmap;
19838 /* "lxml/objectify.pyx":1257
19839 * nsmap = _DEFAULT_NSMAP if annotate else {}
19840 * self._nsmap = nsmap
19841 * self._namespace = None if namespace is None else u"{%s}" % namespace # <<<<<<<<<<<<<<
19842 * self._annotate = annotate
19843 * if makeelement is not None:
19845 __pyx_t_2 = (__pyx_v_namespace == Py_None);
19846 if ((__pyx_t_2 != 0)) {
19847 __Pyx_INCREF(Py_None);
19848 __pyx_t_3 = Py_None;
19850 __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)
19851 __Pyx_GOTREF(__pyx_t_4);
19852 __pyx_t_3 = __pyx_t_4;
19855 __Pyx_GIVEREF(__pyx_t_3);
19856 __Pyx_GOTREF(__pyx_v_self->_namespace);
19857 __Pyx_DECREF(__pyx_v_self->_namespace);
19858 __pyx_v_self->_namespace = __pyx_t_3;
19861 /* "lxml/objectify.pyx":1258
19862 * self._nsmap = nsmap
19863 * self._namespace = None if namespace is None else u"{%s}" % namespace
19864 * self._annotate = annotate # <<<<<<<<<<<<<<
19865 * if makeelement is not None:
19866 * if not callable(makeelement):
19868 __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)
19869 __pyx_v_self->_annotate = __pyx_t_2;
19871 /* "lxml/objectify.pyx":1259
19872 * self._namespace = None if namespace is None else u"{%s}" % namespace
19873 * self._annotate = annotate
19874 * if makeelement is not None: # <<<<<<<<<<<<<<
19875 * if not callable(makeelement):
19878 __pyx_t_2 = (__pyx_v_makeelement != Py_None);
19879 __pyx_t_1 = (__pyx_t_2 != 0);
19882 /* "lxml/objectify.pyx":1260
19883 * self._annotate = annotate
19884 * if makeelement is not None:
19885 * if not callable(makeelement): # <<<<<<<<<<<<<<
19887 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19889 __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_makeelement); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1260, __pyx_L1_error)
19890 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
19891 if (unlikely(__pyx_t_2)) {
19893 /* "lxml/objectify.pyx":1262
19894 * if not callable(makeelement):
19896 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}") # <<<<<<<<<<<<<<
19897 * self._makeelement = makeelement
19900 __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)
19901 __Pyx_GOTREF(__pyx_t_3);
19902 __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)
19903 __Pyx_GOTREF(__pyx_t_4);
19904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19906 /* "lxml/objectify.pyx":1261
19907 * if makeelement is not None:
19908 * if not callable(makeelement):
19909 * raise TypeError( # <<<<<<<<<<<<<<
19910 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19911 * self._makeelement = makeelement
19913 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error)
19914 __Pyx_GOTREF(__pyx_t_3);
19915 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19916 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19917 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19918 __PYX_ERR(0, 1261, __pyx_L1_error)
19920 /* "lxml/objectify.pyx":1260
19921 * self._annotate = annotate
19922 * if makeelement is not None:
19923 * if not callable(makeelement): # <<<<<<<<<<<<<<
19925 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19929 /* "lxml/objectify.pyx":1263
19931 * f"argument of 'makeelement' parameter must be callable, got {type(makeelement)}")
19932 * self._makeelement = makeelement # <<<<<<<<<<<<<<
19934 * self._makeelement = None
19936 __Pyx_INCREF(__pyx_v_makeelement);
19937 __Pyx_GIVEREF(__pyx_v_makeelement);
19938 __Pyx_GOTREF(__pyx_v_self->_makeelement);
19939 __Pyx_DECREF(__pyx_v_self->_makeelement);
19940 __pyx_v_self->_makeelement = __pyx_v_makeelement;
19942 /* "lxml/objectify.pyx":1259
19943 * self._namespace = None if namespace is None else u"{%s}" % namespace
19944 * self._annotate = annotate
19945 * if makeelement is not None: # <<<<<<<<<<<<<<
19946 * if not callable(makeelement):
19952 /* "lxml/objectify.pyx":1265
19953 * self._makeelement = makeelement
19955 * self._makeelement = None # <<<<<<<<<<<<<<
19960 __Pyx_INCREF(Py_None);
19961 __Pyx_GIVEREF(Py_None);
19962 __Pyx_GOTREF(__pyx_v_self->_makeelement);
19963 __Pyx_DECREF(__pyx_v_self->_makeelement);
19964 __pyx_v_self->_makeelement = Py_None;
19968 /* "lxml/objectify.pyx":1266
19970 * self._makeelement = None
19971 * self._cache = {} # <<<<<<<<<<<<<<
19975 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
19976 __Pyx_GOTREF(__pyx_t_3);
19977 __Pyx_GIVEREF(__pyx_t_3);
19978 __Pyx_GOTREF(__pyx_v_self->_cache);
19979 __Pyx_DECREF(__pyx_v_self->_cache);
19980 __pyx_v_self->_cache = ((PyObject*)__pyx_t_3);
19983 /* "lxml/objectify.pyx":1252
19984 * cdef bint _annotate
19986 * def __init__(self, *, namespace=None, nsmap=None, annotate=True, # <<<<<<<<<<<<<<
19987 * makeelement=None):
19988 * if nsmap is None:
19991 /* function exit code */
19995 __Pyx_XDECREF(__pyx_t_3);
19996 __Pyx_XDECREF(__pyx_t_4);
19997 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20000 __Pyx_XDECREF(__pyx_v_nsmap);
20001 __Pyx_RefNannyFinishContext();
20005 /* "lxml/objectify.pyx":1269
20008 * cdef _build_element_maker(self, tag, bint caching): # <<<<<<<<<<<<<<
20009 * cdef _ObjectifyElementMakerCaller element_maker
20010 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20013 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) {
20014 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *__pyx_v_element_maker = 0;
20015 PyObject *__pyx_r = NULL;
20016 __Pyx_RefNannyDeclarations
20017 PyObject *__pyx_t_1 = NULL;
20021 Py_ssize_t __pyx_t_5;
20023 int __pyx_lineno = 0;
20024 const char *__pyx_filename = NULL;
20025 int __pyx_clineno = 0;
20026 __Pyx_RefNannySetupContext("_build_element_maker", 0);
20028 /* "lxml/objectify.pyx":1271
20029 * cdef _build_element_maker(self, tag, bint caching):
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
20035 __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)
20036 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
20037 __pyx_v_element_maker = ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)__pyx_t_1);
20040 /* "lxml/objectify.pyx":1272
20041 * cdef _ObjectifyElementMakerCaller element_maker
20042 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20043 * if self._namespace is not None and tag[0] != u"{": # <<<<<<<<<<<<<<
20044 * element_maker._tag = self._namespace + tag
20047 __pyx_t_3 = (__pyx_v_self->_namespace != Py_None);
20048 __pyx_t_4 = (__pyx_t_3 != 0);
20051 __pyx_t_2 = __pyx_t_4;
20052 goto __pyx_L4_bool_binop_done;
20054 __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)
20055 __Pyx_GOTREF(__pyx_t_1);
20056 __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)
20057 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20058 __pyx_t_2 = __pyx_t_4;
20059 __pyx_L4_bool_binop_done:;
20062 /* "lxml/objectify.pyx":1273
20063 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20064 * if self._namespace is not None and tag[0] != u"{":
20065 * element_maker._tag = self._namespace + tag # <<<<<<<<<<<<<<
20067 * element_maker._tag = tag
20069 __pyx_t_1 = PyNumber_Add(__pyx_v_self->_namespace, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
20070 __Pyx_GOTREF(__pyx_t_1);
20071 __Pyx_GIVEREF(__pyx_t_1);
20072 __Pyx_GOTREF(__pyx_v_element_maker->_tag);
20073 __Pyx_DECREF(__pyx_v_element_maker->_tag);
20074 __pyx_v_element_maker->_tag = __pyx_t_1;
20077 /* "lxml/objectify.pyx":1272
20078 * cdef _ObjectifyElementMakerCaller element_maker
20079 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20080 * if self._namespace is not None and tag[0] != u"{": # <<<<<<<<<<<<<<
20081 * element_maker._tag = self._namespace + tag
20087 /* "lxml/objectify.pyx":1275
20088 * element_maker._tag = self._namespace + tag
20090 * element_maker._tag = tag # <<<<<<<<<<<<<<
20091 * element_maker._nsmap = self._nsmap
20092 * element_maker._annotate = self._annotate
20095 __Pyx_INCREF(__pyx_v_tag);
20096 __Pyx_GIVEREF(__pyx_v_tag);
20097 __Pyx_GOTREF(__pyx_v_element_maker->_tag);
20098 __Pyx_DECREF(__pyx_v_element_maker->_tag);
20099 __pyx_v_element_maker->_tag = __pyx_v_tag;
20103 /* "lxml/objectify.pyx":1276
20105 * element_maker._tag = tag
20106 * element_maker._nsmap = self._nsmap # <<<<<<<<<<<<<<
20107 * element_maker._annotate = self._annotate
20108 * element_maker._element_factory = self._makeelement
20110 __pyx_t_1 = __pyx_v_self->_nsmap;
20111 __Pyx_INCREF(__pyx_t_1);
20112 __Pyx_GIVEREF(__pyx_t_1);
20113 __Pyx_GOTREF(__pyx_v_element_maker->_nsmap);
20114 __Pyx_DECREF(__pyx_v_element_maker->_nsmap);
20115 __pyx_v_element_maker->_nsmap = __pyx_t_1;
20118 /* "lxml/objectify.pyx":1277
20119 * element_maker._tag = tag
20120 * element_maker._nsmap = self._nsmap
20121 * element_maker._annotate = self._annotate # <<<<<<<<<<<<<<
20122 * element_maker._element_factory = self._makeelement
20125 __pyx_t_2 = __pyx_v_self->_annotate;
20126 __pyx_v_element_maker->_annotate = __pyx_t_2;
20128 /* "lxml/objectify.pyx":1278
20129 * element_maker._nsmap = self._nsmap
20130 * element_maker._annotate = self._annotate
20131 * element_maker._element_factory = self._makeelement # <<<<<<<<<<<<<<
20133 * if len(self._cache) > 200:
20135 __pyx_t_1 = __pyx_v_self->_makeelement;
20136 __Pyx_INCREF(__pyx_t_1);
20137 __Pyx_GIVEREF(__pyx_t_1);
20138 __Pyx_GOTREF(__pyx_v_element_maker->_element_factory);
20139 __Pyx_DECREF(__pyx_v_element_maker->_element_factory);
20140 __pyx_v_element_maker->_element_factory = __pyx_t_1;
20143 /* "lxml/objectify.pyx":1279
20144 * element_maker._annotate = self._annotate
20145 * element_maker._element_factory = self._makeelement
20146 * if caching: # <<<<<<<<<<<<<<
20147 * if len(self._cache) > 200:
20148 * self._cache.clear()
20150 __pyx_t_2 = (__pyx_v_caching != 0);
20153 /* "lxml/objectify.pyx":1280
20154 * element_maker._element_factory = self._makeelement
20156 * if len(self._cache) > 200: # <<<<<<<<<<<<<<
20157 * self._cache.clear()
20158 * self._cache[tag] = element_maker
20160 __pyx_t_1 = __pyx_v_self->_cache;
20161 __Pyx_INCREF(__pyx_t_1);
20162 if (unlikely(__pyx_t_1 == Py_None)) {
20163 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20164 __PYX_ERR(0, 1280, __pyx_L1_error)
20166 __pyx_t_5 = PyDict_Size(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1280, __pyx_L1_error)
20167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20168 __pyx_t_2 = ((__pyx_t_5 > 0xC8) != 0);
20171 /* "lxml/objectify.pyx":1281
20173 * if len(self._cache) > 200:
20174 * self._cache.clear() # <<<<<<<<<<<<<<
20175 * self._cache[tag] = element_maker
20176 * return element_maker
20178 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20179 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
20180 __PYX_ERR(0, 1281, __pyx_L1_error)
20182 __pyx_t_6 = __Pyx_PyDict_Clear(__pyx_v_self->_cache); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1281, __pyx_L1_error)
20184 /* "lxml/objectify.pyx":1280
20185 * element_maker._element_factory = self._makeelement
20187 * if len(self._cache) > 200: # <<<<<<<<<<<<<<
20188 * self._cache.clear()
20189 * self._cache[tag] = element_maker
20193 /* "lxml/objectify.pyx":1282
20194 * if len(self._cache) > 200:
20195 * self._cache.clear()
20196 * self._cache[tag] = element_maker # <<<<<<<<<<<<<<
20197 * return element_maker
20200 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20201 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20202 __PYX_ERR(0, 1282, __pyx_L1_error)
20204 if (unlikely(PyDict_SetItem(__pyx_v_self->_cache, __pyx_v_tag, ((PyObject *)__pyx_v_element_maker)) < 0)) __PYX_ERR(0, 1282, __pyx_L1_error)
20206 /* "lxml/objectify.pyx":1279
20207 * element_maker._annotate = self._annotate
20208 * element_maker._element_factory = self._makeelement
20209 * if caching: # <<<<<<<<<<<<<<
20210 * if len(self._cache) > 200:
20211 * self._cache.clear()
20215 /* "lxml/objectify.pyx":1283
20216 * self._cache.clear()
20217 * self._cache[tag] = element_maker
20218 * return element_maker # <<<<<<<<<<<<<<
20220 * def __getattr__(self, tag):
20222 __Pyx_XDECREF(__pyx_r);
20223 __Pyx_INCREF(((PyObject *)__pyx_v_element_maker));
20224 __pyx_r = ((PyObject *)__pyx_v_element_maker);
20227 /* "lxml/objectify.pyx":1269
20230 * cdef _build_element_maker(self, tag, bint caching): # <<<<<<<<<<<<<<
20231 * cdef _ObjectifyElementMakerCaller element_maker
20232 * element_maker = _ObjectifyElementMakerCaller.__new__(_ObjectifyElementMakerCaller)
20235 /* function exit code */
20237 __Pyx_XDECREF(__pyx_t_1);
20238 __Pyx_AddTraceback("lxml.objectify.ElementMaker._build_element_maker", __pyx_clineno, __pyx_lineno, __pyx_filename);
20241 __Pyx_XDECREF((PyObject *)__pyx_v_element_maker);
20242 __Pyx_XGIVEREF(__pyx_r);
20243 __Pyx_RefNannyFinishContext();
20247 /* "lxml/objectify.pyx":1285
20248 * return element_maker
20250 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
20251 * element_maker = self._cache.get(tag)
20252 * if element_maker is None:
20255 /* Python wrapper */
20256 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
20257 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
20258 PyObject *__pyx_r = 0;
20259 __Pyx_RefNannyDeclarations
20260 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
20261 __pyx_r = __pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(((struct __pyx_obj_4lxml_9objectify_ElementMaker *)__pyx_v_self), ((PyObject *)__pyx_v_tag));
20263 /* function exit code */
20264 __Pyx_RefNannyFinishContext();
20268 static PyObject *__pyx_pf_4lxml_9objectify_12ElementMaker_2__getattr__(struct __pyx_obj_4lxml_9objectify_ElementMaker *__pyx_v_self, PyObject *__pyx_v_tag) {
20269 PyObject *__pyx_v_element_maker = NULL;
20270 PyObject *__pyx_r = NULL;
20271 __Pyx_RefNannyDeclarations
20272 PyObject *__pyx_t_1 = NULL;
20275 PyObject *__pyx_t_4 = NULL;
20276 PyObject *__pyx_t_5 = NULL;
20278 PyObject *__pyx_t_7 = NULL;
20279 int __pyx_lineno = 0;
20280 const char *__pyx_filename = NULL;
20281 int __pyx_clineno = 0;
20282 __Pyx_RefNannySetupContext("__getattr__", 0);
20284 /* "lxml/objectify.pyx":1286
20286 * def __getattr__(self, tag):
20287 * element_maker = self._cache.get(tag) # <<<<<<<<<<<<<<
20288 * if element_maker is None:
20289 * if is_special_method(tag):
20291 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20292 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
20293 __PYX_ERR(0, 1286, __pyx_L1_error)
20295 __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)
20296 __Pyx_GOTREF(__pyx_t_1);
20297 __pyx_v_element_maker = __pyx_t_1;
20300 /* "lxml/objectify.pyx":1287
20301 * def __getattr__(self, tag):
20302 * element_maker = self._cache.get(tag)
20303 * if element_maker is None: # <<<<<<<<<<<<<<
20304 * if is_special_method(tag):
20305 * return object.__getattr__(self, tag)
20307 __pyx_t_2 = (__pyx_v_element_maker == Py_None);
20308 __pyx_t_3 = (__pyx_t_2 != 0);
20311 /* "lxml/objectify.pyx":1288
20312 * element_maker = self._cache.get(tag)
20313 * if element_maker is None:
20314 * if is_special_method(tag): # <<<<<<<<<<<<<<
20315 * return object.__getattr__(self, tag)
20316 * return self._build_element_maker(tag, caching=True)
20318 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
20319 __pyx_t_4 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_5 = NULL;
20320 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20321 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20322 if (likely(__pyx_t_5)) {
20323 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20324 __Pyx_INCREF(__pyx_t_5);
20325 __Pyx_INCREF(function);
20326 __Pyx_DECREF_SET(__pyx_t_4, function);
20329 __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);
20330 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20331 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
20332 __Pyx_GOTREF(__pyx_t_1);
20333 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20334 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1288, __pyx_L1_error)
20335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20338 /* "lxml/objectify.pyx":1289
20339 * if element_maker is None:
20340 * if is_special_method(tag):
20341 * return object.__getattr__(self, tag) # <<<<<<<<<<<<<<
20342 * return self._build_element_maker(tag, caching=True)
20343 * return element_maker
20345 __Pyx_XDECREF(__pyx_r);
20346 __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)
20347 __Pyx_GOTREF(__pyx_t_4);
20350 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
20351 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20352 if (likely(__pyx_t_5)) {
20353 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20354 __Pyx_INCREF(__pyx_t_5);
20355 __Pyx_INCREF(function);
20356 __Pyx_DECREF_SET(__pyx_t_4, function);
20360 #if CYTHON_FAST_PYCALL
20361 if (PyFunction_Check(__pyx_t_4)) {
20362 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_tag};
20363 __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)
20364 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20365 __Pyx_GOTREF(__pyx_t_1);
20368 #if CYTHON_FAST_PYCCALL
20369 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
20370 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_tag};
20371 __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)
20372 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20373 __Pyx_GOTREF(__pyx_t_1);
20377 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1289, __pyx_L1_error)
20378 __Pyx_GOTREF(__pyx_t_7);
20380 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
20382 __Pyx_INCREF(((PyObject *)__pyx_v_self));
20383 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20384 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
20385 __Pyx_INCREF(__pyx_v_tag);
20386 __Pyx_GIVEREF(__pyx_v_tag);
20387 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_tag);
20388 __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)
20389 __Pyx_GOTREF(__pyx_t_1);
20390 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20393 __pyx_r = __pyx_t_1;
20397 /* "lxml/objectify.pyx":1288
20398 * element_maker = self._cache.get(tag)
20399 * if element_maker is None:
20400 * if is_special_method(tag): # <<<<<<<<<<<<<<
20401 * return object.__getattr__(self, tag)
20402 * return self._build_element_maker(tag, caching=True)
20406 /* "lxml/objectify.pyx":1290
20407 * if is_special_method(tag):
20408 * return object.__getattr__(self, tag)
20409 * return self._build_element_maker(tag, caching=True) # <<<<<<<<<<<<<<
20410 * return element_maker
20413 __Pyx_XDECREF(__pyx_r);
20414 __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)
20415 __Pyx_GOTREF(__pyx_t_1);
20416 __pyx_r = __pyx_t_1;
20420 /* "lxml/objectify.pyx":1287
20421 * def __getattr__(self, tag):
20422 * element_maker = self._cache.get(tag)
20423 * if element_maker is None: # <<<<<<<<<<<<<<
20424 * if is_special_method(tag):
20425 * return object.__getattr__(self, tag)
20429 /* "lxml/objectify.pyx":1291
20430 * return object.__getattr__(self, tag)
20431 * return self._build_element_maker(tag, caching=True)
20432 * return element_maker # <<<<<<<<<<<<<<
20434 * def __call__(self, tag, *args, **kwargs):
20436 __Pyx_XDECREF(__pyx_r);
20437 __Pyx_INCREF(__pyx_v_element_maker);
20438 __pyx_r = __pyx_v_element_maker;
20441 /* "lxml/objectify.pyx":1285
20442 * return element_maker
20444 * def __getattr__(self, tag): # <<<<<<<<<<<<<<
20445 * element_maker = self._cache.get(tag)
20446 * if element_maker is None:
20449 /* function exit code */
20451 __Pyx_XDECREF(__pyx_t_1);
20452 __Pyx_XDECREF(__pyx_t_4);
20453 __Pyx_XDECREF(__pyx_t_5);
20454 __Pyx_XDECREF(__pyx_t_7);
20455 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20458 __Pyx_XDECREF(__pyx_v_element_maker);
20459 __Pyx_XGIVEREF(__pyx_r);
20460 __Pyx_RefNannyFinishContext();
20464 /* "lxml/objectify.pyx":1293
20465 * return element_maker
20467 * def __call__(self, tag, *args, **kwargs): # <<<<<<<<<<<<<<
20468 * element_maker = self._cache.get(tag)
20469 * if element_maker is None:
20472 /* Python wrapper */
20473 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20474 static PyObject *__pyx_pw_4lxml_9objectify_12ElementMaker_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20475 PyObject *__pyx_v_tag = 0;
20476 PyObject *__pyx_v_args = 0;
20477 PyObject *__pyx_v_kwargs = 0;
20478 int __pyx_lineno = 0;
20479 const char *__pyx_filename = NULL;
20480 int __pyx_clineno = 0;
20481 PyObject *__pyx_r = 0;
20482 __Pyx_RefNannyDeclarations
20483 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
20484 __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
20485 __Pyx_GOTREF(__pyx_v_kwargs);
20486 if (PyTuple_GET_SIZE(__pyx_args) > 1) {
20487 __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
20488 if (unlikely(!__pyx_v_args)) {
20489 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
20490 __Pyx_RefNannyFinishContext();
20493 __Pyx_GOTREF(__pyx_v_args);
20495 __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
20498 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag,0};
20499 PyObject* values[1] = {0};
20500 if (unlikely(__pyx_kwds)) {
20501 Py_ssize_t kw_args;
20502 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20503 switch (pos_args) {
20505 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20506 CYTHON_FALLTHROUGH;
20509 kw_args = PyDict_Size(__pyx_kwds);
20510 switch (pos_args) {
20512 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag)) != 0)) kw_args--;
20513 else goto __pyx_L5_argtuple_error;
20515 if (unlikely(kw_args > 0)) {
20516 const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
20517 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__call__") < 0)) __PYX_ERR(0, 1293, __pyx_L3_error)
20519 } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
20520 goto __pyx_L5_argtuple_error;
20522 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20524 __pyx_v_tag = values[0];
20526 goto __pyx_L4_argument_unpacking_done;
20527 __pyx_L5_argtuple_error:;
20528 __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1293, __pyx_L3_error)
20530 __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
20531 __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
20532 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20533 __Pyx_RefNannyFinishContext();
20535 __pyx_L4_argument_unpacking_done:;
20536 __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);
20538 /* function exit code */
20539 __Pyx_XDECREF(__pyx_v_args);
20540 __Pyx_XDECREF(__pyx_v_kwargs);
20541 __Pyx_RefNannyFinishContext();
20545 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) {
20546 PyObject *__pyx_v_element_maker = NULL;
20547 PyObject *__pyx_r = NULL;
20548 __Pyx_RefNannyDeclarations
20549 PyObject *__pyx_t_1 = NULL;
20552 PyObject *__pyx_t_4 = NULL;
20553 PyObject *__pyx_t_5 = NULL;
20554 int __pyx_lineno = 0;
20555 const char *__pyx_filename = NULL;
20556 int __pyx_clineno = 0;
20557 __Pyx_RefNannySetupContext("__call__", 0);
20559 /* "lxml/objectify.pyx":1294
20561 * def __call__(self, tag, *args, **kwargs):
20562 * element_maker = self._cache.get(tag) # <<<<<<<<<<<<<<
20563 * if element_maker is None:
20564 * element_maker = self._build_element_maker(
20566 if (unlikely(__pyx_v_self->_cache == Py_None)) {
20567 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
20568 __PYX_ERR(0, 1294, __pyx_L1_error)
20570 __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)
20571 __Pyx_GOTREF(__pyx_t_1);
20572 __pyx_v_element_maker = __pyx_t_1;
20575 /* "lxml/objectify.pyx":1295
20576 * def __call__(self, tag, *args, **kwargs):
20577 * element_maker = self._cache.get(tag)
20578 * if element_maker is None: # <<<<<<<<<<<<<<
20579 * element_maker = self._build_element_maker(
20580 * tag, caching=not is_special_method(tag))
20582 __pyx_t_2 = (__pyx_v_element_maker == Py_None);
20583 __pyx_t_3 = (__pyx_t_2 != 0);
20586 /* "lxml/objectify.pyx":1297
20587 * if element_maker is None:
20588 * element_maker = self._build_element_maker(
20589 * tag, caching=not is_special_method(tag)) # <<<<<<<<<<<<<<
20590 * return element_maker(*args, **kwargs)
20593 __Pyx_INCREF(__pyx_v_4lxml_9objectify_is_special_method);
20594 __pyx_t_4 = __pyx_v_4lxml_9objectify_is_special_method; __pyx_t_5 = NULL;
20595 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
20596 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20597 if (likely(__pyx_t_5)) {
20598 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20599 __Pyx_INCREF(__pyx_t_5);
20600 __Pyx_INCREF(function);
20601 __Pyx_DECREF_SET(__pyx_t_4, function);
20604 __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);
20605 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20606 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error)
20607 __Pyx_GOTREF(__pyx_t_1);
20608 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20609 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1297, __pyx_L1_error)
20610 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20612 /* "lxml/objectify.pyx":1296
20613 * element_maker = self._cache.get(tag)
20614 * if element_maker is None:
20615 * element_maker = self._build_element_maker( # <<<<<<<<<<<<<<
20616 * tag, caching=not is_special_method(tag))
20617 * return element_maker(*args, **kwargs)
20619 __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)
20620 __Pyx_GOTREF(__pyx_t_1);
20621 __Pyx_DECREF_SET(__pyx_v_element_maker, __pyx_t_1);
20624 /* "lxml/objectify.pyx":1295
20625 * def __call__(self, tag, *args, **kwargs):
20626 * element_maker = self._cache.get(tag)
20627 * if element_maker is None: # <<<<<<<<<<<<<<
20628 * element_maker = self._build_element_maker(
20629 * tag, caching=not is_special_method(tag))
20633 /* "lxml/objectify.pyx":1298
20634 * element_maker = self._build_element_maker(
20635 * tag, caching=not is_special_method(tag))
20636 * return element_maker(*args, **kwargs) # <<<<<<<<<<<<<<
20638 * ################################################################################
20640 __Pyx_XDECREF(__pyx_r);
20641 __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)
20642 __Pyx_GOTREF(__pyx_t_1);
20643 __pyx_r = __pyx_t_1;
20647 /* "lxml/objectify.pyx":1293
20648 * return element_maker
20650 * def __call__(self, tag, *args, **kwargs): # <<<<<<<<<<<<<<
20651 * element_maker = self._cache.get(tag)
20652 * if element_maker is None:
20655 /* function exit code */
20657 __Pyx_XDECREF(__pyx_t_1);
20658 __Pyx_XDECREF(__pyx_t_4);
20659 __Pyx_XDECREF(__pyx_t_5);
20660 __Pyx_AddTraceback("lxml.objectify.ElementMaker.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20663 __Pyx_XDECREF(__pyx_v_element_maker);
20664 __Pyx_XGIVEREF(__pyx_r);
20665 __Pyx_RefNannyFinishContext();
20669 /* "lxml/objectify.pyx":1305
20670 * cdef bint __RECURSIVE_STR = 0 # default: off
20672 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
20673 * u"""enable_recursive_str(on=True)
20677 /* Python wrapper */
20678 static PyObject *__pyx_pw_4lxml_9objectify_13enable_recursive_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20679 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 ";
20680 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};
20681 static PyObject *__pyx_pw_4lxml_9objectify_13enable_recursive_str(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20682 PyObject *__pyx_v_on = 0;
20683 int __pyx_lineno = 0;
20684 const char *__pyx_filename = NULL;
20685 int __pyx_clineno = 0;
20686 PyObject *__pyx_r = 0;
20687 __Pyx_RefNannyDeclarations
20688 __Pyx_RefNannySetupContext("enable_recursive_str (wrapper)", 0);
20690 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_on,0};
20691 PyObject* values[1] = {0};
20692 values[0] = ((PyObject *)((PyObject *)Py_True));
20693 if (unlikely(__pyx_kwds)) {
20694 Py_ssize_t kw_args;
20695 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20696 switch (pos_args) {
20697 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20698 CYTHON_FALLTHROUGH;
20700 default: goto __pyx_L5_argtuple_error;
20702 kw_args = PyDict_Size(__pyx_kwds);
20703 switch (pos_args) {
20706 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_on);
20707 if (value) { values[0] = value; kw_args--; }
20710 if (unlikely(kw_args > 0)) {
20711 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "enable_recursive_str") < 0)) __PYX_ERR(0, 1305, __pyx_L3_error)
20714 switch (PyTuple_GET_SIZE(__pyx_args)) {
20715 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20716 CYTHON_FALLTHROUGH;
20718 default: goto __pyx_L5_argtuple_error;
20721 __pyx_v_on = values[0];
20723 goto __pyx_L4_argument_unpacking_done;
20724 __pyx_L5_argtuple_error:;
20725 __Pyx_RaiseArgtupleInvalid("enable_recursive_str", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1305, __pyx_L3_error)
20727 __Pyx_AddTraceback("lxml.objectify.enable_recursive_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
20728 __Pyx_RefNannyFinishContext();
20730 __pyx_L4_argument_unpacking_done:;
20731 __pyx_r = __pyx_pf_4lxml_9objectify_12enable_recursive_str(__pyx_self, __pyx_v_on);
20733 /* function exit code */
20734 __Pyx_RefNannyFinishContext();
20738 static PyObject *__pyx_pf_4lxml_9objectify_12enable_recursive_str(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_on) {
20739 PyObject *__pyx_r = NULL;
20740 __Pyx_RefNannyDeclarations
20742 int __pyx_lineno = 0;
20743 const char *__pyx_filename = NULL;
20744 int __pyx_clineno = 0;
20745 __Pyx_RefNannySetupContext("enable_recursive_str", 0);
20747 /* "lxml/objectify.pyx":1312
20749 * global __RECURSIVE_STR
20750 * __RECURSIVE_STR = on # <<<<<<<<<<<<<<
20752 * def dump(_Element element not None):
20754 __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)
20755 __pyx_v_4lxml_9objectify___RECURSIVE_STR = __pyx_t_1;
20757 /* "lxml/objectify.pyx":1305
20758 * cdef bint __RECURSIVE_STR = 0 # default: off
20760 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
20761 * u"""enable_recursive_str(on=True)
20765 /* function exit code */
20766 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20769 __Pyx_AddTraceback("lxml.objectify.enable_recursive_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
20772 __Pyx_XGIVEREF(__pyx_r);
20773 __Pyx_RefNannyFinishContext();
20777 /* "lxml/objectify.pyx":1314
20778 * __RECURSIVE_STR = on
20780 * def dump(_Element element not None): # <<<<<<<<<<<<<<
20781 * u"""dump(_Element element not None)
20785 /* Python wrapper */
20786 static PyObject *__pyx_pw_4lxml_9objectify_15dump(PyObject *__pyx_self, PyObject *__pyx_v_element); /*proto*/
20787 static char __pyx_doc_4lxml_9objectify_14dump[] = "dump(_Element element not None)\n\n Return a recursively generated string representation of an element.\n ";
20788 static PyMethodDef __pyx_mdef_4lxml_9objectify_15dump = {"dump", (PyCFunction)__pyx_pw_4lxml_9objectify_15dump, METH_O, __pyx_doc_4lxml_9objectify_14dump};
20789 static PyObject *__pyx_pw_4lxml_9objectify_15dump(PyObject *__pyx_self, PyObject *__pyx_v_element) {
20790 int __pyx_lineno = 0;
20791 const char *__pyx_filename = NULL;
20792 int __pyx_clineno = 0;
20793 PyObject *__pyx_r = 0;
20794 __Pyx_RefNannyDeclarations
20795 __Pyx_RefNannySetupContext("dump (wrapper)", 0);
20796 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "element", 0))) __PYX_ERR(0, 1314, __pyx_L1_error)
20797 __pyx_r = __pyx_pf_4lxml_9objectify_14dump(__pyx_self, ((struct LxmlElement *)__pyx_v_element));
20799 /* function exit code */
20804 __Pyx_RefNannyFinishContext();
20808 static PyObject *__pyx_pf_4lxml_9objectify_14dump(CYTHON_UNUSED PyObject *__pyx_self, struct LxmlElement *__pyx_v_element) {
20809 PyObject *__pyx_r = NULL;
20810 __Pyx_RefNannyDeclarations
20811 PyObject *__pyx_t_1 = NULL;
20812 int __pyx_lineno = 0;
20813 const char *__pyx_filename = NULL;
20814 int __pyx_clineno = 0;
20815 __Pyx_RefNannySetupContext("dump", 0);
20817 /* "lxml/objectify.pyx":1319
20818 * Return a recursively generated string representation of an element.
20820 * return _dump(element, 0) # <<<<<<<<<<<<<<
20822 * cdef object _dump(_Element element, int indent):
20824 __Pyx_XDECREF(__pyx_r);
20825 __pyx_t_1 = __pyx_f_4lxml_9objectify__dump(__pyx_v_element, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
20826 __Pyx_GOTREF(__pyx_t_1);
20827 __pyx_r = __pyx_t_1;
20831 /* "lxml/objectify.pyx":1314
20832 * __RECURSIVE_STR = on
20834 * def dump(_Element element not None): # <<<<<<<<<<<<<<
20835 * u"""dump(_Element element not None)
20839 /* function exit code */
20841 __Pyx_XDECREF(__pyx_t_1);
20842 __Pyx_AddTraceback("lxml.objectify.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
20845 __Pyx_XGIVEREF(__pyx_r);
20846 __Pyx_RefNannyFinishContext();
20850 /* "lxml/objectify.pyx":1321
20851 * return _dump(element, 0)
20853 * cdef object _dump(_Element element, int indent): # <<<<<<<<<<<<<<
20854 * indentstr = u" " * indent
20855 * if isinstance(element, ObjectifiedDataElement):
20858 static PyObject *__pyx_f_4lxml_9objectify__dump(struct LxmlElement *__pyx_v_element, int __pyx_v_indent) {
20859 PyObject *__pyx_v_indentstr = NULL;
20860 PyObject *__pyx_v_value = NULL;
20861 PyObject *__pyx_v_result = NULL;
20862 PyObject *__pyx_v_xsi_ns = NULL;
20863 PyObject *__pyx_v_pytype_ns = NULL;
20864 PyObject *__pyx_v_name = NULL;
20865 PyObject *__pyx_v_child = NULL;
20866 PyObject *__pyx_r = NULL;
20867 __Pyx_RefNannyDeclarations
20868 PyObject *__pyx_t_1 = NULL;
20869 PyObject *__pyx_t_2 = NULL;
20872 PyObject *__pyx_t_5 = NULL;
20873 Py_ssize_t __pyx_t_6;
20876 PyObject *__pyx_t_9 = NULL;
20877 PyObject *__pyx_t_10 = NULL;
20878 PyObject *(*__pyx_t_11)(PyObject *);
20880 Py_ssize_t __pyx_t_13;
20881 PyObject *(*__pyx_t_14)(PyObject *);
20882 int __pyx_lineno = 0;
20883 const char *__pyx_filename = NULL;
20884 int __pyx_clineno = 0;
20885 __Pyx_RefNannySetupContext("_dump", 0);
20887 /* "lxml/objectify.pyx":1322
20889 * cdef object _dump(_Element element, int indent):
20890 * indentstr = u" " * indent # <<<<<<<<<<<<<<
20891 * if isinstance(element, ObjectifiedDataElement):
20892 * value = repr(element)
20894 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_indent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1322, __pyx_L1_error)
20895 __Pyx_GOTREF(__pyx_t_1);
20896 __pyx_t_2 = PyNumber_Multiply(__pyx_kp_u__10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error)
20897 __Pyx_GOTREF(__pyx_t_2);
20898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20899 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)
20900 __pyx_v_indentstr = ((PyObject*)__pyx_t_2);
20903 /* "lxml/objectify.pyx":1323
20904 * cdef object _dump(_Element element, int indent):
20905 * indentstr = u" " * indent
20906 * if isinstance(element, ObjectifiedDataElement): # <<<<<<<<<<<<<<
20907 * value = repr(element)
20910 __pyx_t_3 = __Pyx_TypeCheck(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
20911 __pyx_t_4 = (__pyx_t_3 != 0);
20914 /* "lxml/objectify.pyx":1324
20915 * indentstr = u" " * indent
20916 * if isinstance(element, ObjectifiedDataElement):
20917 * value = repr(element) # <<<<<<<<<<<<<<
20919 * value = textOf(element._c_node)
20921 __pyx_t_2 = PyObject_Repr(((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
20922 __Pyx_GOTREF(__pyx_t_2);
20923 __pyx_v_value = __pyx_t_2;
20926 /* "lxml/objectify.pyx":1323
20927 * cdef object _dump(_Element element, int indent):
20928 * indentstr = u" " * indent
20929 * if isinstance(element, ObjectifiedDataElement): # <<<<<<<<<<<<<<
20930 * value = repr(element)
20936 /* "lxml/objectify.pyx":1326
20937 * value = repr(element)
20939 * value = textOf(element._c_node) # <<<<<<<<<<<<<<
20940 * if value is not None:
20941 * if not value.strip():
20944 __pyx_t_2 = textOf(__pyx_v_element->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error)
20945 __Pyx_GOTREF(__pyx_t_2);
20946 __pyx_v_value = __pyx_t_2;
20949 /* "lxml/objectify.pyx":1327
20951 * value = textOf(element._c_node)
20952 * if value is not None: # <<<<<<<<<<<<<<
20953 * if not value.strip():
20956 __pyx_t_4 = (__pyx_v_value != Py_None);
20957 __pyx_t_3 = (__pyx_t_4 != 0);
20960 /* "lxml/objectify.pyx":1328
20961 * value = textOf(element._c_node)
20962 * if value is not None:
20963 * if not value.strip(): # <<<<<<<<<<<<<<
20967 __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)
20968 __Pyx_GOTREF(__pyx_t_1);
20970 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20971 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20972 if (likely(__pyx_t_5)) {
20973 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20974 __Pyx_INCREF(__pyx_t_5);
20975 __Pyx_INCREF(function);
20976 __Pyx_DECREF_SET(__pyx_t_1, function);
20979 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
20980 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20981 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
20982 __Pyx_GOTREF(__pyx_t_2);
20983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20984 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1328, __pyx_L1_error)
20985 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20986 __pyx_t_4 = ((!__pyx_t_3) != 0);
20989 /* "lxml/objectify.pyx":1329
20990 * if value is not None:
20991 * if not value.strip():
20992 * value = None # <<<<<<<<<<<<<<
20994 * value = repr(value)
20996 __Pyx_INCREF(Py_None);
20997 __Pyx_DECREF_SET(__pyx_v_value, Py_None);
20999 /* "lxml/objectify.pyx":1328
21000 * value = textOf(element._c_node)
21001 * if value is not None:
21002 * if not value.strip(): # <<<<<<<<<<<<<<
21009 /* "lxml/objectify.pyx":1331
21012 * value = repr(value) # <<<<<<<<<<<<<<
21013 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n"
21014 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21017 __pyx_t_2 = PyObject_Repr(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
21018 __Pyx_GOTREF(__pyx_t_2);
21019 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
21024 /* "lxml/objectify.pyx":1327
21026 * value = textOf(element._c_node)
21027 * if value is not None: # <<<<<<<<<<<<<<
21028 * if not value.strip():
21035 /* "lxml/objectify.pyx":1332
21037 * value = repr(value)
21038 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n" # <<<<<<<<<<<<<<
21039 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21040 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21042 __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1332, __pyx_L1_error)
21043 __Pyx_GOTREF(__pyx_t_2);
21046 __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_indentstr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21047 __Pyx_GOTREF(__pyx_t_1);
21048 __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;
21049 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21050 __Pyx_GIVEREF(__pyx_t_1);
21051 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21053 __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)
21054 __Pyx_GOTREF(__pyx_t_1);
21055 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21056 __Pyx_GOTREF(__pyx_t_5);
21057 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
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, 1, __pyx_t_5);
21063 __Pyx_INCREF(__pyx_kp_u__11);
21065 __Pyx_GIVEREF(__pyx_kp_u__11);
21066 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__11);
21067 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21068 __Pyx_GOTREF(__pyx_t_5);
21069 __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;
21070 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
21071 __Pyx_GIVEREF(__pyx_t_5);
21072 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_5);
21074 __Pyx_INCREF(__pyx_kp_u__12);
21076 __Pyx_GIVEREF(__pyx_kp_u__12);
21077 PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__12);
21078 __pyx_t_5 = __pyx_f_4lxml_9objectify__typename(((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1332, __pyx_L1_error)
21079 __Pyx_GOTREF(__pyx_t_5);
21080 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error)
21081 __Pyx_GOTREF(__pyx_t_1);
21082 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21083 __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;
21084 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21085 __Pyx_GIVEREF(__pyx_t_1);
21086 PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
21088 __Pyx_INCREF(__pyx_kp_u__13);
21090 __Pyx_GIVEREF(__pyx_kp_u__13);
21091 PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__13);
21092 __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)
21093 __Pyx_GOTREF(__pyx_t_1);
21094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21095 __pyx_v_result = __pyx_t_1;
21098 /* "lxml/objectify.pyx":1333
21099 * value = repr(value)
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)):
21105 __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)
21106 __Pyx_GOTREF(__pyx_t_1);
21107 __pyx_v_xsi_ns = ((PyObject*)__pyx_t_1);
21110 /* "lxml/objectify.pyx":1334
21111 * result = f"{indentstr}{element.tag} = {value} [{_typename(element)}]\n"
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)):
21117 __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)
21118 __Pyx_GOTREF(__pyx_t_1);
21119 __pyx_v_pytype_ns = ((PyObject*)__pyx_t_1);
21122 /* "lxml/objectify.pyx":1335
21123 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21124 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21125 * for name, value in sorted(cetree.iterattributes(element, 3)): # <<<<<<<<<<<<<<
21127 * if name == PYTYPE_ATTRIBUTE:
21129 __pyx_t_2 = iterattributes(__pyx_v_element, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
21130 __Pyx_GOTREF(__pyx_t_2);
21131 __pyx_t_5 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1335, __pyx_L1_error)
21132 __Pyx_GOTREF(__pyx_t_5);
21133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21134 __pyx_t_1 = ((PyObject*)__pyx_t_5);
21136 __pyx_t_8 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1335, __pyx_L1_error)
21137 if (unlikely(__pyx_t_1 == Py_None)) {
21138 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
21139 __PYX_ERR(0, 1335, __pyx_L1_error)
21141 __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
21142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21144 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
21145 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21146 __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)
21148 __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)
21149 __Pyx_GOTREF(__pyx_t_1);
21151 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
21152 PyObject* sequence = __pyx_t_1;
21153 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21154 if (unlikely(size != 2)) {
21155 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21156 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21157 __PYX_ERR(0, 1335, __pyx_L1_error)
21159 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21160 if (likely(PyTuple_CheckExact(sequence))) {
21161 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
21162 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
21164 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
21165 __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
21167 __Pyx_INCREF(__pyx_t_2);
21168 __Pyx_INCREF(__pyx_t_9);
21170 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error)
21171 __Pyx_GOTREF(__pyx_t_2);
21172 __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1335, __pyx_L1_error)
21173 __Pyx_GOTREF(__pyx_t_9);
21175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21177 Py_ssize_t index = -1;
21178 __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1335, __pyx_L1_error)
21179 __Pyx_GOTREF(__pyx_t_10);
21180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21181 __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
21182 index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
21183 __Pyx_GOTREF(__pyx_t_2);
21184 index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
21185 __Pyx_GOTREF(__pyx_t_9);
21186 if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 1335, __pyx_L1_error)
21188 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21189 goto __pyx_L9_unpacking_done;
21190 __pyx_L8_unpacking_failed:;
21191 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21193 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
21194 __PYX_ERR(0, 1335, __pyx_L1_error)
21195 __pyx_L9_unpacking_done:;
21197 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
21199 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_9);
21202 /* "lxml/objectify.pyx":1336
21203 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21204 * for name, value in sorted(cetree.iterattributes(element, 3)):
21205 * if u'{' in name: # <<<<<<<<<<<<<<
21206 * if name == PYTYPE_ATTRIBUTE:
21207 * if value == TREE_PYTYPE_NAME:
21209 __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)
21210 __pyx_t_3 = (__pyx_t_4 != 0);
21213 /* "lxml/objectify.pyx":1337
21214 * for name, value in sorted(cetree.iterattributes(element, 3)):
21216 * if name == PYTYPE_ATTRIBUTE: # <<<<<<<<<<<<<<
21217 * if value == TREE_PYTYPE_NAME:
21220 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
21221 __Pyx_GOTREF(__pyx_t_1);
21222 __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)
21223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21224 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error)
21225 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21228 /* "lxml/objectify.pyx":1338
21230 * if name == PYTYPE_ATTRIBUTE:
21231 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
21235 __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)
21238 /* "lxml/objectify.pyx":1339
21239 * if name == PYTYPE_ATTRIBUTE:
21240 * if value == TREE_PYTYPE_NAME:
21241 * continue # <<<<<<<<<<<<<<
21243 * name = name.replace(pytype_ns, u'py:')
21245 goto __pyx_L6_continue;
21247 /* "lxml/objectify.pyx":1338
21249 * if name == PYTYPE_ATTRIBUTE:
21250 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
21256 /* "lxml/objectify.pyx":1341
21259 * name = name.replace(pytype_ns, u'py:') # <<<<<<<<<<<<<<
21260 * name = name.replace(xsi_ns, u'xsi:')
21261 * result += f"{indentstr} * {name} = {value!r}\n"
21264 __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)
21265 __Pyx_GOTREF(__pyx_t_1);
21268 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21269 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
21270 if (likely(__pyx_t_2)) {
21271 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21272 __Pyx_INCREF(__pyx_t_2);
21273 __Pyx_INCREF(function);
21274 __Pyx_DECREF_SET(__pyx_t_1, function);
21278 #if CYTHON_FAST_PYCALL
21279 if (PyFunction_Check(__pyx_t_1)) {
21280 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_pytype_ns, __pyx_kp_u_py};
21281 __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)
21282 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21283 __Pyx_GOTREF(__pyx_t_9);
21286 #if CYTHON_FAST_PYCCALL
21287 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
21288 PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_pytype_ns, __pyx_kp_u_py};
21289 __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)
21290 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21291 __Pyx_GOTREF(__pyx_t_9);
21295 __pyx_t_10 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1341, __pyx_L1_error)
21296 __Pyx_GOTREF(__pyx_t_10);
21298 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
21300 __Pyx_INCREF(__pyx_v_pytype_ns);
21301 __Pyx_GIVEREF(__pyx_v_pytype_ns);
21302 PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_12, __pyx_v_pytype_ns);
21303 __Pyx_INCREF(__pyx_kp_u_py);
21304 __Pyx_GIVEREF(__pyx_kp_u_py);
21305 PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_12, __pyx_kp_u_py);
21306 __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)
21307 __Pyx_GOTREF(__pyx_t_9);
21308 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21311 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9);
21315 /* "lxml/objectify.pyx":1337
21316 * for name, value in sorted(cetree.iterattributes(element, 3)):
21318 * if name == PYTYPE_ATTRIBUTE: # <<<<<<<<<<<<<<
21319 * if value == TREE_PYTYPE_NAME:
21324 /* "lxml/objectify.pyx":1342
21326 * name = name.replace(pytype_ns, u'py:')
21327 * name = name.replace(xsi_ns, u'xsi:') # <<<<<<<<<<<<<<
21328 * result += f"{indentstr} * {name} = {value!r}\n"
21331 __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)
21332 __Pyx_GOTREF(__pyx_t_1);
21335 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
21336 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
21337 if (likely(__pyx_t_10)) {
21338 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21339 __Pyx_INCREF(__pyx_t_10);
21340 __Pyx_INCREF(function);
21341 __Pyx_DECREF_SET(__pyx_t_1, function);
21345 #if CYTHON_FAST_PYCALL
21346 if (PyFunction_Check(__pyx_t_1)) {
21347 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_xsi_ns, __pyx_kp_u_xsi};
21348 __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)
21349 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21350 __Pyx_GOTREF(__pyx_t_9);
21353 #if CYTHON_FAST_PYCCALL
21354 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
21355 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_xsi_ns, __pyx_kp_u_xsi};
21356 __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)
21357 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21358 __Pyx_GOTREF(__pyx_t_9);
21362 __pyx_t_2 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
21363 __Pyx_GOTREF(__pyx_t_2);
21365 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
21367 __Pyx_INCREF(__pyx_v_xsi_ns);
21368 __Pyx_GIVEREF(__pyx_v_xsi_ns);
21369 PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_12, __pyx_v_xsi_ns);
21370 __Pyx_INCREF(__pyx_kp_u_xsi);
21371 __Pyx_GIVEREF(__pyx_kp_u_xsi);
21372 PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_12, __pyx_kp_u_xsi);
21373 __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)
21374 __Pyx_GOTREF(__pyx_t_9);
21375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21377 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21378 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9);
21381 /* "lxml/objectify.pyx":1336
21382 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21383 * for name, value in sorted(cetree.iterattributes(element, 3)):
21384 * if u'{' in name: # <<<<<<<<<<<<<<
21385 * if name == PYTYPE_ATTRIBUTE:
21386 * if value == TREE_PYTYPE_NAME:
21390 /* "lxml/objectify.pyx":1343
21391 * name = name.replace(pytype_ns, u'py:')
21392 * name = name.replace(xsi_ns, u'xsi:')
21393 * result += f"{indentstr} * {name} = {value!r}\n" # <<<<<<<<<<<<<<
21397 __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error)
21398 __Pyx_GOTREF(__pyx_t_9);
21401 __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_indentstr); 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, 0, __pyx_t_1);
21408 __Pyx_INCREF(__pyx_kp_u__14);
21410 __Pyx_GIVEREF(__pyx_kp_u__14);
21411 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_kp_u__14);
21412 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __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, 2, __pyx_t_1);
21419 __Pyx_INCREF(__pyx_kp_u__11);
21421 __Pyx_GIVEREF(__pyx_kp_u__11);
21422 PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_kp_u__11);
21423 __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)
21424 __Pyx_GOTREF(__pyx_t_1);
21425 __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;
21426 __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
21427 __Pyx_GIVEREF(__pyx_t_1);
21428 PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_1);
21430 __Pyx_INCREF(__pyx_kp_u__15);
21432 __Pyx_GIVEREF(__pyx_kp_u__15);
21433 PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_kp_u__15);
21434 __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)
21435 __Pyx_GOTREF(__pyx_t_1);
21436 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21437 __pyx_t_9 = __Pyx_PyUnicode_ConcatSafe(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error)
21438 __Pyx_GOTREF(__pyx_t_9);
21439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21440 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_9);
21443 /* "lxml/objectify.pyx":1335
21444 * xsi_ns = u"{%s}" % XML_SCHEMA_INSTANCE_NS
21445 * pytype_ns = u"{%s}" % PYTYPE_NAMESPACE
21446 * for name, value in sorted(cetree.iterattributes(element, 3)): # <<<<<<<<<<<<<<
21448 * if name == PYTYPE_ATTRIBUTE:
21450 __pyx_L6_continue:;
21452 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21454 /* "lxml/objectify.pyx":1345
21455 * result += f"{indentstr} * {name} = {value!r}\n"
21457 * indent += 1 # <<<<<<<<<<<<<<
21458 * for child in element.iterchildren():
21459 * result += _dump(child, indent)
21461 __pyx_v_indent = (__pyx_v_indent + 1);
21463 /* "lxml/objectify.pyx":1346
21466 * for child in element.iterchildren(): # <<<<<<<<<<<<<<
21467 * result += _dump(child, indent)
21470 __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)
21471 __Pyx_GOTREF(__pyx_t_9);
21473 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
21474 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
21475 if (likely(__pyx_t_1)) {
21476 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21477 __Pyx_INCREF(__pyx_t_1);
21478 __Pyx_INCREF(function);
21479 __Pyx_DECREF_SET(__pyx_t_9, function);
21482 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
21483 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21484 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
21485 __Pyx_GOTREF(__pyx_t_5);
21486 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21487 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
21488 __pyx_t_9 = __pyx_t_5; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0;
21491 __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1346, __pyx_L1_error)
21492 __Pyx_GOTREF(__pyx_t_9);
21493 __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1346, __pyx_L1_error)
21495 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21497 if (likely(!__pyx_t_14)) {
21498 if (likely(PyList_CheckExact(__pyx_t_9))) {
21499 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_9)) break;
21500 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21501 __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)
21503 __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)
21504 __Pyx_GOTREF(__pyx_t_5);
21507 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
21508 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21509 __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)
21511 __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)
21512 __Pyx_GOTREF(__pyx_t_5);
21516 __pyx_t_5 = __pyx_t_14(__pyx_t_9);
21517 if (unlikely(!__pyx_t_5)) {
21518 PyObject* exc_type = PyErr_Occurred();
21520 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21521 else __PYX_ERR(0, 1346, __pyx_L1_error)
21525 __Pyx_GOTREF(__pyx_t_5);
21527 __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_5);
21530 /* "lxml/objectify.pyx":1347
21532 * for child in element.iterchildren():
21533 * result += _dump(child, indent) # <<<<<<<<<<<<<<
21535 * return result[:-1] # strip last '\n'
21537 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)
21538 __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)
21539 __Pyx_GOTREF(__pyx_t_5);
21540 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
21541 __Pyx_GOTREF(__pyx_t_1);
21542 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21543 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_1);
21546 /* "lxml/objectify.pyx":1346
21549 * for child in element.iterchildren(): # <<<<<<<<<<<<<<
21550 * result += _dump(child, indent)
21554 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21556 /* "lxml/objectify.pyx":1348
21557 * for child in element.iterchildren():
21558 * result += _dump(child, indent)
21559 * if indent == 1: # <<<<<<<<<<<<<<
21560 * return result[:-1] # strip last '\n'
21563 __pyx_t_3 = ((__pyx_v_indent == 1) != 0);
21566 /* "lxml/objectify.pyx":1349
21567 * result += _dump(child, indent)
21569 * return result[:-1] # strip last '\n' # <<<<<<<<<<<<<<
21573 __Pyx_XDECREF(__pyx_r);
21574 __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)
21575 __Pyx_GOTREF(__pyx_t_9);
21576 __pyx_r = __pyx_t_9;
21580 /* "lxml/objectify.pyx":1348
21581 * for child in element.iterchildren():
21582 * result += _dump(child, indent)
21583 * if indent == 1: # <<<<<<<<<<<<<<
21584 * return result[:-1] # strip last '\n'
21589 /* "lxml/objectify.pyx":1351
21590 * return result[:-1] # strip last '\n'
21592 * return result # <<<<<<<<<<<<<<
21597 __Pyx_XDECREF(__pyx_r);
21598 __Pyx_INCREF(__pyx_v_result);
21599 __pyx_r = __pyx_v_result;
21603 /* "lxml/objectify.pyx":1321
21604 * return _dump(element, 0)
21606 * cdef object _dump(_Element element, int indent): # <<<<<<<<<<<<<<
21607 * indentstr = u" " * indent
21608 * if isinstance(element, ObjectifiedDataElement):
21611 /* function exit code */
21613 __Pyx_XDECREF(__pyx_t_1);
21614 __Pyx_XDECREF(__pyx_t_2);
21615 __Pyx_XDECREF(__pyx_t_5);
21616 __Pyx_XDECREF(__pyx_t_9);
21617 __Pyx_XDECREF(__pyx_t_10);
21618 __Pyx_AddTraceback("lxml.objectify._dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
21621 __Pyx_XDECREF(__pyx_v_indentstr);
21622 __Pyx_XDECREF(__pyx_v_value);
21623 __Pyx_XDECREF(__pyx_v_result);
21624 __Pyx_XDECREF(__pyx_v_xsi_ns);
21625 __Pyx_XDECREF(__pyx_v_pytype_ns);
21626 __Pyx_XDECREF(__pyx_v_name);
21627 __Pyx_XDECREF(__pyx_v_child);
21628 __Pyx_XGIVEREF(__pyx_r);
21629 __Pyx_RefNannyFinishContext();
21633 /* "lxml/objectify.pyx":1357
21634 * # Pickle support for objectified ElementTree
21636 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
21637 * return etree.ElementTree(fromstring(data))
21641 /* Python wrapper */
21642 static PyObject *__pyx_pw_4lxml_9objectify_17__unpickleElementTree(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
21643 static PyMethodDef __pyx_mdef_4lxml_9objectify_17__unpickleElementTree = {"__unpickleElementTree", (PyCFunction)__pyx_pw_4lxml_9objectify_17__unpickleElementTree, METH_O, 0};
21644 static PyObject *__pyx_pw_4lxml_9objectify_17__unpickleElementTree(PyObject *__pyx_self, PyObject *__pyx_v_data) {
21645 PyObject *__pyx_r = 0;
21646 __Pyx_RefNannyDeclarations
21647 __Pyx_RefNannySetupContext("__unpickleElementTree (wrapper)", 0);
21648 __pyx_r = __pyx_pf_4lxml_9objectify_16__unpickleElementTree(__pyx_self, ((PyObject *)__pyx_v_data));
21650 /* function exit code */
21651 __Pyx_RefNannyFinishContext();
21655 static PyObject *__pyx_pf_4lxml_9objectify_16__unpickleElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
21656 PyObject *__pyx_r = NULL;
21657 __Pyx_RefNannyDeclarations
21658 PyObject *__pyx_t_1 = NULL;
21659 PyObject *__pyx_t_2 = NULL;
21660 PyObject *__pyx_t_3 = NULL;
21661 PyObject *__pyx_t_4 = NULL;
21662 PyObject *__pyx_t_5 = NULL;
21663 int __pyx_lineno = 0;
21664 const char *__pyx_filename = NULL;
21665 int __pyx_clineno = 0;
21666 __Pyx_RefNannySetupContext("__unpickleElementTree", 0);
21668 /* "lxml/objectify.pyx":1358
21670 * def __unpickleElementTree(data):
21671 * return etree.ElementTree(fromstring(data)) # <<<<<<<<<<<<<<
21673 * cdef _setupPickle(elementTreeReduceFunction):
21675 __Pyx_XDECREF(__pyx_r);
21676 __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)
21677 __Pyx_GOTREF(__pyx_t_2);
21678 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1358, __pyx_L1_error)
21679 __Pyx_GOTREF(__pyx_t_4);
21681 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
21682 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
21683 if (likely(__pyx_t_5)) {
21684 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21685 __Pyx_INCREF(__pyx_t_5);
21686 __Pyx_INCREF(function);
21687 __Pyx_DECREF_SET(__pyx_t_4, function);
21690 __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);
21691 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21692 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
21693 __Pyx_GOTREF(__pyx_t_3);
21694 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21696 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
21697 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21698 if (likely(__pyx_t_4)) {
21699 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21700 __Pyx_INCREF(__pyx_t_4);
21701 __Pyx_INCREF(function);
21702 __Pyx_DECREF_SET(__pyx_t_2, function);
21705 __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);
21706 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21707 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21708 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1358, __pyx_L1_error)
21709 __Pyx_GOTREF(__pyx_t_1);
21710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21711 __pyx_r = __pyx_t_1;
21715 /* "lxml/objectify.pyx":1357
21716 * # Pickle support for objectified ElementTree
21718 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
21719 * return etree.ElementTree(fromstring(data))
21723 /* function exit code */
21725 __Pyx_XDECREF(__pyx_t_1);
21726 __Pyx_XDECREF(__pyx_t_2);
21727 __Pyx_XDECREF(__pyx_t_3);
21728 __Pyx_XDECREF(__pyx_t_4);
21729 __Pyx_XDECREF(__pyx_t_5);
21730 __Pyx_AddTraceback("lxml.objectify.__unpickleElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
21733 __Pyx_XGIVEREF(__pyx_r);
21734 __Pyx_RefNannyFinishContext();
21738 /* "lxml/objectify.pyx":1360
21739 * return etree.ElementTree(fromstring(data))
21741 * cdef _setupPickle(elementTreeReduceFunction): # <<<<<<<<<<<<<<
21742 * if python.IS_PYTHON2:
21743 * import copy_reg as copyreg
21746 static PyObject *__pyx_f_4lxml_9objectify__setupPickle(PyObject *__pyx_v_elementTreeReduceFunction) {
21747 PyObject *__pyx_v_copyreg = NULL;
21748 PyObject *__pyx_r = NULL;
21749 __Pyx_RefNannyDeclarations
21751 PyObject *__pyx_t_2 = NULL;
21752 PyObject *__pyx_t_3 = NULL;
21753 PyObject *__pyx_t_4 = NULL;
21754 PyObject *__pyx_t_5 = NULL;
21755 PyObject *__pyx_t_6 = NULL;
21757 PyObject *__pyx_t_8 = NULL;
21758 int __pyx_lineno = 0;
21759 const char *__pyx_filename = NULL;
21760 int __pyx_clineno = 0;
21761 __Pyx_RefNannySetupContext("_setupPickle", 0);
21763 /* "lxml/objectify.pyx":1361
21765 * cdef _setupPickle(elementTreeReduceFunction):
21766 * if python.IS_PYTHON2: # <<<<<<<<<<<<<<
21767 * import copy_reg as copyreg
21770 __pyx_t_1 = (IS_PYTHON2 != 0);
21773 /* "lxml/objectify.pyx":1362
21774 * cdef _setupPickle(elementTreeReduceFunction):
21775 * if python.IS_PYTHON2:
21776 * import copy_reg as copyreg # <<<<<<<<<<<<<<
21780 __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy_reg, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
21781 __Pyx_GOTREF(__pyx_t_2);
21782 __pyx_v_copyreg = __pyx_t_2;
21785 /* "lxml/objectify.pyx":1361
21787 * cdef _setupPickle(elementTreeReduceFunction):
21788 * if python.IS_PYTHON2: # <<<<<<<<<<<<<<
21789 * import copy_reg as copyreg
21795 /* "lxml/objectify.pyx":1364
21796 * import copy_reg as copyreg
21798 * import copyreg # <<<<<<<<<<<<<<
21799 * copyreg.pickle(etree._ElementTree,
21800 * elementTreeReduceFunction, __unpickleElementTree)
21803 __pyx_t_2 = __Pyx_Import(__pyx_n_s_copyreg, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error)
21804 __Pyx_GOTREF(__pyx_t_2);
21805 __pyx_v_copyreg = __pyx_t_2;
21810 /* "lxml/objectify.pyx":1365
21813 * copyreg.pickle(etree._ElementTree, # <<<<<<<<<<<<<<
21814 * elementTreeReduceFunction, __unpickleElementTree)
21817 __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)
21818 __Pyx_GOTREF(__pyx_t_3);
21819 __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)
21820 __Pyx_GOTREF(__pyx_t_4);
21822 /* "lxml/objectify.pyx":1366
21824 * copyreg.pickle(etree._ElementTree,
21825 * elementTreeReduceFunction, __unpickleElementTree) # <<<<<<<<<<<<<<
21827 * def pickleReduceElementTree(obj):
21829 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_unpickleElementTree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
21830 __Pyx_GOTREF(__pyx_t_5);
21833 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
21834 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
21835 if (likely(__pyx_t_6)) {
21836 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21837 __Pyx_INCREF(__pyx_t_6);
21838 __Pyx_INCREF(function);
21839 __Pyx_DECREF_SET(__pyx_t_3, function);
21843 #if CYTHON_FAST_PYCALL
21844 if (PyFunction_Check(__pyx_t_3)) {
21845 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_elementTreeReduceFunction, __pyx_t_5};
21846 __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)
21847 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21848 __Pyx_GOTREF(__pyx_t_2);
21849 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21850 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21853 #if CYTHON_FAST_PYCCALL
21854 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
21855 PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_4, __pyx_v_elementTreeReduceFunction, __pyx_t_5};
21856 __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)
21857 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21858 __Pyx_GOTREF(__pyx_t_2);
21859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21860 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21864 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1365, __pyx_L1_error)
21865 __Pyx_GOTREF(__pyx_t_8);
21867 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
21869 __Pyx_GIVEREF(__pyx_t_4);
21870 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
21871 __Pyx_INCREF(__pyx_v_elementTreeReduceFunction);
21872 __Pyx_GIVEREF(__pyx_v_elementTreeReduceFunction);
21873 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_elementTreeReduceFunction);
21874 __Pyx_GIVEREF(__pyx_t_5);
21875 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5);
21878 __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)
21879 __Pyx_GOTREF(__pyx_t_2);
21880 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21883 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21885 /* "lxml/objectify.pyx":1360
21886 * return etree.ElementTree(fromstring(data))
21888 * cdef _setupPickle(elementTreeReduceFunction): # <<<<<<<<<<<<<<
21889 * if python.IS_PYTHON2:
21890 * import copy_reg as copyreg
21893 /* function exit code */
21894 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21897 __Pyx_XDECREF(__pyx_t_2);
21898 __Pyx_XDECREF(__pyx_t_3);
21899 __Pyx_XDECREF(__pyx_t_4);
21900 __Pyx_XDECREF(__pyx_t_5);
21901 __Pyx_XDECREF(__pyx_t_6);
21902 __Pyx_XDECREF(__pyx_t_8);
21903 __Pyx_AddTraceback("lxml.objectify._setupPickle", __pyx_clineno, __pyx_lineno, __pyx_filename);
21906 __Pyx_XDECREF(__pyx_v_copyreg);
21907 __Pyx_XGIVEREF(__pyx_r);
21908 __Pyx_RefNannyFinishContext();
21912 /* "lxml/objectify.pyx":1368
21913 * elementTreeReduceFunction, __unpickleElementTree)
21915 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
21916 * return __unpickleElementTree, (etree.tostring(obj),)
21920 /* Python wrapper */
21921 static PyObject *__pyx_pw_4lxml_9objectify_19pickleReduceElementTree(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
21922 static PyMethodDef __pyx_mdef_4lxml_9objectify_19pickleReduceElementTree = {"pickleReduceElementTree", (PyCFunction)__pyx_pw_4lxml_9objectify_19pickleReduceElementTree, METH_O, 0};
21923 static PyObject *__pyx_pw_4lxml_9objectify_19pickleReduceElementTree(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
21924 PyObject *__pyx_r = 0;
21925 __Pyx_RefNannyDeclarations
21926 __Pyx_RefNannySetupContext("pickleReduceElementTree (wrapper)", 0);
21927 __pyx_r = __pyx_pf_4lxml_9objectify_18pickleReduceElementTree(__pyx_self, ((PyObject *)__pyx_v_obj));
21929 /* function exit code */
21930 __Pyx_RefNannyFinishContext();
21934 static PyObject *__pyx_pf_4lxml_9objectify_18pickleReduceElementTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
21935 PyObject *__pyx_r = NULL;
21936 __Pyx_RefNannyDeclarations
21937 PyObject *__pyx_t_1 = NULL;
21938 PyObject *__pyx_t_2 = NULL;
21939 PyObject *__pyx_t_3 = NULL;
21940 PyObject *__pyx_t_4 = NULL;
21941 int __pyx_lineno = 0;
21942 const char *__pyx_filename = NULL;
21943 int __pyx_clineno = 0;
21944 __Pyx_RefNannySetupContext("pickleReduceElementTree", 0);
21946 /* "lxml/objectify.pyx":1369
21948 * def pickleReduceElementTree(obj):
21949 * return __unpickleElementTree, (etree.tostring(obj),) # <<<<<<<<<<<<<<
21951 * _setupPickle(pickleReduceElementTree)
21953 __Pyx_XDECREF(__pyx_r);
21954 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unpickleElementTree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L1_error)
21955 __Pyx_GOTREF(__pyx_t_1);
21956 __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)
21957 __Pyx_GOTREF(__pyx_t_3);
21959 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
21960 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
21961 if (likely(__pyx_t_4)) {
21962 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21963 __Pyx_INCREF(__pyx_t_4);
21964 __Pyx_INCREF(function);
21965 __Pyx_DECREF_SET(__pyx_t_3, function);
21968 __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);
21969 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21970 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
21971 __Pyx_GOTREF(__pyx_t_2);
21972 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21973 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1369, __pyx_L1_error)
21974 __Pyx_GOTREF(__pyx_t_3);
21975 __Pyx_GIVEREF(__pyx_t_2);
21976 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
21978 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error)
21979 __Pyx_GOTREF(__pyx_t_2);
21980 __Pyx_GIVEREF(__pyx_t_1);
21981 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
21982 __Pyx_GIVEREF(__pyx_t_3);
21983 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
21986 __pyx_r = __pyx_t_2;
21990 /* "lxml/objectify.pyx":1368
21991 * elementTreeReduceFunction, __unpickleElementTree)
21993 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
21994 * return __unpickleElementTree, (etree.tostring(obj),)
21998 /* function exit code */
22000 __Pyx_XDECREF(__pyx_t_1);
22001 __Pyx_XDECREF(__pyx_t_2);
22002 __Pyx_XDECREF(__pyx_t_3);
22003 __Pyx_XDECREF(__pyx_t_4);
22004 __Pyx_AddTraceback("lxml.objectify.pickleReduceElementTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
22007 __Pyx_XGIVEREF(__pyx_r);
22008 __Pyx_RefNannyFinishContext();
22012 /* "lxml/objectify.pyx":1383
22013 * cdef object empty_data_class
22014 * cdef object tree_class
22015 * def __init__(self, tree_class=None, empty_data_class=None): # <<<<<<<<<<<<<<
22016 * u"""Lookup mechanism for objectify.
22020 /* Python wrapper */
22021 static int __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22022 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 ";
22023 #if CYTHON_COMPILING_IN_CPYTHON
22024 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
22026 static int __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22027 PyObject *__pyx_v_tree_class = 0;
22028 PyObject *__pyx_v_empty_data_class = 0;
22029 int __pyx_lineno = 0;
22030 const char *__pyx_filename = NULL;
22031 int __pyx_clineno = 0;
22033 __Pyx_RefNannyDeclarations
22034 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
22036 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree_class,&__pyx_n_s_empty_data_class,0};
22037 PyObject* values[2] = {0,0};
22038 values[0] = ((PyObject *)Py_None);
22039 values[1] = ((PyObject *)Py_None);
22040 if (unlikely(__pyx_kwds)) {
22041 Py_ssize_t kw_args;
22042 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22043 switch (pos_args) {
22044 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22045 CYTHON_FALLTHROUGH;
22046 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22047 CYTHON_FALLTHROUGH;
22049 default: goto __pyx_L5_argtuple_error;
22051 kw_args = PyDict_Size(__pyx_kwds);
22052 switch (pos_args) {
22055 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tree_class);
22056 if (value) { values[0] = value; kw_args--; }
22058 CYTHON_FALLTHROUGH;
22061 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_empty_data_class);
22062 if (value) { values[1] = value; kw_args--; }
22065 if (unlikely(kw_args > 0)) {
22066 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1383, __pyx_L3_error)
22069 switch (PyTuple_GET_SIZE(__pyx_args)) {
22070 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22071 CYTHON_FALLTHROUGH;
22072 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22073 CYTHON_FALLTHROUGH;
22075 default: goto __pyx_L5_argtuple_error;
22078 __pyx_v_tree_class = values[0];
22079 __pyx_v_empty_data_class = values[1];
22081 goto __pyx_L4_argument_unpacking_done;
22082 __pyx_L5_argtuple_error:;
22083 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1383, __pyx_L3_error)
22085 __Pyx_AddTraceback("lxml.objectify.ObjectifyElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
22086 __Pyx_RefNannyFinishContext();
22088 __pyx_L4_argument_unpacking_done:;
22089 __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);
22091 /* function exit code */
22092 __Pyx_RefNannyFinishContext();
22096 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) {
22098 __Pyx_RefNannyDeclarations
22101 __Pyx_RefNannySetupContext("__init__", 0);
22102 __Pyx_INCREF(__pyx_v_tree_class);
22103 __Pyx_INCREF(__pyx_v_empty_data_class);
22105 /* "lxml/objectify.pyx":1392
22106 * empty data elements (defaults to StringElement).
22108 * self._lookup_function = _lookupElementClass # <<<<<<<<<<<<<<
22109 * if tree_class is None:
22110 * tree_class = ObjectifiedElement
22112 __pyx_v_self->__pyx_base._lookup_function = __pyx_f_4lxml_9objectify__lookupElementClass;
22114 /* "lxml/objectify.pyx":1393
22116 * self._lookup_function = _lookupElementClass
22117 * if tree_class is None: # <<<<<<<<<<<<<<
22118 * tree_class = ObjectifiedElement
22119 * self.tree_class = tree_class
22121 __pyx_t_1 = (__pyx_v_tree_class == Py_None);
22122 __pyx_t_2 = (__pyx_t_1 != 0);
22125 /* "lxml/objectify.pyx":1394
22126 * self._lookup_function = _lookupElementClass
22127 * if tree_class is None:
22128 * tree_class = ObjectifiedElement # <<<<<<<<<<<<<<
22129 * self.tree_class = tree_class
22130 * if empty_data_class is None:
22132 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
22133 __Pyx_DECREF_SET(__pyx_v_tree_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
22135 /* "lxml/objectify.pyx":1393
22137 * self._lookup_function = _lookupElementClass
22138 * if tree_class is None: # <<<<<<<<<<<<<<
22139 * tree_class = ObjectifiedElement
22140 * self.tree_class = tree_class
22144 /* "lxml/objectify.pyx":1395
22145 * if tree_class is None:
22146 * tree_class = ObjectifiedElement
22147 * self.tree_class = tree_class # <<<<<<<<<<<<<<
22148 * if empty_data_class is None:
22149 * empty_data_class = StringElement
22151 __Pyx_INCREF(__pyx_v_tree_class);
22152 __Pyx_GIVEREF(__pyx_v_tree_class);
22153 __Pyx_GOTREF(__pyx_v_self->tree_class);
22154 __Pyx_DECREF(__pyx_v_self->tree_class);
22155 __pyx_v_self->tree_class = __pyx_v_tree_class;
22157 /* "lxml/objectify.pyx":1396
22158 * tree_class = ObjectifiedElement
22159 * self.tree_class = tree_class
22160 * if empty_data_class is None: # <<<<<<<<<<<<<<
22161 * empty_data_class = StringElement
22162 * self.empty_data_class = empty_data_class
22164 __pyx_t_2 = (__pyx_v_empty_data_class == Py_None);
22165 __pyx_t_1 = (__pyx_t_2 != 0);
22168 /* "lxml/objectify.pyx":1397
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
22175 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
22176 __Pyx_DECREF_SET(__pyx_v_empty_data_class, ((PyObject *)__pyx_ptype_4lxml_9objectify_StringElement));
22178 /* "lxml/objectify.pyx":1396
22179 * tree_class = ObjectifiedElement
22180 * self.tree_class = tree_class
22181 * if empty_data_class is None: # <<<<<<<<<<<<<<
22182 * empty_data_class = StringElement
22183 * self.empty_data_class = empty_data_class
22187 /* "lxml/objectify.pyx":1398
22188 * if empty_data_class is None:
22189 * empty_data_class = StringElement
22190 * self.empty_data_class = empty_data_class # <<<<<<<<<<<<<<
22192 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node):
22194 __Pyx_INCREF(__pyx_v_empty_data_class);
22195 __Pyx_GIVEREF(__pyx_v_empty_data_class);
22196 __Pyx_GOTREF(__pyx_v_self->empty_data_class);
22197 __Pyx_DECREF(__pyx_v_self->empty_data_class);
22198 __pyx_v_self->empty_data_class = __pyx_v_empty_data_class;
22200 /* "lxml/objectify.pyx":1383
22201 * cdef object empty_data_class
22202 * cdef object tree_class
22203 * def __init__(self, tree_class=None, empty_data_class=None): # <<<<<<<<<<<<<<
22204 * u"""Lookup mechanism for objectify.
22208 /* function exit code */
22210 __Pyx_XDECREF(__pyx_v_tree_class);
22211 __Pyx_XDECREF(__pyx_v_empty_data_class);
22212 __Pyx_RefNannyFinishContext();
22216 /* "lxml/objectify.pyx":1400
22217 * self.empty_data_class = empty_data_class
22219 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node): # <<<<<<<<<<<<<<
22220 * cdef ObjectifyElementClassLookup lookup
22221 * lookup = <ObjectifyElementClassLookup>state
22224 static PyObject *__pyx_f_4lxml_9objectify__lookupElementClass(PyObject *__pyx_v_state, CYTHON_UNUSED struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
22225 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *__pyx_v_lookup = 0;
22226 PyObject *__pyx_v_value = NULL;
22227 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
22228 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_schema_type = NULL;
22229 CYTHON_UNUSED PyObject *__pyx_v_prefix = NULL;
22230 PyObject *__pyx_v_el_class = NULL;
22231 PyObject *__pyx_r = NULL;
22232 __Pyx_RefNannyDeclarations
22233 PyObject *__pyx_t_1 = NULL;
22236 PyObject *__pyx_t_4 = NULL;
22238 PyObject *__pyx_t_6 = NULL;
22239 PyObject *__pyx_t_7 = NULL;
22240 PyObject *(*__pyx_t_8)(PyObject *);
22241 int __pyx_lineno = 0;
22242 const char *__pyx_filename = NULL;
22243 int __pyx_clineno = 0;
22244 __Pyx_RefNannySetupContext("_lookupElementClass", 0);
22246 /* "lxml/objectify.pyx":1402
22247 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node):
22248 * cdef ObjectifyElementClassLookup lookup
22249 * lookup = <ObjectifyElementClassLookup>state # <<<<<<<<<<<<<<
22250 * # if element has children => no data class
22251 * if cetree.hasChild(c_node):
22253 __pyx_t_1 = __pyx_v_state;
22254 __Pyx_INCREF(__pyx_t_1);
22255 __pyx_v_lookup = ((struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)__pyx_t_1);
22258 /* "lxml/objectify.pyx":1404
22259 * lookup = <ObjectifyElementClassLookup>state
22260 * # if element has children => no data class
22261 * if cetree.hasChild(c_node): # <<<<<<<<<<<<<<
22262 * return lookup.tree_class
22265 __pyx_t_2 = (hasChild(__pyx_v_c_node) != 0);
22268 /* "lxml/objectify.pyx":1405
22269 * # if element has children => no data class
22270 * if cetree.hasChild(c_node):
22271 * return lookup.tree_class # <<<<<<<<<<<<<<
22273 * # if element is defined as xsi:nil, return NoneElement class
22275 __Pyx_XDECREF(__pyx_r);
22276 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22277 __pyx_r = __pyx_v_lookup->tree_class;
22280 /* "lxml/objectify.pyx":1404
22281 * lookup = <ObjectifyElementClassLookup>state
22282 * # if element has children => no data class
22283 * if cetree.hasChild(c_node): # <<<<<<<<<<<<<<
22284 * return lookup.tree_class
22289 /* "lxml/objectify.pyx":1408
22291 * # if element is defined as xsi:nil, return NoneElement class
22292 * if u"true" == cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22293 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22294 * return NoneElement
22296 __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)
22297 __Pyx_GOTREF(__pyx_t_1);
22298 __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)
22299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22302 /* "lxml/objectify.pyx":1410
22303 * if u"true" == cetree.attributeValueFromNsName(
22304 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22305 * return NoneElement # <<<<<<<<<<<<<<
22307 * # check for Python type hint
22309 __Pyx_XDECREF(__pyx_r);
22310 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement));
22311 __pyx_r = ((PyObject *)__pyx_ptype_4lxml_9objectify_NoneElement);
22314 /* "lxml/objectify.pyx":1408
22316 * # if element is defined as xsi:nil, return NoneElement class
22317 * if u"true" == cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22318 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil"):
22319 * return NoneElement
22323 /* "lxml/objectify.pyx":1413
22325 * # check for Python type hint
22326 * value = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22327 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22328 * if value is not None:
22330 __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)
22331 __Pyx_GOTREF(__pyx_t_1);
22332 __pyx_v_value = __pyx_t_1;
22335 /* "lxml/objectify.pyx":1415
22336 * value = cetree.attributeValueFromNsName(
22337 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22338 * if value is not None: # <<<<<<<<<<<<<<
22339 * if value == TREE_PYTYPE_NAME:
22340 * return lookup.tree_class
22342 __pyx_t_2 = (__pyx_v_value != Py_None);
22343 __pyx_t_3 = (__pyx_t_2 != 0);
22346 /* "lxml/objectify.pyx":1416
22347 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22348 * if value is not None:
22349 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
22350 * return lookup.tree_class
22351 * py_type = <PyType>_PYTYPE_DICT.get(value)
22353 __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)
22356 /* "lxml/objectify.pyx":1417
22357 * if value is not None:
22358 * if value == TREE_PYTYPE_NAME:
22359 * return lookup.tree_class # <<<<<<<<<<<<<<
22360 * py_type = <PyType>_PYTYPE_DICT.get(value)
22361 * if py_type is not None:
22363 __Pyx_XDECREF(__pyx_r);
22364 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22365 __pyx_r = __pyx_v_lookup->tree_class;
22368 /* "lxml/objectify.pyx":1416
22369 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22370 * if value is not None:
22371 * if value == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
22372 * return lookup.tree_class
22373 * py_type = <PyType>_PYTYPE_DICT.get(value)
22377 /* "lxml/objectify.pyx":1418
22378 * if value == TREE_PYTYPE_NAME:
22379 * return lookup.tree_class
22380 * py_type = <PyType>_PYTYPE_DICT.get(value) # <<<<<<<<<<<<<<
22381 * if py_type is not None:
22382 * return py_type._type
22384 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
22385 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22386 __PYX_ERR(0, 1418, __pyx_L1_error)
22388 __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)
22389 __Pyx_GOTREF(__pyx_t_1);
22390 __pyx_t_4 = __pyx_t_1;
22391 __Pyx_INCREF(__pyx_t_4);
22392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22393 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
22396 /* "lxml/objectify.pyx":1419
22397 * return lookup.tree_class
22398 * py_type = <PyType>_PYTYPE_DICT.get(value)
22399 * if py_type is not None: # <<<<<<<<<<<<<<
22400 * return py_type._type
22401 * # unknown 'pyval' => try to figure it out ourself, just go on
22403 __pyx_t_3 = (((PyObject *)__pyx_v_py_type) != Py_None);
22404 __pyx_t_2 = (__pyx_t_3 != 0);
22407 /* "lxml/objectify.pyx":1420
22408 * py_type = <PyType>_PYTYPE_DICT.get(value)
22409 * if py_type is not None:
22410 * return py_type._type # <<<<<<<<<<<<<<
22411 * # unknown 'pyval' => try to figure it out ourself, just go on
22414 __Pyx_XDECREF(__pyx_r);
22415 __Pyx_INCREF(__pyx_v_py_type->_type);
22416 __pyx_r = __pyx_v_py_type->_type;
22419 /* "lxml/objectify.pyx":1419
22420 * return lookup.tree_class
22421 * py_type = <PyType>_PYTYPE_DICT.get(value)
22422 * if py_type is not None: # <<<<<<<<<<<<<<
22423 * return py_type._type
22424 * # unknown 'pyval' => try to figure it out ourself, just go on
22428 /* "lxml/objectify.pyx":1415
22429 * value = cetree.attributeValueFromNsName(
22430 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
22431 * if value is not None: # <<<<<<<<<<<<<<
22432 * if value == TREE_PYTYPE_NAME:
22433 * return lookup.tree_class
22437 /* "lxml/objectify.pyx":1424
22439 * # check for XML Schema type hint
22440 * value = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
22441 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22444 __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)
22445 __Pyx_GOTREF(__pyx_t_4);
22446 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
22449 /* "lxml/objectify.pyx":1427
22450 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22452 * if value is not None: # <<<<<<<<<<<<<<
22453 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22454 * if schema_type is None and u':' in value:
22456 __pyx_t_2 = (__pyx_v_value != Py_None);
22457 __pyx_t_3 = (__pyx_t_2 != 0);
22460 /* "lxml/objectify.pyx":1428
22462 * if value is not None:
22463 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value) # <<<<<<<<<<<<<<
22464 * if schema_type is None and u':' in value:
22465 * prefix, value = value.split(u':', 1)
22467 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
22468 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22469 __PYX_ERR(0, 1428, __pyx_L1_error)
22471 __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)
22472 __Pyx_GOTREF(__pyx_t_4);
22473 __pyx_t_1 = __pyx_t_4;
22474 __Pyx_INCREF(__pyx_t_1);
22475 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22476 __pyx_v_schema_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1);
22479 /* "lxml/objectify.pyx":1429
22480 * if value is not None:
22481 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22482 * if schema_type is None and u':' in value: # <<<<<<<<<<<<<<
22483 * prefix, value = value.split(u':', 1)
22484 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22486 __pyx_t_2 = (((PyObject *)__pyx_v_schema_type) == Py_None);
22487 __pyx_t_5 = (__pyx_t_2 != 0);
22490 __pyx_t_3 = __pyx_t_5;
22491 goto __pyx_L10_bool_binop_done;
22493 __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)
22494 __pyx_t_2 = (__pyx_t_5 != 0);
22495 __pyx_t_3 = __pyx_t_2;
22496 __pyx_L10_bool_binop_done:;
22499 /* "lxml/objectify.pyx":1430
22500 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22501 * if schema_type is None and u':' in value:
22502 * prefix, value = value.split(u':', 1) # <<<<<<<<<<<<<<
22503 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22504 * if schema_type is not None:
22506 __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)
22507 __Pyx_GOTREF(__pyx_t_1);
22508 __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)
22509 __Pyx_GOTREF(__pyx_t_4);
22510 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22511 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
22512 PyObject* sequence = __pyx_t_4;
22513 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
22514 if (unlikely(size != 2)) {
22515 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
22516 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
22517 __PYX_ERR(0, 1430, __pyx_L1_error)
22519 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22520 if (likely(PyTuple_CheckExact(sequence))) {
22521 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
22522 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
22524 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
22525 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
22527 __Pyx_INCREF(__pyx_t_1);
22528 __Pyx_INCREF(__pyx_t_6);
22530 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
22531 __Pyx_GOTREF(__pyx_t_1);
22532 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1430, __pyx_L1_error)
22533 __Pyx_GOTREF(__pyx_t_6);
22535 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22537 Py_ssize_t index = -1;
22538 __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1430, __pyx_L1_error)
22539 __Pyx_GOTREF(__pyx_t_7);
22540 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22541 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
22542 index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L12_unpacking_failed;
22543 __Pyx_GOTREF(__pyx_t_1);
22544 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed;
22545 __Pyx_GOTREF(__pyx_t_6);
22546 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1430, __pyx_L1_error)
22548 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22549 goto __pyx_L13_unpacking_done;
22550 __pyx_L12_unpacking_failed:;
22551 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22553 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
22554 __PYX_ERR(0, 1430, __pyx_L1_error)
22555 __pyx_L13_unpacking_done:;
22557 __pyx_v_prefix = __pyx_t_1;
22559 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
22562 /* "lxml/objectify.pyx":1431
22563 * if schema_type is None and u':' in value:
22564 * prefix, value = value.split(u':', 1)
22565 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value) # <<<<<<<<<<<<<<
22566 * if schema_type is not None:
22567 * return schema_type._type
22569 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
22570 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
22571 __PYX_ERR(0, 1431, __pyx_L1_error)
22573 __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)
22574 __Pyx_GOTREF(__pyx_t_4);
22575 __pyx_t_6 = __pyx_t_4;
22576 __Pyx_INCREF(__pyx_t_6);
22577 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22578 __Pyx_DECREF_SET(__pyx_v_schema_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
22581 /* "lxml/objectify.pyx":1429
22582 * if value is not None:
22583 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22584 * if schema_type is None and u':' in value: # <<<<<<<<<<<<<<
22585 * prefix, value = value.split(u':', 1)
22586 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22590 /* "lxml/objectify.pyx":1432
22591 * prefix, value = value.split(u':', 1)
22592 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22593 * if schema_type is not None: # <<<<<<<<<<<<<<
22594 * return schema_type._type
22597 __pyx_t_3 = (((PyObject *)__pyx_v_schema_type) != Py_None);
22598 __pyx_t_2 = (__pyx_t_3 != 0);
22601 /* "lxml/objectify.pyx":1433
22602 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22603 * if schema_type is not None:
22604 * return schema_type._type # <<<<<<<<<<<<<<
22606 * # otherwise determine class based on text content type
22608 __Pyx_XDECREF(__pyx_r);
22609 __Pyx_INCREF(__pyx_v_schema_type->_type);
22610 __pyx_r = __pyx_v_schema_type->_type;
22613 /* "lxml/objectify.pyx":1432
22614 * prefix, value = value.split(u':', 1)
22615 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22616 * if schema_type is not None: # <<<<<<<<<<<<<<
22617 * return schema_type._type
22622 /* "lxml/objectify.pyx":1427
22623 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
22625 * if value is not None: # <<<<<<<<<<<<<<
22626 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
22627 * if schema_type is None and u':' in value:
22631 /* "lxml/objectify.pyx":1436
22633 * # otherwise determine class based on text content type
22634 * el_class = _guessElementClass(c_node) # <<<<<<<<<<<<<<
22635 * if el_class is not None:
22638 __pyx_t_6 = __pyx_f_4lxml_9objectify__guessElementClass(__pyx_v_c_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error)
22639 __Pyx_GOTREF(__pyx_t_6);
22640 __pyx_v_el_class = __pyx_t_6;
22643 /* "lxml/objectify.pyx":1437
22644 * # otherwise determine class based on text content type
22645 * el_class = _guessElementClass(c_node)
22646 * if el_class is not None: # <<<<<<<<<<<<<<
22650 __pyx_t_2 = (__pyx_v_el_class != Py_None);
22651 __pyx_t_3 = (__pyx_t_2 != 0);
22654 /* "lxml/objectify.pyx":1438
22655 * el_class = _guessElementClass(c_node)
22656 * if el_class is not None:
22657 * return el_class # <<<<<<<<<<<<<<
22659 * # if element is a root node => default to tree node
22661 __Pyx_XDECREF(__pyx_r);
22662 __Pyx_INCREF(__pyx_v_el_class);
22663 __pyx_r = __pyx_v_el_class;
22666 /* "lxml/objectify.pyx":1437
22667 * # otherwise determine class based on text content type
22668 * el_class = _guessElementClass(c_node)
22669 * if el_class is not None: # <<<<<<<<<<<<<<
22675 /* "lxml/objectify.pyx":1441
22677 * # if element is a root node => default to tree node
22678 * if c_node.parent is NULL or not tree._isElement(c_node.parent): # <<<<<<<<<<<<<<
22679 * return lookup.tree_class
22682 __pyx_t_2 = ((__pyx_v_c_node->parent == NULL) != 0);
22685 __pyx_t_3 = __pyx_t_2;
22686 goto __pyx_L17_bool_binop_done;
22688 __pyx_t_2 = ((!(_isElement(__pyx_v_c_node->parent) != 0)) != 0);
22689 __pyx_t_3 = __pyx_t_2;
22690 __pyx_L17_bool_binop_done:;
22693 /* "lxml/objectify.pyx":1442
22694 * # if element is a root node => default to tree node
22695 * if c_node.parent is NULL or not tree._isElement(c_node.parent):
22696 * return lookup.tree_class # <<<<<<<<<<<<<<
22698 * return lookup.empty_data_class
22700 __Pyx_XDECREF(__pyx_r);
22701 __Pyx_INCREF(__pyx_v_lookup->tree_class);
22702 __pyx_r = __pyx_v_lookup->tree_class;
22705 /* "lxml/objectify.pyx":1441
22707 * # if element is a root node => default to tree node
22708 * if c_node.parent is NULL or not tree._isElement(c_node.parent): # <<<<<<<<<<<<<<
22709 * return lookup.tree_class
22714 /* "lxml/objectify.pyx":1444
22715 * return lookup.tree_class
22717 * return lookup.empty_data_class # <<<<<<<<<<<<<<
22721 __Pyx_XDECREF(__pyx_r);
22722 __Pyx_INCREF(__pyx_v_lookup->empty_data_class);
22723 __pyx_r = __pyx_v_lookup->empty_data_class;
22726 /* "lxml/objectify.pyx":1400
22727 * self.empty_data_class = empty_data_class
22729 * cdef object _lookupElementClass(state, _Document doc, tree.xmlNode* c_node): # <<<<<<<<<<<<<<
22730 * cdef ObjectifyElementClassLookup lookup
22731 * lookup = <ObjectifyElementClassLookup>state
22734 /* function exit code */
22736 __Pyx_XDECREF(__pyx_t_1);
22737 __Pyx_XDECREF(__pyx_t_4);
22738 __Pyx_XDECREF(__pyx_t_6);
22739 __Pyx_XDECREF(__pyx_t_7);
22740 __Pyx_AddTraceback("lxml.objectify._lookupElementClass", __pyx_clineno, __pyx_lineno, __pyx_filename);
22743 __Pyx_XDECREF((PyObject *)__pyx_v_lookup);
22744 __Pyx_XDECREF(__pyx_v_value);
22745 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
22746 __Pyx_XDECREF((PyObject *)__pyx_v_schema_type);
22747 __Pyx_XDECREF(__pyx_v_prefix);
22748 __Pyx_XDECREF(__pyx_v_el_class);
22749 __Pyx_XGIVEREF(__pyx_r);
22750 __Pyx_RefNannyFinishContext();
22754 /* "lxml/objectify.pyx":1450
22755 * # Type annotations
22757 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype): # <<<<<<<<<<<<<<
22758 * if pytype is None:
22762 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) {
22763 PyObject *__pyx_v_value = NULL;
22764 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_r = NULL;
22765 __Pyx_RefNannyDeclarations
22768 PyObject *__pyx_t_3 = NULL;
22769 PyObject *__pyx_t_4 = NULL;
22770 PyObject *__pyx_t_5 = NULL;
22771 PyObject *__pyx_t_6 = NULL;
22772 PyObject *__pyx_t_7 = NULL;
22773 PyObject *__pyx_t_8 = NULL;
22775 int __pyx_lineno = 0;
22776 const char *__pyx_filename = NULL;
22777 int __pyx_clineno = 0;
22778 __Pyx_RefNannySetupContext("_check_type", 0);
22780 /* "lxml/objectify.pyx":1451
22782 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22783 * if pytype is None: # <<<<<<<<<<<<<<
22785 * value = textOf(c_node)
22787 __pyx_t_1 = (((PyObject *)__pyx_v_pytype) == Py_None);
22788 __pyx_t_2 = (__pyx_t_1 != 0);
22791 /* "lxml/objectify.pyx":1452
22792 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22793 * if pytype is None:
22794 * return None # <<<<<<<<<<<<<<
22795 * value = textOf(c_node)
22798 __Pyx_XDECREF(((PyObject *)__pyx_r));
22799 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
22802 /* "lxml/objectify.pyx":1451
22804 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype):
22805 * if pytype is None: # <<<<<<<<<<<<<<
22807 * value = textOf(c_node)
22811 /* "lxml/objectify.pyx":1453
22812 * if pytype is None:
22814 * value = textOf(c_node) # <<<<<<<<<<<<<<
22816 * pytype.type_check(value)
22818 __pyx_t_3 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error)
22819 __Pyx_GOTREF(__pyx_t_3);
22820 __pyx_v_value = __pyx_t_3;
22823 /* "lxml/objectify.pyx":1454
22825 * value = textOf(c_node)
22826 * try: # <<<<<<<<<<<<<<
22827 * pytype.type_check(value)
22831 __Pyx_PyThreadState_declare
22832 __Pyx_PyThreadState_assign
22833 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
22834 __Pyx_XGOTREF(__pyx_t_4);
22835 __Pyx_XGOTREF(__pyx_t_5);
22836 __Pyx_XGOTREF(__pyx_t_6);
22839 /* "lxml/objectify.pyx":1455
22840 * value = textOf(c_node)
22842 * pytype.type_check(value) # <<<<<<<<<<<<<<
22844 * except IGNORABLE_ERRORS:
22846 __Pyx_INCREF(__pyx_v_pytype->type_check);
22847 __pyx_t_7 = __pyx_v_pytype->type_check; __pyx_t_8 = NULL;
22848 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
22849 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
22850 if (likely(__pyx_t_8)) {
22851 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22852 __Pyx_INCREF(__pyx_t_8);
22853 __Pyx_INCREF(function);
22854 __Pyx_DECREF_SET(__pyx_t_7, function);
22857 __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);
22858 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22859 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1455, __pyx_L4_error)
22860 __Pyx_GOTREF(__pyx_t_3);
22861 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22864 /* "lxml/objectify.pyx":1456
22866 * pytype.type_check(value)
22867 * return pytype # <<<<<<<<<<<<<<
22868 * except IGNORABLE_ERRORS:
22869 * # could not be parsed as the specified type => ignore
22871 __Pyx_XDECREF(((PyObject *)__pyx_r));
22872 __Pyx_INCREF(((PyObject *)__pyx_v_pytype));
22873 __pyx_r = __pyx_v_pytype;
22874 goto __pyx_L8_try_return;
22876 /* "lxml/objectify.pyx":1454
22878 * value = textOf(c_node)
22879 * try: # <<<<<<<<<<<<<<
22880 * pytype.type_check(value)
22885 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22886 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22887 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22889 /* "lxml/objectify.pyx":1457
22890 * pytype.type_check(value)
22892 * except IGNORABLE_ERRORS: # <<<<<<<<<<<<<<
22893 * # could not be parsed as the specified type => ignore
22896 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
22898 __Pyx_ErrRestore(0,0,0);
22899 goto __pyx_L5_exception_handled;
22901 goto __pyx_L6_except_error;
22902 __pyx_L6_except_error:;
22904 /* "lxml/objectify.pyx":1454
22906 * value = textOf(c_node)
22907 * try: # <<<<<<<<<<<<<<
22908 * pytype.type_check(value)
22911 __Pyx_XGIVEREF(__pyx_t_4);
22912 __Pyx_XGIVEREF(__pyx_t_5);
22913 __Pyx_XGIVEREF(__pyx_t_6);
22914 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22915 goto __pyx_L1_error;
22916 __pyx_L8_try_return:;
22917 __Pyx_XGIVEREF(__pyx_t_4);
22918 __Pyx_XGIVEREF(__pyx_t_5);
22919 __Pyx_XGIVEREF(__pyx_t_6);
22920 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22922 __pyx_L5_exception_handled:;
22923 __Pyx_XGIVEREF(__pyx_t_4);
22924 __Pyx_XGIVEREF(__pyx_t_5);
22925 __Pyx_XGIVEREF(__pyx_t_6);
22926 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
22929 /* "lxml/objectify.pyx":1460
22930 * # could not be parsed as the specified type => ignore
22932 * return None # <<<<<<<<<<<<<<
22934 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False,
22936 __Pyx_XDECREF(((PyObject *)__pyx_r));
22937 __pyx_r = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); __Pyx_INCREF(Py_None);
22940 /* "lxml/objectify.pyx":1450
22941 * # Type annotations
22943 * cdef PyType _check_type(tree.xmlNode* c_node, PyType pytype): # <<<<<<<<<<<<<<
22944 * if pytype is None:
22948 /* function exit code */
22950 __Pyx_XDECREF(__pyx_t_3);
22951 __Pyx_XDECREF(__pyx_t_7);
22952 __Pyx_XDECREF(__pyx_t_8);
22953 __Pyx_AddTraceback("lxml.objectify._check_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
22956 __Pyx_XDECREF(__pyx_v_value);
22957 __Pyx_XGIVEREF((PyObject *)__pyx_r);
22958 __Pyx_RefNannyFinishContext();
22962 /* "lxml/objectify.pyx":1462
22965 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
22966 * empty_pytype=None):
22967 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
22970 /* Python wrapper */
22971 static PyObject *__pyx_pw_4lxml_9objectify_21pyannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22972 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 ";
22973 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};
22974 static PyObject *__pyx_pw_4lxml_9objectify_21pyannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22975 PyObject *__pyx_v_element_or_tree = 0;
22976 PyObject *__pyx_v_ignore_old = 0;
22977 PyObject *__pyx_v_ignore_xsi = 0;
22978 PyObject *__pyx_v_empty_pytype = 0;
22979 int __pyx_lineno = 0;
22980 const char *__pyx_filename = NULL;
22981 int __pyx_clineno = 0;
22982 PyObject *__pyx_r = 0;
22983 __Pyx_RefNannyDeclarations
22984 __Pyx_RefNannySetupContext("pyannotate (wrapper)", 0);
22986 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};
22987 PyObject* values[4] = {0,0,0,0};
22988 values[1] = ((PyObject *)((PyObject *)Py_False));
22989 values[2] = ((PyObject *)((PyObject *)Py_False));
22991 /* "lxml/objectify.pyx":1463
22993 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False,
22994 * empty_pytype=None): # <<<<<<<<<<<<<<
22995 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
22998 values[3] = ((PyObject *)((PyObject *)Py_None));
22999 if (unlikely(__pyx_kwds)) {
23000 Py_ssize_t kw_args;
23001 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23002 switch (pos_args) {
23003 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23004 CYTHON_FALLTHROUGH;
23006 default: goto __pyx_L5_argtuple_error;
23008 kw_args = PyDict_Size(__pyx_kwds);
23009 switch (pos_args) {
23011 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23012 else goto __pyx_L5_argtuple_error;
23014 if (kw_args > 0 && likely(kw_args <= 3)) {
23016 for (index = 1; index < 4 && kw_args > 0; index++) {
23017 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23018 if (value) { values[index] = value; kw_args--; }
23021 if (unlikely(kw_args > 0)) {
23022 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pyannotate") < 0)) __PYX_ERR(0, 1462, __pyx_L3_error)
23024 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23025 goto __pyx_L5_argtuple_error;
23027 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23029 __pyx_v_element_or_tree = values[0];
23030 __pyx_v_ignore_old = values[1];
23031 __pyx_v_ignore_xsi = values[2];
23032 __pyx_v_empty_pytype = values[3];
23034 goto __pyx_L4_argument_unpacking_done;
23035 __pyx_L5_argtuple_error:;
23036 __Pyx_RaiseArgtupleInvalid("pyannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1462, __pyx_L3_error)
23038 __Pyx_AddTraceback("lxml.objectify.pyannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23039 __Pyx_RefNannyFinishContext();
23041 __pyx_L4_argument_unpacking_done:;
23042 __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);
23044 /* "lxml/objectify.pyx":1462
23047 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
23048 * empty_pytype=None):
23049 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
23052 /* function exit code */
23053 __Pyx_RefNannyFinishContext();
23057 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) {
23058 struct LxmlElement *__pyx_v_element = 0;
23059 PyObject *__pyx_r = NULL;
23060 __Pyx_RefNannyDeclarations
23061 PyObject *__pyx_t_1 = NULL;
23064 int __pyx_lineno = 0;
23065 const char *__pyx_filename = NULL;
23066 int __pyx_clineno = 0;
23067 __Pyx_RefNannySetupContext("pyannotate", 0);
23069 /* "lxml/objectify.pyx":1482
23071 * cdef _Element element
23072 * element = cetree.rootNodeOrRaise(element_or_tree) # <<<<<<<<<<<<<<
23073 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23076 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __pyx_L1_error)
23077 __Pyx_GOTREF(__pyx_t_1);
23078 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23081 /* "lxml/objectify.pyx":1483
23082 * cdef _Element element
23083 * element = cetree.rootNodeOrRaise(element_or_tree)
23084 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype) # <<<<<<<<<<<<<<
23086 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False,
23088 __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)
23089 __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)
23090 __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)
23091 __Pyx_GOTREF(__pyx_t_1);
23092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23094 /* "lxml/objectify.pyx":1462
23097 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
23098 * empty_pytype=None):
23099 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
23102 /* function exit code */
23103 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23106 __Pyx_XDECREF(__pyx_t_1);
23107 __Pyx_AddTraceback("lxml.objectify.pyannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23110 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23111 __Pyx_XGIVEREF(__pyx_r);
23112 __Pyx_RefNannyFinishContext();
23116 /* "lxml/objectify.pyx":1485
23117 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23119 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23120 * empty_type=None):
23121 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23124 /* Python wrapper */
23125 static PyObject *__pyx_pw_4lxml_9objectify_23xsiannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23126 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 ";
23127 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};
23128 static PyObject *__pyx_pw_4lxml_9objectify_23xsiannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23129 PyObject *__pyx_v_element_or_tree = 0;
23130 PyObject *__pyx_v_ignore_old = 0;
23131 PyObject *__pyx_v_ignore_pytype = 0;
23132 PyObject *__pyx_v_empty_type = 0;
23133 int __pyx_lineno = 0;
23134 const char *__pyx_filename = NULL;
23135 int __pyx_clineno = 0;
23136 PyObject *__pyx_r = 0;
23137 __Pyx_RefNannyDeclarations
23138 __Pyx_RefNannySetupContext("xsiannotate (wrapper)", 0);
23140 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};
23141 PyObject* values[4] = {0,0,0,0};
23142 values[1] = ((PyObject *)((PyObject *)Py_False));
23143 values[2] = ((PyObject *)((PyObject *)Py_False));
23145 /* "lxml/objectify.pyx":1486
23147 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False,
23148 * empty_type=None): # <<<<<<<<<<<<<<
23149 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23152 values[3] = ((PyObject *)((PyObject *)Py_None));
23153 if (unlikely(__pyx_kwds)) {
23154 Py_ssize_t kw_args;
23155 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23156 switch (pos_args) {
23157 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23158 CYTHON_FALLTHROUGH;
23160 default: goto __pyx_L5_argtuple_error;
23162 kw_args = PyDict_Size(__pyx_kwds);
23163 switch (pos_args) {
23165 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23166 else goto __pyx_L5_argtuple_error;
23168 if (kw_args > 0 && likely(kw_args <= 3)) {
23170 for (index = 1; index < 4 && kw_args > 0; index++) {
23171 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23172 if (value) { values[index] = value; kw_args--; }
23175 if (unlikely(kw_args > 0)) {
23176 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "xsiannotate") < 0)) __PYX_ERR(0, 1485, __pyx_L3_error)
23178 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23179 goto __pyx_L5_argtuple_error;
23181 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23183 __pyx_v_element_or_tree = values[0];
23184 __pyx_v_ignore_old = values[1];
23185 __pyx_v_ignore_pytype = values[2];
23186 __pyx_v_empty_type = values[3];
23188 goto __pyx_L4_argument_unpacking_done;
23189 __pyx_L5_argtuple_error:;
23190 __Pyx_RaiseArgtupleInvalid("xsiannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1485, __pyx_L3_error)
23192 __Pyx_AddTraceback("lxml.objectify.xsiannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23193 __Pyx_RefNannyFinishContext();
23195 __pyx_L4_argument_unpacking_done:;
23196 __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);
23198 /* "lxml/objectify.pyx":1485
23199 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23201 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23202 * empty_type=None):
23203 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23206 /* function exit code */
23207 __Pyx_RefNannyFinishContext();
23211 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) {
23212 struct LxmlElement *__pyx_v_element = 0;
23213 PyObject *__pyx_r = NULL;
23214 __Pyx_RefNannyDeclarations
23215 PyObject *__pyx_t_1 = NULL;
23218 int __pyx_lineno = 0;
23219 const char *__pyx_filename = NULL;
23220 int __pyx_clineno = 0;
23221 __Pyx_RefNannySetupContext("xsiannotate", 0);
23223 /* "lxml/objectify.pyx":1510
23225 * cdef _Element element
23226 * element = cetree.rootNodeOrRaise(element_or_tree) # <<<<<<<<<<<<<<
23227 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23230 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
23231 __Pyx_GOTREF(__pyx_t_1);
23232 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23235 /* "lxml/objectify.pyx":1511
23236 * cdef _Element element
23237 * element = cetree.rootNodeOrRaise(element_or_tree)
23238 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None) # <<<<<<<<<<<<<<
23240 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False,
23242 __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)
23243 __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)
23244 __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)
23245 __Pyx_GOTREF(__pyx_t_1);
23246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23248 /* "lxml/objectify.pyx":1485
23249 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
23251 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
23252 * empty_type=None):
23253 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
23256 /* function exit code */
23257 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23260 __Pyx_XDECREF(__pyx_t_1);
23261 __Pyx_AddTraceback("lxml.objectify.xsiannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23264 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23265 __Pyx_XGIVEREF(__pyx_r);
23266 __Pyx_RefNannyFinishContext();
23270 /* "lxml/objectify.pyx":1513
23271 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23273 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23274 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23275 * annotate_pytype=1):
23278 /* Python wrapper */
23279 static PyObject *__pyx_pw_4lxml_9objectify_25annotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23280 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 ";
23281 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};
23282 static PyObject *__pyx_pw_4lxml_9objectify_25annotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23283 PyObject *__pyx_v_element_or_tree = 0;
23284 PyObject *__pyx_v_ignore_old = 0;
23285 PyObject *__pyx_v_ignore_xsi = 0;
23286 PyObject *__pyx_v_empty_pytype = 0;
23287 PyObject *__pyx_v_empty_type = 0;
23288 PyObject *__pyx_v_annotate_xsi = 0;
23289 PyObject *__pyx_v_annotate_pytype = 0;
23290 int __pyx_lineno = 0;
23291 const char *__pyx_filename = NULL;
23292 int __pyx_clineno = 0;
23293 PyObject *__pyx_r = 0;
23294 __Pyx_RefNannyDeclarations
23295 __Pyx_RefNannySetupContext("annotate (wrapper)", 0);
23297 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};
23298 PyObject* values[7] = {0,0,0,0,0,0,0};
23299 values[1] = ((PyObject *)((PyObject *)Py_True));
23300 values[2] = ((PyObject *)((PyObject *)Py_False));
23302 /* "lxml/objectify.pyx":1514
23304 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False,
23305 * empty_pytype=None, empty_type=None, annotate_xsi=0, # <<<<<<<<<<<<<<
23306 * annotate_pytype=1):
23307 * u"""annotate(element_or_tree, ignore_old=True, ignore_xsi=False, empty_pytype=None, empty_type=None, annotate_xsi=0, annotate_pytype=1)
23309 values[3] = ((PyObject *)((PyObject *)Py_None));
23310 values[4] = ((PyObject *)((PyObject *)Py_None));
23311 values[5] = ((PyObject *)((PyObject *)__pyx_int_0));
23312 values[6] = ((PyObject *)((PyObject *)__pyx_int_1));
23313 if (unlikely(__pyx_kwds)) {
23314 Py_ssize_t kw_args;
23315 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23316 switch (pos_args) {
23317 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23318 CYTHON_FALLTHROUGH;
23320 default: goto __pyx_L5_argtuple_error;
23322 kw_args = PyDict_Size(__pyx_kwds);
23323 switch (pos_args) {
23325 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
23326 else goto __pyx_L5_argtuple_error;
23328 if (kw_args > 0 && likely(kw_args <= 6)) {
23330 for (index = 1; index < 7 && kw_args > 0; index++) {
23331 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
23332 if (value) { values[index] = value; kw_args--; }
23335 if (unlikely(kw_args > 0)) {
23336 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "annotate") < 0)) __PYX_ERR(0, 1513, __pyx_L3_error)
23338 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
23339 goto __pyx_L5_argtuple_error;
23341 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23343 __pyx_v_element_or_tree = values[0];
23344 __pyx_v_ignore_old = values[1];
23345 __pyx_v_ignore_xsi = values[2];
23346 __pyx_v_empty_pytype = values[3];
23347 __pyx_v_empty_type = values[4];
23348 __pyx_v_annotate_xsi = values[5];
23349 __pyx_v_annotate_pytype = values[6];
23351 goto __pyx_L4_argument_unpacking_done;
23352 __pyx_L5_argtuple_error:;
23353 __Pyx_RaiseArgtupleInvalid("annotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1513, __pyx_L3_error)
23355 __Pyx_AddTraceback("lxml.objectify.annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23356 __Pyx_RefNannyFinishContext();
23358 __pyx_L4_argument_unpacking_done:;
23359 __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);
23361 /* "lxml/objectify.pyx":1513
23362 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23364 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23365 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23366 * annotate_pytype=1):
23369 /* function exit code */
23370 __Pyx_RefNannyFinishContext();
23374 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) {
23375 struct LxmlElement *__pyx_v_element = 0;
23376 PyObject *__pyx_r = NULL;
23377 __Pyx_RefNannyDeclarations
23378 PyObject *__pyx_t_1 = NULL;
23383 int __pyx_lineno = 0;
23384 const char *__pyx_filename = NULL;
23385 int __pyx_clineno = 0;
23386 __Pyx_RefNannySetupContext("annotate", 0);
23388 /* "lxml/objectify.pyx":1547
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)
23395 __pyx_t_1 = ((PyObject *)rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error)
23396 __Pyx_GOTREF(__pyx_t_1);
23397 __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
23400 /* "lxml/objectify.pyx":1548
23401 * cdef _Element element
23402 * element = cetree.rootNodeOrRaise(element_or_tree)
23403 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi, # <<<<<<<<<<<<<<
23404 * ignore_old, empty_type, empty_pytype)
23407 __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)
23408 __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)
23409 __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)
23411 /* "lxml/objectify.pyx":1549
23412 * element = cetree.rootNodeOrRaise(element_or_tree)
23413 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi,
23414 * ignore_old, empty_type, empty_pytype) # <<<<<<<<<<<<<<
23418 __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)
23420 /* "lxml/objectify.pyx":1548
23421 * cdef _Element element
23422 * element = cetree.rootNodeOrRaise(element_or_tree)
23423 * _annotate(element, annotate_xsi, annotate_pytype, ignore_xsi, # <<<<<<<<<<<<<<
23424 * ignore_old, empty_type, empty_pytype)
23427 __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)
23428 __Pyx_GOTREF(__pyx_t_1);
23429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23431 /* "lxml/objectify.pyx":1513
23432 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
23434 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
23435 * empty_pytype=None, empty_type=None, annotate_xsi=0,
23436 * annotate_pytype=1):
23439 /* function exit code */
23440 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23443 __Pyx_XDECREF(__pyx_t_1);
23444 __Pyx_AddTraceback("lxml.objectify.annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23447 __Pyx_XDECREF((PyObject *)__pyx_v_element);
23448 __Pyx_XGIVEREF(__pyx_r);
23449 __Pyx_RefNannyFinishContext();
23453 /* "lxml/objectify.pyx":1552
23456 * cdef _annotate(_Element element, bint annotate_xsi, bint annotate_pytype, # <<<<<<<<<<<<<<
23457 * bint ignore_xsi, bint ignore_pytype,
23458 * empty_type_name, empty_pytype_name):
23461 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) {
23462 struct LxmlDocument *__pyx_v_doc = 0;
23463 xmlNode *__pyx_v_c_node;
23464 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_empty_pytype = 0;
23465 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_StrType = 0;
23466 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_NoneType = 0;
23467 PyObject *__pyx_r = NULL;
23468 __Pyx_RefNannyDeclarations
23471 PyObject *__pyx_t_3 = NULL;
23472 PyObject *__pyx_t_4 = NULL;
23473 xmlNode *__pyx_t_5;
23475 int __pyx_lineno = 0;
23476 const char *__pyx_filename = NULL;
23477 int __pyx_clineno = 0;
23478 __Pyx_RefNannySetupContext("_annotate", 0);
23479 __Pyx_INCREF(__pyx_v_empty_type_name);
23480 __Pyx_INCREF(__pyx_v_empty_pytype_name);
23482 /* "lxml/objectify.pyx":1559
23483 * cdef PyType empty_pytype, StrType, NoneType
23485 * if not annotate_xsi and not annotate_pytype: # <<<<<<<<<<<<<<
23489 __pyx_t_2 = ((!(__pyx_v_annotate_xsi != 0)) != 0);
23492 __pyx_t_1 = __pyx_t_2;
23493 goto __pyx_L4_bool_binop_done;
23495 __pyx_t_2 = ((!(__pyx_v_annotate_pytype != 0)) != 0);
23496 __pyx_t_1 = __pyx_t_2;
23497 __pyx_L4_bool_binop_done:;
23500 /* "lxml/objectify.pyx":1560
23502 * if not annotate_xsi and not annotate_pytype:
23503 * return # <<<<<<<<<<<<<<
23505 * if empty_type_name is not None:
23507 __Pyx_XDECREF(__pyx_r);
23508 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23511 /* "lxml/objectify.pyx":1559
23512 * cdef PyType empty_pytype, StrType, NoneType
23514 * if not annotate_xsi and not annotate_pytype: # <<<<<<<<<<<<<<
23520 /* "lxml/objectify.pyx":1562
23523 * if empty_type_name is not None: # <<<<<<<<<<<<<<
23524 * if isinstance(empty_type_name, bytes):
23525 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23527 __pyx_t_1 = (__pyx_v_empty_type_name != Py_None);
23528 __pyx_t_2 = (__pyx_t_1 != 0);
23531 /* "lxml/objectify.pyx":1563
23533 * if empty_type_name is not None:
23534 * if isinstance(empty_type_name, bytes): # <<<<<<<<<<<<<<
23535 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23536 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23538 __pyx_t_2 = PyBytes_Check(__pyx_v_empty_type_name);
23539 __pyx_t_1 = (__pyx_t_2 != 0);
23542 /* "lxml/objectify.pyx":1564
23543 * if empty_type_name is not None:
23544 * if isinstance(empty_type_name, bytes):
23545 * empty_type_name = (<bytes>empty_type_name).decode("ascii") # <<<<<<<<<<<<<<
23546 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23547 * elif empty_pytype_name is not None:
23549 if (unlikely(__pyx_v_empty_type_name == Py_None)) {
23550 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
23551 __PYX_ERR(0, 1564, __pyx_L1_error)
23553 __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)
23554 __Pyx_GOTREF(__pyx_t_3);
23555 __Pyx_DECREF_SET(__pyx_v_empty_type_name, __pyx_t_3);
23558 /* "lxml/objectify.pyx":1563
23560 * if empty_type_name is not None:
23561 * if isinstance(empty_type_name, bytes): # <<<<<<<<<<<<<<
23562 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23563 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23567 /* "lxml/objectify.pyx":1565
23568 * if isinstance(empty_type_name, bytes):
23569 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23570 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name) # <<<<<<<<<<<<<<
23571 * elif empty_pytype_name is not None:
23572 * if isinstance(empty_pytype_name, bytes):
23574 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
23575 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23576 __PYX_ERR(0, 1565, __pyx_L1_error)
23578 __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)
23579 __Pyx_GOTREF(__pyx_t_3);
23580 __pyx_t_4 = __pyx_t_3;
23581 __Pyx_INCREF(__pyx_t_4);
23582 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23583 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
23586 /* "lxml/objectify.pyx":1562
23589 * if empty_type_name is not None: # <<<<<<<<<<<<<<
23590 * if isinstance(empty_type_name, bytes):
23591 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23596 /* "lxml/objectify.pyx":1566
23597 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23598 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23599 * elif empty_pytype_name is not None: # <<<<<<<<<<<<<<
23600 * if isinstance(empty_pytype_name, bytes):
23601 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23603 __pyx_t_1 = (__pyx_v_empty_pytype_name != Py_None);
23604 __pyx_t_2 = (__pyx_t_1 != 0);
23607 /* "lxml/objectify.pyx":1567
23608 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23609 * elif empty_pytype_name is not None:
23610 * if isinstance(empty_pytype_name, bytes): # <<<<<<<<<<<<<<
23611 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23612 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23614 __pyx_t_2 = PyBytes_Check(__pyx_v_empty_pytype_name);
23615 __pyx_t_1 = (__pyx_t_2 != 0);
23618 /* "lxml/objectify.pyx":1568
23619 * elif empty_pytype_name is not None:
23620 * if isinstance(empty_pytype_name, bytes):
23621 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii") # <<<<<<<<<<<<<<
23622 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23625 if (unlikely(__pyx_v_empty_pytype_name == Py_None)) {
23626 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
23627 __PYX_ERR(0, 1568, __pyx_L1_error)
23629 __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)
23630 __Pyx_GOTREF(__pyx_t_4);
23631 __Pyx_DECREF_SET(__pyx_v_empty_pytype_name, __pyx_t_4);
23634 /* "lxml/objectify.pyx":1567
23635 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23636 * elif empty_pytype_name is not None:
23637 * if isinstance(empty_pytype_name, bytes): # <<<<<<<<<<<<<<
23638 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23639 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23643 /* "lxml/objectify.pyx":1569
23644 * if isinstance(empty_pytype_name, bytes):
23645 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23646 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name) # <<<<<<<<<<<<<<
23648 * empty_pytype = None
23650 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23651 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23652 __PYX_ERR(0, 1569, __pyx_L1_error)
23654 __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)
23655 __Pyx_GOTREF(__pyx_t_4);
23656 __pyx_t_3 = __pyx_t_4;
23657 __Pyx_INCREF(__pyx_t_3);
23658 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23659 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
23662 /* "lxml/objectify.pyx":1566
23663 * empty_type_name = (<bytes>empty_type_name).decode("ascii")
23664 * empty_pytype = <PyType>_SCHEMA_TYPE_DICT.get(empty_type_name)
23665 * elif empty_pytype_name is not None: # <<<<<<<<<<<<<<
23666 * if isinstance(empty_pytype_name, bytes):
23667 * empty_pytype_name = (<bytes>empty_pytype_name).decode("ascii")
23672 /* "lxml/objectify.pyx":1571
23673 * empty_pytype = <PyType>_PYTYPE_DICT.get(empty_pytype_name)
23675 * empty_pytype = None # <<<<<<<<<<<<<<
23677 * StrType = <PyType>_PYTYPE_DICT.get(u'str')
23680 __Pyx_INCREF(Py_None);
23681 __pyx_v_empty_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None);
23685 /* "lxml/objectify.pyx":1573
23686 * empty_pytype = None
23688 * StrType = <PyType>_PYTYPE_DICT.get(u'str') # <<<<<<<<<<<<<<
23689 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType')
23692 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23693 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23694 __PYX_ERR(0, 1573, __pyx_L1_error)
23696 __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)
23697 __Pyx_GOTREF(__pyx_t_3);
23698 __pyx_t_4 = __pyx_t_3;
23699 __Pyx_INCREF(__pyx_t_4);
23700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23701 __pyx_v_StrType = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_4);
23704 /* "lxml/objectify.pyx":1574
23706 * StrType = <PyType>_PYTYPE_DICT.get(u'str')
23707 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType') # <<<<<<<<<<<<<<
23709 * doc = element._doc
23711 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
23712 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23713 __PYX_ERR(0, 1574, __pyx_L1_error)
23715 __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)
23716 __Pyx_GOTREF(__pyx_t_4);
23717 __pyx_t_3 = __pyx_t_4;
23718 __Pyx_INCREF(__pyx_t_3);
23719 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23720 __pyx_v_NoneType = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_3);
23723 /* "lxml/objectify.pyx":1576
23724 * NoneType = <PyType>_PYTYPE_DICT.get(u'NoneType')
23726 * doc = element._doc # <<<<<<<<<<<<<<
23727 * c_node = element._c_node
23728 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23730 __pyx_t_3 = ((PyObject *)__pyx_v_element->_doc);
23731 __Pyx_INCREF(__pyx_t_3);
23732 __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
23735 /* "lxml/objectify.pyx":1577
23737 * doc = element._doc
23738 * c_node = element._c_node # <<<<<<<<<<<<<<
23739 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23740 * if c_node.type == tree.XML_ELEMENT_NODE:
23742 __pyx_t_5 = __pyx_v_element->_c_node;
23743 __pyx_v_c_node = __pyx_t_5;
23745 /* "lxml/objectify.pyx":1578
23746 * doc = element._doc
23747 * c_node = element._c_node
23748 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1) # <<<<<<<<<<<<<<
23749 * if c_node.type == tree.XML_ELEMENT_NODE:
23750 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23752 BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node, __pyx_v_c_node, 1);
23754 /* "lxml/objectify.pyx":1579
23755 * c_node = element._c_node
23756 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23757 * if c_node.type == tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
23758 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23759 * ignore_xsi, ignore_pytype,
23761 __pyx_t_1 = ((__pyx_v_c_node->type == XML_ELEMENT_NODE) != 0);
23764 /* "lxml/objectify.pyx":1580
23765 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23766 * if c_node.type == tree.XML_ELEMENT_NODE:
23767 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype, # <<<<<<<<<<<<<<
23768 * ignore_xsi, ignore_pytype,
23769 * empty_type_name, empty_pytype, StrType, NoneType)
23771 __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)
23773 /* "lxml/objectify.pyx":1579
23774 * c_node = element._c_node
23775 * tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
23776 * if c_node.type == tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
23777 * _annotate_element(c_node, doc, annotate_xsi, annotate_pytype,
23778 * ignore_xsi, ignore_pytype,
23782 /* "lxml/objectify.pyx":1583
23783 * ignore_xsi, ignore_pytype,
23784 * empty_type_name, empty_pytype, StrType, NoneType)
23785 * tree.END_FOR_EACH_ELEMENT_FROM(c_node) # <<<<<<<<<<<<<<
23787 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc,
23789 END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
23791 /* "lxml/objectify.pyx":1552
23794 * cdef _annotate(_Element element, bint annotate_xsi, bint annotate_pytype, # <<<<<<<<<<<<<<
23795 * bint ignore_xsi, bint ignore_pytype,
23796 * empty_type_name, empty_pytype_name):
23799 /* function exit code */
23800 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23803 __Pyx_XDECREF(__pyx_t_3);
23804 __Pyx_XDECREF(__pyx_t_4);
23805 __Pyx_AddTraceback("lxml.objectify._annotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
23808 __Pyx_XDECREF((PyObject *)__pyx_v_doc);
23809 __Pyx_XDECREF((PyObject *)__pyx_v_empty_pytype);
23810 __Pyx_XDECREF((PyObject *)__pyx_v_StrType);
23811 __Pyx_XDECREF((PyObject *)__pyx_v_NoneType);
23812 __Pyx_XDECREF(__pyx_v_empty_type_name);
23813 __Pyx_XDECREF(__pyx_v_empty_pytype_name);
23814 __Pyx_XGIVEREF(__pyx_r);
23815 __Pyx_RefNannyFinishContext();
23819 /* "lxml/objectify.pyx":1585
23820 * tree.END_FOR_EACH_ELEMENT_FROM(c_node)
23822 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc, # <<<<<<<<<<<<<<
23823 * bint annotate_xsi, bint annotate_pytype,
23824 * bint ignore_xsi, bint ignore_pytype,
23827 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) {
23828 xmlNs *__pyx_v_c_ns;
23829 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_pytype = 0;
23830 PyObject *__pyx_v_typename = NULL;
23831 long __pyx_v_istree;
23832 PyObject *__pyx_v_prefix = NULL;
23833 PyObject *__pyx_v_old_pytypename = NULL;
23834 PyObject *__pyx_v_typename_utf8 = NULL;
23835 PyObject *__pyx_v_name = NULL;
23836 PyObject *__pyx_v_pytype_name = NULL;
23838 __Pyx_RefNannyDeclarations
23839 PyObject *__pyx_t_1 = NULL;
23843 PyObject *__pyx_t_5 = NULL;
23844 PyObject *__pyx_t_6 = NULL;
23845 PyObject *__pyx_t_7 = NULL;
23846 PyObject *(*__pyx_t_8)(PyObject *);
23847 int __pyx_lineno = 0;
23848 const char *__pyx_filename = NULL;
23849 int __pyx_clineno = 0;
23850 __Pyx_RefNannySetupContext("_annotate_element", 0);
23852 /* "lxml/objectify.pyx":1591
23853 * PyType StrType, PyType NoneType) except -1:
23854 * cdef tree.xmlNs* c_ns
23855 * cdef PyType pytype = None # <<<<<<<<<<<<<<
23859 __Pyx_INCREF(Py_None);
23860 __pyx_v_pytype = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None);
23862 /* "lxml/objectify.pyx":1592
23863 * cdef tree.xmlNs* c_ns
23864 * cdef PyType pytype = None
23865 * typename = None # <<<<<<<<<<<<<<
23869 __Pyx_INCREF(Py_None);
23870 __pyx_v_typename = Py_None;
23872 /* "lxml/objectify.pyx":1593
23873 * cdef PyType pytype = None
23875 * istree = 0 # <<<<<<<<<<<<<<
23877 * # if element is defined as xsi:nil, represent it as None
23879 __pyx_v_istree = 0;
23881 /* "lxml/objectify.pyx":1596
23883 * # if element is defined as xsi:nil, represent it as None
23884 * if cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23885 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23886 * pytype = NoneType
23888 __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)
23889 __Pyx_GOTREF(__pyx_t_1);
23890 __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)
23891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23894 /* "lxml/objectify.pyx":1598
23895 * if cetree.attributeValueFromNsName(
23896 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23897 * pytype = NoneType # <<<<<<<<<<<<<<
23899 * if pytype is None and not ignore_xsi:
23901 __Pyx_INCREF(((PyObject *)__pyx_v_NoneType));
23902 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_NoneType);
23904 /* "lxml/objectify.pyx":1596
23906 * # if element is defined as xsi:nil, represent it as None
23907 * if cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23908 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"nil") == "true":
23909 * pytype = NoneType
23913 /* "lxml/objectify.pyx":1600
23914 * pytype = NoneType
23916 * if pytype is None and not ignore_xsi: # <<<<<<<<<<<<<<
23917 * # check that old xsi type value is valid
23918 * typename = cetree.attributeValueFromNsName(
23920 __pyx_t_3 = (((PyObject *)__pyx_v_pytype) == Py_None);
23921 __pyx_t_4 = (__pyx_t_3 != 0);
23924 __pyx_t_2 = __pyx_t_4;
23925 goto __pyx_L5_bool_binop_done;
23927 __pyx_t_4 = ((!(__pyx_v_ignore_xsi != 0)) != 0);
23928 __pyx_t_2 = __pyx_t_4;
23929 __pyx_L5_bool_binop_done:;
23932 /* "lxml/objectify.pyx":1602
23933 * if pytype is None and not ignore_xsi:
23934 * # check that old xsi type value is valid
23935 * typename = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
23936 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23937 * if typename is not None:
23939 __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)
23940 __Pyx_GOTREF(__pyx_t_1);
23941 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_1);
23944 /* "lxml/objectify.pyx":1604
23945 * typename = cetree.attributeValueFromNsName(
23946 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23947 * if typename is not None: # <<<<<<<<<<<<<<
23948 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23949 * if pytype is None and u':' in typename:
23951 __pyx_t_2 = (__pyx_v_typename != Py_None);
23952 __pyx_t_4 = (__pyx_t_2 != 0);
23955 /* "lxml/objectify.pyx":1605
23956 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
23957 * if typename is not None:
23958 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename) # <<<<<<<<<<<<<<
23959 * if pytype is None and u':' in typename:
23960 * prefix, typename = typename.split(u':', 1)
23962 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
23963 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23964 __PYX_ERR(0, 1605, __pyx_L1_error)
23966 __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)
23967 __Pyx_GOTREF(__pyx_t_1);
23968 __pyx_t_5 = __pyx_t_1;
23969 __Pyx_INCREF(__pyx_t_5);
23970 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23971 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_5));
23974 /* "lxml/objectify.pyx":1606
23975 * if typename is not None:
23976 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23977 * if pytype is None and u':' in typename: # <<<<<<<<<<<<<<
23978 * prefix, typename = typename.split(u':', 1)
23979 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23981 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) == Py_None);
23982 __pyx_t_3 = (__pyx_t_2 != 0);
23985 __pyx_t_4 = __pyx_t_3;
23986 goto __pyx_L9_bool_binop_done;
23988 __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)
23989 __pyx_t_2 = (__pyx_t_3 != 0);
23990 __pyx_t_4 = __pyx_t_2;
23991 __pyx_L9_bool_binop_done:;
23994 /* "lxml/objectify.pyx":1607
23995 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23996 * if pytype is None and u':' in typename:
23997 * prefix, typename = typename.split(u':', 1) # <<<<<<<<<<<<<<
23998 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
23999 * if pytype is not None and pytype is not StrType:
24001 __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)
24002 __Pyx_GOTREF(__pyx_t_5);
24003 __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)
24004 __Pyx_GOTREF(__pyx_t_1);
24005 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24006 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
24007 PyObject* sequence = __pyx_t_1;
24008 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24009 if (unlikely(size != 2)) {
24010 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24011 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24012 __PYX_ERR(0, 1607, __pyx_L1_error)
24014 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24015 if (likely(PyTuple_CheckExact(sequence))) {
24016 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
24017 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
24019 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
24020 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
24022 __Pyx_INCREF(__pyx_t_5);
24023 __Pyx_INCREF(__pyx_t_6);
24025 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1607, __pyx_L1_error)
24026 __Pyx_GOTREF(__pyx_t_5);
24027 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1607, __pyx_L1_error)
24028 __Pyx_GOTREF(__pyx_t_6);
24030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24032 Py_ssize_t index = -1;
24033 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1607, __pyx_L1_error)
24034 __Pyx_GOTREF(__pyx_t_7);
24035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24036 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
24037 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
24038 __Pyx_GOTREF(__pyx_t_5);
24039 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
24040 __Pyx_GOTREF(__pyx_t_6);
24041 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1607, __pyx_L1_error)
24043 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24044 goto __pyx_L12_unpacking_done;
24045 __pyx_L11_unpacking_failed:;
24046 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24048 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
24049 __PYX_ERR(0, 1607, __pyx_L1_error)
24050 __pyx_L12_unpacking_done:;
24052 __pyx_v_prefix = __pyx_t_5;
24054 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24057 /* "lxml/objectify.pyx":1608
24058 * if pytype is None and u':' in typename:
24059 * prefix, typename = typename.split(u':', 1)
24060 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename) # <<<<<<<<<<<<<<
24061 * if pytype is not None and pytype is not StrType:
24062 * # StrType does not have a typecheck but is the default
24064 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
24065 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
24066 __PYX_ERR(0, 1608, __pyx_L1_error)
24068 __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)
24069 __Pyx_GOTREF(__pyx_t_1);
24070 __pyx_t_6 = __pyx_t_1;
24071 __Pyx_INCREF(__pyx_t_6);
24072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24073 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24076 /* "lxml/objectify.pyx":1606
24077 * if typename is not None:
24078 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24079 * if pytype is None and u':' in typename: # <<<<<<<<<<<<<<
24080 * prefix, typename = typename.split(u':', 1)
24081 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24085 /* "lxml/objectify.pyx":1609
24086 * prefix, typename = typename.split(u':', 1)
24087 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24088 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24089 * # StrType does not have a typecheck but is the default
24090 * # anyway, so just accept it if given as type
24092 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24093 __pyx_t_3 = (__pyx_t_2 != 0);
24096 __pyx_t_4 = __pyx_t_3;
24097 goto __pyx_L14_bool_binop_done;
24099 __pyx_t_3 = (__pyx_v_pytype != __pyx_v_StrType);
24100 __pyx_t_2 = (__pyx_t_3 != 0);
24101 __pyx_t_4 = __pyx_t_2;
24102 __pyx_L14_bool_binop_done:;
24105 /* "lxml/objectify.pyx":1613
24106 * # anyway, so just accept it if given as type
24108 * pytype = _check_type(c_node, pytype) # <<<<<<<<<<<<<<
24109 * if pytype is None:
24112 __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)
24113 __Pyx_GOTREF(__pyx_t_6);
24114 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24117 /* "lxml/objectify.pyx":1614
24119 * pytype = _check_type(c_node, pytype)
24120 * if pytype is None: # <<<<<<<<<<<<<<
24124 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
24125 __pyx_t_2 = (__pyx_t_4 != 0);
24128 /* "lxml/objectify.pyx":1615
24129 * pytype = _check_type(c_node, pytype)
24130 * if pytype is None:
24131 * typename = None # <<<<<<<<<<<<<<
24133 * if pytype is None and not ignore_pytype:
24135 __Pyx_INCREF(Py_None);
24136 __Pyx_DECREF_SET(__pyx_v_typename, Py_None);
24138 /* "lxml/objectify.pyx":1614
24140 * pytype = _check_type(c_node, pytype)
24141 * if pytype is None: # <<<<<<<<<<<<<<
24147 /* "lxml/objectify.pyx":1609
24148 * prefix, typename = typename.split(u':', 1)
24149 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24150 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24151 * # StrType does not have a typecheck but is the default
24152 * # anyway, so just accept it if given as type
24156 /* "lxml/objectify.pyx":1604
24157 * typename = cetree.attributeValueFromNsName(
24158 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24159 * if typename is not None: # <<<<<<<<<<<<<<
24160 * pytype = <PyType>_SCHEMA_TYPE_DICT.get(typename)
24161 * if pytype is None and u':' in typename:
24165 /* "lxml/objectify.pyx":1600
24166 * pytype = NoneType
24168 * if pytype is None and not ignore_xsi: # <<<<<<<<<<<<<<
24169 * # check that old xsi type value is valid
24170 * typename = cetree.attributeValueFromNsName(
24174 /* "lxml/objectify.pyx":1617
24177 * if pytype is None and not ignore_pytype: # <<<<<<<<<<<<<<
24178 * # check that old pytype value is valid
24179 * old_pytypename = cetree.attributeValueFromNsName(
24181 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
24182 __pyx_t_3 = (__pyx_t_4 != 0);
24185 __pyx_t_2 = __pyx_t_3;
24186 goto __pyx_L18_bool_binop_done;
24188 __pyx_t_3 = ((!(__pyx_v_ignore_pytype != 0)) != 0);
24189 __pyx_t_2 = __pyx_t_3;
24190 __pyx_L18_bool_binop_done:;
24193 /* "lxml/objectify.pyx":1619
24194 * if pytype is None and not ignore_pytype:
24195 * # check that old pytype value is valid
24196 * old_pytypename = cetree.attributeValueFromNsName( # <<<<<<<<<<<<<<
24197 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24198 * if old_pytypename is not None:
24200 __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)
24201 __Pyx_GOTREF(__pyx_t_6);
24202 __pyx_v_old_pytypename = __pyx_t_6;
24205 /* "lxml/objectify.pyx":1621
24206 * old_pytypename = cetree.attributeValueFromNsName(
24207 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24208 * if old_pytypename is not None: # <<<<<<<<<<<<<<
24209 * if old_pytypename == TREE_PYTYPE_NAME:
24210 * if not cetree.hasChild(c_node):
24212 __pyx_t_2 = (__pyx_v_old_pytypename != Py_None);
24213 __pyx_t_3 = (__pyx_t_2 != 0);
24216 /* "lxml/objectify.pyx":1622
24217 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24218 * if old_pytypename is not None:
24219 * if old_pytypename == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
24220 * if not cetree.hasChild(c_node):
24221 * # only case where we should keep it,
24223 __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)
24226 /* "lxml/objectify.pyx":1623
24227 * if old_pytypename is not None:
24228 * if old_pytypename == TREE_PYTYPE_NAME:
24229 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24230 * # only case where we should keep it,
24231 * # everything else is clear enough
24233 __pyx_t_3 = ((!(hasChild(__pyx_v_c_node) != 0)) != 0);
24236 /* "lxml/objectify.pyx":1626
24237 * # only case where we should keep it,
24238 * # everything else is clear enough
24239 * pytype = TREE_PYTYPE # <<<<<<<<<<<<<<
24241 * if old_pytypename == 'none':
24243 __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_9objectify_TREE_PYTYPE));
24244 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_4lxml_9objectify_TREE_PYTYPE);
24246 /* "lxml/objectify.pyx":1623
24247 * if old_pytypename is not None:
24248 * if old_pytypename == TREE_PYTYPE_NAME:
24249 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24250 * # only case where we should keep it,
24251 * # everything else is clear enough
24255 /* "lxml/objectify.pyx":1622
24256 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24257 * if old_pytypename is not None:
24258 * if old_pytypename == TREE_PYTYPE_NAME: # <<<<<<<<<<<<<<
24259 * if not cetree.hasChild(c_node):
24260 * # only case where we should keep it,
24265 /* "lxml/objectify.pyx":1628
24266 * pytype = TREE_PYTYPE
24268 * if old_pytypename == 'none': # <<<<<<<<<<<<<<
24269 * # transition from lxml 1.x
24270 * old_pytypename = "NoneType"
24273 __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)
24276 /* "lxml/objectify.pyx":1630
24277 * if old_pytypename == 'none':
24278 * # transition from lxml 1.x
24279 * old_pytypename = "NoneType" # <<<<<<<<<<<<<<
24280 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24281 * if pytype is not None and pytype is not StrType:
24283 __Pyx_INCREF(__pyx_n_s_NoneType);
24284 __Pyx_DECREF_SET(__pyx_v_old_pytypename, __pyx_n_s_NoneType);
24286 /* "lxml/objectify.pyx":1628
24287 * pytype = TREE_PYTYPE
24289 * if old_pytypename == 'none': # <<<<<<<<<<<<<<
24290 * # transition from lxml 1.x
24291 * old_pytypename = "NoneType"
24295 /* "lxml/objectify.pyx":1631
24296 * # transition from lxml 1.x
24297 * old_pytypename = "NoneType"
24298 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename) # <<<<<<<<<<<<<<
24299 * if pytype is not None and pytype is not StrType:
24300 * # StrType does not have a typecheck but is the
24302 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
24303 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
24304 __PYX_ERR(0, 1631, __pyx_L1_error)
24306 __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)
24307 __Pyx_GOTREF(__pyx_t_6);
24308 __pyx_t_1 = __pyx_t_6;
24309 __Pyx_INCREF(__pyx_t_1);
24310 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24311 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
24314 /* "lxml/objectify.pyx":1632
24315 * old_pytypename = "NoneType"
24316 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24317 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24318 * # StrType does not have a typecheck but is the
24319 * # default anyway, so just accept it if given as
24321 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24322 __pyx_t_4 = (__pyx_t_2 != 0);
24325 __pyx_t_3 = __pyx_t_4;
24326 goto __pyx_L25_bool_binop_done;
24328 __pyx_t_4 = (__pyx_v_pytype != __pyx_v_StrType);
24329 __pyx_t_2 = (__pyx_t_4 != 0);
24330 __pyx_t_3 = __pyx_t_2;
24331 __pyx_L25_bool_binop_done:;
24334 /* "lxml/objectify.pyx":1636
24335 * # default anyway, so just accept it if given as
24336 * # type information
24337 * pytype = _check_type(c_node, pytype) # <<<<<<<<<<<<<<
24339 * if pytype is None:
24341 __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)
24342 __Pyx_GOTREF(__pyx_t_1);
24343 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_1));
24346 /* "lxml/objectify.pyx":1632
24347 * old_pytypename = "NoneType"
24348 * pytype = <PyType>_PYTYPE_DICT.get(old_pytypename)
24349 * if pytype is not None and pytype is not StrType: # <<<<<<<<<<<<<<
24350 * # StrType does not have a typecheck but is the
24351 * # default anyway, so just accept it if given as
24357 /* "lxml/objectify.pyx":1621
24358 * old_pytypename = cetree.attributeValueFromNsName(
24359 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
24360 * if old_pytypename is not None: # <<<<<<<<<<<<<<
24361 * if old_pytypename == TREE_PYTYPE_NAME:
24362 * if not cetree.hasChild(c_node):
24366 /* "lxml/objectify.pyx":1617
24369 * if pytype is None and not ignore_pytype: # <<<<<<<<<<<<<<
24370 * # check that old pytype value is valid
24371 * old_pytypename = cetree.attributeValueFromNsName(
24375 /* "lxml/objectify.pyx":1638
24376 * pytype = _check_type(c_node, pytype)
24378 * if pytype is None: # <<<<<<<<<<<<<<
24379 * # try to guess type
24380 * if not cetree.hasChild(c_node):
24382 __pyx_t_3 = (((PyObject *)__pyx_v_pytype) == Py_None);
24383 __pyx_t_2 = (__pyx_t_3 != 0);
24386 /* "lxml/objectify.pyx":1640
24387 * if pytype is None:
24388 * # try to guess type
24389 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24390 * # element has no children => data class
24391 * pytype = _guessPyType(textOf(c_node), StrType)
24393 __pyx_t_2 = ((!(hasChild(__pyx_v_c_node) != 0)) != 0);
24396 /* "lxml/objectify.pyx":1642
24397 * if not cetree.hasChild(c_node):
24398 * # element has no children => data class
24399 * pytype = _guessPyType(textOf(c_node), StrType) # <<<<<<<<<<<<<<
24403 __pyx_t_1 = textOf(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error)
24404 __Pyx_GOTREF(__pyx_t_1);
24405 __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)
24406 __Pyx_GOTREF(__pyx_t_6);
24407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24408 __Pyx_DECREF_SET(__pyx_v_pytype, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
24411 /* "lxml/objectify.pyx":1640
24412 * if pytype is None:
24413 * # try to guess type
24414 * if not cetree.hasChild(c_node): # <<<<<<<<<<<<<<
24415 * # element has no children => data class
24416 * pytype = _guessPyType(textOf(c_node), StrType)
24421 /* "lxml/objectify.pyx":1644
24422 * pytype = _guessPyType(textOf(c_node), StrType)
24424 * istree = 1 # <<<<<<<<<<<<<<
24426 * if pytype is None:
24429 __pyx_v_istree = 1;
24433 /* "lxml/objectify.pyx":1638
24434 * pytype = _check_type(c_node, pytype)
24436 * if pytype is None: # <<<<<<<<<<<<<<
24437 * # try to guess type
24438 * if not cetree.hasChild(c_node):
24442 /* "lxml/objectify.pyx":1646
24445 * if pytype is None: # <<<<<<<<<<<<<<
24446 * # use default type for empty elements
24447 * if cetree.hasText(c_node):
24449 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) == Py_None);
24450 __pyx_t_3 = (__pyx_t_2 != 0);
24453 /* "lxml/objectify.pyx":1648
24454 * if pytype is None:
24455 * # use default type for empty elements
24456 * if cetree.hasText(c_node): # <<<<<<<<<<<<<<
24460 __pyx_t_3 = (hasText(__pyx_v_c_node) != 0);
24463 /* "lxml/objectify.pyx":1649
24464 * # use default type for empty elements
24465 * if cetree.hasText(c_node):
24466 * pytype = StrType # <<<<<<<<<<<<<<
24468 * pytype = empty_pytype
24470 __Pyx_INCREF(((PyObject *)__pyx_v_StrType));
24471 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_StrType);
24473 /* "lxml/objectify.pyx":1648
24474 * if pytype is None:
24475 * # use default type for empty elements
24476 * if cetree.hasText(c_node): # <<<<<<<<<<<<<<
24483 /* "lxml/objectify.pyx":1651
24486 * pytype = empty_pytype # <<<<<<<<<<<<<<
24487 * if typename is None:
24488 * typename = empty_type_name
24491 __Pyx_INCREF(((PyObject *)__pyx_v_empty_pytype));
24492 __Pyx_DECREF_SET(__pyx_v_pytype, __pyx_v_empty_pytype);
24494 /* "lxml/objectify.pyx":1652
24496 * pytype = empty_pytype
24497 * if typename is None: # <<<<<<<<<<<<<<
24498 * typename = empty_type_name
24501 __pyx_t_3 = (__pyx_v_typename == Py_None);
24502 __pyx_t_2 = (__pyx_t_3 != 0);
24505 /* "lxml/objectify.pyx":1653
24506 * pytype = empty_pytype
24507 * if typename is None:
24508 * typename = empty_type_name # <<<<<<<<<<<<<<
24510 * if pytype is not None:
24512 __Pyx_INCREF(__pyx_v_empty_type_name);
24513 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_v_empty_type_name);
24515 /* "lxml/objectify.pyx":1652
24517 * pytype = empty_pytype
24518 * if typename is None: # <<<<<<<<<<<<<<
24519 * typename = empty_type_name
24526 /* "lxml/objectify.pyx":1646
24529 * if pytype is None: # <<<<<<<<<<<<<<
24530 * # use default type for empty elements
24531 * if cetree.hasText(c_node):
24535 /* "lxml/objectify.pyx":1655
24536 * typename = empty_type_name
24538 * if pytype is not None: # <<<<<<<<<<<<<<
24539 * if typename is None:
24542 __pyx_t_2 = (((PyObject *)__pyx_v_pytype) != Py_None);
24543 __pyx_t_3 = (__pyx_t_2 != 0);
24546 /* "lxml/objectify.pyx":1656
24548 * if pytype is not None:
24549 * if typename is None: # <<<<<<<<<<<<<<
24551 * if pytype._schema_types:
24553 __pyx_t_3 = (__pyx_v_typename == Py_None);
24554 __pyx_t_2 = (__pyx_t_3 != 0);
24557 /* "lxml/objectify.pyx":1657
24558 * if pytype is not None:
24559 * if typename is None:
24560 * if not istree: # <<<<<<<<<<<<<<
24561 * if pytype._schema_types:
24562 * # pytype->xsi:type is a 1:n mapping
24564 __pyx_t_2 = ((!(__pyx_v_istree != 0)) != 0);
24567 /* "lxml/objectify.pyx":1658
24568 * if typename is None:
24570 * if pytype._schema_types: # <<<<<<<<<<<<<<
24571 * # pytype->xsi:type is a 1:n mapping
24572 * # simply take the first
24574 __pyx_t_2 = (__pyx_v_pytype->_schema_types != Py_None)&&(PyList_GET_SIZE(__pyx_v_pytype->_schema_types) != 0);
24577 /* "lxml/objectify.pyx":1661
24578 * # pytype->xsi:type is a 1:n mapping
24579 * # simply take the first
24580 * typename = pytype._schema_types[0] # <<<<<<<<<<<<<<
24581 * elif typename not in pytype._schema_types:
24582 * typename = pytype._schema_types[0]
24584 if (unlikely(__pyx_v_pytype->_schema_types == Py_None)) {
24585 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24586 __PYX_ERR(0, 1661, __pyx_L1_error)
24588 __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)
24589 __Pyx_GOTREF(__pyx_t_6);
24590 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24593 /* "lxml/objectify.pyx":1658
24594 * if typename is None:
24596 * if pytype._schema_types: # <<<<<<<<<<<<<<
24597 * # pytype->xsi:type is a 1:n mapping
24598 * # simply take the first
24602 /* "lxml/objectify.pyx":1657
24603 * if pytype is not None:
24604 * if typename is None:
24605 * if not istree: # <<<<<<<<<<<<<<
24606 * if pytype._schema_types:
24607 * # pytype->xsi:type is a 1:n mapping
24611 /* "lxml/objectify.pyx":1656
24613 * if pytype is not None:
24614 * if typename is None: # <<<<<<<<<<<<<<
24616 * if pytype._schema_types:
24621 /* "lxml/objectify.pyx":1662
24622 * # simply take the first
24623 * typename = pytype._schema_types[0]
24624 * elif typename not in pytype._schema_types: # <<<<<<<<<<<<<<
24625 * typename = pytype._schema_types[0]
24628 __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)
24629 __pyx_t_3 = (__pyx_t_2 != 0);
24632 /* "lxml/objectify.pyx":1663
24633 * typename = pytype._schema_types[0]
24634 * elif typename not in pytype._schema_types:
24635 * typename = pytype._schema_types[0] # <<<<<<<<<<<<<<
24639 if (unlikely(__pyx_v_pytype->_schema_types == Py_None)) {
24640 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
24641 __PYX_ERR(0, 1663, __pyx_L1_error)
24643 __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)
24644 __Pyx_GOTREF(__pyx_t_6);
24645 __Pyx_DECREF_SET(__pyx_v_typename, __pyx_t_6);
24648 /* "lxml/objectify.pyx":1662
24649 * # simply take the first
24650 * typename = pytype._schema_types[0]
24651 * elif typename not in pytype._schema_types: # <<<<<<<<<<<<<<
24652 * typename = pytype._schema_types[0]
24658 /* "lxml/objectify.pyx":1655
24659 * typename = empty_type_name
24661 * if pytype is not None: # <<<<<<<<<<<<<<
24662 * if typename is None:
24667 /* "lxml/objectify.pyx":1665
24668 * typename = pytype._schema_types[0]
24670 * if annotate_xsi: # <<<<<<<<<<<<<<
24671 * if typename is None or istree:
24672 * cetree.delAttributeFromNsName(
24674 __pyx_t_3 = (__pyx_v_annotate_xsi != 0);
24677 /* "lxml/objectify.pyx":1666
24680 * if typename is None or istree: # <<<<<<<<<<<<<<
24681 * cetree.delAttributeFromNsName(
24682 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24684 __pyx_t_2 = (__pyx_v_typename == Py_None);
24685 __pyx_t_4 = (__pyx_t_2 != 0);
24688 __pyx_t_3 = __pyx_t_4;
24689 goto __pyx_L38_bool_binop_done;
24691 __pyx_t_4 = (__pyx_v_istree != 0);
24692 __pyx_t_3 = __pyx_t_4;
24693 __pyx_L38_bool_binop_done:;
24696 /* "lxml/objectify.pyx":1667
24698 * if typename is None or istree:
24699 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
24700 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24703 (void)(delAttributeFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS, ((unsigned char *)((unsigned char *)((char const *)"type")))));
24705 /* "lxml/objectify.pyx":1666
24708 * if typename is None or istree: # <<<<<<<<<<<<<<
24709 * cetree.delAttributeFromNsName(
24710 * c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>"type")
24715 /* "lxml/objectify.pyx":1671
24717 * # update or create attribute
24718 * typename_utf8 = cetree.utf8(typename) # <<<<<<<<<<<<<<
24719 * c_ns = cetree.findOrBuildNodeNsPrefix(
24720 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24723 __pyx_t_6 = utf8(__pyx_v_typename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1671, __pyx_L1_error)
24724 __Pyx_GOTREF(__pyx_t_6);
24725 __pyx_v_typename_utf8 = __pyx_t_6;
24728 /* "lxml/objectify.pyx":1672
24729 * # update or create attribute
24730 * typename_utf8 = cetree.utf8(typename)
24731 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
24732 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24733 * if c_ns is not NULL:
24735 __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"))));
24737 /* "lxml/objectify.pyx":1674
24738 * c_ns = cetree.findOrBuildNodeNsPrefix(
24739 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24740 * if c_ns is not NULL: # <<<<<<<<<<<<<<
24741 * if b':' in typename_utf8:
24742 * prefix, name = typename_utf8.split(b':', 1)
24744 __pyx_t_3 = ((__pyx_v_c_ns != NULL) != 0);
24747 /* "lxml/objectify.pyx":1675
24748 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24749 * if c_ns is not NULL:
24750 * if b':' in typename_utf8: # <<<<<<<<<<<<<<
24751 * prefix, name = typename_utf8.split(b':', 1)
24752 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24754 __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)
24755 __pyx_t_4 = (__pyx_t_3 != 0);
24758 /* "lxml/objectify.pyx":1676
24759 * if c_ns is not NULL:
24760 * if b':' in typename_utf8:
24761 * prefix, name = typename_utf8.split(b':', 1) # <<<<<<<<<<<<<<
24762 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24763 * typename_utf8 = name
24765 __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)
24766 __Pyx_GOTREF(__pyx_t_6);
24767 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
24768 PyObject* sequence = __pyx_t_6;
24769 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24770 if (unlikely(size != 2)) {
24771 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
24772 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24773 __PYX_ERR(0, 1676, __pyx_L1_error)
24775 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24776 if (likely(PyTuple_CheckExact(sequence))) {
24777 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
24778 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
24780 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
24781 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
24783 __Pyx_INCREF(__pyx_t_1);
24784 __Pyx_INCREF(__pyx_t_5);
24786 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
24787 __Pyx_GOTREF(__pyx_t_1);
24788 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1676, __pyx_L1_error)
24789 __Pyx_GOTREF(__pyx_t_5);
24791 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24793 Py_ssize_t index = -1;
24794 __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1676, __pyx_L1_error)
24795 __Pyx_GOTREF(__pyx_t_7);
24796 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24797 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
24798 index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L42_unpacking_failed;
24799 __Pyx_GOTREF(__pyx_t_1);
24800 index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L42_unpacking_failed;
24801 __Pyx_GOTREF(__pyx_t_5);
24802 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1676, __pyx_L1_error)
24804 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24805 goto __pyx_L43_unpacking_done;
24806 __pyx_L42_unpacking_failed:;
24807 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24809 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
24810 __PYX_ERR(0, 1676, __pyx_L1_error)
24811 __pyx_L43_unpacking_done:;
24813 __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_1);
24815 __pyx_v_name = __pyx_t_5;
24818 /* "lxml/objectify.pyx":1677
24819 * if b':' in typename_utf8:
24820 * prefix, name = typename_utf8.split(b':', 1)
24821 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0': # <<<<<<<<<<<<<<
24822 * typename_utf8 = name
24823 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24825 __pyx_t_3 = ((__pyx_v_c_ns->prefix == NULL) != 0);
24828 __pyx_t_4 = __pyx_t_3;
24829 goto __pyx_L45_bool_binop_done;
24831 __pyx_t_3 = (((__pyx_v_c_ns->prefix[0]) == '\x00') != 0);
24832 __pyx_t_4 = __pyx_t_3;
24833 __pyx_L45_bool_binop_done:;
24836 /* "lxml/objectify.pyx":1678
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:
24841 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24843 __Pyx_INCREF(__pyx_v_name);
24844 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_v_name);
24846 /* "lxml/objectify.pyx":1677
24847 * if b':' in typename_utf8:
24848 * prefix, name = typename_utf8.split(b':', 1)
24849 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0': # <<<<<<<<<<<<<<
24850 * typename_utf8 = name
24851 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24856 /* "lxml/objectify.pyx":1679
24857 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24858 * typename_utf8 = name
24859 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0: # <<<<<<<<<<<<<<
24860 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24861 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24863 __pyx_t_4 = ((xmlStrcmp((const xmlChar*)PyBytes_AS_STRING(__pyx_v_prefix), __pyx_v_c_ns->prefix) != 0) != 0);
24866 /* "lxml/objectify.pyx":1680
24867 * typename_utf8 = name
24868 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24869 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name # <<<<<<<<<<<<<<
24870 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24871 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24873 __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)
24874 __Pyx_GOTREF(__pyx_t_6);
24875 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1680, __pyx_L1_error)
24876 __Pyx_GOTREF(__pyx_t_5);
24877 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24878 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1680, __pyx_L1_error)
24879 __Pyx_GOTREF(__pyx_t_6);
24880 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24881 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_t_6);
24884 /* "lxml/objectify.pyx":1679
24885 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24886 * typename_utf8 = name
24887 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0: # <<<<<<<<<<<<<<
24888 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24889 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24894 /* "lxml/objectify.pyx":1675
24895 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24896 * if c_ns is not NULL:
24897 * if b':' in typename_utf8: # <<<<<<<<<<<<<<
24898 * prefix, name = typename_utf8.split(b':', 1)
24899 * if c_ns.prefix is NULL or c_ns.prefix[0] == c'\0':
24904 /* "lxml/objectify.pyx":1681
24905 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24906 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24907 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0': # <<<<<<<<<<<<<<
24908 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24909 * c_ns = cetree.findOrBuildNodeNsPrefix(
24911 __pyx_t_3 = ((__pyx_v_c_ns->prefix != NULL) != 0);
24914 __pyx_t_4 = __pyx_t_3;
24915 goto __pyx_L47_bool_binop_done;
24917 __pyx_t_3 = (((__pyx_v_c_ns->prefix[0]) != '\x00') != 0);
24918 __pyx_t_4 = __pyx_t_3;
24919 __pyx_L47_bool_binop_done:;
24922 /* "lxml/objectify.pyx":1682
24923 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24924 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24925 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8 # <<<<<<<<<<<<<<
24926 * c_ns = cetree.findOrBuildNodeNsPrefix(
24927 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24929 __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)
24930 __Pyx_GOTREF(__pyx_t_6);
24931 __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_kp_b__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error)
24932 __Pyx_GOTREF(__pyx_t_5);
24933 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24934 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_v_typename_utf8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error)
24935 __Pyx_GOTREF(__pyx_t_6);
24936 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24937 __Pyx_DECREF_SET(__pyx_v_typename_utf8, __pyx_t_6);
24940 /* "lxml/objectify.pyx":1681
24941 * elif tree.xmlStrcmp(_xcstr(prefix), c_ns.prefix) != 0:
24942 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + name
24943 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0': # <<<<<<<<<<<<<<
24944 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24945 * c_ns = cetree.findOrBuildNodeNsPrefix(
24950 /* "lxml/objectify.pyx":1674
24951 * c_ns = cetree.findOrBuildNodeNsPrefix(
24952 * doc, c_node, _XML_SCHEMA_NS, <unsigned char*>'xsd')
24953 * if c_ns is not NULL: # <<<<<<<<<<<<<<
24954 * if b':' in typename_utf8:
24955 * prefix, name = typename_utf8.split(b':', 1)
24959 /* "lxml/objectify.pyx":1683
24960 * elif c_ns.prefix is not NULL and c_ns.prefix[0] != c'\0':
24961 * typename_utf8 = (<unsigned char*>c_ns.prefix) + b':' + typename_utf8
24962 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
24963 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24964 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
24966 __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"))));
24968 /* "lxml/objectify.pyx":1685
24969 * c_ns = cetree.findOrBuildNodeNsPrefix(
24970 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
24971 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8)) # <<<<<<<<<<<<<<
24973 * if annotate_pytype:
24975 (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)));
24979 /* "lxml/objectify.pyx":1665
24980 * typename = pytype._schema_types[0]
24982 * if annotate_xsi: # <<<<<<<<<<<<<<
24983 * if typename is None or istree:
24984 * cetree.delAttributeFromNsName(
24988 /* "lxml/objectify.pyx":1687
24989 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
24991 * if annotate_pytype: # <<<<<<<<<<<<<<
24992 * if pytype is None:
24993 * # delete attribute if it exists
24995 __pyx_t_4 = (__pyx_v_annotate_pytype != 0);
24998 /* "lxml/objectify.pyx":1688
25000 * if annotate_pytype:
25001 * if pytype is None: # <<<<<<<<<<<<<<
25002 * # delete attribute if it exists
25003 * cetree.delAttributeFromNsName(
25005 __pyx_t_4 = (((PyObject *)__pyx_v_pytype) == Py_None);
25006 __pyx_t_3 = (__pyx_t_4 != 0);
25009 /* "lxml/objectify.pyx":1690
25010 * if pytype is None:
25011 * # delete attribute if it exists
25012 * cetree.delAttributeFromNsName( # <<<<<<<<<<<<<<
25013 * c_node, _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
25016 (void)(delAttributeFromNsName(__pyx_v_c_node, __pyx_v_4lxml_9objectify__PYTYPE_NAMESPACE, __pyx_v_4lxml_9objectify__PYTYPE_ATTRIBUTE_NAME));
25018 /* "lxml/objectify.pyx":1688
25020 * if annotate_pytype:
25021 * if pytype is None: # <<<<<<<<<<<<<<
25022 * # delete attribute if it exists
25023 * cetree.delAttributeFromNsName(
25028 /* "lxml/objectify.pyx":1694
25030 * # update or create attribute
25031 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
25032 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25033 * pytype_name = cetree.utf8(pytype.name)
25037 /* "lxml/objectify.pyx":1695
25038 * # update or create attribute
25039 * c_ns = cetree.findOrBuildNodeNsPrefix(
25040 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py') # <<<<<<<<<<<<<<
25041 * pytype_name = cetree.utf8(pytype.name)
25042 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25044 __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"))));
25046 /* "lxml/objectify.pyx":1696
25047 * c_ns = cetree.findOrBuildNodeNsPrefix(
25048 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25049 * pytype_name = cetree.utf8(pytype.name) # <<<<<<<<<<<<<<
25050 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25051 * _xcstr(pytype_name))
25053 __pyx_t_6 = __pyx_v_pytype->name;
25054 __Pyx_INCREF(__pyx_t_6);
25055 __pyx_t_5 = utf8(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1696, __pyx_L1_error)
25056 __Pyx_GOTREF(__pyx_t_5);
25057 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25058 __pyx_v_pytype_name = ((PyObject*)__pyx_t_5);
25061 /* "lxml/objectify.pyx":1697
25062 * doc, c_node, _PYTYPE_NAMESPACE, <unsigned char*>'py')
25063 * pytype_name = cetree.utf8(pytype.name)
25064 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME, # <<<<<<<<<<<<<<
25065 * _xcstr(pytype_name))
25066 * if pytype is NoneType:
25068 (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)));
25070 /* "lxml/objectify.pyx":1699
25071 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25072 * _xcstr(pytype_name))
25073 * if pytype is NoneType: # <<<<<<<<<<<<<<
25074 * c_ns = cetree.findOrBuildNodeNsPrefix(
25075 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25077 __pyx_t_3 = (__pyx_v_pytype == __pyx_v_NoneType);
25078 __pyx_t_4 = (__pyx_t_3 != 0);
25081 /* "lxml/objectify.pyx":1700
25082 * _xcstr(pytype_name))
25083 * if pytype is NoneType:
25084 * c_ns = cetree.findOrBuildNodeNsPrefix( # <<<<<<<<<<<<<<
25085 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25086 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true")
25088 __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"))));
25090 /* "lxml/objectify.pyx":1702
25091 * c_ns = cetree.findOrBuildNodeNsPrefix(
25092 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25093 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true") # <<<<<<<<<<<<<<
25097 (void)(xmlSetNsProp(__pyx_v_c_node, __pyx_v_c_ns, ((unsigned char *)((unsigned char *)((char const *)"nil"))), ((unsigned char *)((unsigned char *)((char const *)"true")))));
25099 /* "lxml/objectify.pyx":1699
25100 * tree.xmlSetNsProp(c_node, c_ns, _PYTYPE_ATTRIBUTE_NAME,
25101 * _xcstr(pytype_name))
25102 * if pytype is NoneType: # <<<<<<<<<<<<<<
25103 * c_ns = cetree.findOrBuildNodeNsPrefix(
25104 * doc, c_node, _XML_SCHEMA_INSTANCE_NS, <unsigned char*>'xsi')
25110 /* "lxml/objectify.pyx":1687
25111 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"type", _xcstr(typename_utf8))
25113 * if annotate_pytype: # <<<<<<<<<<<<<<
25114 * if pytype is None:
25115 * # delete attribute if it exists
25119 /* "lxml/objectify.pyx":1704
25120 * tree.xmlSetNsProp(c_node, c_ns, <unsigned char*>"nil", <unsigned char*>"true")
25122 * return 0 # <<<<<<<<<<<<<<
25124 * cdef object _strip_attributes = etree.strip_attributes
25129 /* "lxml/objectify.pyx":1585
25130 * tree.END_FOR_EACH_ELEMENT_FROM(c_node)
25132 * cdef int _annotate_element(tree.xmlNode* c_node, _Document doc, # <<<<<<<<<<<<<<
25133 * bint annotate_xsi, bint annotate_pytype,
25134 * bint ignore_xsi, bint ignore_pytype,
25137 /* function exit code */
25139 __Pyx_XDECREF(__pyx_t_1);
25140 __Pyx_XDECREF(__pyx_t_5);
25141 __Pyx_XDECREF(__pyx_t_6);
25142 __Pyx_XDECREF(__pyx_t_7);
25143 __Pyx_AddTraceback("lxml.objectify._annotate_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
25146 __Pyx_XDECREF((PyObject *)__pyx_v_pytype);
25147 __Pyx_XDECREF(__pyx_v_typename);
25148 __Pyx_XDECREF(__pyx_v_prefix);
25149 __Pyx_XDECREF(__pyx_v_old_pytypename);
25150 __Pyx_XDECREF(__pyx_v_typename_utf8);
25151 __Pyx_XDECREF(__pyx_v_name);
25152 __Pyx_XDECREF(__pyx_v_pytype_name);
25153 __Pyx_RefNannyFinishContext();
25157 /* "lxml/objectify.pyx":1709
25158 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25160 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25161 * bint xsi_nil=False, bint cleanup_namespaces=False):
25162 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25165 /* Python wrapper */
25166 static PyObject *__pyx_pw_4lxml_9objectify_27deannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25167 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 ";
25168 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};
25169 static PyObject *__pyx_pw_4lxml_9objectify_27deannotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25170 PyObject *__pyx_v_element_or_tree = 0;
25171 int __pyx_v_pytype;
25173 int __pyx_v_xsi_nil;
25174 int __pyx_v_cleanup_namespaces;
25175 int __pyx_lineno = 0;
25176 const char *__pyx_filename = NULL;
25177 int __pyx_clineno = 0;
25178 PyObject *__pyx_r = 0;
25179 __Pyx_RefNannyDeclarations
25180 __Pyx_RefNannySetupContext("deannotate (wrapper)", 0);
25182 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};
25183 PyObject* values[5] = {0,0,0,0,0};
25184 if (unlikely(__pyx_kwds)) {
25185 Py_ssize_t kw_args;
25186 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25187 switch (pos_args) {
25188 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25189 CYTHON_FALLTHROUGH;
25191 default: goto __pyx_L5_argtuple_error;
25193 kw_args = PyDict_Size(__pyx_kwds);
25194 switch (pos_args) {
25196 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_or_tree)) != 0)) kw_args--;
25197 else goto __pyx_L5_argtuple_error;
25199 if (kw_args > 0 && likely(kw_args <= 4)) {
25201 for (index = 1; index < 5 && kw_args > 0; index++) {
25202 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
25203 if (value) { values[index] = value; kw_args--; }
25206 if (unlikely(kw_args > 0)) {
25207 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "deannotate") < 0)) __PYX_ERR(0, 1709, __pyx_L3_error)
25209 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
25210 goto __pyx_L5_argtuple_error;
25212 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25214 __pyx_v_element_or_tree = values[0];
25216 __pyx_v_pytype = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pytype == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
25218 __pyx_v_pytype = ((int)((int)1));
25221 __pyx_v_xsi = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_xsi == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1709, __pyx_L3_error)
25223 __pyx_v_xsi = ((int)((int)1));
25226 __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)
25229 /* "lxml/objectify.pyx":1710
25231 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
25232 * bint xsi_nil=False, bint cleanup_namespaces=False): # <<<<<<<<<<<<<<
25233 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25236 __pyx_v_xsi_nil = ((int)((int)0));
25239 __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)
25241 __pyx_v_cleanup_namespaces = ((int)((int)0));
25244 goto __pyx_L4_argument_unpacking_done;
25245 __pyx_L5_argtuple_error:;
25246 __Pyx_RaiseArgtupleInvalid("deannotate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1709, __pyx_L3_error)
25248 __Pyx_AddTraceback("lxml.objectify.deannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
25249 __Pyx_RefNannyFinishContext();
25251 __pyx_L4_argument_unpacking_done:;
25252 __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);
25254 /* "lxml/objectify.pyx":1709
25255 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25257 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25258 * bint xsi_nil=False, bint cleanup_namespaces=False):
25259 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25262 /* function exit code */
25263 __Pyx_RefNannyFinishContext();
25267 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) {
25268 PyObject *__pyx_v_attribute_names = 0;
25269 PyObject *__pyx_r = NULL;
25270 __Pyx_RefNannyDeclarations
25271 PyObject *__pyx_t_1 = NULL;
25274 PyObject *__pyx_t_4 = NULL;
25275 PyObject *__pyx_t_5 = NULL;
25276 int __pyx_lineno = 0;
25277 const char *__pyx_filename = NULL;
25278 int __pyx_clineno = 0;
25279 __Pyx_RefNannySetupContext("deannotate", 0);
25281 /* "lxml/objectify.pyx":1726
25282 * the tree, pass the option ``cleanup_namespaces=True``.
25284 * cdef list attribute_names = [] # <<<<<<<<<<<<<<
25288 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __pyx_L1_error)
25289 __Pyx_GOTREF(__pyx_t_1);
25290 __pyx_v_attribute_names = ((PyObject*)__pyx_t_1);
25293 /* "lxml/objectify.pyx":1728
25294 * cdef list attribute_names = []
25296 * if pytype: # <<<<<<<<<<<<<<
25297 * attribute_names.append(PYTYPE_ATTRIBUTE)
25300 __pyx_t_2 = (__pyx_v_pytype != 0);
25303 /* "lxml/objectify.pyx":1729
25306 * attribute_names.append(PYTYPE_ATTRIBUTE) # <<<<<<<<<<<<<<
25308 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25310 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1729, __pyx_L1_error)
25311 __Pyx_GOTREF(__pyx_t_1);
25312 __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)
25313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25315 /* "lxml/objectify.pyx":1728
25316 * cdef list attribute_names = []
25318 * if pytype: # <<<<<<<<<<<<<<
25319 * attribute_names.append(PYTYPE_ATTRIBUTE)
25324 /* "lxml/objectify.pyx":1730
25326 * attribute_names.append(PYTYPE_ATTRIBUTE)
25327 * if xsi: # <<<<<<<<<<<<<<
25328 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25331 __pyx_t_2 = (__pyx_v_xsi != 0);
25334 /* "lxml/objectify.pyx":1731
25335 * attribute_names.append(PYTYPE_ATTRIBUTE)
25337 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR) # <<<<<<<<<<<<<<
25339 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25341 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR;
25342 __Pyx_INCREF(__pyx_t_1);
25343 __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)
25344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25346 /* "lxml/objectify.pyx":1730
25348 * attribute_names.append(PYTYPE_ATTRIBUTE)
25349 * if xsi: # <<<<<<<<<<<<<<
25350 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25355 /* "lxml/objectify.pyx":1732
25357 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25358 * if xsi_nil: # <<<<<<<<<<<<<<
25359 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25362 __pyx_t_2 = (__pyx_v_xsi_nil != 0);
25365 /* "lxml/objectify.pyx":1733
25366 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25368 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR) # <<<<<<<<<<<<<<
25370 * _strip_attributes(element_or_tree, *attribute_names)
25372 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR;
25373 __Pyx_INCREF(__pyx_t_1);
25374 __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)
25375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25377 /* "lxml/objectify.pyx":1732
25379 * attribute_names.append(XML_SCHEMA_INSTANCE_TYPE_ATTR)
25380 * if xsi_nil: # <<<<<<<<<<<<<<
25381 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25386 /* "lxml/objectify.pyx":1735
25387 * attribute_names.append(XML_SCHEMA_INSTANCE_NIL_ATTR)
25389 * _strip_attributes(element_or_tree, *attribute_names) # <<<<<<<<<<<<<<
25390 * if cleanup_namespaces:
25391 * _cleanup_namespaces(element_or_tree)
25393 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error)
25394 __Pyx_GOTREF(__pyx_t_1);
25395 __Pyx_INCREF(__pyx_v_element_or_tree);
25396 __Pyx_GIVEREF(__pyx_v_element_or_tree);
25397 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_element_or_tree);
25398 __pyx_t_4 = PySequence_Tuple(__pyx_v_attribute_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1735, __pyx_L1_error)
25399 __Pyx_GOTREF(__pyx_t_4);
25400 __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1735, __pyx_L1_error)
25401 __Pyx_GOTREF(__pyx_t_5);
25402 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25404 __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)
25405 __Pyx_GOTREF(__pyx_t_4);
25406 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25407 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25409 /* "lxml/objectify.pyx":1736
25411 * _strip_attributes(element_or_tree, *attribute_names)
25412 * if cleanup_namespaces: # <<<<<<<<<<<<<<
25413 * _cleanup_namespaces(element_or_tree)
25416 __pyx_t_2 = (__pyx_v_cleanup_namespaces != 0);
25419 /* "lxml/objectify.pyx":1737
25420 * _strip_attributes(element_or_tree, *attribute_names)
25421 * if cleanup_namespaces:
25422 * _cleanup_namespaces(element_or_tree) # <<<<<<<<<<<<<<
25424 * ################################################################################
25426 __Pyx_INCREF(__pyx_v_4lxml_9objectify__cleanup_namespaces);
25427 __pyx_t_5 = __pyx_v_4lxml_9objectify__cleanup_namespaces; __pyx_t_1 = NULL;
25428 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
25429 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
25430 if (likely(__pyx_t_1)) {
25431 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
25432 __Pyx_INCREF(__pyx_t_1);
25433 __Pyx_INCREF(function);
25434 __Pyx_DECREF_SET(__pyx_t_5, function);
25437 __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);
25438 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25439 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1737, __pyx_L1_error)
25440 __Pyx_GOTREF(__pyx_t_4);
25441 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25442 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25444 /* "lxml/objectify.pyx":1736
25446 * _strip_attributes(element_or_tree, *attribute_names)
25447 * if cleanup_namespaces: # <<<<<<<<<<<<<<
25448 * _cleanup_namespaces(element_or_tree)
25453 /* "lxml/objectify.pyx":1709
25454 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
25456 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
25457 * bint xsi_nil=False, bint cleanup_namespaces=False):
25458 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
25461 /* function exit code */
25462 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25465 __Pyx_XDECREF(__pyx_t_1);
25466 __Pyx_XDECREF(__pyx_t_4);
25467 __Pyx_XDECREF(__pyx_t_5);
25468 __Pyx_AddTraceback("lxml.objectify.deannotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
25471 __Pyx_XDECREF(__pyx_v_attribute_names);
25472 __Pyx_XGIVEREF(__pyx_r);
25473 __Pyx_RefNannyFinishContext();
25477 /* "lxml/objectify.pyx":1749
25478 * objectify_parser = __DEFAULT_PARSER
25480 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
25481 * u"""set_default_parser(new_parser = None)
25485 /* Python wrapper */
25486 static PyObject *__pyx_pw_4lxml_9objectify_29set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25487 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 ";
25488 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};
25489 static PyObject *__pyx_pw_4lxml_9objectify_29set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25490 PyObject *__pyx_v_new_parser = 0;
25491 int __pyx_lineno = 0;
25492 const char *__pyx_filename = NULL;
25493 int __pyx_clineno = 0;
25494 PyObject *__pyx_r = 0;
25495 __Pyx_RefNannyDeclarations
25496 __Pyx_RefNannySetupContext("set_default_parser (wrapper)", 0);
25498 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_new_parser,0};
25499 PyObject* values[1] = {0};
25500 values[0] = ((PyObject *)((PyObject *)Py_None));
25501 if (unlikely(__pyx_kwds)) {
25502 Py_ssize_t kw_args;
25503 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25504 switch (pos_args) {
25505 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25506 CYTHON_FALLTHROUGH;
25508 default: goto __pyx_L5_argtuple_error;
25510 kw_args = PyDict_Size(__pyx_kwds);
25511 switch (pos_args) {
25514 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_new_parser);
25515 if (value) { values[0] = value; kw_args--; }
25518 if (unlikely(kw_args > 0)) {
25519 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_default_parser") < 0)) __PYX_ERR(0, 1749, __pyx_L3_error)
25522 switch (PyTuple_GET_SIZE(__pyx_args)) {
25523 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25524 CYTHON_FALLTHROUGH;
25526 default: goto __pyx_L5_argtuple_error;
25529 __pyx_v_new_parser = values[0];
25531 goto __pyx_L4_argument_unpacking_done;
25532 __pyx_L5_argtuple_error:;
25533 __Pyx_RaiseArgtupleInvalid("set_default_parser", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1749, __pyx_L3_error)
25535 __Pyx_AddTraceback("lxml.objectify.set_default_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25536 __Pyx_RefNannyFinishContext();
25538 __pyx_L4_argument_unpacking_done:;
25539 __pyx_r = __pyx_pf_4lxml_9objectify_28set_default_parser(__pyx_self, __pyx_v_new_parser);
25541 /* function exit code */
25542 __Pyx_RefNannyFinishContext();
25546 static PyObject *__pyx_pf_4lxml_9objectify_28set_default_parser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_new_parser) {
25547 PyObject *__pyx_r = NULL;
25548 __Pyx_RefNannyDeclarations
25551 PyObject *__pyx_t_3 = NULL;
25552 int __pyx_lineno = 0;
25553 const char *__pyx_filename = NULL;
25554 int __pyx_clineno = 0;
25555 __Pyx_RefNannySetupContext("set_default_parser", 0);
25557 /* "lxml/objectify.pyx":1760
25559 * global objectify_parser
25560 * if new_parser is None: # <<<<<<<<<<<<<<
25561 * objectify_parser = __DEFAULT_PARSER
25562 * elif isinstance(new_parser, etree.XMLParser):
25564 __pyx_t_1 = (__pyx_v_new_parser == Py_None);
25565 __pyx_t_2 = (__pyx_t_1 != 0);
25568 /* "lxml/objectify.pyx":1761
25569 * global objectify_parser
25570 * if new_parser is None:
25571 * objectify_parser = __DEFAULT_PARSER # <<<<<<<<<<<<<<
25572 * elif isinstance(new_parser, etree.XMLParser):
25573 * objectify_parser = new_parser
25575 __Pyx_INCREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25576 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
25577 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25578 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
25580 /* "lxml/objectify.pyx":1760
25582 * global objectify_parser
25583 * if new_parser is None: # <<<<<<<<<<<<<<
25584 * objectify_parser = __DEFAULT_PARSER
25585 * elif isinstance(new_parser, etree.XMLParser):
25590 /* "lxml/objectify.pyx":1762
25591 * if new_parser is None:
25592 * objectify_parser = __DEFAULT_PARSER
25593 * elif isinstance(new_parser, etree.XMLParser): # <<<<<<<<<<<<<<
25594 * objectify_parser = new_parser
25597 __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)
25598 __Pyx_GOTREF(__pyx_t_3);
25599 __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)
25600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25601 __pyx_t_1 = (__pyx_t_2 != 0);
25602 if (likely(__pyx_t_1)) {
25604 /* "lxml/objectify.pyx":1763
25605 * objectify_parser = __DEFAULT_PARSER
25606 * elif isinstance(new_parser, etree.XMLParser):
25607 * objectify_parser = new_parser # <<<<<<<<<<<<<<
25609 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25611 __Pyx_INCREF(__pyx_v_new_parser);
25612 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
25613 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_new_parser);
25614 __Pyx_GIVEREF(__pyx_v_new_parser);
25616 /* "lxml/objectify.pyx":1762
25617 * if new_parser is None:
25618 * objectify_parser = __DEFAULT_PARSER
25619 * elif isinstance(new_parser, etree.XMLParser): # <<<<<<<<<<<<<<
25620 * objectify_parser = new_parser
25626 /* "lxml/objectify.pyx":1765
25627 * objectify_parser = new_parser
25629 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser" # <<<<<<<<<<<<<<
25631 * def makeparser(**kw):
25634 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_parser_must_inherit_from_lxml_et, 0, 0);
25635 __PYX_ERR(0, 1765, __pyx_L1_error)
25639 /* "lxml/objectify.pyx":1749
25640 * objectify_parser = __DEFAULT_PARSER
25642 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
25643 * u"""set_default_parser(new_parser = None)
25647 /* function exit code */
25648 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25651 __Pyx_XDECREF(__pyx_t_3);
25652 __Pyx_AddTraceback("lxml.objectify.set_default_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25655 __Pyx_XGIVEREF(__pyx_r);
25656 __Pyx_RefNannyFinishContext();
25660 /* "lxml/objectify.pyx":1767
25661 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25663 * def makeparser(**kw): # <<<<<<<<<<<<<<
25664 * u"""makeparser(remove_blank_text=True, **kw)
25668 /* Python wrapper */
25669 static PyObject *__pyx_pw_4lxml_9objectify_31makeparser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25670 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 ";
25671 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};
25672 static PyObject *__pyx_pw_4lxml_9objectify_31makeparser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25673 PyObject *__pyx_v_kw = 0;
25674 PyObject *__pyx_r = 0;
25675 __Pyx_RefNannyDeclarations
25676 __Pyx_RefNannySetupContext("makeparser (wrapper)", 0);
25677 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
25678 __Pyx_RaiseArgtupleInvalid("makeparser", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
25679 if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "makeparser", 1))) return NULL;
25680 __pyx_v_kw = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
25681 __Pyx_GOTREF(__pyx_v_kw);
25682 __pyx_r = __pyx_pf_4lxml_9objectify_30makeparser(__pyx_self, __pyx_v_kw);
25684 /* function exit code */
25685 __Pyx_XDECREF(__pyx_v_kw);
25686 __Pyx_RefNannyFinishContext();
25690 static PyObject *__pyx_pf_4lxml_9objectify_30makeparser(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_kw) {
25691 PyObject *__pyx_v_parser = NULL;
25692 PyObject *__pyx_r = NULL;
25693 __Pyx_RefNannyDeclarations
25696 PyObject *__pyx_t_3 = NULL;
25697 PyObject *__pyx_t_4 = NULL;
25698 PyObject *__pyx_t_5 = NULL;
25699 PyObject *__pyx_t_6 = NULL;
25700 int __pyx_lineno = 0;
25701 const char *__pyx_filename = NULL;
25702 int __pyx_clineno = 0;
25703 __Pyx_RefNannySetupContext("makeparser", 0);
25705 /* "lxml/objectify.pyx":1777
25706 * ``remove_blank_text`` boolean keyword option yourself.
25708 * if 'remove_blank_text' not in kw: # <<<<<<<<<<<<<<
25709 * kw['remove_blank_text'] = True
25710 * parser = etree.XMLParser(**kw)
25712 __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)
25713 __pyx_t_2 = (__pyx_t_1 != 0);
25716 /* "lxml/objectify.pyx":1778
25718 * if 'remove_blank_text' not in kw:
25719 * kw['remove_blank_text'] = True # <<<<<<<<<<<<<<
25720 * parser = etree.XMLParser(**kw)
25721 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25723 if (unlikely(PyDict_SetItem(__pyx_v_kw, __pyx_n_s_remove_blank_text, Py_True) < 0)) __PYX_ERR(0, 1778, __pyx_L1_error)
25725 /* "lxml/objectify.pyx":1777
25726 * ``remove_blank_text`` boolean keyword option yourself.
25728 * if 'remove_blank_text' not in kw: # <<<<<<<<<<<<<<
25729 * kw['remove_blank_text'] = True
25730 * parser = etree.XMLParser(**kw)
25734 /* "lxml/objectify.pyx":1779
25735 * if 'remove_blank_text' not in kw:
25736 * kw['remove_blank_text'] = True
25737 * parser = etree.XMLParser(**kw) # <<<<<<<<<<<<<<
25738 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25741 __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)
25742 __Pyx_GOTREF(__pyx_t_3);
25743 __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)
25744 __Pyx_GOTREF(__pyx_t_4);
25745 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25746 __pyx_v_parser = __pyx_t_4;
25749 /* "lxml/objectify.pyx":1780
25750 * kw['remove_blank_text'] = True
25751 * parser = etree.XMLParser(**kw)
25752 * parser.set_element_class_lookup( ObjectifyElementClassLookup() ) # <<<<<<<<<<<<<<
25756 __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)
25757 __Pyx_GOTREF(__pyx_t_3);
25758 __pyx_t_5 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1780, __pyx_L1_error)
25759 __Pyx_GOTREF(__pyx_t_5);
25761 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
25762 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
25763 if (likely(__pyx_t_6)) {
25764 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25765 __Pyx_INCREF(__pyx_t_6);
25766 __Pyx_INCREF(function);
25767 __Pyx_DECREF_SET(__pyx_t_3, function);
25770 __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);
25771 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25772 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25773 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1780, __pyx_L1_error)
25774 __Pyx_GOTREF(__pyx_t_4);
25775 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25776 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25778 /* "lxml/objectify.pyx":1781
25779 * parser = etree.XMLParser(**kw)
25780 * parser.set_element_class_lookup( ObjectifyElementClassLookup() )
25781 * return parser # <<<<<<<<<<<<<<
25783 * cdef _Element _makeElement(tag, text, attrib, nsmap):
25785 __Pyx_XDECREF(__pyx_r);
25786 __Pyx_INCREF(__pyx_v_parser);
25787 __pyx_r = __pyx_v_parser;
25790 /* "lxml/objectify.pyx":1767
25791 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
25793 * def makeparser(**kw): # <<<<<<<<<<<<<<
25794 * u"""makeparser(remove_blank_text=True, **kw)
25798 /* function exit code */
25800 __Pyx_XDECREF(__pyx_t_3);
25801 __Pyx_XDECREF(__pyx_t_4);
25802 __Pyx_XDECREF(__pyx_t_5);
25803 __Pyx_XDECREF(__pyx_t_6);
25804 __Pyx_AddTraceback("lxml.objectify.makeparser", __pyx_clineno, __pyx_lineno, __pyx_filename);
25807 __Pyx_XDECREF(__pyx_v_parser);
25808 __Pyx_XGIVEREF(__pyx_r);
25809 __Pyx_RefNannyFinishContext();
25813 /* "lxml/objectify.pyx":1783
25816 * cdef _Element _makeElement(tag, text, attrib, nsmap): # <<<<<<<<<<<<<<
25817 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap)
25821 static struct LxmlElement *__pyx_f_4lxml_9objectify__makeElement(PyObject *__pyx_v_tag, PyObject *__pyx_v_text, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
25822 struct LxmlElement *__pyx_r = NULL;
25823 __Pyx_RefNannyDeclarations
25824 PyObject *__pyx_t_1 = NULL;
25825 PyObject *__pyx_t_2 = NULL;
25826 int __pyx_lineno = 0;
25827 const char *__pyx_filename = NULL;
25828 int __pyx_clineno = 0;
25829 __Pyx_RefNannySetupContext("_makeElement", 0);
25831 /* "lxml/objectify.pyx":1784
25833 * cdef _Element _makeElement(tag, text, attrib, nsmap):
25834 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap) # <<<<<<<<<<<<<<
25836 * ################################################################################
25838 __Pyx_XDECREF(((PyObject *)__pyx_r));
25839 __pyx_t_1 = __pyx_v_4lxml_9objectify_objectify_parser;
25840 __Pyx_INCREF(__pyx_t_1);
25841 __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)
25842 __Pyx_GOTREF(__pyx_t_2);
25843 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25844 __pyx_r = ((struct LxmlElement *)__pyx_t_2);
25848 /* "lxml/objectify.pyx":1783
25851 * cdef _Element _makeElement(tag, text, attrib, nsmap): # <<<<<<<<<<<<<<
25852 * return cetree.makeElement(tag, None, objectify_parser, text, None, attrib, nsmap)
25856 /* function exit code */
25858 __Pyx_XDECREF(__pyx_t_1);
25859 __Pyx_XDECREF(__pyx_t_2);
25860 __Pyx_AddTraceback("lxml.objectify._makeElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
25863 __Pyx_XGIVEREF((PyObject *)__pyx_r);
25864 __Pyx_RefNannyFinishContext();
25868 /* "lxml/objectify.pyx":1794
25869 * SubElement = etree.SubElement
25871 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
25872 * u"""fromstring(xml, parser=None, base_url=None)
25876 /* Python wrapper */
25877 static PyObject *__pyx_pw_4lxml_9objectify_33fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25878 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 ";
25879 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};
25880 static PyObject *__pyx_pw_4lxml_9objectify_33fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25881 PyObject *__pyx_v_xml = 0;
25882 PyObject *__pyx_v_parser = 0;
25883 PyObject *__pyx_v_base_url = 0;
25884 int __pyx_lineno = 0;
25885 const char *__pyx_filename = NULL;
25886 int __pyx_clineno = 0;
25887 PyObject *__pyx_r = 0;
25888 __Pyx_RefNannyDeclarations
25889 __Pyx_RefNannySetupContext("fromstring (wrapper)", 0);
25891 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xml,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
25892 PyObject* values[3] = {0,0,0};
25893 values[1] = ((PyObject *)((PyObject *)Py_None));
25894 values[2] = ((PyObject *)((PyObject *)Py_None));
25895 if (unlikely(__pyx_kwds)) {
25896 Py_ssize_t kw_args;
25897 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25898 switch (pos_args) {
25899 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25900 CYTHON_FALLTHROUGH;
25901 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25902 CYTHON_FALLTHROUGH;
25904 default: goto __pyx_L5_argtuple_error;
25906 kw_args = PyDict_Size(__pyx_kwds);
25907 switch (pos_args) {
25909 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xml)) != 0)) kw_args--;
25910 else goto __pyx_L5_argtuple_error;
25911 CYTHON_FALLTHROUGH;
25914 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
25915 if (value) { values[1] = value; kw_args--; }
25918 if (kw_args == 1) {
25919 const Py_ssize_t index = 2;
25920 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
25921 if (value) { values[index] = value; kw_args--; }
25923 if (unlikely(kw_args > 0)) {
25924 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fromstring") < 0)) __PYX_ERR(0, 1794, __pyx_L3_error)
25927 switch (PyTuple_GET_SIZE(__pyx_args)) {
25928 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25929 CYTHON_FALLTHROUGH;
25930 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25932 default: goto __pyx_L5_argtuple_error;
25935 __pyx_v_xml = values[0];
25936 __pyx_v_parser = values[1];
25937 __pyx_v_base_url = values[2];
25939 goto __pyx_L4_argument_unpacking_done;
25940 __pyx_L5_argtuple_error:;
25941 __Pyx_RaiseArgtupleInvalid("fromstring", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1794, __pyx_L3_error)
25943 __Pyx_AddTraceback("lxml.objectify.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
25944 __Pyx_RefNannyFinishContext();
25946 __pyx_L4_argument_unpacking_done:;
25947 __pyx_r = __pyx_pf_4lxml_9objectify_32fromstring(__pyx_self, __pyx_v_xml, __pyx_v_parser, __pyx_v_base_url);
25949 /* function exit code */
25950 __Pyx_RefNannyFinishContext();
25954 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) {
25955 PyObject *__pyx_r = NULL;
25956 __Pyx_RefNannyDeclarations
25959 PyObject *__pyx_t_3 = NULL;
25960 PyObject *__pyx_t_4 = NULL;
25961 PyObject *__pyx_t_5 = NULL;
25962 int __pyx_lineno = 0;
25963 const char *__pyx_filename = NULL;
25964 int __pyx_clineno = 0;
25965 __Pyx_RefNannySetupContext("fromstring", 0);
25966 __Pyx_INCREF(__pyx_v_parser);
25968 /* "lxml/objectify.pyx":1806
25969 * (DTD, XInclude, ...).
25971 * if parser is None: # <<<<<<<<<<<<<<
25972 * parser = objectify_parser
25973 * return _fromstring(xml, parser, base_url=base_url)
25975 __pyx_t_1 = (__pyx_v_parser == Py_None);
25976 __pyx_t_2 = (__pyx_t_1 != 0);
25979 /* "lxml/objectify.pyx":1807
25981 * if parser is None:
25982 * parser = objectify_parser # <<<<<<<<<<<<<<
25983 * return _fromstring(xml, parser, base_url=base_url)
25986 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
25987 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
25989 /* "lxml/objectify.pyx":1806
25990 * (DTD, XInclude, ...).
25992 * if parser is None: # <<<<<<<<<<<<<<
25993 * parser = objectify_parser
25994 * return _fromstring(xml, parser, base_url=base_url)
25998 /* "lxml/objectify.pyx":1808
25999 * if parser is None:
26000 * parser = objectify_parser
26001 * return _fromstring(xml, parser, base_url=base_url) # <<<<<<<<<<<<<<
26003 * def XML(xml, parser=None, *, base_url=None):
26005 __Pyx_XDECREF(__pyx_r);
26006 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
26007 __Pyx_GOTREF(__pyx_t_3);
26008 __Pyx_INCREF(__pyx_v_xml);
26009 __Pyx_GIVEREF(__pyx_v_xml);
26010 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xml);
26011 __Pyx_INCREF(__pyx_v_parser);
26012 __Pyx_GIVEREF(__pyx_v_parser);
26013 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26014 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __pyx_L1_error)
26015 __Pyx_GOTREF(__pyx_t_4);
26016 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1808, __pyx_L1_error)
26017 __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)
26018 __Pyx_GOTREF(__pyx_t_5);
26019 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26020 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26021 __pyx_r = __pyx_t_5;
26025 /* "lxml/objectify.pyx":1794
26026 * SubElement = etree.SubElement
26028 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26029 * u"""fromstring(xml, parser=None, base_url=None)
26033 /* function exit code */
26035 __Pyx_XDECREF(__pyx_t_3);
26036 __Pyx_XDECREF(__pyx_t_4);
26037 __Pyx_XDECREF(__pyx_t_5);
26038 __Pyx_AddTraceback("lxml.objectify.fromstring", __pyx_clineno, __pyx_lineno, __pyx_filename);
26041 __Pyx_XDECREF(__pyx_v_parser);
26042 __Pyx_XGIVEREF(__pyx_r);
26043 __Pyx_RefNannyFinishContext();
26047 /* "lxml/objectify.pyx":1810
26048 * return _fromstring(xml, parser, base_url=base_url)
26050 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26051 * u"""XML(xml, parser=None, base_url=None)
26055 /* Python wrapper */
26056 static PyObject *__pyx_pw_4lxml_9objectify_35XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26057 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 ";
26058 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};
26059 static PyObject *__pyx_pw_4lxml_9objectify_35XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26060 PyObject *__pyx_v_xml = 0;
26061 PyObject *__pyx_v_parser = 0;
26062 PyObject *__pyx_v_base_url = 0;
26063 int __pyx_lineno = 0;
26064 const char *__pyx_filename = NULL;
26065 int __pyx_clineno = 0;
26066 PyObject *__pyx_r = 0;
26067 __Pyx_RefNannyDeclarations
26068 __Pyx_RefNannySetupContext("XML (wrapper)", 0);
26070 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xml,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
26071 PyObject* values[3] = {0,0,0};
26072 values[1] = ((PyObject *)((PyObject *)Py_None));
26073 values[2] = ((PyObject *)((PyObject *)Py_None));
26074 if (unlikely(__pyx_kwds)) {
26075 Py_ssize_t kw_args;
26076 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26077 switch (pos_args) {
26078 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26079 CYTHON_FALLTHROUGH;
26080 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26081 CYTHON_FALLTHROUGH;
26083 default: goto __pyx_L5_argtuple_error;
26085 kw_args = PyDict_Size(__pyx_kwds);
26086 switch (pos_args) {
26088 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xml)) != 0)) kw_args--;
26089 else goto __pyx_L5_argtuple_error;
26090 CYTHON_FALLTHROUGH;
26093 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
26094 if (value) { values[1] = value; kw_args--; }
26097 if (kw_args == 1) {
26098 const Py_ssize_t index = 2;
26099 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26100 if (value) { values[index] = value; kw_args--; }
26102 if (unlikely(kw_args > 0)) {
26103 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "XML") < 0)) __PYX_ERR(0, 1810, __pyx_L3_error)
26106 switch (PyTuple_GET_SIZE(__pyx_args)) {
26107 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26108 CYTHON_FALLTHROUGH;
26109 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26111 default: goto __pyx_L5_argtuple_error;
26114 __pyx_v_xml = values[0];
26115 __pyx_v_parser = values[1];
26116 __pyx_v_base_url = values[2];
26118 goto __pyx_L4_argument_unpacking_done;
26119 __pyx_L5_argtuple_error:;
26120 __Pyx_RaiseArgtupleInvalid("XML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1810, __pyx_L3_error)
26122 __Pyx_AddTraceback("lxml.objectify.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
26123 __Pyx_RefNannyFinishContext();
26125 __pyx_L4_argument_unpacking_done:;
26126 __pyx_r = __pyx_pf_4lxml_9objectify_34XML(__pyx_self, __pyx_v_xml, __pyx_v_parser, __pyx_v_base_url);
26128 /* function exit code */
26129 __Pyx_RefNannyFinishContext();
26133 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) {
26134 PyObject *__pyx_r = NULL;
26135 __Pyx_RefNannyDeclarations
26138 PyObject *__pyx_t_3 = NULL;
26139 PyObject *__pyx_t_4 = NULL;
26140 PyObject *__pyx_t_5 = NULL;
26141 int __pyx_lineno = 0;
26142 const char *__pyx_filename = NULL;
26143 int __pyx_clineno = 0;
26144 __Pyx_RefNannySetupContext("XML", 0);
26145 __Pyx_INCREF(__pyx_v_parser);
26147 /* "lxml/objectify.pyx":1822
26148 * (DTD, XInclude, ...).
26150 * if parser is None: # <<<<<<<<<<<<<<
26151 * parser = objectify_parser
26152 * return _fromstring(xml, parser, base_url=base_url)
26154 __pyx_t_1 = (__pyx_v_parser == Py_None);
26155 __pyx_t_2 = (__pyx_t_1 != 0);
26158 /* "lxml/objectify.pyx":1823
26160 * if parser is None:
26161 * parser = objectify_parser # <<<<<<<<<<<<<<
26162 * return _fromstring(xml, parser, base_url=base_url)
26165 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
26166 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
26168 /* "lxml/objectify.pyx":1822
26169 * (DTD, XInclude, ...).
26171 * if parser is None: # <<<<<<<<<<<<<<
26172 * parser = objectify_parser
26173 * return _fromstring(xml, parser, base_url=base_url)
26177 /* "lxml/objectify.pyx":1824
26178 * if parser is None:
26179 * parser = objectify_parser
26180 * return _fromstring(xml, parser, base_url=base_url) # <<<<<<<<<<<<<<
26182 * cdef object _parse
26184 __Pyx_XDECREF(__pyx_r);
26185 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1824, __pyx_L1_error)
26186 __Pyx_GOTREF(__pyx_t_3);
26187 __Pyx_INCREF(__pyx_v_xml);
26188 __Pyx_GIVEREF(__pyx_v_xml);
26189 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xml);
26190 __Pyx_INCREF(__pyx_v_parser);
26191 __Pyx_GIVEREF(__pyx_v_parser);
26192 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26193 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1824, __pyx_L1_error)
26194 __Pyx_GOTREF(__pyx_t_4);
26195 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1824, __pyx_L1_error)
26196 __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)
26197 __Pyx_GOTREF(__pyx_t_5);
26198 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26199 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26200 __pyx_r = __pyx_t_5;
26204 /* "lxml/objectify.pyx":1810
26205 * return _fromstring(xml, parser, base_url=base_url)
26207 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26208 * u"""XML(xml, parser=None, base_url=None)
26212 /* function exit code */
26214 __Pyx_XDECREF(__pyx_t_3);
26215 __Pyx_XDECREF(__pyx_t_4);
26216 __Pyx_XDECREF(__pyx_t_5);
26217 __Pyx_AddTraceback("lxml.objectify.XML", __pyx_clineno, __pyx_lineno, __pyx_filename);
26220 __Pyx_XDECREF(__pyx_v_parser);
26221 __Pyx_XGIVEREF(__pyx_r);
26222 __Pyx_RefNannyFinishContext();
26226 /* "lxml/objectify.pyx":1829
26227 * _parse = etree.parse
26229 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26230 * u"""parse(f, parser=None, base_url=None)
26234 /* Python wrapper */
26235 static PyObject *__pyx_pw_4lxml_9objectify_37parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26236 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 ";
26237 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};
26238 static PyObject *__pyx_pw_4lxml_9objectify_37parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26239 PyObject *__pyx_v_f = 0;
26240 PyObject *__pyx_v_parser = 0;
26241 PyObject *__pyx_v_base_url = 0;
26242 int __pyx_lineno = 0;
26243 const char *__pyx_filename = NULL;
26244 int __pyx_clineno = 0;
26245 PyObject *__pyx_r = 0;
26246 __Pyx_RefNannyDeclarations
26247 __Pyx_RefNannySetupContext("parse (wrapper)", 0);
26249 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_parser,&__pyx_n_s_base_url,0};
26250 PyObject* values[3] = {0,0,0};
26251 values[1] = ((PyObject *)((PyObject *)Py_None));
26252 values[2] = ((PyObject *)((PyObject *)Py_None));
26253 if (unlikely(__pyx_kwds)) {
26254 Py_ssize_t kw_args;
26255 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26256 switch (pos_args) {
26257 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26258 CYTHON_FALLTHROUGH;
26259 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26260 CYTHON_FALLTHROUGH;
26262 default: goto __pyx_L5_argtuple_error;
26264 kw_args = PyDict_Size(__pyx_kwds);
26265 switch (pos_args) {
26267 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
26268 else goto __pyx_L5_argtuple_error;
26269 CYTHON_FALLTHROUGH;
26272 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_parser);
26273 if (value) { values[1] = value; kw_args--; }
26276 if (kw_args == 1) {
26277 const Py_ssize_t index = 2;
26278 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26279 if (value) { values[index] = value; kw_args--; }
26281 if (unlikely(kw_args > 0)) {
26282 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parse") < 0)) __PYX_ERR(0, 1829, __pyx_L3_error)
26285 switch (PyTuple_GET_SIZE(__pyx_args)) {
26286 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26287 CYTHON_FALLTHROUGH;
26288 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26290 default: goto __pyx_L5_argtuple_error;
26293 __pyx_v_f = values[0];
26294 __pyx_v_parser = values[1];
26295 __pyx_v_base_url = values[2];
26297 goto __pyx_L4_argument_unpacking_done;
26298 __pyx_L5_argtuple_error:;
26299 __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1829, __pyx_L3_error)
26301 __Pyx_AddTraceback("lxml.objectify.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
26302 __Pyx_RefNannyFinishContext();
26304 __pyx_L4_argument_unpacking_done:;
26305 __pyx_r = __pyx_pf_4lxml_9objectify_36parse(__pyx_self, __pyx_v_f, __pyx_v_parser, __pyx_v_base_url);
26307 /* function exit code */
26308 __Pyx_RefNannyFinishContext();
26312 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) {
26313 PyObject *__pyx_r = NULL;
26314 __Pyx_RefNannyDeclarations
26317 PyObject *__pyx_t_3 = NULL;
26318 PyObject *__pyx_t_4 = NULL;
26319 PyObject *__pyx_t_5 = NULL;
26320 int __pyx_lineno = 0;
26321 const char *__pyx_filename = NULL;
26322 int __pyx_clineno = 0;
26323 __Pyx_RefNannySetupContext("parse", 0);
26324 __Pyx_INCREF(__pyx_v_parser);
26326 /* "lxml/objectify.pyx":1840
26327 * up external entities (DTD, XInclude, ...) with relative paths.
26329 * if parser is None: # <<<<<<<<<<<<<<
26330 * parser = objectify_parser
26331 * return _parse(f, parser, base_url=base_url)
26333 __pyx_t_1 = (__pyx_v_parser == Py_None);
26334 __pyx_t_2 = (__pyx_t_1 != 0);
26337 /* "lxml/objectify.pyx":1841
26339 * if parser is None:
26340 * parser = objectify_parser # <<<<<<<<<<<<<<
26341 * return _parse(f, parser, base_url=base_url)
26344 __Pyx_INCREF(__pyx_v_4lxml_9objectify_objectify_parser);
26345 __Pyx_DECREF_SET(__pyx_v_parser, __pyx_v_4lxml_9objectify_objectify_parser);
26347 /* "lxml/objectify.pyx":1840
26348 * up external entities (DTD, XInclude, ...) with relative paths.
26350 * if parser is None: # <<<<<<<<<<<<<<
26351 * parser = objectify_parser
26352 * return _parse(f, parser, base_url=base_url)
26356 /* "lxml/objectify.pyx":1842
26357 * if parser is None:
26358 * parser = objectify_parser
26359 * return _parse(f, parser, base_url=base_url) # <<<<<<<<<<<<<<
26361 * cdef dict _DEFAULT_NSMAP = {
26363 __Pyx_XDECREF(__pyx_r);
26364 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1842, __pyx_L1_error)
26365 __Pyx_GOTREF(__pyx_t_3);
26366 __Pyx_INCREF(__pyx_v_f);
26367 __Pyx_GIVEREF(__pyx_v_f);
26368 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
26369 __Pyx_INCREF(__pyx_v_parser);
26370 __Pyx_GIVEREF(__pyx_v_parser);
26371 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_parser);
26372 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1842, __pyx_L1_error)
26373 __Pyx_GOTREF(__pyx_t_4);
26374 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_base_url, __pyx_v_base_url) < 0) __PYX_ERR(0, 1842, __pyx_L1_error)
26375 __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)
26376 __Pyx_GOTREF(__pyx_t_5);
26377 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26379 __pyx_r = __pyx_t_5;
26383 /* "lxml/objectify.pyx":1829
26384 * _parse = etree.parse
26386 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
26387 * u"""parse(f, parser=None, base_url=None)
26391 /* function exit code */
26393 __Pyx_XDECREF(__pyx_t_3);
26394 __Pyx_XDECREF(__pyx_t_4);
26395 __Pyx_XDECREF(__pyx_t_5);
26396 __Pyx_AddTraceback("lxml.objectify.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
26399 __Pyx_XDECREF(__pyx_v_parser);
26400 __Pyx_XGIVEREF(__pyx_r);
26401 __Pyx_RefNannyFinishContext();
26405 /* "lxml/objectify.pyx":1852
26406 * E = ElementMaker()
26408 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
26409 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
26413 /* Python wrapper */
26414 static PyObject *__pyx_pw_4lxml_9objectify_39Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26415 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 ";
26416 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};
26417 static PyObject *__pyx_pw_4lxml_9objectify_39Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26418 PyObject *__pyx_v__tag = 0;
26419 PyObject *__pyx_v_attrib = 0;
26420 PyObject *__pyx_v_nsmap = 0;
26421 PyObject *__pyx_v__pytype = 0;
26422 PyObject *__pyx_v__attributes = 0;
26423 int __pyx_lineno = 0;
26424 const char *__pyx_filename = NULL;
26425 int __pyx_clineno = 0;
26426 PyObject *__pyx_r = 0;
26427 __Pyx_RefNannyDeclarations
26428 __Pyx_RefNannySetupContext("Element (wrapper)", 0);
26429 __pyx_v__attributes = PyDict_New(); if (unlikely(!__pyx_v__attributes)) return NULL;
26430 __Pyx_GOTREF(__pyx_v__attributes);
26432 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tag_2,&__pyx_n_s_attrib,&__pyx_n_s_nsmap,&__pyx_n_s_pytype_2,0};
26433 PyObject* values[4] = {0,0,0,0};
26434 values[1] = ((PyObject *)((PyObject *)Py_None));
26435 values[2] = ((PyObject *)((PyObject *)Py_None));
26436 values[3] = ((PyObject *)((PyObject *)Py_None));
26437 if (unlikely(__pyx_kwds)) {
26438 Py_ssize_t kw_args;
26439 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26440 switch (pos_args) {
26441 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26442 CYTHON_FALLTHROUGH;
26443 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26444 CYTHON_FALLTHROUGH;
26445 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26446 CYTHON_FALLTHROUGH;
26448 default: goto __pyx_L5_argtuple_error;
26450 kw_args = PyDict_Size(__pyx_kwds);
26451 switch (pos_args) {
26453 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tag_2)) != 0)) kw_args--;
26454 else goto __pyx_L5_argtuple_error;
26455 CYTHON_FALLTHROUGH;
26458 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrib);
26459 if (value) { values[1] = value; kw_args--; }
26461 CYTHON_FALLTHROUGH;
26464 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsmap);
26465 if (value) { values[2] = value; kw_args--; }
26468 if (kw_args == 1) {
26469 const Py_ssize_t index = 3;
26470 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26471 if (value) { values[index] = value; kw_args--; }
26473 if (unlikely(kw_args > 0)) {
26474 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__attributes, values, pos_args, "Element") < 0)) __PYX_ERR(0, 1852, __pyx_L3_error)
26477 switch (PyTuple_GET_SIZE(__pyx_args)) {
26478 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26479 CYTHON_FALLTHROUGH;
26480 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26481 CYTHON_FALLTHROUGH;
26482 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26484 default: goto __pyx_L5_argtuple_error;
26487 __pyx_v__tag = values[0];
26488 __pyx_v_attrib = values[1];
26489 __pyx_v_nsmap = values[2];
26490 __pyx_v__pytype = values[3];
26492 goto __pyx_L4_argument_unpacking_done;
26493 __pyx_L5_argtuple_error:;
26494 __Pyx_RaiseArgtupleInvalid("Element", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1852, __pyx_L3_error)
26496 __Pyx_DECREF(__pyx_v__attributes); __pyx_v__attributes = 0;
26497 __Pyx_AddTraceback("lxml.objectify.Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
26498 __Pyx_RefNannyFinishContext();
26500 __pyx_L4_argument_unpacking_done:;
26501 __pyx_r = __pyx_pf_4lxml_9objectify_38Element(__pyx_self, __pyx_v__tag, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__pytype, __pyx_v__attributes);
26503 /* function exit code */
26504 __Pyx_XDECREF(__pyx_v__attributes);
26505 __Pyx_RefNannyFinishContext();
26509 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) {
26510 PyObject *__pyx_r = NULL;
26511 __Pyx_RefNannyDeclarations
26514 PyObject *__pyx_t_3 = NULL;
26515 PyObject *__pyx_t_4 = NULL;
26516 PyObject *__pyx_t_5 = NULL;
26517 int __pyx_lineno = 0;
26518 const char *__pyx_filename = NULL;
26519 int __pyx_clineno = 0;
26520 __Pyx_RefNannySetupContext("Element", 0);
26521 __Pyx_INCREF(__pyx_v_attrib);
26522 __Pyx_INCREF(__pyx_v_nsmap);
26523 __Pyx_INCREF(__pyx_v__pytype);
26524 __Pyx_INCREF(__pyx_v__attributes);
26526 /* "lxml/objectify.pyx":1860
26527 * NOTE: requires parser based element class lookup activated in lxml.etree!
26529 * if attrib is not None: # <<<<<<<<<<<<<<
26531 * attrib = dict(attrib)
26533 __pyx_t_1 = (__pyx_v_attrib != Py_None);
26534 __pyx_t_2 = (__pyx_t_1 != 0);
26537 /* "lxml/objectify.pyx":1861
26539 * if attrib is not None:
26540 * if _attributes: # <<<<<<<<<<<<<<
26541 * attrib = dict(attrib)
26542 * attrib.update(_attributes)
26544 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1861, __pyx_L1_error)
26547 /* "lxml/objectify.pyx":1862
26548 * if attrib is not None:
26550 * attrib = dict(attrib) # <<<<<<<<<<<<<<
26551 * attrib.update(_attributes)
26552 * _attributes = attrib
26554 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_attrib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1862, __pyx_L1_error)
26555 __Pyx_GOTREF(__pyx_t_3);
26556 __Pyx_DECREF_SET(__pyx_v_attrib, __pyx_t_3);
26559 /* "lxml/objectify.pyx":1863
26561 * attrib = dict(attrib)
26562 * attrib.update(_attributes) # <<<<<<<<<<<<<<
26563 * _attributes = attrib
26564 * if _pytype is None:
26566 __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)
26567 __Pyx_GOTREF(__pyx_t_4);
26569 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
26570 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
26571 if (likely(__pyx_t_5)) {
26572 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
26573 __Pyx_INCREF(__pyx_t_5);
26574 __Pyx_INCREF(function);
26575 __Pyx_DECREF_SET(__pyx_t_4, function);
26578 __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);
26579 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26580 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error)
26581 __Pyx_GOTREF(__pyx_t_3);
26582 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26583 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26585 /* "lxml/objectify.pyx":1861
26587 * if attrib is not None:
26588 * if _attributes: # <<<<<<<<<<<<<<
26589 * attrib = dict(attrib)
26590 * attrib.update(_attributes)
26594 /* "lxml/objectify.pyx":1864
26595 * attrib = dict(attrib)
26596 * attrib.update(_attributes)
26597 * _attributes = attrib # <<<<<<<<<<<<<<
26598 * if _pytype is None:
26599 * _pytype = TREE_PYTYPE_NAME
26601 __Pyx_INCREF(__pyx_v_attrib);
26602 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_attrib);
26604 /* "lxml/objectify.pyx":1860
26605 * NOTE: requires parser based element class lookup activated in lxml.etree!
26607 * if attrib is not None: # <<<<<<<<<<<<<<
26609 * attrib = dict(attrib)
26613 /* "lxml/objectify.pyx":1865
26614 * attrib.update(_attributes)
26615 * _attributes = attrib
26616 * if _pytype is None: # <<<<<<<<<<<<<<
26617 * _pytype = TREE_PYTYPE_NAME
26618 * if nsmap is None:
26620 __pyx_t_2 = (__pyx_v__pytype == Py_None);
26621 __pyx_t_1 = (__pyx_t_2 != 0);
26624 /* "lxml/objectify.pyx":1866
26625 * _attributes = attrib
26626 * if _pytype is None:
26627 * _pytype = TREE_PYTYPE_NAME # <<<<<<<<<<<<<<
26628 * if nsmap is None:
26629 * nsmap = _DEFAULT_NSMAP
26631 __Pyx_INCREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
26632 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
26634 /* "lxml/objectify.pyx":1865
26635 * attrib.update(_attributes)
26636 * _attributes = attrib
26637 * if _pytype is None: # <<<<<<<<<<<<<<
26638 * _pytype = TREE_PYTYPE_NAME
26639 * if nsmap is None:
26643 /* "lxml/objectify.pyx":1867
26644 * if _pytype is None:
26645 * _pytype = TREE_PYTYPE_NAME
26646 * if nsmap is None: # <<<<<<<<<<<<<<
26647 * nsmap = _DEFAULT_NSMAP
26648 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26650 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
26651 __pyx_t_2 = (__pyx_t_1 != 0);
26654 /* "lxml/objectify.pyx":1868
26655 * _pytype = TREE_PYTYPE_NAME
26656 * if nsmap is None:
26657 * nsmap = _DEFAULT_NSMAP # <<<<<<<<<<<<<<
26658 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26659 * return _makeElement(_tag, None, _attributes, nsmap)
26661 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26662 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26664 /* "lxml/objectify.pyx":1867
26665 * if _pytype is None:
26666 * _pytype = TREE_PYTYPE_NAME
26667 * if nsmap is None: # <<<<<<<<<<<<<<
26668 * nsmap = _DEFAULT_NSMAP
26669 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26673 /* "lxml/objectify.pyx":1869
26674 * if nsmap is None:
26675 * nsmap = _DEFAULT_NSMAP
26676 * _attributes[PYTYPE_ATTRIBUTE] = _pytype # <<<<<<<<<<<<<<
26677 * return _makeElement(_tag, None, _attributes, nsmap)
26680 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __pyx_L1_error)
26681 __Pyx_GOTREF(__pyx_t_3);
26682 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_t_3, __pyx_v__pytype) < 0)) __PYX_ERR(0, 1869, __pyx_L1_error)
26683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26685 /* "lxml/objectify.pyx":1870
26686 * nsmap = _DEFAULT_NSMAP
26687 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
26688 * return _makeElement(_tag, None, _attributes, nsmap) # <<<<<<<<<<<<<<
26690 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None,
26692 __Pyx_XDECREF(__pyx_r);
26693 __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)
26694 __Pyx_GOTREF(__pyx_t_3);
26695 __pyx_r = __pyx_t_3;
26699 /* "lxml/objectify.pyx":1852
26700 * E = ElementMaker()
26702 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
26703 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
26707 /* function exit code */
26709 __Pyx_XDECREF(__pyx_t_3);
26710 __Pyx_XDECREF(__pyx_t_4);
26711 __Pyx_XDECREF(__pyx_t_5);
26712 __Pyx_AddTraceback("lxml.objectify.Element", __pyx_clineno, __pyx_lineno, __pyx_filename);
26715 __Pyx_XDECREF(__pyx_v__attributes);
26716 __Pyx_XDECREF(__pyx_v_attrib);
26717 __Pyx_XDECREF(__pyx_v_nsmap);
26718 __Pyx_XDECREF(__pyx_v__pytype);
26719 __Pyx_XGIVEREF(__pyx_r);
26720 __Pyx_RefNannyFinishContext();
26724 /* "lxml/objectify.pyx":1872
26725 * return _makeElement(_tag, None, _attributes, nsmap)
26727 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
26729 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
26732 /* Python wrapper */
26733 static PyObject *__pyx_pw_4lxml_9objectify_41DataElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26734 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 ";
26735 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};
26736 static PyObject *__pyx_pw_4lxml_9objectify_41DataElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26737 PyObject *__pyx_v__value = 0;
26738 PyObject *__pyx_v_attrib = 0;
26739 PyObject *__pyx_v_nsmap = 0;
26740 PyObject *__pyx_v__pytype = 0;
26741 PyObject *__pyx_v__xsi = 0;
26742 PyObject *__pyx_v__attributes = 0;
26743 int __pyx_lineno = 0;
26744 const char *__pyx_filename = NULL;
26745 int __pyx_clineno = 0;
26746 PyObject *__pyx_r = 0;
26747 __Pyx_RefNannyDeclarations
26748 __Pyx_RefNannySetupContext("DataElement (wrapper)", 0);
26749 __pyx_v__attributes = PyDict_New(); if (unlikely(!__pyx_v__attributes)) return NULL;
26750 __Pyx_GOTREF(__pyx_v__attributes);
26752 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};
26753 PyObject* values[5] = {0,0,0,0,0};
26754 values[1] = ((PyObject *)((PyObject *)Py_None));
26755 values[2] = ((PyObject *)((PyObject *)Py_None));
26756 values[3] = ((PyObject *)((PyObject *)Py_None));
26757 values[4] = ((PyObject *)((PyObject *)Py_None));
26758 if (unlikely(__pyx_kwds)) {
26759 Py_ssize_t kw_args;
26760 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26761 switch (pos_args) {
26762 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26763 CYTHON_FALLTHROUGH;
26764 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26765 CYTHON_FALLTHROUGH;
26766 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26767 CYTHON_FALLTHROUGH;
26769 default: goto __pyx_L5_argtuple_error;
26771 kw_args = PyDict_Size(__pyx_kwds);
26772 switch (pos_args) {
26774 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value_2)) != 0)) kw_args--;
26775 else goto __pyx_L5_argtuple_error;
26776 CYTHON_FALLTHROUGH;
26779 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrib);
26780 if (value) { values[1] = value; kw_args--; }
26782 CYTHON_FALLTHROUGH;
26785 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nsmap);
26786 if (value) { values[2] = value; kw_args--; }
26789 if (kw_args > 0 && (kw_args <= 2)) {
26791 for (index = 3; index < 5 && kw_args > 0; index++) {
26792 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
26793 if (value) { values[index] = value; kw_args--; }
26796 if (unlikely(kw_args > 0)) {
26797 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__attributes, values, pos_args, "DataElement") < 0)) __PYX_ERR(0, 1872, __pyx_L3_error)
26800 switch (PyTuple_GET_SIZE(__pyx_args)) {
26801 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26802 CYTHON_FALLTHROUGH;
26803 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26804 CYTHON_FALLTHROUGH;
26805 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26807 default: goto __pyx_L5_argtuple_error;
26810 __pyx_v__value = values[0];
26811 __pyx_v_attrib = values[1];
26812 __pyx_v_nsmap = values[2];
26813 __pyx_v__pytype = values[3];
26814 __pyx_v__xsi = values[4];
26816 goto __pyx_L4_argument_unpacking_done;
26817 __pyx_L5_argtuple_error:;
26818 __Pyx_RaiseArgtupleInvalid("DataElement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1872, __pyx_L3_error)
26820 __Pyx_DECREF(__pyx_v__attributes); __pyx_v__attributes = 0;
26821 __Pyx_AddTraceback("lxml.objectify.DataElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
26822 __Pyx_RefNannyFinishContext();
26824 __pyx_L4_argument_unpacking_done:;
26825 __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);
26827 /* function exit code */
26828 __Pyx_XDECREF(__pyx_v__attributes);
26829 __Pyx_RefNannyFinishContext();
26833 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) {
26834 PyObject *__pyx_v_temp = NULL;
26835 PyObject *__pyx_v_prefix = NULL;
26836 PyObject *__pyx_v_name = NULL;
26837 PyObject *__pyx_v_ns = NULL;
26838 struct __pyx_obj_4lxml_9objectify_PyType *__pyx_v_py_type = NULL;
26839 PyObject *__pyx_v_strval = NULL;
26840 PyObject *__pyx_v_stringify = NULL;
26841 PyObject *__pyx_r = NULL;
26842 __Pyx_RefNannyDeclarations
26846 PyObject *__pyx_t_4 = NULL;
26847 PyObject *__pyx_t_5 = NULL;
26848 PyObject *__pyx_t_6 = NULL;
26849 PyObject *__pyx_t_7 = NULL;
26850 PyObject *(*__pyx_t_8)(PyObject *);
26851 Py_ssize_t __pyx_t_9;
26852 PyObject *(*__pyx_t_10)(PyObject *);
26853 PyObject *__pyx_t_11 = NULL;
26854 int __pyx_lineno = 0;
26855 const char *__pyx_filename = NULL;
26856 int __pyx_clineno = 0;
26857 __Pyx_RefNannySetupContext("DataElement", 0);
26858 __Pyx_INCREF(__pyx_v_attrib);
26859 __Pyx_INCREF(__pyx_v_nsmap);
26860 __Pyx_INCREF(__pyx_v__pytype);
26861 __Pyx_INCREF(__pyx_v__xsi);
26862 __Pyx_INCREF(__pyx_v__attributes);
26864 /* "lxml/objectify.pyx":1887
26865 * in attrib and/or keyword arguments.
26867 * if nsmap is None: # <<<<<<<<<<<<<<
26868 * nsmap = _DEFAULT_NSMAP
26869 * if attrib is not None and attrib:
26871 __pyx_t_1 = (__pyx_v_nsmap == Py_None);
26872 __pyx_t_2 = (__pyx_t_1 != 0);
26875 /* "lxml/objectify.pyx":1888
26877 * if nsmap is None:
26878 * nsmap = _DEFAULT_NSMAP # <<<<<<<<<<<<<<
26879 * if attrib is not None and attrib:
26882 __Pyx_INCREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26883 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
26885 /* "lxml/objectify.pyx":1887
26886 * in attrib and/or keyword arguments.
26888 * if nsmap is None: # <<<<<<<<<<<<<<
26889 * nsmap = _DEFAULT_NSMAP
26890 * if attrib is not None and attrib:
26894 /* "lxml/objectify.pyx":1889
26895 * if nsmap is None:
26896 * nsmap = _DEFAULT_NSMAP
26897 * if attrib is not None and attrib: # <<<<<<<<<<<<<<
26899 * attrib = dict(attrib)
26901 __pyx_t_1 = (__pyx_v_attrib != Py_None);
26902 __pyx_t_3 = (__pyx_t_1 != 0);
26905 __pyx_t_2 = __pyx_t_3;
26906 goto __pyx_L5_bool_binop_done;
26908 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1889, __pyx_L1_error)
26909 __pyx_t_2 = __pyx_t_3;
26910 __pyx_L5_bool_binop_done:;
26913 /* "lxml/objectify.pyx":1890
26914 * nsmap = _DEFAULT_NSMAP
26915 * if attrib is not None and attrib:
26916 * if _attributes: # <<<<<<<<<<<<<<
26917 * attrib = dict(attrib)
26918 * attrib.update(_attributes)
26920 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1890, __pyx_L1_error)
26923 /* "lxml/objectify.pyx":1891
26924 * if attrib is not None and attrib:
26926 * attrib = dict(attrib) # <<<<<<<<<<<<<<
26927 * attrib.update(_attributes)
26928 * _attributes = attrib
26930 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L1_error)
26931 __Pyx_GOTREF(__pyx_t_4);
26932 __Pyx_DECREF_SET(__pyx_v_attrib, __pyx_t_4);
26935 /* "lxml/objectify.pyx":1892
26937 * attrib = dict(attrib)
26938 * attrib.update(_attributes) # <<<<<<<<<<<<<<
26939 * _attributes = attrib
26940 * if isinstance(_value, ObjectifiedElement):
26942 __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)
26943 __Pyx_GOTREF(__pyx_t_5);
26945 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
26946 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
26947 if (likely(__pyx_t_6)) {
26948 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
26949 __Pyx_INCREF(__pyx_t_6);
26950 __Pyx_INCREF(function);
26951 __Pyx_DECREF_SET(__pyx_t_5, function);
26954 __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);
26955 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26956 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error)
26957 __Pyx_GOTREF(__pyx_t_4);
26958 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26959 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26961 /* "lxml/objectify.pyx":1890
26962 * nsmap = _DEFAULT_NSMAP
26963 * if attrib is not None and attrib:
26964 * if _attributes: # <<<<<<<<<<<<<<
26965 * attrib = dict(attrib)
26966 * attrib.update(_attributes)
26970 /* "lxml/objectify.pyx":1893
26971 * attrib = dict(attrib)
26972 * attrib.update(_attributes)
26973 * _attributes = attrib # <<<<<<<<<<<<<<
26974 * if isinstance(_value, ObjectifiedElement):
26975 * if _pytype is None:
26977 __Pyx_INCREF(__pyx_v_attrib);
26978 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_attrib);
26980 /* "lxml/objectify.pyx":1889
26981 * if nsmap is None:
26982 * nsmap = _DEFAULT_NSMAP
26983 * if attrib is not None and attrib: # <<<<<<<<<<<<<<
26985 * attrib = dict(attrib)
26989 /* "lxml/objectify.pyx":1894
26990 * attrib.update(_attributes)
26991 * _attributes = attrib
26992 * if isinstance(_value, ObjectifiedElement): # <<<<<<<<<<<<<<
26993 * if _pytype is None:
26994 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
26996 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__value, __pyx_ptype_4lxml_9objectify_ObjectifiedElement);
26997 __pyx_t_3 = (__pyx_t_2 != 0);
27000 /* "lxml/objectify.pyx":1895
27001 * _attributes = attrib
27002 * if isinstance(_value, ObjectifiedElement):
27003 * if _pytype is None: # <<<<<<<<<<<<<<
27004 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27005 * # special case: no change!
27007 __pyx_t_3 = (__pyx_v__pytype == Py_None);
27008 __pyx_t_2 = (__pyx_t_3 != 0);
27011 /* "lxml/objectify.pyx":1896
27012 * if isinstance(_value, ObjectifiedElement):
27013 * if _pytype is None:
27014 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27015 * # special case: no change!
27016 * return _value.__copy__()
27018 __pyx_t_3 = (__pyx_v__xsi == Py_None);
27019 __pyx_t_1 = (__pyx_t_3 != 0);
27022 __pyx_t_2 = __pyx_t_1;
27023 goto __pyx_L11_bool_binop_done;
27025 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v__attributes); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1896, __pyx_L1_error)
27026 __pyx_t_3 = ((!__pyx_t_1) != 0);
27029 __pyx_t_2 = __pyx_t_3;
27030 goto __pyx_L11_bool_binop_done;
27032 __pyx_t_3 = (__pyx_v_nsmap == __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
27033 __pyx_t_1 = (__pyx_t_3 != 0);
27034 __pyx_t_2 = __pyx_t_1;
27035 __pyx_L11_bool_binop_done:;
27038 /* "lxml/objectify.pyx":1898
27039 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27040 * # special case: no change!
27041 * return _value.__copy__() # <<<<<<<<<<<<<<
27042 * if isinstance(_value, ObjectifiedDataElement):
27043 * # reuse existing nsmap unless redefined in nsmap parameter
27045 __Pyx_XDECREF(__pyx_r);
27046 __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)
27047 __Pyx_GOTREF(__pyx_t_5);
27049 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27050 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27051 if (likely(__pyx_t_6)) {
27052 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27053 __Pyx_INCREF(__pyx_t_6);
27054 __Pyx_INCREF(function);
27055 __Pyx_DECREF_SET(__pyx_t_5, function);
27058 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
27059 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27060 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1898, __pyx_L1_error)
27061 __Pyx_GOTREF(__pyx_t_4);
27062 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27063 __pyx_r = __pyx_t_4;
27067 /* "lxml/objectify.pyx":1896
27068 * if isinstance(_value, ObjectifiedElement):
27069 * if _pytype is None:
27070 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27071 * # special case: no change!
27072 * return _value.__copy__()
27076 /* "lxml/objectify.pyx":1895
27077 * _attributes = attrib
27078 * if isinstance(_value, ObjectifiedElement):
27079 * if _pytype is None: # <<<<<<<<<<<<<<
27080 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27081 * # special case: no change!
27085 /* "lxml/objectify.pyx":1894
27086 * attrib.update(_attributes)
27087 * _attributes = attrib
27088 * if isinstance(_value, ObjectifiedElement): # <<<<<<<<<<<<<<
27089 * if _pytype is None:
27090 * if _xsi is None and not _attributes and nsmap is _DEFAULT_NSMAP:
27094 /* "lxml/objectify.pyx":1899
27095 * # special case: no change!
27096 * return _value.__copy__()
27097 * if isinstance(_value, ObjectifiedDataElement): # <<<<<<<<<<<<<<
27098 * # reuse existing nsmap unless redefined in nsmap parameter
27099 * temp = _value.nsmap
27101 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v__value, __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
27102 __pyx_t_1 = (__pyx_t_2 != 0);
27105 /* "lxml/objectify.pyx":1901
27106 * if isinstance(_value, ObjectifiedDataElement):
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)
27112 __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)
27113 __Pyx_GOTREF(__pyx_t_4);
27114 __pyx_v_temp = __pyx_t_4;
27117 /* "lxml/objectify.pyx":1902
27118 * # reuse existing nsmap unless redefined in nsmap parameter
27119 * temp = _value.nsmap
27120 * if temp is not None and temp: # <<<<<<<<<<<<<<
27121 * temp = dict(temp)
27122 * temp.update(nsmap)
27124 __pyx_t_2 = (__pyx_v_temp != Py_None);
27125 __pyx_t_3 = (__pyx_t_2 != 0);
27128 __pyx_t_1 = __pyx_t_3;
27129 goto __pyx_L16_bool_binop_done;
27131 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_temp); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1902, __pyx_L1_error)
27132 __pyx_t_1 = __pyx_t_3;
27133 __pyx_L16_bool_binop_done:;
27136 /* "lxml/objectify.pyx":1903
27137 * temp = _value.nsmap
27138 * if temp is not None and temp:
27139 * temp = dict(temp) # <<<<<<<<<<<<<<
27140 * temp.update(nsmap)
27143 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_temp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error)
27144 __Pyx_GOTREF(__pyx_t_4);
27145 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27148 /* "lxml/objectify.pyx":1904
27149 * if temp is not None and temp:
27150 * temp = dict(temp)
27151 * temp.update(nsmap) # <<<<<<<<<<<<<<
27153 * # reuse existing attributes unless redefined in attrib/_attributes
27155 __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)
27156 __Pyx_GOTREF(__pyx_t_5);
27158 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27159 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27160 if (likely(__pyx_t_6)) {
27161 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27162 __Pyx_INCREF(__pyx_t_6);
27163 __Pyx_INCREF(function);
27164 __Pyx_DECREF_SET(__pyx_t_5, function);
27167 __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);
27168 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27169 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1904, __pyx_L1_error)
27170 __Pyx_GOTREF(__pyx_t_4);
27171 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27172 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27174 /* "lxml/objectify.pyx":1905
27175 * temp = dict(temp)
27176 * temp.update(nsmap)
27177 * nsmap = temp # <<<<<<<<<<<<<<
27178 * # reuse existing attributes unless redefined in attrib/_attributes
27179 * temp = _value.attrib
27181 __Pyx_INCREF(__pyx_v_temp);
27182 __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_temp);
27184 /* "lxml/objectify.pyx":1902
27185 * # reuse existing nsmap unless redefined in nsmap parameter
27186 * temp = _value.nsmap
27187 * if temp is not None and temp: # <<<<<<<<<<<<<<
27188 * temp = dict(temp)
27189 * temp.update(nsmap)
27193 /* "lxml/objectify.pyx":1907
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)
27200 __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)
27201 __Pyx_GOTREF(__pyx_t_4);
27202 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27205 /* "lxml/objectify.pyx":1908
27206 * # reuse existing attributes unless redefined in attrib/_attributes
27207 * temp = _value.attrib
27208 * if temp is not None and temp: # <<<<<<<<<<<<<<
27209 * temp = dict(temp)
27210 * temp.update(_attributes)
27212 __pyx_t_3 = (__pyx_v_temp != Py_None);
27213 __pyx_t_2 = (__pyx_t_3 != 0);
27216 __pyx_t_1 = __pyx_t_2;
27217 goto __pyx_L19_bool_binop_done;
27219 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_temp); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1908, __pyx_L1_error)
27220 __pyx_t_1 = __pyx_t_2;
27221 __pyx_L19_bool_binop_done:;
27224 /* "lxml/objectify.pyx":1909
27225 * temp = _value.attrib
27226 * if temp is not None and temp:
27227 * temp = dict(temp) # <<<<<<<<<<<<<<
27228 * temp.update(_attributes)
27229 * _attributes = temp
27231 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_temp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1909, __pyx_L1_error)
27232 __Pyx_GOTREF(__pyx_t_4);
27233 __Pyx_DECREF_SET(__pyx_v_temp, __pyx_t_4);
27236 /* "lxml/objectify.pyx":1910
27237 * if temp is not None and temp:
27238 * temp = dict(temp)
27239 * temp.update(_attributes) # <<<<<<<<<<<<<<
27240 * _attributes = temp
27241 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27243 __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)
27244 __Pyx_GOTREF(__pyx_t_5);
27246 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27247 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27248 if (likely(__pyx_t_6)) {
27249 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27250 __Pyx_INCREF(__pyx_t_6);
27251 __Pyx_INCREF(function);
27252 __Pyx_DECREF_SET(__pyx_t_5, function);
27255 __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);
27256 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27257 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1910, __pyx_L1_error)
27258 __Pyx_GOTREF(__pyx_t_4);
27259 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27260 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27262 /* "lxml/objectify.pyx":1911
27263 * temp = dict(temp)
27264 * temp.update(_attributes)
27265 * _attributes = temp # <<<<<<<<<<<<<<
27266 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27269 __Pyx_INCREF(__pyx_v_temp);
27270 __Pyx_DECREF_SET(__pyx_v__attributes, __pyx_v_temp);
27272 /* "lxml/objectify.pyx":1908
27273 * # reuse existing attributes unless redefined in attrib/_attributes
27274 * temp = _value.attrib
27275 * if temp is not None and temp: # <<<<<<<<<<<<<<
27276 * temp = dict(temp)
27277 * temp.update(_attributes)
27281 /* "lxml/objectify.pyx":1914
27282 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27284 * if _xsi is None and _pytype is None: # <<<<<<<<<<<<<<
27285 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27286 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27288 __pyx_t_2 = (__pyx_v__xsi == Py_None);
27289 __pyx_t_3 = (__pyx_t_2 != 0);
27292 __pyx_t_1 = __pyx_t_3;
27293 goto __pyx_L22_bool_binop_done;
27295 __pyx_t_3 = (__pyx_v__pytype == Py_None);
27296 __pyx_t_2 = (__pyx_t_3 != 0);
27297 __pyx_t_1 = __pyx_t_2;
27298 __pyx_L22_bool_binop_done:;
27301 /* "lxml/objectify.pyx":1915
27303 * if _xsi is None and _pytype is None:
27304 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR) # <<<<<<<<<<<<<<
27305 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27308 __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)
27309 __Pyx_GOTREF(__pyx_t_5);
27311 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27312 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
27313 if (likely(__pyx_t_6)) {
27314 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27315 __Pyx_INCREF(__pyx_t_6);
27316 __Pyx_INCREF(function);
27317 __Pyx_DECREF_SET(__pyx_t_5, function);
27320 __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);
27321 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27322 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
27323 __Pyx_GOTREF(__pyx_t_4);
27324 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27325 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_4);
27328 /* "lxml/objectify.pyx":1916
27329 * if _xsi is None and _pytype is None:
27330 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27331 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE) # <<<<<<<<<<<<<<
27333 * if _xsi is not None:
27335 __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)
27336 __Pyx_GOTREF(__pyx_t_5);
27337 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1916, __pyx_L1_error)
27338 __Pyx_GOTREF(__pyx_t_6);
27340 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
27341 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
27342 if (likely(__pyx_t_7)) {
27343 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
27344 __Pyx_INCREF(__pyx_t_7);
27345 __Pyx_INCREF(function);
27346 __Pyx_DECREF_SET(__pyx_t_5, function);
27349 __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);
27350 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27351 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27352 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1916, __pyx_L1_error)
27353 __Pyx_GOTREF(__pyx_t_4);
27354 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27355 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_4);
27358 /* "lxml/objectify.pyx":1914
27359 * # reuse existing xsi:type or py:pytype attributes, unless provided as
27361 * if _xsi is None and _pytype is None: # <<<<<<<<<<<<<<
27362 * _xsi = _attributes.get(XML_SCHEMA_INSTANCE_TYPE_ATTR)
27363 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27367 /* "lxml/objectify.pyx":1899
27368 * # special case: no change!
27369 * return _value.__copy__()
27370 * if isinstance(_value, ObjectifiedDataElement): # <<<<<<<<<<<<<<
27371 * # reuse existing nsmap unless redefined in nsmap parameter
27372 * temp = _value.nsmap
27376 /* "lxml/objectify.pyx":1918
27377 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27379 * if _xsi is not None: # <<<<<<<<<<<<<<
27381 * prefix, name = _xsi.split(u':', 1)
27383 __pyx_t_1 = (__pyx_v__xsi != Py_None);
27384 __pyx_t_2 = (__pyx_t_1 != 0);
27387 /* "lxml/objectify.pyx":1919
27389 * if _xsi is not None:
27390 * if u':' in _xsi: # <<<<<<<<<<<<<<
27391 * prefix, name = _xsi.split(u':', 1)
27392 * ns = nsmap.get(prefix)
27394 __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)
27395 __pyx_t_1 = (__pyx_t_2 != 0);
27398 /* "lxml/objectify.pyx":1920
27399 * if _xsi is not None:
27401 * prefix, name = _xsi.split(u':', 1) # <<<<<<<<<<<<<<
27402 * ns = nsmap.get(prefix)
27403 * if ns != XML_SCHEMA_NS:
27405 __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)
27406 __Pyx_GOTREF(__pyx_t_4);
27407 __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)
27408 __Pyx_GOTREF(__pyx_t_5);
27409 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27410 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
27411 PyObject* sequence = __pyx_t_5;
27412 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27413 if (unlikely(size != 2)) {
27414 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27415 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
27416 __PYX_ERR(0, 1920, __pyx_L1_error)
27418 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27419 if (likely(PyTuple_CheckExact(sequence))) {
27420 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
27421 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
27423 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
27424 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
27426 __Pyx_INCREF(__pyx_t_4);
27427 __Pyx_INCREF(__pyx_t_6);
27429 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L1_error)
27430 __Pyx_GOTREF(__pyx_t_4);
27431 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1920, __pyx_L1_error)
27432 __Pyx_GOTREF(__pyx_t_6);
27434 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27436 Py_ssize_t index = -1;
27437 __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1920, __pyx_L1_error)
27438 __Pyx_GOTREF(__pyx_t_7);
27439 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27440 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
27441 index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L26_unpacking_failed;
27442 __Pyx_GOTREF(__pyx_t_4);
27443 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L26_unpacking_failed;
27444 __Pyx_GOTREF(__pyx_t_6);
27445 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1920, __pyx_L1_error)
27447 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27448 goto __pyx_L27_unpacking_done;
27449 __pyx_L26_unpacking_failed:;
27450 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27452 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
27453 __PYX_ERR(0, 1920, __pyx_L1_error)
27454 __pyx_L27_unpacking_done:;
27456 __pyx_v_prefix = __pyx_t_4;
27458 __pyx_v_name = __pyx_t_6;
27461 /* "lxml/objectify.pyx":1921
27463 * prefix, name = _xsi.split(u':', 1)
27464 * ns = nsmap.get(prefix) # <<<<<<<<<<<<<<
27465 * if ns != XML_SCHEMA_NS:
27466 * raise ValueError, u"XSD types require the XSD namespace"
27468 __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)
27469 __Pyx_GOTREF(__pyx_t_6);
27471 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
27472 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
27473 if (likely(__pyx_t_4)) {
27474 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27475 __Pyx_INCREF(__pyx_t_4);
27476 __Pyx_INCREF(function);
27477 __Pyx_DECREF_SET(__pyx_t_6, function);
27480 __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);
27481 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27482 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1921, __pyx_L1_error)
27483 __Pyx_GOTREF(__pyx_t_5);
27484 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27485 __pyx_v_ns = __pyx_t_5;
27488 /* "lxml/objectify.pyx":1922
27489 * prefix, name = _xsi.split(u':', 1)
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:
27495 __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)
27496 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1922, __pyx_L1_error)
27497 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27498 if (unlikely(__pyx_t_1)) {
27500 /* "lxml/objectify.pyx":1923
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:
27507 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_XSD_types_require_the_XSD_namesp, 0, 0);
27508 __PYX_ERR(0, 1923, __pyx_L1_error)
27510 /* "lxml/objectify.pyx":1922
27511 * prefix, name = _xsi.split(u':', 1)
27512 * ns = nsmap.get(prefix)
27513 * if ns != XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27514 * raise ValueError, u"XSD types require the XSD namespace"
27515 * elif nsmap is _DEFAULT_NSMAP:
27519 /* "lxml/objectify.pyx":1919
27521 * if _xsi is not None:
27522 * if u':' in _xsi: # <<<<<<<<<<<<<<
27523 * prefix, name = _xsi.split(u':', 1)
27524 * ns = nsmap.get(prefix)
27529 /* "lxml/objectify.pyx":1924
27530 * if ns != XML_SCHEMA_NS:
27531 * raise ValueError, u"XSD types require the XSD namespace"
27532 * elif nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27534 * _xsi = u'xsd:' + _xsi
27536 __pyx_t_1 = (__pyx_v_nsmap == __pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
27537 __pyx_t_2 = (__pyx_t_1 != 0);
27540 /* "lxml/objectify.pyx":1925
27541 * raise ValueError, u"XSD types require the XSD namespace"
27542 * elif nsmap is _DEFAULT_NSMAP:
27543 * name = _xsi # <<<<<<<<<<<<<<
27544 * _xsi = u'xsd:' + _xsi
27547 __Pyx_INCREF(__pyx_v__xsi);
27548 __pyx_v_name = __pyx_v__xsi;
27550 /* "lxml/objectify.pyx":1926
27551 * elif nsmap is _DEFAULT_NSMAP:
27553 * _xsi = u'xsd:' + _xsi # <<<<<<<<<<<<<<
27557 __pyx_t_5 = PyNumber_Add(__pyx_kp_u_xsd, __pyx_v__xsi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1926, __pyx_L1_error)
27558 __Pyx_GOTREF(__pyx_t_5);
27559 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_5);
27562 /* "lxml/objectify.pyx":1924
27563 * if ns != XML_SCHEMA_NS:
27564 * raise ValueError, u"XSD types require the XSD namespace"
27565 * elif nsmap is _DEFAULT_NSMAP: # <<<<<<<<<<<<<<
27567 * _xsi = u'xsd:' + _xsi
27572 /* "lxml/objectify.pyx":1928
27573 * _xsi = u'xsd:' + _xsi
27575 * name = _xsi # <<<<<<<<<<<<<<
27576 * for prefix, ns in nsmap.items():
27577 * if ns == XML_SCHEMA_NS:
27580 __Pyx_INCREF(__pyx_v__xsi);
27581 __pyx_v_name = __pyx_v__xsi;
27583 /* "lxml/objectify.pyx":1929
27586 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27587 * if ns == XML_SCHEMA_NS:
27588 * if prefix is not None and prefix:
27590 __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)
27591 __Pyx_GOTREF(__pyx_t_6);
27593 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
27594 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
27595 if (likely(__pyx_t_4)) {
27596 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27597 __Pyx_INCREF(__pyx_t_4);
27598 __Pyx_INCREF(function);
27599 __Pyx_DECREF_SET(__pyx_t_6, function);
27602 __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
27603 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27604 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1929, __pyx_L1_error)
27605 __Pyx_GOTREF(__pyx_t_5);
27606 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27607 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
27608 __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
27611 __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1929, __pyx_L1_error)
27612 __Pyx_GOTREF(__pyx_t_6);
27613 __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1929, __pyx_L1_error)
27615 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27617 if (likely(!__pyx_t_10)) {
27618 if (likely(PyList_CheckExact(__pyx_t_6))) {
27619 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
27620 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27621 __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)
27623 __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)
27624 __Pyx_GOTREF(__pyx_t_5);
27627 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
27628 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27629 __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)
27631 __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)
27632 __Pyx_GOTREF(__pyx_t_5);
27636 __pyx_t_5 = __pyx_t_10(__pyx_t_6);
27637 if (unlikely(!__pyx_t_5)) {
27638 PyObject* exc_type = PyErr_Occurred();
27640 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27641 else __PYX_ERR(0, 1929, __pyx_L1_error)
27645 __Pyx_GOTREF(__pyx_t_5);
27647 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
27648 PyObject* sequence = __pyx_t_5;
27649 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27650 if (unlikely(size != 2)) {
27651 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27652 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
27653 __PYX_ERR(0, 1929, __pyx_L1_error)
27655 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27656 if (likely(PyTuple_CheckExact(sequence))) {
27657 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
27658 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
27660 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
27661 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
27663 __Pyx_INCREF(__pyx_t_4);
27664 __Pyx_INCREF(__pyx_t_7);
27666 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1929, __pyx_L1_error)
27667 __Pyx_GOTREF(__pyx_t_4);
27668 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1929, __pyx_L1_error)
27669 __Pyx_GOTREF(__pyx_t_7);
27671 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27673 Py_ssize_t index = -1;
27674 __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1929, __pyx_L1_error)
27675 __Pyx_GOTREF(__pyx_t_11);
27676 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27677 __pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
27678 index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L31_unpacking_failed;
27679 __Pyx_GOTREF(__pyx_t_4);
27680 index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L31_unpacking_failed;
27681 __Pyx_GOTREF(__pyx_t_7);
27682 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1929, __pyx_L1_error)
27684 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27685 goto __pyx_L32_unpacking_done;
27686 __pyx_L31_unpacking_failed:;
27687 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
27689 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
27690 __PYX_ERR(0, 1929, __pyx_L1_error)
27691 __pyx_L32_unpacking_done:;
27693 __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_4);
27695 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
27698 /* "lxml/objectify.pyx":1930
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
27705 __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)
27706 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1930, __pyx_L1_error)
27707 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27710 /* "lxml/objectify.pyx":1931
27711 * for prefix, ns in nsmap.items():
27712 * if ns == XML_SCHEMA_NS:
27713 * if prefix is not None and prefix: # <<<<<<<<<<<<<<
27714 * _xsi = prefix + u':' + _xsi
27717 __pyx_t_1 = (__pyx_v_prefix != Py_None);
27718 __pyx_t_3 = (__pyx_t_1 != 0);
27721 __pyx_t_2 = __pyx_t_3;
27722 goto __pyx_L35_bool_binop_done;
27724 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1931, __pyx_L1_error)
27725 __pyx_t_2 = __pyx_t_3;
27726 __pyx_L35_bool_binop_done:;
27729 /* "lxml/objectify.pyx":1932
27730 * if ns == XML_SCHEMA_NS:
27731 * if prefix is not None and prefix:
27732 * _xsi = prefix + u':' + _xsi # <<<<<<<<<<<<<<
27736 __pyx_t_5 = PyNumber_Add(__pyx_v_prefix, __pyx_kp_u__17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1932, __pyx_L1_error)
27737 __Pyx_GOTREF(__pyx_t_5);
27738 __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v__xsi); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
27739 __Pyx_GOTREF(__pyx_t_7);
27740 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
27741 __Pyx_DECREF_SET(__pyx_v__xsi, __pyx_t_7);
27744 /* "lxml/objectify.pyx":1931
27745 * for prefix, ns in nsmap.items():
27746 * if ns == XML_SCHEMA_NS:
27747 * if prefix is not None and prefix: # <<<<<<<<<<<<<<
27748 * _xsi = prefix + u':' + _xsi
27753 /* "lxml/objectify.pyx":1933
27754 * if prefix is not None and prefix:
27755 * _xsi = prefix + u':' + _xsi
27756 * break # <<<<<<<<<<<<<<
27758 * raise ValueError, u"XSD types require the XSD namespace"
27760 goto __pyx_L30_break;
27762 /* "lxml/objectify.pyx":1930
27764 * for prefix, ns in nsmap.items():
27765 * if ns == XML_SCHEMA_NS: # <<<<<<<<<<<<<<
27766 * if prefix is not None and prefix:
27767 * _xsi = prefix + u':' + _xsi
27771 /* "lxml/objectify.pyx":1929
27774 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27775 * if ns == XML_SCHEMA_NS:
27776 * if prefix is not None and prefix:
27781 /* "lxml/objectify.pyx":1935
27784 * raise ValueError, u"XSD types require the XSD namespace" # <<<<<<<<<<<<<<
27785 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27786 * if _pytype is None:
27788 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_XSD_types_require_the_XSD_namesp, 0, 0);
27789 __PYX_ERR(0, 1935, __pyx_L1_error)
27792 /* "lxml/objectify.pyx":1929
27795 * for prefix, ns in nsmap.items(): # <<<<<<<<<<<<<<
27796 * if ns == XML_SCHEMA_NS:
27797 * if prefix is not None and prefix:
27800 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27804 /* "lxml/objectify.pyx":1936
27806 * raise ValueError, u"XSD types require the XSD namespace"
27807 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi # <<<<<<<<<<<<<<
27808 * if _pytype is None:
27809 * # allow using unregistered or even wrong xsi:type names
27811 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)
27813 /* "lxml/objectify.pyx":1937
27814 * raise ValueError, u"XSD types require the XSD namespace"
27815 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27816 * if _pytype is None: # <<<<<<<<<<<<<<
27817 * # allow using unregistered or even wrong xsi:type names
27818 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27820 __pyx_t_2 = (__pyx_v__pytype == Py_None);
27821 __pyx_t_3 = (__pyx_t_2 != 0);
27824 /* "lxml/objectify.pyx":1939
27825 * if _pytype is None:
27826 * # allow using unregistered or even wrong xsi:type names
27827 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi) # <<<<<<<<<<<<<<
27828 * if py_type is None:
27829 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27831 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
27832 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
27833 __PYX_ERR(0, 1939, __pyx_L1_error)
27835 __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)
27836 __Pyx_GOTREF(__pyx_t_6);
27837 __pyx_t_7 = __pyx_t_6;
27838 __Pyx_INCREF(__pyx_t_7);
27839 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27840 __pyx_v_py_type = ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_7);
27843 /* "lxml/objectify.pyx":1940
27844 * # allow using unregistered or even wrong xsi:type names
27845 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27846 * if py_type is None: # <<<<<<<<<<<<<<
27847 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27848 * if py_type is not None:
27850 __pyx_t_3 = (((PyObject *)__pyx_v_py_type) == Py_None);
27851 __pyx_t_2 = (__pyx_t_3 != 0);
27854 /* "lxml/objectify.pyx":1941
27855 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27856 * if py_type is None:
27857 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name) # <<<<<<<<<<<<<<
27858 * if py_type is not None:
27859 * _pytype = py_type.name
27861 if (unlikely(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT == Py_None)) {
27862 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
27863 __PYX_ERR(0, 1941, __pyx_L1_error)
27865 __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)
27866 __Pyx_GOTREF(__pyx_t_7);
27867 __pyx_t_6 = __pyx_t_7;
27868 __Pyx_INCREF(__pyx_t_6);
27869 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27870 __Pyx_DECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
27873 /* "lxml/objectify.pyx":1940
27874 * # allow using unregistered or even wrong xsi:type names
27875 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27876 * if py_type is None: # <<<<<<<<<<<<<<
27877 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27878 * if py_type is not None:
27882 /* "lxml/objectify.pyx":1942
27883 * if py_type is None:
27884 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27885 * if py_type is not None: # <<<<<<<<<<<<<<
27886 * _pytype = py_type.name
27889 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
27890 __pyx_t_3 = (__pyx_t_2 != 0);
27893 /* "lxml/objectify.pyx":1943
27894 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27895 * if py_type is not None:
27896 * _pytype = py_type.name # <<<<<<<<<<<<<<
27898 * if _pytype is None:
27900 __pyx_t_6 = __pyx_v_py_type->name;
27901 __Pyx_INCREF(__pyx_t_6);
27902 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
27905 /* "lxml/objectify.pyx":1942
27906 * if py_type is None:
27907 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(name)
27908 * if py_type is not None: # <<<<<<<<<<<<<<
27909 * _pytype = py_type.name
27914 /* "lxml/objectify.pyx":1937
27915 * raise ValueError, u"XSD types require the XSD namespace"
27916 * _attributes[XML_SCHEMA_INSTANCE_TYPE_ATTR] = _xsi
27917 * if _pytype is None: # <<<<<<<<<<<<<<
27918 * # allow using unregistered or even wrong xsi:type names
27919 * py_type = <PyType>_SCHEMA_TYPE_DICT.get(_xsi)
27923 /* "lxml/objectify.pyx":1918
27924 * _pytype = _attributes.get(PYTYPE_ATTRIBUTE)
27926 * if _xsi is not None: # <<<<<<<<<<<<<<
27928 * prefix, name = _xsi.split(u':', 1)
27932 /* "lxml/objectify.pyx":1945
27933 * _pytype = py_type.name
27935 * if _pytype is None: # <<<<<<<<<<<<<<
27936 * _pytype = _pytypename(_value)
27939 __pyx_t_3 = (__pyx_v__pytype == Py_None);
27940 __pyx_t_2 = (__pyx_t_3 != 0);
27943 /* "lxml/objectify.pyx":1946
27945 * if _pytype is None:
27946 * _pytype = _pytypename(_value) # <<<<<<<<<<<<<<
27948 * if _value is None and _pytype != u"str":
27950 __pyx_t_6 = __pyx_f_4lxml_9objectify__pytypename(__pyx_v__value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1946, __pyx_L1_error)
27951 __Pyx_GOTREF(__pyx_t_6);
27952 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
27955 /* "lxml/objectify.pyx":1945
27956 * _pytype = py_type.name
27958 * if _pytype is None: # <<<<<<<<<<<<<<
27959 * _pytype = _pytypename(_value)
27964 /* "lxml/objectify.pyx":1948
27965 * _pytype = _pytypename(_value)
27967 * if _value is None and _pytype != u"str": # <<<<<<<<<<<<<<
27968 * _pytype = _pytype or u"NoneType"
27971 __pyx_t_3 = (__pyx_v__value == Py_None);
27972 __pyx_t_1 = (__pyx_t_3 != 0);
27975 __pyx_t_2 = __pyx_t_1;
27976 goto __pyx_L43_bool_binop_done;
27978 __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)
27979 __pyx_t_2 = __pyx_t_1;
27980 __pyx_L43_bool_binop_done:;
27983 /* "lxml/objectify.pyx":1949
27985 * if _value is None and _pytype != u"str":
27986 * _pytype = _pytype or u"NoneType" # <<<<<<<<<<<<<<
27988 * elif python._isString(_value):
27990 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__pytype); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1949, __pyx_L1_error)
27993 __Pyx_INCREF(__pyx_v__pytype);
27994 __pyx_t_6 = __pyx_v__pytype;
27995 goto __pyx_L45_bool_binop_done;
27997 __Pyx_INCREF(__pyx_n_u_NoneType);
27998 __pyx_t_6 = __pyx_n_u_NoneType;
27999 __pyx_L45_bool_binop_done:;
28000 __Pyx_DECREF_SET(__pyx_v__pytype, __pyx_t_6);
28003 /* "lxml/objectify.pyx":1950
28004 * if _value is None and _pytype != u"str":
28005 * _pytype = _pytype or u"NoneType"
28006 * strval = None # <<<<<<<<<<<<<<
28007 * elif python._isString(_value):
28010 __Pyx_INCREF(Py_None);
28011 __pyx_v_strval = Py_None;
28013 /* "lxml/objectify.pyx":1948
28014 * _pytype = _pytypename(_value)
28016 * if _value is None and _pytype != u"str": # <<<<<<<<<<<<<<
28017 * _pytype = _pytype or u"NoneType"
28023 /* "lxml/objectify.pyx":1951
28024 * _pytype = _pytype or u"NoneType"
28026 * elif python._isString(_value): # <<<<<<<<<<<<<<
28028 * elif isinstance(_value, bool):
28030 __pyx_t_2 = (_isString(__pyx_v__value) != 0);
28033 /* "lxml/objectify.pyx":1952
28035 * elif python._isString(_value):
28036 * strval = _value # <<<<<<<<<<<<<<
28037 * elif isinstance(_value, bool):
28040 __Pyx_INCREF(__pyx_v__value);
28041 __pyx_v_strval = __pyx_v__value;
28043 /* "lxml/objectify.pyx":1951
28044 * _pytype = _pytype or u"NoneType"
28046 * elif python._isString(_value): # <<<<<<<<<<<<<<
28048 * elif isinstance(_value, bool):
28053 /* "lxml/objectify.pyx":1953
28054 * elif python._isString(_value):
28056 * elif isinstance(_value, bool): # <<<<<<<<<<<<<<
28060 __pyx_t_6 = ((PyObject*)&PyBool_Type);
28061 __Pyx_INCREF(__pyx_t_6);
28062 __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)
28063 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28064 __pyx_t_1 = (__pyx_t_2 != 0);
28067 /* "lxml/objectify.pyx":1954
28069 * elif isinstance(_value, bool):
28070 * if _value: # <<<<<<<<<<<<<<
28074 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v__value); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1954, __pyx_L1_error)
28077 /* "lxml/objectify.pyx":1955
28078 * elif isinstance(_value, bool):
28080 * strval = u"true" # <<<<<<<<<<<<<<
28082 * strval = u"false"
28084 __Pyx_INCREF(__pyx_n_u_true);
28085 __pyx_v_strval = __pyx_n_u_true;
28087 /* "lxml/objectify.pyx":1954
28089 * elif isinstance(_value, bool):
28090 * if _value: # <<<<<<<<<<<<<<
28097 /* "lxml/objectify.pyx":1957
28100 * strval = u"false" # <<<<<<<<<<<<<<
28102 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28105 __Pyx_INCREF(__pyx_n_u_false);
28106 __pyx_v_strval = __pyx_n_u_false;
28110 /* "lxml/objectify.pyx":1953
28111 * elif python._isString(_value):
28113 * elif isinstance(_value, bool): # <<<<<<<<<<<<<<
28120 /* "lxml/objectify.pyx":1959
28121 * strval = u"false"
28123 * py_type = <PyType>_PYTYPE_DICT.get(_pytype) # <<<<<<<<<<<<<<
28124 * stringify = unicode if py_type is None else py_type.stringify
28125 * strval = stringify(_value)
28128 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
28129 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
28130 __PYX_ERR(0, 1959, __pyx_L1_error)
28132 __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)
28133 __Pyx_GOTREF(__pyx_t_6);
28134 __pyx_t_7 = __pyx_t_6;
28135 __Pyx_INCREF(__pyx_t_7);
28136 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28137 __Pyx_XDECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_7));
28140 /* "lxml/objectify.pyx":1960
28142 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28143 * stringify = unicode if py_type is None else py_type.stringify # <<<<<<<<<<<<<<
28144 * strval = stringify(_value)
28147 __pyx_t_1 = (((PyObject *)__pyx_v_py_type) == Py_None);
28148 if ((__pyx_t_1 != 0)) {
28149 __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
28150 __pyx_t_7 = ((PyObject *)(&PyUnicode_Type));
28152 __Pyx_INCREF(__pyx_v_py_type->stringify);
28153 __pyx_t_7 = __pyx_v_py_type->stringify;
28155 __pyx_v_stringify = __pyx_t_7;
28158 /* "lxml/objectify.pyx":1961
28159 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28160 * stringify = unicode if py_type is None else py_type.stringify
28161 * strval = stringify(_value) # <<<<<<<<<<<<<<
28163 * if _pytype is not None:
28165 __Pyx_INCREF(__pyx_v_stringify);
28166 __pyx_t_6 = __pyx_v_stringify; __pyx_t_5 = NULL;
28167 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
28168 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
28169 if (likely(__pyx_t_5)) {
28170 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
28171 __Pyx_INCREF(__pyx_t_5);
28172 __Pyx_INCREF(function);
28173 __Pyx_DECREF_SET(__pyx_t_6, function);
28176 __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);
28177 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28178 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1961, __pyx_L1_error)
28179 __Pyx_GOTREF(__pyx_t_7);
28180 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28181 __pyx_v_strval = __pyx_t_7;
28186 /* "lxml/objectify.pyx":1963
28187 * strval = stringify(_value)
28189 * if _pytype is not None: # <<<<<<<<<<<<<<
28190 * if _pytype == u"NoneType" or _pytype == u"none":
28193 __pyx_t_1 = (__pyx_v__pytype != Py_None);
28194 __pyx_t_2 = (__pyx_t_1 != 0);
28197 /* "lxml/objectify.pyx":1964
28199 * if _pytype is not None:
28200 * if _pytype == u"NoneType" or _pytype == u"none": # <<<<<<<<<<<<<<
28202 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28204 __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)
28207 __pyx_t_2 = __pyx_t_1;
28208 goto __pyx_L50_bool_binop_done;
28210 __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)
28211 __pyx_t_2 = __pyx_t_1;
28212 __pyx_L50_bool_binop_done:;
28215 /* "lxml/objectify.pyx":1965
28216 * if _pytype is not None:
28217 * if _pytype == u"NoneType" or _pytype == u"none":
28218 * strval = None # <<<<<<<<<<<<<<
28219 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28222 __Pyx_INCREF(Py_None);
28223 __Pyx_DECREF_SET(__pyx_v_strval, Py_None);
28225 /* "lxml/objectify.pyx":1966
28226 * if _pytype == u"NoneType" or _pytype == u"none":
28228 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true" # <<<<<<<<<<<<<<
28230 * # check if type information from arguments is valid
28232 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)
28234 /* "lxml/objectify.pyx":1964
28236 * if _pytype is not None:
28237 * if _pytype == u"NoneType" or _pytype == u"none": # <<<<<<<<<<<<<<
28239 * _attributes[XML_SCHEMA_INSTANCE_NIL_ATTR] = u"true"
28244 /* "lxml/objectify.pyx":1969
28246 * # check if type information from arguments is valid
28247 * py_type = <PyType>_PYTYPE_DICT.get(_pytype) # <<<<<<<<<<<<<<
28248 * if py_type is not None:
28249 * if py_type.type_check is not None:
28252 if (unlikely(__pyx_v_4lxml_9objectify__PYTYPE_DICT == Py_None)) {
28253 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
28254 __PYX_ERR(0, 1969, __pyx_L1_error)
28256 __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)
28257 __Pyx_GOTREF(__pyx_t_7);
28258 __pyx_t_6 = __pyx_t_7;
28259 __Pyx_INCREF(__pyx_t_6);
28260 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28261 __Pyx_XDECREF_SET(__pyx_v_py_type, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_6));
28264 /* "lxml/objectify.pyx":1970
28265 * # check if type information from arguments is valid
28266 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28267 * if py_type is not None: # <<<<<<<<<<<<<<
28268 * if py_type.type_check is not None:
28269 * py_type.type_check(strval)
28271 __pyx_t_2 = (((PyObject *)__pyx_v_py_type) != Py_None);
28272 __pyx_t_1 = (__pyx_t_2 != 0);
28275 /* "lxml/objectify.pyx":1971
28276 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28277 * if py_type is not None:
28278 * if py_type.type_check is not None: # <<<<<<<<<<<<<<
28279 * py_type.type_check(strval)
28280 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28282 __pyx_t_1 = (__pyx_v_py_type->type_check != Py_None);
28283 __pyx_t_2 = (__pyx_t_1 != 0);
28286 /* "lxml/objectify.pyx":1972
28287 * if py_type is not None:
28288 * if py_type.type_check is not None:
28289 * py_type.type_check(strval) # <<<<<<<<<<<<<<
28290 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28293 __Pyx_INCREF(__pyx_v_py_type->type_check);
28294 __pyx_t_7 = __pyx_v_py_type->type_check; __pyx_t_5 = NULL;
28295 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
28296 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
28297 if (likely(__pyx_t_5)) {
28298 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
28299 __Pyx_INCREF(__pyx_t_5);
28300 __Pyx_INCREF(function);
28301 __Pyx_DECREF_SET(__pyx_t_7, function);
28304 __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);
28305 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28306 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1972, __pyx_L1_error)
28307 __Pyx_GOTREF(__pyx_t_6);
28308 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28309 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28311 /* "lxml/objectify.pyx":1971
28312 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28313 * if py_type is not None:
28314 * if py_type.type_check is not None: # <<<<<<<<<<<<<<
28315 * py_type.type_check(strval)
28316 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28320 /* "lxml/objectify.pyx":1973
28321 * if py_type.type_check is not None:
28322 * py_type.type_check(strval)
28323 * _attributes[PYTYPE_ATTRIBUTE] = _pytype # <<<<<<<<<<<<<<
28325 * return _makeElement(u"value", strval, _attributes, nsmap)
28327 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_PYTYPE_ATTRIBUTE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1973, __pyx_L1_error)
28328 __Pyx_GOTREF(__pyx_t_6);
28329 if (unlikely(PyObject_SetItem(__pyx_v__attributes, __pyx_t_6, __pyx_v__pytype) < 0)) __PYX_ERR(0, 1973, __pyx_L1_error)
28330 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28332 /* "lxml/objectify.pyx":1970
28333 * # check if type information from arguments is valid
28334 * py_type = <PyType>_PYTYPE_DICT.get(_pytype)
28335 * if py_type is not None: # <<<<<<<<<<<<<<
28336 * if py_type.type_check is not None:
28337 * py_type.type_check(strval)
28343 /* "lxml/objectify.pyx":1963
28344 * strval = stringify(_value)
28346 * if _pytype is not None: # <<<<<<<<<<<<<<
28347 * if _pytype == u"NoneType" or _pytype == u"none":
28352 /* "lxml/objectify.pyx":1975
28353 * _attributes[PYTYPE_ATTRIBUTE] = _pytype
28355 * return _makeElement(u"value", strval, _attributes, nsmap) # <<<<<<<<<<<<<<
28359 __Pyx_XDECREF(__pyx_r);
28360 __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)
28361 __Pyx_GOTREF(__pyx_t_6);
28362 __pyx_r = __pyx_t_6;
28366 /* "lxml/objectify.pyx":1872
28367 * return _makeElement(_tag, None, _attributes, nsmap)
28369 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
28371 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
28374 /* function exit code */
28376 __Pyx_XDECREF(__pyx_t_4);
28377 __Pyx_XDECREF(__pyx_t_5);
28378 __Pyx_XDECREF(__pyx_t_6);
28379 __Pyx_XDECREF(__pyx_t_7);
28380 __Pyx_XDECREF(__pyx_t_11);
28381 __Pyx_AddTraceback("lxml.objectify.DataElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
28384 __Pyx_XDECREF(__pyx_v__attributes);
28385 __Pyx_XDECREF(__pyx_v_temp);
28386 __Pyx_XDECREF(__pyx_v_prefix);
28387 __Pyx_XDECREF(__pyx_v_name);
28388 __Pyx_XDECREF(__pyx_v_ns);
28389 __Pyx_XDECREF((PyObject *)__pyx_v_py_type);
28390 __Pyx_XDECREF(__pyx_v_strval);
28391 __Pyx_XDECREF(__pyx_v_stringify);
28392 __Pyx_XDECREF(__pyx_v_attrib);
28393 __Pyx_XDECREF(__pyx_v_nsmap);
28394 __Pyx_XDECREF(__pyx_v__pytype);
28395 __Pyx_XDECREF(__pyx_v__xsi);
28396 __Pyx_XGIVEREF(__pyx_r);
28397 __Pyx_RefNannyFinishContext();
28401 /* "src/lxml/objectpath.pxi":24
28402 * cdef _ObjectPath* _c_path
28403 * cdef Py_ssize_t _path_len
28404 * def __init__(self, path): # <<<<<<<<<<<<<<
28405 * if python._isString(path):
28406 * self._path = _parse_object_path_string(path)
28409 /* Python wrapper */
28410 static int __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28411 static int __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28412 PyObject *__pyx_v_path = 0;
28413 int __pyx_lineno = 0;
28414 const char *__pyx_filename = NULL;
28415 int __pyx_clineno = 0;
28417 __Pyx_RefNannyDeclarations
28418 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
28420 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,0};
28421 PyObject* values[1] = {0};
28422 if (unlikely(__pyx_kwds)) {
28423 Py_ssize_t kw_args;
28424 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28425 switch (pos_args) {
28426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28427 CYTHON_FALLTHROUGH;
28429 default: goto __pyx_L5_argtuple_error;
28431 kw_args = PyDict_Size(__pyx_kwds);
28432 switch (pos_args) {
28434 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
28435 else goto __pyx_L5_argtuple_error;
28437 if (unlikely(kw_args > 0)) {
28438 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 24, __pyx_L3_error)
28440 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
28441 goto __pyx_L5_argtuple_error;
28443 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28445 __pyx_v_path = values[0];
28447 goto __pyx_L4_argument_unpacking_done;
28448 __pyx_L5_argtuple_error:;
28449 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 24, __pyx_L3_error)
28451 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28452 __Pyx_RefNannyFinishContext();
28454 __pyx_L4_argument_unpacking_done:;
28455 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath___init__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_path);
28457 /* function exit code */
28458 __Pyx_RefNannyFinishContext();
28462 static int __pyx_pf_4lxml_9objectify_10ObjectPath___init__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, PyObject *__pyx_v_path) {
28464 __Pyx_RefNannyDeclarations
28466 PyObject *__pyx_t_2 = NULL;
28467 Py_ssize_t __pyx_t_3;
28468 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_t_4;
28469 int __pyx_lineno = 0;
28470 const char *__pyx_filename = NULL;
28471 int __pyx_clineno = 0;
28472 __Pyx_RefNannySetupContext("__init__", 0);
28474 /* "src/lxml/objectpath.pxi":25
28475 * cdef Py_ssize_t _path_len
28476 * def __init__(self, path):
28477 * if python._isString(path): # <<<<<<<<<<<<<<
28478 * self._path = _parse_object_path_string(path)
28479 * self._path_str = path
28481 __pyx_t_1 = (_isString(__pyx_v_path) != 0);
28484 /* "src/lxml/objectpath.pxi":26
28485 * def __init__(self, path):
28486 * if python._isString(path):
28487 * self._path = _parse_object_path_string(path) # <<<<<<<<<<<<<<
28488 * self._path_str = path
28491 __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)
28492 __Pyx_GOTREF(__pyx_t_2);
28493 __Pyx_GIVEREF(__pyx_t_2);
28494 __Pyx_GOTREF(__pyx_v_self->_path);
28495 __Pyx_DECREF(__pyx_v_self->_path);
28496 __pyx_v_self->_path = ((PyObject*)__pyx_t_2);
28499 /* "src/lxml/objectpath.pxi":27
28500 * if python._isString(path):
28501 * self._path = _parse_object_path_string(path)
28502 * self._path_str = path # <<<<<<<<<<<<<<
28504 * self._path = _parse_object_path_list(path)
28506 __Pyx_INCREF(__pyx_v_path);
28507 __Pyx_GIVEREF(__pyx_v_path);
28508 __Pyx_GOTREF(__pyx_v_self->_path_str);
28509 __Pyx_DECREF(__pyx_v_self->_path_str);
28510 __pyx_v_self->_path_str = __pyx_v_path;
28512 /* "src/lxml/objectpath.pxi":25
28513 * cdef Py_ssize_t _path_len
28514 * def __init__(self, path):
28515 * if python._isString(path): # <<<<<<<<<<<<<<
28516 * self._path = _parse_object_path_string(path)
28517 * self._path_str = path
28522 /* "src/lxml/objectpath.pxi":29
28523 * self._path_str = path
28525 * self._path = _parse_object_path_list(path) # <<<<<<<<<<<<<<
28526 * self._path_str = u'.'.join(path)
28527 * self._path_len = len(self._path)
28530 __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)
28531 __Pyx_GOTREF(__pyx_t_2);
28532 __Pyx_GIVEREF(__pyx_t_2);
28533 __Pyx_GOTREF(__pyx_v_self->_path);
28534 __Pyx_DECREF(__pyx_v_self->_path);
28535 __pyx_v_self->_path = ((PyObject*)__pyx_t_2);
28538 /* "src/lxml/objectpath.pxi":30
28540 * self._path = _parse_object_path_list(path)
28541 * self._path_str = u'.'.join(path) # <<<<<<<<<<<<<<
28542 * self._path_len = len(self._path)
28543 * self._c_path = _build_object_path_segments(self._path)
28545 __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error)
28546 __Pyx_GOTREF(__pyx_t_2);
28547 __Pyx_GIVEREF(__pyx_t_2);
28548 __Pyx_GOTREF(__pyx_v_self->_path_str);
28549 __Pyx_DECREF(__pyx_v_self->_path_str);
28550 __pyx_v_self->_path_str = __pyx_t_2;
28555 /* "src/lxml/objectpath.pxi":31
28556 * self._path = _parse_object_path_list(path)
28557 * self._path_str = u'.'.join(path)
28558 * self._path_len = len(self._path) # <<<<<<<<<<<<<<
28559 * self._c_path = _build_object_path_segments(self._path)
28560 * self.find = self.__call__
28562 __pyx_t_2 = __pyx_v_self->_path;
28563 __Pyx_INCREF(__pyx_t_2);
28564 if (unlikely(__pyx_t_2 == Py_None)) {
28565 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
28566 __PYX_ERR(1, 31, __pyx_L1_error)
28568 __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)
28569 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28570 __pyx_v_self->_path_len = __pyx_t_3;
28572 /* "src/lxml/objectpath.pxi":32
28573 * self._path_str = u'.'.join(path)
28574 * self._path_len = len(self._path)
28575 * self._c_path = _build_object_path_segments(self._path) # <<<<<<<<<<<<<<
28576 * self.find = self.__call__
28579 __pyx_t_2 = __pyx_v_self->_path;
28580 __Pyx_INCREF(__pyx_t_2);
28581 __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)
28582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28583 __pyx_v_self->_c_path = __pyx_t_4;
28585 /* "src/lxml/objectpath.pxi":33
28586 * self._path_len = len(self._path)
28587 * self._c_path = _build_object_path_segments(self._path)
28588 * self.find = self.__call__ # <<<<<<<<<<<<<<
28590 * def __dealloc__(self):
28592 __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)
28593 __Pyx_GOTREF(__pyx_t_2);
28594 __Pyx_GIVEREF(__pyx_t_2);
28595 __Pyx_GOTREF(__pyx_v_self->find);
28596 __Pyx_DECREF(__pyx_v_self->find);
28597 __pyx_v_self->find = __pyx_t_2;
28600 /* "src/lxml/objectpath.pxi":24
28601 * cdef _ObjectPath* _c_path
28602 * cdef Py_ssize_t _path_len
28603 * def __init__(self, path): # <<<<<<<<<<<<<<
28604 * if python._isString(path):
28605 * self._path = _parse_object_path_string(path)
28608 /* function exit code */
28612 __Pyx_XDECREF(__pyx_t_2);
28613 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28616 __Pyx_RefNannyFinishContext();
28620 /* "src/lxml/objectpath.pxi":35
28621 * self.find = self.__call__
28623 * def __dealloc__(self): # <<<<<<<<<<<<<<
28624 * if self._c_path is not NULL:
28625 * python.lxml_free(self._c_path)
28628 /* Python wrapper */
28629 static void __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
28630 static void __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(PyObject *__pyx_v_self) {
28631 __Pyx_RefNannyDeclarations
28632 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
28633 __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
28635 /* function exit code */
28636 __Pyx_RefNannyFinishContext();
28639 static void __pyx_pf_4lxml_9objectify_10ObjectPath_2__dealloc__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
28640 __Pyx_RefNannyDeclarations
28642 __Pyx_RefNannySetupContext("__dealloc__", 0);
28644 /* "src/lxml/objectpath.pxi":36
28646 * def __dealloc__(self):
28647 * if self._c_path is not NULL: # <<<<<<<<<<<<<<
28648 * python.lxml_free(self._c_path)
28651 __pyx_t_1 = ((__pyx_v_self->_c_path != NULL) != 0);
28654 /* "src/lxml/objectpath.pxi":37
28655 * def __dealloc__(self):
28656 * if self._c_path is not NULL:
28657 * python.lxml_free(self._c_path) # <<<<<<<<<<<<<<
28659 * def __str__(self):
28661 lxml_free(__pyx_v_self->_c_path);
28663 /* "src/lxml/objectpath.pxi":36
28665 * def __dealloc__(self):
28666 * if self._c_path is not NULL: # <<<<<<<<<<<<<<
28667 * python.lxml_free(self._c_path)
28672 /* "src/lxml/objectpath.pxi":35
28673 * self.find = self.__call__
28675 * def __dealloc__(self): # <<<<<<<<<<<<<<
28676 * if self._c_path is not NULL:
28677 * python.lxml_free(self._c_path)
28680 /* function exit code */
28681 __Pyx_RefNannyFinishContext();
28684 /* "src/lxml/objectpath.pxi":39
28685 * python.lxml_free(self._c_path)
28687 * def __str__(self): # <<<<<<<<<<<<<<
28688 * return self._path_str
28692 /* Python wrapper */
28693 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_5__str__(PyObject *__pyx_v_self); /*proto*/
28694 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_5__str__(PyObject *__pyx_v_self) {
28695 PyObject *__pyx_r = 0;
28696 __Pyx_RefNannyDeclarations
28697 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
28698 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
28700 /* function exit code */
28701 __Pyx_RefNannyFinishContext();
28705 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4__str__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
28706 PyObject *__pyx_r = NULL;
28707 __Pyx_RefNannyDeclarations
28708 __Pyx_RefNannySetupContext("__str__", 0);
28710 /* "src/lxml/objectpath.pxi":40
28712 * def __str__(self):
28713 * return self._path_str # <<<<<<<<<<<<<<
28715 * def __call__(self, _Element root not None, *_default):
28717 __Pyx_XDECREF(__pyx_r);
28718 __Pyx_INCREF(__pyx_v_self->_path_str);
28719 __pyx_r = __pyx_v_self->_path_str;
28722 /* "src/lxml/objectpath.pxi":39
28723 * python.lxml_free(self._c_path)
28725 * def __str__(self): # <<<<<<<<<<<<<<
28726 * return self._path_str
28730 /* function exit code */
28732 __Pyx_XGIVEREF(__pyx_r);
28733 __Pyx_RefNannyFinishContext();
28737 /* "src/lxml/objectpath.pxi":42
28738 * return self._path_str
28740 * def __call__(self, _Element root not None, *_default): # <<<<<<<<<<<<<<
28741 * u"""Follow the attribute path in the object structure and return the
28742 * target attribute value.
28745 /* Python wrapper */
28746 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28747 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 ";
28748 #if CYTHON_COMPILING_IN_CPYTHON
28749 struct wrapperbase __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__;
28751 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_7__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28752 struct LxmlElement *__pyx_v_root = 0;
28753 PyObject *__pyx_v__default = 0;
28754 int __pyx_lineno = 0;
28755 const char *__pyx_filename = NULL;
28756 int __pyx_clineno = 0;
28757 PyObject *__pyx_r = 0;
28758 __Pyx_RefNannyDeclarations
28759 __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
28760 if (PyTuple_GET_SIZE(__pyx_args) > 1) {
28761 __pyx_v__default = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
28762 if (unlikely(!__pyx_v__default)) {
28763 __Pyx_RefNannyFinishContext();
28766 __Pyx_GOTREF(__pyx_v__default);
28768 __pyx_v__default = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
28771 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,0};
28772 PyObject* values[1] = {0};
28773 if (unlikely(__pyx_kwds)) {
28774 Py_ssize_t kw_args;
28775 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28776 switch (pos_args) {
28778 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28779 CYTHON_FALLTHROUGH;
28782 kw_args = PyDict_Size(__pyx_kwds);
28783 switch (pos_args) {
28785 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
28786 else goto __pyx_L5_argtuple_error;
28788 if (unlikely(kw_args > 0)) {
28789 const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
28790 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__call__") < 0)) __PYX_ERR(1, 42, __pyx_L3_error)
28792 } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
28793 goto __pyx_L5_argtuple_error;
28795 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28797 __pyx_v_root = ((struct LxmlElement *)values[0]);
28799 goto __pyx_L4_argument_unpacking_done;
28800 __pyx_L5_argtuple_error:;
28801 __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 42, __pyx_L3_error)
28803 __Pyx_DECREF(__pyx_v__default); __pyx_v__default = 0;
28804 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28805 __Pyx_RefNannyFinishContext();
28807 __pyx_L4_argument_unpacking_done:;
28808 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 42, __pyx_L1_error)
28809 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_6__call__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v__default);
28811 /* function exit code */
28816 __Pyx_XDECREF(__pyx_v__default);
28817 __Pyx_RefNannyFinishContext();
28821 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) {
28822 PyObject *__pyx_v_default = NULL;
28823 PyObject *__pyx_r = NULL;
28824 __Pyx_RefNannyDeclarations
28826 Py_ssize_t __pyx_t_2;
28827 PyObject *__pyx_t_3 = NULL;
28828 int __pyx_lineno = 0;
28829 const char *__pyx_filename = NULL;
28830 int __pyx_clineno = 0;
28831 __Pyx_RefNannySetupContext("__call__", 0);
28833 /* "src/lxml/objectpath.pxi":49
28834 * as second argument) or raises AttributeError.
28836 * if _default: # <<<<<<<<<<<<<<
28837 * if len(_default) > 1:
28838 * raise TypeError, u"invalid number of arguments: needs one or two"
28840 __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v__default) != 0);
28843 /* "src/lxml/objectpath.pxi":50
28846 * if len(_default) > 1: # <<<<<<<<<<<<<<
28847 * raise TypeError, u"invalid number of arguments: needs one or two"
28848 * default = _default[0]
28850 __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)
28851 __pyx_t_1 = ((__pyx_t_2 > 1) != 0);
28852 if (unlikely(__pyx_t_1)) {
28854 /* "src/lxml/objectpath.pxi":51
28856 * if len(_default) > 1:
28857 * raise TypeError, u"invalid number of arguments: needs one or two" # <<<<<<<<<<<<<<
28858 * default = _default[0]
28861 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_number_of_arguments_need, 0, 0);
28862 __PYX_ERR(1, 51, __pyx_L1_error)
28864 /* "src/lxml/objectpath.pxi":50
28867 * if len(_default) > 1: # <<<<<<<<<<<<<<
28868 * raise TypeError, u"invalid number of arguments: needs one or two"
28869 * default = _default[0]
28873 /* "src/lxml/objectpath.pxi":52
28874 * if len(_default) > 1:
28875 * raise TypeError, u"invalid number of arguments: needs one or two"
28876 * default = _default[0] # <<<<<<<<<<<<<<
28878 * default = _NO_DEFAULT
28880 __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)
28881 __Pyx_GOTREF(__pyx_t_3);
28882 __pyx_v_default = __pyx_t_3;
28885 /* "src/lxml/objectpath.pxi":49
28886 * as second argument) or raises AttributeError.
28888 * if _default: # <<<<<<<<<<<<<<
28889 * if len(_default) > 1:
28890 * raise TypeError, u"invalid number of arguments: needs one or two"
28895 /* "src/lxml/objectpath.pxi":54
28896 * default = _default[0]
28898 * default = _NO_DEFAULT # <<<<<<<<<<<<<<
28899 * return _find_object_path(root, self._c_path, self._path_len, default)
28903 __Pyx_INCREF(__pyx_v_4lxml_9objectify__NO_DEFAULT);
28904 __pyx_v_default = __pyx_v_4lxml_9objectify__NO_DEFAULT;
28908 /* "src/lxml/objectpath.pxi":55
28910 * default = _NO_DEFAULT
28911 * return _find_object_path(root, self._c_path, self._path_len, default) # <<<<<<<<<<<<<<
28913 * def hasattr(self, _Element root not None):
28915 __Pyx_XDECREF(__pyx_r);
28916 __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)
28917 __Pyx_GOTREF(__pyx_t_3);
28918 __pyx_r = __pyx_t_3;
28922 /* "src/lxml/objectpath.pxi":42
28923 * return self._path_str
28925 * def __call__(self, _Element root not None, *_default): # <<<<<<<<<<<<<<
28926 * u"""Follow the attribute path in the object structure and return the
28927 * target attribute value.
28930 /* function exit code */
28932 __Pyx_XDECREF(__pyx_t_3);
28933 __Pyx_AddTraceback("lxml.objectify.ObjectPath.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28936 __Pyx_XDECREF(__pyx_v_default);
28937 __Pyx_XGIVEREF(__pyx_r);
28938 __Pyx_RefNannyFinishContext();
28942 /* "src/lxml/objectpath.pxi":57
28943 * return _find_object_path(root, self._c_path, self._path_len, default)
28945 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
28946 * u"hasattr(self, root)"
28950 /* Python wrapper */
28951 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr(PyObject *__pyx_v_self, PyObject *__pyx_v_root); /*proto*/
28952 static char __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr[] = "hasattr(self, root)";
28953 static PyMethodDef __pyx_mdef_4lxml_9objectify_10ObjectPath_9hasattr = {"hasattr", (PyCFunction)__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr, METH_O, __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr};
28954 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr(PyObject *__pyx_v_self, PyObject *__pyx_v_root) {
28955 int __pyx_lineno = 0;
28956 const char *__pyx_filename = NULL;
28957 int __pyx_clineno = 0;
28958 PyObject *__pyx_r = 0;
28959 __Pyx_RefNannyDeclarations
28960 __Pyx_RefNannySetupContext("hasattr (wrapper)", 0);
28961 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 57, __pyx_L1_error)
28962 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_root));
28964 /* function exit code */
28969 __Pyx_RefNannyFinishContext();
28973 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_8hasattr(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self, struct LxmlElement *__pyx_v_root) {
28974 PyObject *__pyx_r = NULL;
28975 __Pyx_RefNannyDeclarations
28976 PyObject *__pyx_t_1 = NULL;
28977 PyObject *__pyx_t_2 = NULL;
28978 PyObject *__pyx_t_3 = NULL;
28979 PyObject *__pyx_t_4 = NULL;
28980 PyObject *__pyx_t_5 = NULL;
28982 PyObject *__pyx_t_7 = NULL;
28983 int __pyx_lineno = 0;
28984 const char *__pyx_filename = NULL;
28985 int __pyx_clineno = 0;
28986 __Pyx_RefNannySetupContext("hasattr", 0);
28988 /* "src/lxml/objectpath.pxi":59
28989 * def hasattr(self, _Element root not None):
28990 * u"hasattr(self, root)"
28991 * try: # <<<<<<<<<<<<<<
28992 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
28993 * except AttributeError:
28996 __Pyx_PyThreadState_declare
28997 __Pyx_PyThreadState_assign
28998 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28999 __Pyx_XGOTREF(__pyx_t_1);
29000 __Pyx_XGOTREF(__pyx_t_2);
29001 __Pyx_XGOTREF(__pyx_t_3);
29004 /* "src/lxml/objectpath.pxi":60
29005 * u"hasattr(self, root)"
29007 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT) # <<<<<<<<<<<<<<
29008 * except AttributeError:
29011 __pyx_t_4 = __pyx_v_4lxml_9objectify__NO_DEFAULT;
29012 __Pyx_INCREF(__pyx_t_4);
29013 __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)
29014 __Pyx_GOTREF(__pyx_t_5);
29015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29016 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29018 /* "src/lxml/objectpath.pxi":59
29019 * def hasattr(self, _Element root not None):
29020 * u"hasattr(self, root)"
29021 * try: # <<<<<<<<<<<<<<
29022 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29023 * except AttributeError:
29026 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29027 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29028 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29029 goto __pyx_L8_try_end;
29031 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29032 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29034 /* "src/lxml/objectpath.pxi":61
29036 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29037 * except AttributeError: # <<<<<<<<<<<<<<
29041 __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
29043 __Pyx_AddTraceback("lxml.objectify.ObjectPath.hasattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29044 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 61, __pyx_L5_except_error)
29045 __Pyx_GOTREF(__pyx_t_5);
29046 __Pyx_GOTREF(__pyx_t_4);
29047 __Pyx_GOTREF(__pyx_t_7);
29049 /* "src/lxml/objectpath.pxi":62
29050 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29051 * except AttributeError:
29052 * return False # <<<<<<<<<<<<<<
29056 __Pyx_XDECREF(__pyx_r);
29057 __Pyx_INCREF(Py_False);
29058 __pyx_r = Py_False;
29059 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29060 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29061 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29062 goto __pyx_L6_except_return;
29064 goto __pyx_L5_except_error;
29065 __pyx_L5_except_error:;
29067 /* "src/lxml/objectpath.pxi":59
29068 * def hasattr(self, _Element root not None):
29069 * u"hasattr(self, root)"
29070 * try: # <<<<<<<<<<<<<<
29071 * _find_object_path(root, self._c_path, self._path_len, _NO_DEFAULT)
29072 * except AttributeError:
29074 __Pyx_XGIVEREF(__pyx_t_1);
29075 __Pyx_XGIVEREF(__pyx_t_2);
29076 __Pyx_XGIVEREF(__pyx_t_3);
29077 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29078 goto __pyx_L1_error;
29079 __pyx_L6_except_return:;
29080 __Pyx_XGIVEREF(__pyx_t_1);
29081 __Pyx_XGIVEREF(__pyx_t_2);
29082 __Pyx_XGIVEREF(__pyx_t_3);
29083 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29088 /* "src/lxml/objectpath.pxi":63
29089 * except AttributeError:
29091 * return True # <<<<<<<<<<<<<<
29093 * def setattr(self, _Element root not None, value):
29095 __Pyx_XDECREF(__pyx_r);
29096 __Pyx_INCREF(Py_True);
29100 /* "src/lxml/objectpath.pxi":57
29101 * return _find_object_path(root, self._c_path, self._path_len, default)
29103 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
29104 * u"hasattr(self, root)"
29108 /* function exit code */
29110 __Pyx_XDECREF(__pyx_t_4);
29111 __Pyx_XDECREF(__pyx_t_5);
29112 __Pyx_XDECREF(__pyx_t_7);
29113 __Pyx_AddTraceback("lxml.objectify.ObjectPath.hasattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29116 __Pyx_XGIVEREF(__pyx_r);
29117 __Pyx_RefNannyFinishContext();
29121 /* "src/lxml/objectpath.pxi":65
29124 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29125 * u"""setattr(self, root, value)
29129 /* Python wrapper */
29130 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29131 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 ";
29132 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};
29133 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29134 struct LxmlElement *__pyx_v_root = 0;
29135 PyObject *__pyx_v_value = 0;
29136 int __pyx_lineno = 0;
29137 const char *__pyx_filename = NULL;
29138 int __pyx_clineno = 0;
29139 PyObject *__pyx_r = 0;
29140 __Pyx_RefNannyDeclarations
29141 __Pyx_RefNannySetupContext("setattr (wrapper)", 0);
29143 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_value,0};
29144 PyObject* values[2] = {0,0};
29145 if (unlikely(__pyx_kwds)) {
29146 Py_ssize_t kw_args;
29147 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29148 switch (pos_args) {
29149 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29150 CYTHON_FALLTHROUGH;
29151 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29152 CYTHON_FALLTHROUGH;
29154 default: goto __pyx_L5_argtuple_error;
29156 kw_args = PyDict_Size(__pyx_kwds);
29157 switch (pos_args) {
29159 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
29160 else goto __pyx_L5_argtuple_error;
29161 CYTHON_FALLTHROUGH;
29163 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
29165 __Pyx_RaiseArgtupleInvalid("setattr", 1, 2, 2, 1); __PYX_ERR(1, 65, __pyx_L3_error)
29168 if (unlikely(kw_args > 0)) {
29169 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setattr") < 0)) __PYX_ERR(1, 65, __pyx_L3_error)
29171 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
29172 goto __pyx_L5_argtuple_error;
29174 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29175 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29177 __pyx_v_root = ((struct LxmlElement *)values[0]);
29178 __pyx_v_value = values[1];
29180 goto __pyx_L4_argument_unpacking_done;
29181 __pyx_L5_argtuple_error:;
29182 __Pyx_RaiseArgtupleInvalid("setattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 65, __pyx_L3_error)
29184 __Pyx_AddTraceback("lxml.objectify.ObjectPath.setattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29185 __Pyx_RefNannyFinishContext();
29187 __pyx_L4_argument_unpacking_done:;
29188 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 65, __pyx_L1_error)
29189 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_10setattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v_value);
29191 /* function exit code */
29196 __Pyx_RefNannyFinishContext();
29200 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) {
29201 PyObject *__pyx_r = NULL;
29202 __Pyx_RefNannyDeclarations
29203 PyObject *__pyx_t_1 = NULL;
29204 int __pyx_lineno = 0;
29205 const char *__pyx_filename = NULL;
29206 int __pyx_clineno = 0;
29207 __Pyx_RefNannySetupContext("setattr", 0);
29209 /* "src/lxml/objectpath.pxi":72
29210 * If any of the children on the path does not exist, it is created.
29212 * _create_object_path(root, self._c_path, self._path_len, 1, value) # <<<<<<<<<<<<<<
29214 * def addattr(self, _Element root not None, value):
29216 __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)
29217 __Pyx_GOTREF(__pyx_t_1);
29218 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29220 /* "src/lxml/objectpath.pxi":65
29223 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29224 * u"""setattr(self, root, value)
29228 /* function exit code */
29229 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29232 __Pyx_XDECREF(__pyx_t_1);
29233 __Pyx_AddTraceback("lxml.objectify.ObjectPath.setattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29236 __Pyx_XGIVEREF(__pyx_r);
29237 __Pyx_RefNannyFinishContext();
29241 /* "src/lxml/objectpath.pxi":74
29242 * _create_object_path(root, self._c_path, self._path_len, 1, value)
29244 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29245 * u"""addattr(self, root, value)
29249 /* Python wrapper */
29250 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29251 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 ";
29252 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};
29253 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29254 struct LxmlElement *__pyx_v_root = 0;
29255 PyObject *__pyx_v_value = 0;
29256 int __pyx_lineno = 0;
29257 const char *__pyx_filename = NULL;
29258 int __pyx_clineno = 0;
29259 PyObject *__pyx_r = 0;
29260 __Pyx_RefNannyDeclarations
29261 __Pyx_RefNannySetupContext("addattr (wrapper)", 0);
29263 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_value,0};
29264 PyObject* values[2] = {0,0};
29265 if (unlikely(__pyx_kwds)) {
29266 Py_ssize_t kw_args;
29267 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29268 switch (pos_args) {
29269 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29270 CYTHON_FALLTHROUGH;
29271 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29272 CYTHON_FALLTHROUGH;
29274 default: goto __pyx_L5_argtuple_error;
29276 kw_args = PyDict_Size(__pyx_kwds);
29277 switch (pos_args) {
29279 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
29280 else goto __pyx_L5_argtuple_error;
29281 CYTHON_FALLTHROUGH;
29283 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
29285 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, 1); __PYX_ERR(1, 74, __pyx_L3_error)
29288 if (unlikely(kw_args > 0)) {
29289 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "addattr") < 0)) __PYX_ERR(1, 74, __pyx_L3_error)
29291 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
29292 goto __pyx_L5_argtuple_error;
29294 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29295 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
29297 __pyx_v_root = ((struct LxmlElement *)values[0]);
29298 __pyx_v_value = values[1];
29300 goto __pyx_L4_argument_unpacking_done;
29301 __pyx_L5_argtuple_error:;
29302 __Pyx_RaiseArgtupleInvalid("addattr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 74, __pyx_L3_error)
29304 __Pyx_AddTraceback("lxml.objectify.ObjectPath.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29305 __Pyx_RefNannyFinishContext();
29307 __pyx_L4_argument_unpacking_done:;
29308 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_8includes_11etreepublic__Element, 0, "root", 0))) __PYX_ERR(1, 74, __pyx_L1_error)
29309 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_12addattr(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self), __pyx_v_root, __pyx_v_value);
29311 /* function exit code */
29316 __Pyx_RefNannyFinishContext();
29320 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) {
29321 PyObject *__pyx_r = NULL;
29322 __Pyx_RefNannyDeclarations
29323 PyObject *__pyx_t_1 = NULL;
29324 int __pyx_lineno = 0;
29325 const char *__pyx_filename = NULL;
29326 int __pyx_clineno = 0;
29327 __Pyx_RefNannySetupContext("addattr", 0);
29329 /* "src/lxml/objectpath.pxi":81
29330 * If any of the children on the path does not exist, it is created.
29332 * _create_object_path(root, self._c_path, self._path_len, 0, value) # <<<<<<<<<<<<<<
29336 __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)
29337 __Pyx_GOTREF(__pyx_t_1);
29338 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29340 /* "src/lxml/objectpath.pxi":74
29341 * _create_object_path(root, self._c_path, self._path_len, 1, value)
29343 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
29344 * u"""addattr(self, root, value)
29348 /* function exit code */
29349 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29352 __Pyx_XDECREF(__pyx_t_1);
29353 __Pyx_AddTraceback("lxml.objectify.ObjectPath.addattr", __pyx_clineno, __pyx_lineno, __pyx_filename);
29356 __Pyx_XGIVEREF(__pyx_r);
29357 __Pyx_RefNannyFinishContext();
29361 /* "src/lxml/objectpath.pxi":19
29362 * Example for a path: 'root.child[1].{other}child[25]'
29364 * cdef readonly object find # <<<<<<<<<<<<<<
29366 * cdef object _path_str
29369 /* Python wrapper */
29370 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(PyObject *__pyx_v_self); /*proto*/
29371 static PyObject *__pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(PyObject *__pyx_v_self) {
29372 PyObject *__pyx_r = 0;
29373 __Pyx_RefNannyDeclarations
29374 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29375 __pyx_r = __pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(((struct __pyx_obj_4lxml_9objectify_ObjectPath *)__pyx_v_self));
29377 /* function exit code */
29378 __Pyx_RefNannyFinishContext();
29382 static PyObject *__pyx_pf_4lxml_9objectify_10ObjectPath_4find___get__(struct __pyx_obj_4lxml_9objectify_ObjectPath *__pyx_v_self) {
29383 PyObject *__pyx_r = NULL;
29384 __Pyx_RefNannyDeclarations
29385 __Pyx_RefNannySetupContext("__get__", 0);
29386 __Pyx_XDECREF(__pyx_r);
29387 __Pyx_INCREF(__pyx_v_self->find);
29388 __pyx_r = __pyx_v_self->find;
29391 /* function exit code */
29393 __Pyx_XGIVEREF(__pyx_r);
29394 __Pyx_RefNannyFinishContext();
29398 /* "src/lxml/objectpath.pxi":91
29401 * cdef list _parse_object_path_string(_path): # <<<<<<<<<<<<<<
29402 * u"""Parse object path string into a (ns, name, index) list.
29406 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_string(PyObject *__pyx_v__path) {
29407 int __pyx_v_has_dot;
29408 PyObject *__pyx_v_path = 0;
29409 PyObject *__pyx_v_new_path = NULL;
29410 PyObject *__pyx_v_path_pos = NULL;
29411 PyObject *__pyx_v_match = NULL;
29412 PyObject *__pyx_v_dot = NULL;
29413 PyObject *__pyx_v_ns = NULL;
29414 PyObject *__pyx_v_name = NULL;
29415 PyObject *__pyx_v_index = NULL;
29416 PyObject *__pyx_r = NULL;
29417 __Pyx_RefNannyDeclarations
29418 PyObject *__pyx_t_1 = NULL;
29421 PyObject *__pyx_t_4 = NULL;
29422 PyObject *__pyx_t_5 = NULL;
29424 PyObject *__pyx_t_7 = NULL;
29425 PyObject *__pyx_t_8 = NULL;
29426 PyObject *__pyx_t_9 = NULL;
29427 PyObject *(*__pyx_t_10)(PyObject *);
29430 Py_ssize_t __pyx_t_13;
29431 int __pyx_lineno = 0;
29432 const char *__pyx_filename = NULL;
29433 int __pyx_clineno = 0;
29434 __Pyx_RefNannySetupContext("_parse_object_path_string", 0);
29436 /* "src/lxml/objectpath.pxi":96
29437 * cdef bint has_dot
29438 * cdef unicode path
29439 * new_path = [] # <<<<<<<<<<<<<<
29440 * if isinstance(_path, bytes):
29441 * path = (<bytes>_path).decode('ascii')
29443 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
29444 __Pyx_GOTREF(__pyx_t_1);
29445 __pyx_v_new_path = ((PyObject*)__pyx_t_1);
29448 /* "src/lxml/objectpath.pxi":97
29449 * cdef unicode path
29451 * if isinstance(_path, bytes): # <<<<<<<<<<<<<<
29452 * path = (<bytes>_path).decode('ascii')
29453 * elif type(_path) is not unicode:
29455 __pyx_t_2 = PyBytes_Check(__pyx_v__path);
29456 __pyx_t_3 = (__pyx_t_2 != 0);
29459 /* "src/lxml/objectpath.pxi":98
29461 * if isinstance(_path, bytes):
29462 * path = (<bytes>_path).decode('ascii') # <<<<<<<<<<<<<<
29463 * elif type(_path) is not unicode:
29464 * path = unicode(_path)
29466 if (unlikely(__pyx_v__path == Py_None)) {
29467 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
29468 __PYX_ERR(1, 98, __pyx_L1_error)
29470 __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)
29471 __Pyx_GOTREF(__pyx_t_1);
29472 __pyx_v_path = ((PyObject*)__pyx_t_1);
29475 /* "src/lxml/objectpath.pxi":97
29476 * cdef unicode path
29478 * if isinstance(_path, bytes): # <<<<<<<<<<<<<<
29479 * path = (<bytes>_path).decode('ascii')
29480 * elif type(_path) is not unicode:
29485 /* "src/lxml/objectpath.pxi":99
29486 * if isinstance(_path, bytes):
29487 * path = (<bytes>_path).decode('ascii')
29488 * elif type(_path) is not unicode: # <<<<<<<<<<<<<<
29489 * path = unicode(_path)
29492 __pyx_t_3 = (((PyObject *)Py_TYPE(__pyx_v__path)) != ((PyObject *)(&PyUnicode_Type)));
29493 __pyx_t_2 = (__pyx_t_3 != 0);
29496 /* "src/lxml/objectpath.pxi":100
29497 * path = (<bytes>_path).decode('ascii')
29498 * elif type(_path) is not unicode:
29499 * path = unicode(_path) # <<<<<<<<<<<<<<
29503 __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v__path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 100, __pyx_L1_error)
29504 __Pyx_GOTREF(__pyx_t_1);
29505 __pyx_v_path = ((PyObject*)__pyx_t_1);
29508 /* "src/lxml/objectpath.pxi":99
29509 * if isinstance(_path, bytes):
29510 * path = (<bytes>_path).decode('ascii')
29511 * elif type(_path) is not unicode: # <<<<<<<<<<<<<<
29512 * path = unicode(_path)
29518 /* "src/lxml/objectpath.pxi":102
29519 * path = unicode(_path)
29521 * path = _path # <<<<<<<<<<<<<<
29522 * path = path.strip()
29526 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)
29527 __pyx_t_1 = __pyx_v__path;
29528 __Pyx_INCREF(__pyx_t_1);
29529 __pyx_v_path = ((PyObject*)__pyx_t_1);
29534 /* "src/lxml/objectpath.pxi":103
29537 * path = path.strip() # <<<<<<<<<<<<<<
29539 * return [_RELATIVE_PATH_SEGMENT]
29541 __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)
29542 __Pyx_GOTREF(__pyx_t_1);
29543 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)
29544 __Pyx_DECREF_SET(__pyx_v_path, ((PyObject*)__pyx_t_1));
29547 /* "src/lxml/objectpath.pxi":104
29549 * path = path.strip()
29550 * if path == u'.': # <<<<<<<<<<<<<<
29551 * return [_RELATIVE_PATH_SEGMENT]
29554 __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)
29555 __pyx_t_3 = (__pyx_t_2 != 0);
29558 /* "src/lxml/objectpath.pxi":105
29559 * path = path.strip()
29561 * return [_RELATIVE_PATH_SEGMENT] # <<<<<<<<<<<<<<
29565 __Pyx_XDECREF(__pyx_r);
29566 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
29567 __Pyx_GOTREF(__pyx_t_1);
29568 __Pyx_INCREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29569 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29570 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
29571 __pyx_r = ((PyObject*)__pyx_t_1);
29575 /* "src/lxml/objectpath.pxi":104
29577 * path = path.strip()
29578 * if path == u'.': # <<<<<<<<<<<<<<
29579 * return [_RELATIVE_PATH_SEGMENT]
29584 /* "src/lxml/objectpath.pxi":106
29586 * return [_RELATIVE_PATH_SEGMENT]
29587 * path_pos = 0 # <<<<<<<<<<<<<<
29589 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29591 __Pyx_INCREF(__pyx_int_0);
29592 __pyx_v_path_pos = __pyx_int_0;
29594 /* "src/lxml/objectpath.pxi":107
29595 * return [_RELATIVE_PATH_SEGMENT]
29597 * while path: # <<<<<<<<<<<<<<
29598 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29599 * if match is None:
29602 __pyx_t_3 = (__pyx_v_path != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_path) != 0);
29603 if (!__pyx_t_3) break;
29605 /* "src/lxml/objectpath.pxi":108
29608 * match = __MATCH_PATH_SEGMENT(path, path_pos) # <<<<<<<<<<<<<<
29609 * if match is None:
29612 __Pyx_INCREF(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
29613 __pyx_t_4 = __pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT; __pyx_t_5 = NULL;
29615 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
29616 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
29617 if (likely(__pyx_t_5)) {
29618 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
29619 __Pyx_INCREF(__pyx_t_5);
29620 __Pyx_INCREF(function);
29621 __Pyx_DECREF_SET(__pyx_t_4, function);
29625 #if CYTHON_FAST_PYCALL
29626 if (PyFunction_Check(__pyx_t_4)) {
29627 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_path, __pyx_v_path_pos};
29628 __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)
29629 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29630 __Pyx_GOTREF(__pyx_t_1);
29633 #if CYTHON_FAST_PYCCALL
29634 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
29635 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_path, __pyx_v_path_pos};
29636 __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)
29637 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29638 __Pyx_GOTREF(__pyx_t_1);
29642 __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 108, __pyx_L1_error)
29643 __Pyx_GOTREF(__pyx_t_7);
29645 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
29647 __Pyx_INCREF(__pyx_v_path);
29648 __Pyx_GIVEREF(__pyx_v_path);
29649 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_path);
29650 __Pyx_INCREF(__pyx_v_path_pos);
29651 __Pyx_GIVEREF(__pyx_v_path_pos);
29652 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_path_pos);
29653 __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)
29654 __Pyx_GOTREF(__pyx_t_1);
29655 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29657 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29658 __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_1);
29661 /* "src/lxml/objectpath.pxi":109
29663 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29664 * if match is None: # <<<<<<<<<<<<<<
29668 __pyx_t_3 = (__pyx_v_match == Py_None);
29669 __pyx_t_2 = (__pyx_t_3 != 0);
29672 /* "src/lxml/objectpath.pxi":110
29673 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29674 * if match is None:
29675 * break # <<<<<<<<<<<<<<
29677 * dot, ns, name, index = match.groups()
29679 goto __pyx_L6_break;
29681 /* "src/lxml/objectpath.pxi":109
29683 * match = __MATCH_PATH_SEGMENT(path, path_pos)
29684 * if match is None: # <<<<<<<<<<<<<<
29690 /* "src/lxml/objectpath.pxi":112
29693 * dot, ns, name, index = match.groups() # <<<<<<<<<<<<<<
29694 * index = int(index) if index else 0
29695 * has_dot = dot == u'.'
29697 __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)
29698 __Pyx_GOTREF(__pyx_t_4);
29700 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
29701 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
29702 if (likely(__pyx_t_7)) {
29703 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
29704 __Pyx_INCREF(__pyx_t_7);
29705 __Pyx_INCREF(function);
29706 __Pyx_DECREF_SET(__pyx_t_4, function);
29709 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
29710 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29711 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 112, __pyx_L1_error)
29712 __Pyx_GOTREF(__pyx_t_1);
29713 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29714 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
29715 PyObject* sequence = __pyx_t_1;
29716 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
29717 if (unlikely(size != 4)) {
29718 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
29719 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29720 __PYX_ERR(1, 112, __pyx_L1_error)
29722 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29723 if (likely(PyTuple_CheckExact(sequence))) {
29724 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
29725 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
29726 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
29727 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
29729 __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
29730 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
29731 __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
29732 __pyx_t_8 = PyList_GET_ITEM(sequence, 3);
29734 __Pyx_INCREF(__pyx_t_4);
29735 __Pyx_INCREF(__pyx_t_7);
29736 __Pyx_INCREF(__pyx_t_5);
29737 __Pyx_INCREF(__pyx_t_8);
29741 PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8};
29742 for (i=0; i < 4; i++) {
29743 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 112, __pyx_L1_error)
29744 __Pyx_GOTREF(item);
29745 *(temps[i]) = item;
29749 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29751 Py_ssize_t index = -1;
29752 PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_5,&__pyx_t_8};
29753 __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 112, __pyx_L1_error)
29754 __Pyx_GOTREF(__pyx_t_9);
29755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29756 __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
29757 for (index=0; index < 4; index++) {
29758 PyObject* item = __pyx_t_10(__pyx_t_9); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
29759 __Pyx_GOTREF(item);
29760 *(temps[index]) = item;
29762 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 4) < 0) __PYX_ERR(1, 112, __pyx_L1_error)
29764 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
29765 goto __pyx_L9_unpacking_done;
29766 __pyx_L8_unpacking_failed:;
29767 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
29769 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
29770 __PYX_ERR(1, 112, __pyx_L1_error)
29771 __pyx_L9_unpacking_done:;
29773 __Pyx_XDECREF_SET(__pyx_v_dot, __pyx_t_4);
29775 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
29777 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
29779 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
29782 /* "src/lxml/objectpath.pxi":113
29784 * dot, ns, name, index = match.groups()
29785 * index = int(index) if index else 0 # <<<<<<<<<<<<<<
29786 * has_dot = dot == u'.'
29789 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 113, __pyx_L1_error)
29791 __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_v_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 113, __pyx_L1_error)
29792 __Pyx_GOTREF(__pyx_t_8);
29793 __pyx_t_1 = __pyx_t_8;
29796 __Pyx_INCREF(__pyx_int_0);
29797 __pyx_t_1 = __pyx_int_0;
29799 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_1);
29802 /* "src/lxml/objectpath.pxi":114
29803 * dot, ns, name, index = match.groups()
29804 * index = int(index) if index else 0
29805 * has_dot = dot == u'.' # <<<<<<<<<<<<<<
29809 __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)
29810 __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)
29811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29812 __pyx_v_has_dot = __pyx_t_2;
29814 /* "src/lxml/objectpath.pxi":115
29815 * index = int(index) if index else 0
29816 * has_dot = dot == u'.'
29817 * if not new_path: # <<<<<<<<<<<<<<
29819 * # path '.child' => ignore root
29821 __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
29822 __pyx_t_3 = ((!__pyx_t_2) != 0);
29825 /* "src/lxml/objectpath.pxi":116
29826 * has_dot = dot == u'.'
29828 * if has_dot: # <<<<<<<<<<<<<<
29829 * # path '.child' => ignore root
29830 * new_path.append(_RELATIVE_PATH_SEGMENT)
29832 __pyx_t_3 = (__pyx_v_has_dot != 0);
29835 /* "src/lxml/objectpath.pxi":118
29837 * # path '.child' => ignore root
29838 * new_path.append(_RELATIVE_PATH_SEGMENT) # <<<<<<<<<<<<<<
29840 * raise ValueError, u"index not allowed on root node"
29842 __pyx_t_1 = __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT;
29843 __Pyx_INCREF(__pyx_t_1);
29844 __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)
29845 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29847 /* "src/lxml/objectpath.pxi":116
29848 * has_dot = dot == u'.'
29850 * if has_dot: # <<<<<<<<<<<<<<
29851 * # path '.child' => ignore root
29852 * new_path.append(_RELATIVE_PATH_SEGMENT)
29857 /* "src/lxml/objectpath.pxi":119
29858 * # path '.child' => ignore root
29859 * new_path.append(_RELATIVE_PATH_SEGMENT)
29860 * elif index: # <<<<<<<<<<<<<<
29861 * raise ValueError, u"index not allowed on root node"
29862 * elif not has_dot:
29864 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_index); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 119, __pyx_L1_error)
29865 if (unlikely(__pyx_t_3)) {
29867 /* "src/lxml/objectpath.pxi":120
29868 * new_path.append(_RELATIVE_PATH_SEGMENT)
29870 * raise ValueError, u"index not allowed on root node" # <<<<<<<<<<<<<<
29871 * elif not has_dot:
29872 * raise ValueError, u"invalid path"
29874 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_not_allowed_on_root_node, 0, 0);
29875 __PYX_ERR(1, 120, __pyx_L1_error)
29877 /* "src/lxml/objectpath.pxi":119
29878 * # path '.child' => ignore root
29879 * new_path.append(_RELATIVE_PATH_SEGMENT)
29880 * elif index: # <<<<<<<<<<<<<<
29881 * raise ValueError, u"index not allowed on root node"
29882 * elif not has_dot:
29887 /* "src/lxml/objectpath.pxi":115
29888 * index = int(index) if index else 0
29889 * has_dot = dot == u'.'
29890 * if not new_path: # <<<<<<<<<<<<<<
29892 * # path '.child' => ignore root
29897 /* "src/lxml/objectpath.pxi":121
29899 * raise ValueError, u"index not allowed on root node"
29900 * elif not has_dot: # <<<<<<<<<<<<<<
29901 * raise ValueError, u"invalid path"
29902 * if ns is not None:
29904 __pyx_t_3 = ((!(__pyx_v_has_dot != 0)) != 0);
29905 if (unlikely(__pyx_t_3)) {
29907 /* "src/lxml/objectpath.pxi":122
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:
29912 * ns = python.PyUnicode_AsUTF8String(ns)
29914 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
29915 __PYX_ERR(1, 122, __pyx_L1_error)
29917 /* "src/lxml/objectpath.pxi":121
29919 * raise ValueError, u"index not allowed on root node"
29920 * elif not has_dot: # <<<<<<<<<<<<<<
29921 * raise ValueError, u"invalid path"
29922 * if ns is not None:
29927 /* "src/lxml/objectpath.pxi":123
29928 * elif not has_dot:
29929 * raise ValueError, u"invalid path"
29930 * if ns is not None: # <<<<<<<<<<<<<<
29931 * ns = python.PyUnicode_AsUTF8String(ns)
29932 * name = python.PyUnicode_AsUTF8String(name)
29934 __pyx_t_3 = (__pyx_v_ns != Py_None);
29935 __pyx_t_2 = (__pyx_t_3 != 0);
29938 /* "src/lxml/objectpath.pxi":124
29939 * raise ValueError, u"invalid path"
29940 * if ns is not None:
29941 * ns = python.PyUnicode_AsUTF8String(ns) # <<<<<<<<<<<<<<
29942 * name = python.PyUnicode_AsUTF8String(name)
29943 * new_path.append( (ns, name, index) )
29945 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error)
29946 __Pyx_GOTREF(__pyx_t_1);
29947 __Pyx_DECREF_SET(__pyx_v_ns, __pyx_t_1);
29950 /* "src/lxml/objectpath.pxi":123
29951 * elif not has_dot:
29952 * raise ValueError, u"invalid path"
29953 * if ns is not None: # <<<<<<<<<<<<<<
29954 * ns = python.PyUnicode_AsUTF8String(ns)
29955 * name = python.PyUnicode_AsUTF8String(name)
29959 /* "src/lxml/objectpath.pxi":125
29960 * if ns is not None:
29961 * ns = python.PyUnicode_AsUTF8String(ns)
29962 * name = python.PyUnicode_AsUTF8String(name) # <<<<<<<<<<<<<<
29963 * new_path.append( (ns, name, index) )
29966 __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error)
29967 __Pyx_GOTREF(__pyx_t_1);
29968 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
29971 /* "src/lxml/objectpath.pxi":126
29972 * ns = python.PyUnicode_AsUTF8String(ns)
29973 * name = python.PyUnicode_AsUTF8String(name)
29974 * new_path.append( (ns, name, index) ) # <<<<<<<<<<<<<<
29976 * path_pos = match.end()
29978 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
29979 __Pyx_GOTREF(__pyx_t_1);
29980 __Pyx_INCREF(__pyx_v_ns);
29981 __Pyx_GIVEREF(__pyx_v_ns);
29982 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ns);
29983 __Pyx_INCREF(__pyx_v_name);
29984 __Pyx_GIVEREF(__pyx_v_name);
29985 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_name);
29986 __Pyx_INCREF(__pyx_v_index);
29987 __Pyx_GIVEREF(__pyx_v_index);
29988 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_index);
29989 __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)
29990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29992 /* "src/lxml/objectpath.pxi":128
29993 * new_path.append( (ns, name, index) )
29995 * path_pos = match.end() # <<<<<<<<<<<<<<
29996 * if not new_path or len(path) > path_pos:
29997 * raise ValueError, u"invalid path"
29999 __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)
30000 __Pyx_GOTREF(__pyx_t_8);
30002 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
30003 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
30004 if (likely(__pyx_t_5)) {
30005 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
30006 __Pyx_INCREF(__pyx_t_5);
30007 __Pyx_INCREF(function);
30008 __Pyx_DECREF_SET(__pyx_t_8, function);
30011 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
30012 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
30013 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
30014 __Pyx_GOTREF(__pyx_t_1);
30015 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30016 __Pyx_DECREF_SET(__pyx_v_path_pos, __pyx_t_1);
30021 /* "src/lxml/objectpath.pxi":129
30023 * path_pos = match.end()
30024 * if not new_path or len(path) > path_pos: # <<<<<<<<<<<<<<
30025 * raise ValueError, u"invalid path"
30028 __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30029 __pyx_t_12 = ((!__pyx_t_3) != 0);
30032 __pyx_t_2 = __pyx_t_12;
30033 goto __pyx_L14_bool_binop_done;
30035 if (unlikely(__pyx_v_path == Py_None)) {
30036 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30037 __PYX_ERR(1, 129, __pyx_L1_error)
30039 __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)
30040 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
30041 __Pyx_GOTREF(__pyx_t_1);
30042 __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)
30043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30044 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(1, 129, __pyx_L1_error)
30045 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30046 __pyx_t_2 = __pyx_t_12;
30047 __pyx_L14_bool_binop_done:;
30048 if (unlikely(__pyx_t_2)) {
30050 /* "src/lxml/objectpath.pxi":130
30051 * path_pos = match.end()
30052 * if not new_path or len(path) > path_pos:
30053 * raise ValueError, u"invalid path" # <<<<<<<<<<<<<<
30057 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
30058 __PYX_ERR(1, 130, __pyx_L1_error)
30060 /* "src/lxml/objectpath.pxi":129
30062 * path_pos = match.end()
30063 * if not new_path or len(path) > path_pos: # <<<<<<<<<<<<<<
30064 * raise ValueError, u"invalid path"
30069 /* "src/lxml/objectpath.pxi":131
30070 * if not new_path or len(path) > path_pos:
30071 * raise ValueError, u"invalid path"
30072 * return new_path # <<<<<<<<<<<<<<
30076 __Pyx_XDECREF(__pyx_r);
30077 __Pyx_INCREF(__pyx_v_new_path);
30078 __pyx_r = __pyx_v_new_path;
30081 /* "src/lxml/objectpath.pxi":91
30084 * cdef list _parse_object_path_string(_path): # <<<<<<<<<<<<<<
30085 * u"""Parse object path string into a (ns, name, index) list.
30089 /* function exit code */
30091 __Pyx_XDECREF(__pyx_t_1);
30092 __Pyx_XDECREF(__pyx_t_4);
30093 __Pyx_XDECREF(__pyx_t_5);
30094 __Pyx_XDECREF(__pyx_t_7);
30095 __Pyx_XDECREF(__pyx_t_8);
30096 __Pyx_XDECREF(__pyx_t_9);
30097 __Pyx_AddTraceback("lxml.objectify._parse_object_path_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
30100 __Pyx_XDECREF(__pyx_v_path);
30101 __Pyx_XDECREF(__pyx_v_new_path);
30102 __Pyx_XDECREF(__pyx_v_path_pos);
30103 __Pyx_XDECREF(__pyx_v_match);
30104 __Pyx_XDECREF(__pyx_v_dot);
30105 __Pyx_XDECREF(__pyx_v_ns);
30106 __Pyx_XDECREF(__pyx_v_name);
30107 __Pyx_XDECREF(__pyx_v_index);
30108 __Pyx_XGIVEREF(__pyx_r);
30109 __Pyx_RefNannyFinishContext();
30113 /* "src/lxml/objectpath.pxi":134
30116 * cdef list _parse_object_path_list(path): # <<<<<<<<<<<<<<
30117 * u"""Parse object path sequence into a (ns, name, index) list.
30121 static PyObject *__pyx_f_4lxml_9objectify__parse_object_path_list(PyObject *__pyx_v_path) {
30122 PyObject *__pyx_v_new_path = NULL;
30123 PyObject *__pyx_v_item = NULL;
30124 PyObject *__pyx_v_ns = NULL;
30125 PyObject *__pyx_v_name = NULL;
30126 PyObject *__pyx_v_index = NULL;
30127 const xmlChar *__pyx_v_c_name;
30128 const xmlChar *__pyx_v_index_pos;
30129 const xmlChar *__pyx_v_index_end;
30130 PyObject *__pyx_r = NULL;
30131 __Pyx_RefNannyDeclarations
30132 PyObject *__pyx_t_1 = NULL;
30133 Py_ssize_t __pyx_t_2;
30134 PyObject *(*__pyx_t_3)(PyObject *);
30135 PyObject *__pyx_t_4 = NULL;
30136 PyObject *__pyx_t_5 = NULL;
30137 PyObject *__pyx_t_6 = NULL;
30142 int __pyx_lineno = 0;
30143 const char *__pyx_filename = NULL;
30144 int __pyx_clineno = 0;
30145 __Pyx_RefNannySetupContext("_parse_object_path_list", 0);
30147 /* "src/lxml/objectpath.pxi":137
30148 * u"""Parse object path sequence into a (ns, name, index) list.
30150 * new_path = [] # <<<<<<<<<<<<<<
30151 * for item in path:
30152 * item = item.strip()
30154 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 137, __pyx_L1_error)
30155 __Pyx_GOTREF(__pyx_t_1);
30156 __pyx_v_new_path = ((PyObject*)__pyx_t_1);
30159 /* "src/lxml/objectpath.pxi":138
30162 * for item in path: # <<<<<<<<<<<<<<
30163 * item = item.strip()
30164 * if not new_path and item == u'':
30166 if (likely(PyList_CheckExact(__pyx_v_path)) || PyTuple_CheckExact(__pyx_v_path)) {
30167 __pyx_t_1 = __pyx_v_path; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
30170 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error)
30171 __Pyx_GOTREF(__pyx_t_1);
30172 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
30175 if (likely(!__pyx_t_3)) {
30176 if (likely(PyList_CheckExact(__pyx_t_1))) {
30177 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
30178 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30179 __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)
30181 __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)
30182 __Pyx_GOTREF(__pyx_t_4);
30185 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
30186 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30187 __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)
30189 __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)
30190 __Pyx_GOTREF(__pyx_t_4);
30194 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
30195 if (unlikely(!__pyx_t_4)) {
30196 PyObject* exc_type = PyErr_Occurred();
30198 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
30199 else __PYX_ERR(1, 138, __pyx_L1_error)
30203 __Pyx_GOTREF(__pyx_t_4);
30205 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
30208 /* "src/lxml/objectpath.pxi":139
30210 * for item in path:
30211 * item = item.strip() # <<<<<<<<<<<<<<
30212 * if not new_path and item == u'':
30213 * # path '.child' => ignore root
30215 __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)
30216 __Pyx_GOTREF(__pyx_t_5);
30218 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
30219 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
30220 if (likely(__pyx_t_6)) {
30221 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
30222 __Pyx_INCREF(__pyx_t_6);
30223 __Pyx_INCREF(function);
30224 __Pyx_DECREF_SET(__pyx_t_5, function);
30227 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
30228 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
30229 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 139, __pyx_L1_error)
30230 __Pyx_GOTREF(__pyx_t_4);
30231 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
30232 __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_4);
30235 /* "src/lxml/objectpath.pxi":140
30236 * for item in path:
30237 * item = item.strip()
30238 * if not new_path and item == u'': # <<<<<<<<<<<<<<
30239 * # path '.child' => ignore root
30242 __pyx_t_8 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30243 __pyx_t_9 = ((!__pyx_t_8) != 0);
30246 __pyx_t_7 = __pyx_t_9;
30247 goto __pyx_L6_bool_binop_done;
30249 __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)
30250 __pyx_t_7 = __pyx_t_9;
30251 __pyx_L6_bool_binop_done:;
30254 /* "src/lxml/objectpath.pxi":142
30255 * if not new_path and item == u'':
30256 * # path '.child' => ignore root
30257 * ns = name = None # <<<<<<<<<<<<<<
30261 __Pyx_INCREF(Py_None);
30262 __Pyx_XDECREF_SET(__pyx_v_ns, Py_None);
30263 __Pyx_INCREF(Py_None);
30264 __Pyx_XDECREF_SET(__pyx_v_name, Py_None);
30266 /* "src/lxml/objectpath.pxi":143
30267 * # path '.child' => ignore root
30269 * index = 0 # <<<<<<<<<<<<<<
30271 * ns, name = cetree.getNsTag(item)
30273 __Pyx_INCREF(__pyx_int_0);
30274 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_int_0);
30276 /* "src/lxml/objectpath.pxi":140
30277 * for item in path:
30278 * item = item.strip()
30279 * if not new_path and item == u'': # <<<<<<<<<<<<<<
30280 * # path '.child' => ignore root
30286 /* "src/lxml/objectpath.pxi":145
30289 * ns, name = cetree.getNsTag(item) # <<<<<<<<<<<<<<
30290 * c_name = _xcstr(name)
30291 * index_pos = tree.xmlStrchr(c_name, c'[')
30294 __pyx_t_4 = getNsTag(__pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
30295 __Pyx_GOTREF(__pyx_t_4);
30296 if (likely(__pyx_t_4 != Py_None)) {
30297 PyObject* sequence = __pyx_t_4;
30298 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
30299 if (unlikely(size != 2)) {
30300 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
30301 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
30302 __PYX_ERR(1, 145, __pyx_L1_error)
30304 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30305 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
30306 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
30307 __Pyx_INCREF(__pyx_t_5);
30308 __Pyx_INCREF(__pyx_t_6);
30310 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 145, __pyx_L1_error)
30311 __Pyx_GOTREF(__pyx_t_5);
30312 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 145, __pyx_L1_error)
30313 __Pyx_GOTREF(__pyx_t_6);
30315 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30317 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 145, __pyx_L1_error)
30319 __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_5);
30321 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
30324 /* "src/lxml/objectpath.pxi":146
30326 * ns, name = cetree.getNsTag(item)
30327 * c_name = _xcstr(name) # <<<<<<<<<<<<<<
30328 * index_pos = tree.xmlStrchr(c_name, c'[')
30329 * if index_pos is NULL:
30331 __pyx_v_c_name = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name);
30333 /* "src/lxml/objectpath.pxi":147
30334 * ns, name = cetree.getNsTag(item)
30335 * c_name = _xcstr(name)
30336 * index_pos = tree.xmlStrchr(c_name, c'[') # <<<<<<<<<<<<<<
30337 * if index_pos is NULL:
30340 __pyx_v_index_pos = xmlStrchr(__pyx_v_c_name, '[');
30342 /* "src/lxml/objectpath.pxi":148
30343 * c_name = _xcstr(name)
30344 * index_pos = tree.xmlStrchr(c_name, c'[')
30345 * if index_pos is NULL: # <<<<<<<<<<<<<<
30349 __pyx_t_7 = ((__pyx_v_index_pos == NULL) != 0);
30352 /* "src/lxml/objectpath.pxi":149
30353 * index_pos = tree.xmlStrchr(c_name, c'[')
30354 * if index_pos is NULL:
30355 * index = 0 # <<<<<<<<<<<<<<
30357 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30359 __Pyx_INCREF(__pyx_int_0);
30360 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_int_0);
30362 /* "src/lxml/objectpath.pxi":148
30363 * c_name = _xcstr(name)
30364 * index_pos = tree.xmlStrchr(c_name, c'[')
30365 * if index_pos is NULL: # <<<<<<<<<<<<<<
30372 /* "src/lxml/objectpath.pxi":151
30375 * index_end = tree.xmlStrchr(index_pos + 1, c']') # <<<<<<<<<<<<<<
30376 * if index_end is NULL:
30377 * raise ValueError, u"index must be enclosed in []"
30380 __pyx_v_index_end = xmlStrchr((__pyx_v_index_pos + 1), ']');
30382 /* "src/lxml/objectpath.pxi":152
30384 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30385 * if index_end is NULL: # <<<<<<<<<<<<<<
30386 * raise ValueError, u"index must be enclosed in []"
30387 * index = int(index_pos[1:index_end - index_pos])
30389 __pyx_t_7 = ((__pyx_v_index_end == NULL) != 0);
30390 if (unlikely(__pyx_t_7)) {
30392 /* "src/lxml/objectpath.pxi":153
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])
30397 * if not new_path and index != 0:
30399 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_must_be_enclosed_in, 0, 0);
30400 __PYX_ERR(1, 153, __pyx_L1_error)
30402 /* "src/lxml/objectpath.pxi":152
30404 * index_end = tree.xmlStrchr(index_pos + 1, c']')
30405 * if index_end is NULL: # <<<<<<<<<<<<<<
30406 * raise ValueError, u"index must be enclosed in []"
30407 * index = int(index_pos[1:index_end - index_pos])
30411 /* "src/lxml/objectpath.pxi":154
30412 * if index_end is NULL:
30413 * raise ValueError, u"index must be enclosed in []"
30414 * index = int(index_pos[1:index_end - index_pos]) # <<<<<<<<<<<<<<
30415 * if not new_path and index != 0:
30416 * raise ValueError, u"index not allowed on root node"
30418 __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)
30419 __Pyx_GOTREF(__pyx_t_4);
30420 __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
30421 __Pyx_GOTREF(__pyx_t_6);
30422 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30423 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_6);
30426 /* "src/lxml/objectpath.pxi":155
30427 * raise ValueError, u"index must be enclosed in []"
30428 * index = int(index_pos[1:index_end - index_pos])
30429 * if not new_path and index != 0: # <<<<<<<<<<<<<<
30430 * raise ValueError, u"index not allowed on root node"
30431 * name = <bytes>c_name[:index_pos - c_name]
30433 __pyx_t_9 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30434 __pyx_t_8 = ((!__pyx_t_9) != 0);
30437 __pyx_t_7 = __pyx_t_8;
30438 goto __pyx_L11_bool_binop_done;
30440 __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)
30441 __Pyx_GOTREF(__pyx_t_6);
30442 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
30443 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30444 __pyx_t_7 = __pyx_t_8;
30445 __pyx_L11_bool_binop_done:;
30446 if (unlikely(__pyx_t_7)) {
30448 /* "src/lxml/objectpath.pxi":156
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]
30453 * new_path.append( (ns, name, index) )
30455 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_index_not_allowed_on_root_node, 0, 0);
30456 __PYX_ERR(1, 156, __pyx_L1_error)
30458 /* "src/lxml/objectpath.pxi":155
30459 * raise ValueError, u"index must be enclosed in []"
30460 * index = int(index_pos[1:index_end - index_pos])
30461 * if not new_path and index != 0: # <<<<<<<<<<<<<<
30462 * raise ValueError, u"index not allowed on root node"
30463 * name = <bytes>c_name[:index_pos - c_name]
30467 /* "src/lxml/objectpath.pxi":157
30468 * if not new_path and index != 0:
30469 * raise ValueError, u"index not allowed on root node"
30470 * name = <bytes>c_name[:index_pos - c_name] # <<<<<<<<<<<<<<
30471 * new_path.append( (ns, name, index) )
30474 __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)
30475 __Pyx_GOTREF(__pyx_t_6);
30476 __pyx_t_4 = __pyx_t_6;
30477 __Pyx_INCREF(__pyx_t_4);
30478 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
30479 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
30486 /* "src/lxml/objectpath.pxi":158
30487 * raise ValueError, u"index not allowed on root node"
30488 * name = <bytes>c_name[:index_pos - c_name]
30489 * new_path.append( (ns, name, index) ) # <<<<<<<<<<<<<<
30491 * raise ValueError, u"invalid path"
30493 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 158, __pyx_L1_error)
30494 __Pyx_GOTREF(__pyx_t_4);
30495 __Pyx_INCREF(__pyx_v_ns);
30496 __Pyx_GIVEREF(__pyx_v_ns);
30497 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ns);
30498 __Pyx_INCREF(__pyx_v_name);
30499 __Pyx_GIVEREF(__pyx_v_name);
30500 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name);
30501 __Pyx_INCREF(__pyx_v_index);
30502 __Pyx_GIVEREF(__pyx_v_index);
30503 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_index);
30504 __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)
30505 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30507 /* "src/lxml/objectpath.pxi":138
30510 * for item in path: # <<<<<<<<<<<<<<
30511 * item = item.strip()
30512 * if not new_path and item == u'':
30515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30517 /* "src/lxml/objectpath.pxi":159
30518 * name = <bytes>c_name[:index_pos - c_name]
30519 * new_path.append( (ns, name, index) )
30520 * if not new_path: # <<<<<<<<<<<<<<
30521 * raise ValueError, u"invalid path"
30524 __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_new_path) != 0);
30525 __pyx_t_8 = ((!__pyx_t_7) != 0);
30526 if (unlikely(__pyx_t_8)) {
30528 /* "src/lxml/objectpath.pxi":160
30529 * new_path.append( (ns, name, index) )
30531 * raise ValueError, u"invalid path" # <<<<<<<<<<<<<<
30535 __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_invalid_path, 0, 0);
30536 __PYX_ERR(1, 160, __pyx_L1_error)
30538 /* "src/lxml/objectpath.pxi":159
30539 * name = <bytes>c_name[:index_pos - c_name]
30540 * new_path.append( (ns, name, index) )
30541 * if not new_path: # <<<<<<<<<<<<<<
30542 * raise ValueError, u"invalid path"
30547 /* "src/lxml/objectpath.pxi":161
30549 * raise ValueError, u"invalid path"
30550 * return new_path # <<<<<<<<<<<<<<
30554 __Pyx_XDECREF(__pyx_r);
30555 __Pyx_INCREF(__pyx_v_new_path);
30556 __pyx_r = __pyx_v_new_path;
30559 /* "src/lxml/objectpath.pxi":134
30562 * cdef list _parse_object_path_list(path): # <<<<<<<<<<<<<<
30563 * u"""Parse object path sequence into a (ns, name, index) list.
30567 /* function exit code */
30569 __Pyx_XDECREF(__pyx_t_1);
30570 __Pyx_XDECREF(__pyx_t_4);
30571 __Pyx_XDECREF(__pyx_t_5);
30572 __Pyx_XDECREF(__pyx_t_6);
30573 __Pyx_AddTraceback("lxml.objectify._parse_object_path_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
30576 __Pyx_XDECREF(__pyx_v_new_path);
30577 __Pyx_XDECREF(__pyx_v_item);
30578 __Pyx_XDECREF(__pyx_v_ns);
30579 __Pyx_XDECREF(__pyx_v_name);
30580 __Pyx_XDECREF(__pyx_v_index);
30581 __Pyx_XGIVEREF(__pyx_r);
30582 __Pyx_RefNannyFinishContext();
30586 /* "src/lxml/objectpath.pxi":164
30589 * cdef _ObjectPath* _build_object_path_segments(list path_list) except NULL: # <<<<<<<<<<<<<<
30590 * cdef _ObjectPath* c_path
30591 * cdef _ObjectPath* c_path_segments
30594 static __pyx_t_4lxml_9objectify__ObjectPath *__pyx_f_4lxml_9objectify__build_object_path_segments(PyObject *__pyx_v_path_list) {
30595 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path;
30596 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_v_c_path_segments;
30597 PyObject *__pyx_v_href = NULL;
30598 PyObject *__pyx_v_name = NULL;
30599 PyObject *__pyx_v_index = NULL;
30600 __pyx_t_4lxml_9objectify__ObjectPath *__pyx_r;
30601 __Pyx_RefNannyDeclarations
30602 Py_ssize_t __pyx_t_1;
30604 PyObject *__pyx_t_3 = NULL;
30605 PyObject *__pyx_t_4 = NULL;
30606 PyObject *__pyx_t_5 = NULL;
30607 PyObject *__pyx_t_6 = NULL;
30608 PyObject *__pyx_t_7 = NULL;
30609 PyObject *__pyx_t_8 = NULL;
30610 PyObject *(*__pyx_t_9)(PyObject *);
30611 const xmlChar *__pyx_t_10;
30612 Py_ssize_t __pyx_t_11;
30613 int __pyx_lineno = 0;
30614 const char *__pyx_filename = NULL;
30615 int __pyx_clineno = 0;
30616 __Pyx_RefNannySetupContext("_build_object_path_segments", 0);
30618 /* "src/lxml/objectpath.pxi":167
30619 * cdef _ObjectPath* c_path
30620 * cdef _ObjectPath* c_path_segments
30621 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath)) # <<<<<<<<<<<<<<
30622 * if c_path_segments is NULL:
30623 * raise MemoryError()
30625 if (unlikely(__pyx_v_path_list == Py_None)) {
30626 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
30627 __PYX_ERR(1, 167, __pyx_L1_error)
30629 __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)
30630 __pyx_v_c_path_segments = ((__pyx_t_4lxml_9objectify__ObjectPath *)lxml_malloc(__pyx_t_1, (sizeof(__pyx_t_4lxml_9objectify__ObjectPath))));
30632 /* "src/lxml/objectpath.pxi":168
30633 * cdef _ObjectPath* c_path_segments
30634 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30635 * if c_path_segments is NULL: # <<<<<<<<<<<<<<
30636 * raise MemoryError()
30637 * c_path = c_path_segments
30639 __pyx_t_2 = ((__pyx_v_c_path_segments == NULL) != 0);
30640 if (unlikely(__pyx_t_2)) {
30642 /* "src/lxml/objectpath.pxi":169
30643 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30644 * if c_path_segments is NULL:
30645 * raise MemoryError() # <<<<<<<<<<<<<<
30646 * c_path = c_path_segments
30647 * for href, name, index in path_list:
30649 PyErr_NoMemory(); __PYX_ERR(1, 169, __pyx_L1_error)
30651 /* "src/lxml/objectpath.pxi":168
30652 * cdef _ObjectPath* c_path_segments
30653 * c_path_segments = <_ObjectPath*>python.lxml_malloc(len(path_list), sizeof(_ObjectPath))
30654 * if c_path_segments is NULL: # <<<<<<<<<<<<<<
30655 * raise MemoryError()
30656 * c_path = c_path_segments
30660 /* "src/lxml/objectpath.pxi":170
30661 * if c_path_segments is NULL:
30662 * raise MemoryError()
30663 * c_path = c_path_segments # <<<<<<<<<<<<<<
30664 * for href, name, index in path_list:
30665 * c_path[0].href = _xcstr(href) if href is not None else NULL
30667 __pyx_v_c_path = __pyx_v_c_path_segments;
30669 /* "src/lxml/objectpath.pxi":171
30670 * raise MemoryError()
30671 * c_path = c_path_segments
30672 * for href, name, index in path_list: # <<<<<<<<<<<<<<
30673 * c_path[0].href = _xcstr(href) if href is not None else NULL
30674 * c_path[0].name = _xcstr(name) if name is not None else NULL
30676 if (unlikely(__pyx_v_path_list == Py_None)) {
30677 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
30678 __PYX_ERR(1, 171, __pyx_L1_error)
30680 __pyx_t_3 = __pyx_v_path_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
30682 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
30683 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30684 __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)
30686 __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)
30687 __Pyx_GOTREF(__pyx_t_4);
30689 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
30690 PyObject* sequence = __pyx_t_4;
30691 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
30692 if (unlikely(size != 3)) {
30693 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
30694 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
30695 __PYX_ERR(1, 171, __pyx_L1_error)
30697 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30698 if (likely(PyTuple_CheckExact(sequence))) {
30699 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
30700 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
30701 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
30703 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
30704 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
30705 __pyx_t_7 = PyList_GET_ITEM(sequence, 2);
30707 __Pyx_INCREF(__pyx_t_5);
30708 __Pyx_INCREF(__pyx_t_6);
30709 __Pyx_INCREF(__pyx_t_7);
30711 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 171, __pyx_L1_error)
30712 __Pyx_GOTREF(__pyx_t_5);
30713 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 171, __pyx_L1_error)
30714 __Pyx_GOTREF(__pyx_t_6);
30715 __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 171, __pyx_L1_error)
30716 __Pyx_GOTREF(__pyx_t_7);
30718 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30720 Py_ssize_t index = -1;
30721 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 171, __pyx_L1_error)
30722 __Pyx_GOTREF(__pyx_t_8);
30723 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
30724 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
30725 index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
30726 __Pyx_GOTREF(__pyx_t_5);
30727 index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
30728 __Pyx_GOTREF(__pyx_t_6);
30729 index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
30730 __Pyx_GOTREF(__pyx_t_7);
30731 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(1, 171, __pyx_L1_error)
30733 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30734 goto __pyx_L7_unpacking_done;
30735 __pyx_L6_unpacking_failed:;
30736 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30738 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
30739 __PYX_ERR(1, 171, __pyx_L1_error)
30740 __pyx_L7_unpacking_done:;
30742 __Pyx_XDECREF_SET(__pyx_v_href, __pyx_t_5);
30744 __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
30746 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
30749 /* "src/lxml/objectpath.pxi":172
30750 * c_path = c_path_segments
30751 * for href, name, index in path_list:
30752 * c_path[0].href = _xcstr(href) if href is not None else NULL # <<<<<<<<<<<<<<
30753 * c_path[0].name = _xcstr(name) if name is not None else NULL
30754 * c_path[0].index = index
30756 __pyx_t_2 = (__pyx_v_href != Py_None);
30757 if ((__pyx_t_2 != 0)) {
30758 __pyx_t_10 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_href);
30762 (__pyx_v_c_path[0]).href = __pyx_t_10;
30764 /* "src/lxml/objectpath.pxi":173
30765 * for href, name, index in path_list:
30766 * c_path[0].href = _xcstr(href) if href is not None else NULL
30767 * c_path[0].name = _xcstr(name) if name is not None else NULL # <<<<<<<<<<<<<<
30768 * c_path[0].index = index
30771 __pyx_t_2 = (__pyx_v_name != Py_None);
30772 if ((__pyx_t_2 != 0)) {
30773 __pyx_t_10 = (const xmlChar*)PyBytes_AS_STRING(__pyx_v_name);
30777 (__pyx_v_c_path[0]).name = __pyx_t_10;
30779 /* "src/lxml/objectpath.pxi":174
30780 * c_path[0].href = _xcstr(href) if href is not None else NULL
30781 * c_path[0].name = _xcstr(name) if name is not None else NULL
30782 * c_path[0].index = index # <<<<<<<<<<<<<<
30784 * return c_path_segments
30786 __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)
30787 (__pyx_v_c_path[0]).index = __pyx_t_11;
30789 /* "src/lxml/objectpath.pxi":175
30790 * c_path[0].name = _xcstr(name) if name is not None else NULL
30791 * c_path[0].index = index
30792 * c_path += 1 # <<<<<<<<<<<<<<
30793 * return c_path_segments
30796 __pyx_v_c_path = (__pyx_v_c_path + 1);
30798 /* "src/lxml/objectpath.pxi":171
30799 * raise MemoryError()
30800 * c_path = c_path_segments
30801 * for href, name, index in path_list: # <<<<<<<<<<<<<<
30802 * c_path[0].href = _xcstr(href) if href is not None else NULL
30803 * c_path[0].name = _xcstr(name) if name is not None else NULL
30806 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
30808 /* "src/lxml/objectpath.pxi":176
30809 * c_path[0].index = index
30811 * return c_path_segments # <<<<<<<<<<<<<<
30815 __pyx_r = __pyx_v_c_path_segments;
30818 /* "src/lxml/objectpath.pxi":164
30821 * cdef _ObjectPath* _build_object_path_segments(list path_list) except NULL: # <<<<<<<<<<<<<<
30822 * cdef _ObjectPath* c_path
30823 * cdef _ObjectPath* c_path_segments
30826 /* function exit code */
30828 __Pyx_XDECREF(__pyx_t_3);
30829 __Pyx_XDECREF(__pyx_t_4);
30830 __Pyx_XDECREF(__pyx_t_5);
30831 __Pyx_XDECREF(__pyx_t_6);
30832 __Pyx_XDECREF(__pyx_t_7);
30833 __Pyx_XDECREF(__pyx_t_8);
30834 __Pyx_AddTraceback("lxml.objectify._build_object_path_segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
30837 __Pyx_XDECREF(__pyx_v_href);
30838 __Pyx_XDECREF(__pyx_v_name);
30839 __Pyx_XDECREF(__pyx_v_index);
30840 __Pyx_RefNannyFinishContext();
30844 /* "src/lxml/objectpath.pxi":179
30847 * cdef _find_object_path(_Element root, _ObjectPath* c_path, Py_ssize_t c_path_len, default_value): # <<<<<<<<<<<<<<
30848 * u"""Follow the path to find the target element.
30852 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) {
30853 xmlNode *__pyx_v_c_node;
30854 Py_ssize_t __pyx_v_c_index;
30855 const xmlChar *__pyx_v_c_name;
30856 const xmlChar *__pyx_v_c_href;
30857 PyObject *__pyx_v_tag = NULL;
30858 PyObject *__pyx_r = NULL;
30859 __Pyx_RefNannyDeclarations
30860 xmlNode *__pyx_t_1;
30861 const xmlChar *__pyx_t_2;
30864 PyObject *__pyx_t_5 = NULL;
30865 Py_ssize_t __pyx_t_6;
30867 PyObject *__pyx_t_8 = NULL;
30868 PyObject *__pyx_t_9 = NULL;
30869 int __pyx_lineno = 0;
30870 const char *__pyx_filename = NULL;
30871 int __pyx_clineno = 0;
30872 __Pyx_RefNannySetupContext("_find_object_path", 0);
30874 /* "src/lxml/objectpath.pxi":184
30875 * cdef tree.xmlNode* c_node
30876 * cdef Py_ssize_t c_index
30877 * c_node = root._c_node # <<<<<<<<<<<<<<
30878 * c_name = c_path[0].name
30879 * c_href = c_path[0].href
30881 __pyx_t_1 = __pyx_v_root->_c_node;
30882 __pyx_v_c_node = __pyx_t_1;
30884 /* "src/lxml/objectpath.pxi":185
30885 * cdef Py_ssize_t c_index
30886 * c_node = root._c_node
30887 * c_name = c_path[0].name # <<<<<<<<<<<<<<
30888 * c_href = c_path[0].href
30889 * if c_href is NULL or c_href[0] == c'\0':
30891 __pyx_t_2 = (__pyx_v_c_path[0]).name;
30892 __pyx_v_c_name = __pyx_t_2;
30894 /* "src/lxml/objectpath.pxi":186
30895 * c_node = root._c_node
30896 * c_name = c_path[0].name
30897 * c_href = c_path[0].href # <<<<<<<<<<<<<<
30898 * if c_href is NULL or c_href[0] == c'\0':
30899 * c_href = tree._getNs(c_node)
30901 __pyx_t_2 = (__pyx_v_c_path[0]).href;
30902 __pyx_v_c_href = __pyx_t_2;
30904 /* "src/lxml/objectpath.pxi":187
30905 * c_name = c_path[0].name
30906 * c_href = c_path[0].href
30907 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
30908 * c_href = tree._getNs(c_node)
30909 * if not cetree.tagMatches(c_node, c_href, c_name):
30911 __pyx_t_4 = ((__pyx_v_c_href == NULL) != 0);
30914 __pyx_t_3 = __pyx_t_4;
30915 goto __pyx_L4_bool_binop_done;
30917 __pyx_t_4 = (((__pyx_v_c_href[0]) == '\x00') != 0);
30918 __pyx_t_3 = __pyx_t_4;
30919 __pyx_L4_bool_binop_done:;
30922 /* "src/lxml/objectpath.pxi":188
30923 * c_href = c_path[0].href
30924 * if c_href is NULL or c_href[0] == c'\0':
30925 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
30926 * if not cetree.tagMatches(c_node, c_href, c_name):
30927 * if default_value is not _NO_DEFAULT:
30929 __pyx_v_c_href = _getNs(__pyx_v_c_node);
30931 /* "src/lxml/objectpath.pxi":187
30932 * c_name = c_path[0].name
30933 * c_href = c_path[0].href
30934 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
30935 * c_href = tree._getNs(c_node)
30936 * if not cetree.tagMatches(c_node, c_href, c_name):
30940 /* "src/lxml/objectpath.pxi":189
30941 * if c_href is NULL or c_href[0] == c'\0':
30942 * c_href = tree._getNs(c_node)
30943 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
30944 * if default_value is not _NO_DEFAULT:
30945 * return default_value
30947 __pyx_t_3 = ((!(tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0)) != 0);
30950 /* "src/lxml/objectpath.pxi":190
30951 * c_href = tree._getNs(c_node)
30952 * if not cetree.tagMatches(c_node, c_href, c_name):
30953 * if default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
30954 * return default_value
30957 __pyx_t_3 = (__pyx_v_default_value != __pyx_v_4lxml_9objectify__NO_DEFAULT);
30958 __pyx_t_4 = (__pyx_t_3 != 0);
30959 if (likely(__pyx_t_4)) {
30961 /* "src/lxml/objectpath.pxi":191
30962 * if not cetree.tagMatches(c_node, c_href, c_name):
30963 * if default_value is not _NO_DEFAULT:
30964 * return default_value # <<<<<<<<<<<<<<
30966 * raise ValueError(
30968 __Pyx_XDECREF(__pyx_r);
30969 __Pyx_INCREF(__pyx_v_default_value);
30970 __pyx_r = __pyx_v_default_value;
30973 /* "src/lxml/objectpath.pxi":190
30974 * c_href = tree._getNs(c_node)
30975 * if not cetree.tagMatches(c_node, c_href, c_name):
30976 * if default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
30977 * return default_value
30982 /* "src/lxml/objectpath.pxi":193
30983 * return default_value
30985 * raise ValueError( # <<<<<<<<<<<<<<
30986 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
30991 /* "src/lxml/objectpath.pxi":194
30993 * raise ValueError(
30994 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}") # <<<<<<<<<<<<<<
30996 * while c_node is not NULL:
30998 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 194, __pyx_L1_error)
30999 __Pyx_GOTREF(__pyx_t_5);
31002 __Pyx_INCREF(__pyx_kp_u_root_element_does_not_match_need);
31004 __Pyx_GIVEREF(__pyx_kp_u_root_element_does_not_match_need);
31005 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_root_element_does_not_match_need);
31006 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 194, __pyx_L1_error)
31007 __Pyx_GOTREF(__pyx_t_8);
31008 __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 194, __pyx_L1_error)
31009 __Pyx_GOTREF(__pyx_t_9);
31010 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31011 __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;
31012 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
31013 __Pyx_GIVEREF(__pyx_t_9);
31014 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
31016 __Pyx_INCREF(__pyx_kp_u_got);
31018 __Pyx_GIVEREF(__pyx_kp_u_got);
31019 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_got);
31020 __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)
31021 __Pyx_GOTREF(__pyx_t_9);
31022 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 194, __pyx_L1_error)
31023 __Pyx_GOTREF(__pyx_t_8);
31024 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31025 __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;
31026 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
31027 __Pyx_GIVEREF(__pyx_t_8);
31028 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
31030 __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)
31031 __Pyx_GOTREF(__pyx_t_8);
31032 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31034 /* "src/lxml/objectpath.pxi":193
31035 * return default_value
31037 * raise ValueError( # <<<<<<<<<<<<<<
31038 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31041 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 193, __pyx_L1_error)
31042 __Pyx_GOTREF(__pyx_t_5);
31043 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31044 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
31045 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31046 __PYX_ERR(1, 193, __pyx_L1_error)
31049 /* "src/lxml/objectpath.pxi":189
31050 * if c_href is NULL or c_href[0] == c'\0':
31051 * c_href = tree._getNs(c_node)
31052 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31053 * if default_value is not _NO_DEFAULT:
31054 * return default_value
31058 /* "src/lxml/objectpath.pxi":196
31059 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31061 * while c_node is not NULL: # <<<<<<<<<<<<<<
31063 * if c_path_len <= 0:
31066 __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
31067 if (!__pyx_t_4) break;
31069 /* "src/lxml/objectpath.pxi":197
31071 * while c_node is not NULL:
31072 * c_path_len -= 1 # <<<<<<<<<<<<<<
31073 * if c_path_len <= 0:
31076 __pyx_v_c_path_len = (__pyx_v_c_path_len - 1);
31078 /* "src/lxml/objectpath.pxi":198
31079 * while c_node is not NULL:
31081 * if c_path_len <= 0: # <<<<<<<<<<<<<<
31085 __pyx_t_4 = ((__pyx_v_c_path_len <= 0) != 0);
31088 /* "src/lxml/objectpath.pxi":199
31090 * if c_path_len <= 0:
31091 * break # <<<<<<<<<<<<<<
31095 goto __pyx_L9_break;
31097 /* "src/lxml/objectpath.pxi":198
31098 * while c_node is not NULL:
31100 * if c_path_len <= 0: # <<<<<<<<<<<<<<
31106 /* "src/lxml/objectpath.pxi":201
31109 * c_path += 1 # <<<<<<<<<<<<<<
31110 * if c_path[0].href is not NULL:
31111 * c_href = c_path[0].href # otherwise: keep parent namespace
31113 __pyx_v_c_path = (__pyx_v_c_path + 1);
31115 /* "src/lxml/objectpath.pxi":202
31118 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31119 * c_href = c_path[0].href # otherwise: keep parent namespace
31120 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31122 __pyx_t_4 = (((__pyx_v_c_path[0]).href != NULL) != 0);
31125 /* "src/lxml/objectpath.pxi":203
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)
31130 * if c_name is NULL:
31132 __pyx_t_2 = (__pyx_v_c_path[0]).href;
31133 __pyx_v_c_href = __pyx_t_2;
31135 /* "src/lxml/objectpath.pxi":202
31138 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31139 * c_href = c_path[0].href # otherwise: keep parent namespace
31140 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31144 /* "src/lxml/objectpath.pxi":204
31145 * if c_path[0].href is not NULL:
31146 * c_href = c_path[0].href # otherwise: keep parent namespace
31147 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1) # <<<<<<<<<<<<<<
31148 * if c_name is NULL:
31149 * c_name = c_path[0].name
31151 __pyx_v_c_name = xmlDictExists(__pyx_v_c_node->doc->dict, (__pyx_v_c_path[0]).name, -1);
31153 /* "src/lxml/objectpath.pxi":205
31154 * c_href = c_path[0].href # otherwise: keep parent namespace
31155 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31156 * if c_name is NULL: # <<<<<<<<<<<<<<
31157 * c_name = c_path[0].name
31160 __pyx_t_4 = ((__pyx_v_c_name == NULL) != 0);
31163 /* "src/lxml/objectpath.pxi":206
31164 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31165 * if c_name is NULL:
31166 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31170 __pyx_t_2 = (__pyx_v_c_path[0]).name;
31171 __pyx_v_c_name = __pyx_t_2;
31173 /* "src/lxml/objectpath.pxi":207
31174 * if c_name is NULL:
31175 * c_name = c_path[0].name
31176 * c_node = NULL # <<<<<<<<<<<<<<
31178 * c_index = c_path[0].index
31180 __pyx_v_c_node = NULL;
31182 /* "src/lxml/objectpath.pxi":208
31183 * c_name = c_path[0].name
31185 * break # <<<<<<<<<<<<<<
31186 * c_index = c_path[0].index
31187 * c_node = c_node.last if c_index < 0 else c_node.children
31189 goto __pyx_L9_break;
31191 /* "src/lxml/objectpath.pxi":205
31192 * c_href = c_path[0].href # otherwise: keep parent namespace
31193 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31194 * if c_name is NULL: # <<<<<<<<<<<<<<
31195 * c_name = c_path[0].name
31200 /* "src/lxml/objectpath.pxi":209
31203 * c_index = c_path[0].index # <<<<<<<<<<<<<<
31204 * c_node = c_node.last if c_index < 0 else c_node.children
31205 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31207 __pyx_t_6 = (__pyx_v_c_path[0]).index;
31208 __pyx_v_c_index = __pyx_t_6;
31210 /* "src/lxml/objectpath.pxi":210
31212 * c_index = c_path[0].index
31213 * c_node = c_node.last if c_index < 0 else c_node.children # <<<<<<<<<<<<<<
31214 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31217 if (((__pyx_v_c_index < 0) != 0)) {
31218 __pyx_t_1 = __pyx_v_c_node->last;
31220 __pyx_t_1 = __pyx_v_c_node->children;
31222 __pyx_v_c_node = __pyx_t_1;
31224 /* "src/lxml/objectpath.pxi":211
31225 * c_index = c_path[0].index
31226 * c_node = c_node.last if c_index < 0 else c_node.children
31227 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index) # <<<<<<<<<<<<<<
31229 * if c_node is not NULL:
31231 __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);
31235 /* "src/lxml/objectpath.pxi":213
31236 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31238 * if c_node is not NULL: # <<<<<<<<<<<<<<
31239 * return cetree.elementFactory(root._doc, c_node)
31240 * elif default_value is not _NO_DEFAULT:
31242 __pyx_t_4 = ((__pyx_v_c_node != NULL) != 0);
31245 /* "src/lxml/objectpath.pxi":214
31247 * if c_node is not NULL:
31248 * return cetree.elementFactory(root._doc, c_node) # <<<<<<<<<<<<<<
31249 * elif default_value is not _NO_DEFAULT:
31250 * return default_value
31252 __Pyx_XDECREF(__pyx_r);
31253 __pyx_t_5 = ((PyObject *)__pyx_v_root->_doc);
31254 __Pyx_INCREF(__pyx_t_5);
31255 __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)
31256 __Pyx_GOTREF(__pyx_t_8);
31257 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31258 __pyx_r = __pyx_t_8;
31262 /* "src/lxml/objectpath.pxi":213
31263 * c_node = _findFollowingSibling(c_node, c_href, c_name, c_index)
31265 * if c_node is not NULL: # <<<<<<<<<<<<<<
31266 * return cetree.elementFactory(root._doc, c_node)
31267 * elif default_value is not _NO_DEFAULT:
31271 /* "src/lxml/objectpath.pxi":215
31272 * if c_node is not NULL:
31273 * return cetree.elementFactory(root._doc, c_node)
31274 * elif default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
31275 * return default_value
31278 __pyx_t_4 = (__pyx_v_default_value != __pyx_v_4lxml_9objectify__NO_DEFAULT);
31279 __pyx_t_3 = (__pyx_t_4 != 0);
31280 if (likely(__pyx_t_3)) {
31282 /* "src/lxml/objectpath.pxi":216
31283 * return cetree.elementFactory(root._doc, c_node)
31284 * elif default_value is not _NO_DEFAULT:
31285 * return default_value # <<<<<<<<<<<<<<
31287 * tag = cetree.namespacedNameFromNsName(c_href, c_name)
31289 __Pyx_XDECREF(__pyx_r);
31290 __Pyx_INCREF(__pyx_v_default_value);
31291 __pyx_r = __pyx_v_default_value;
31294 /* "src/lxml/objectpath.pxi":215
31295 * if c_node is not NULL:
31296 * return cetree.elementFactory(root._doc, c_node)
31297 * elif default_value is not _NO_DEFAULT: # <<<<<<<<<<<<<<
31298 * return default_value
31303 /* "src/lxml/objectpath.pxi":218
31304 * return default_value
31306 * tag = cetree.namespacedNameFromNsName(c_href, c_name) # <<<<<<<<<<<<<<
31307 * raise AttributeError, f"no such child: {tag}"
31311 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 218, __pyx_L1_error)
31312 __Pyx_GOTREF(__pyx_t_8);
31313 __pyx_v_tag = __pyx_t_8;
31316 /* "src/lxml/objectpath.pxi":219
31318 * tag = cetree.namespacedNameFromNsName(c_href, c_name)
31319 * raise AttributeError, f"no such child: {tag}" # <<<<<<<<<<<<<<
31323 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 219, __pyx_L1_error)
31324 __Pyx_GOTREF(__pyx_t_8);
31325 __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)
31326 __Pyx_GOTREF(__pyx_t_5);
31327 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31328 __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_t_5, 0, 0);
31329 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31330 __PYX_ERR(1, 219, __pyx_L1_error)
31333 /* "src/lxml/objectpath.pxi":179
31336 * cdef _find_object_path(_Element root, _ObjectPath* c_path, Py_ssize_t c_path_len, default_value): # <<<<<<<<<<<<<<
31337 * u"""Follow the path to find the target element.
31341 /* function exit code */
31343 __Pyx_XDECREF(__pyx_t_5);
31344 __Pyx_XDECREF(__pyx_t_8);
31345 __Pyx_XDECREF(__pyx_t_9);
31346 __Pyx_AddTraceback("lxml.objectify._find_object_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
31349 __Pyx_XDECREF(__pyx_v_tag);
31350 __Pyx_XGIVEREF(__pyx_r);
31351 __Pyx_RefNannyFinishContext();
31355 /* "src/lxml/objectpath.pxi":222
31358 * cdef _create_object_path(_Element root, _ObjectPath* c_path, # <<<<<<<<<<<<<<
31359 * Py_ssize_t c_path_len, int replace, value):
31360 * u"""Follow the path to find the target element, build the missing children
31363 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) {
31364 struct LxmlElement *__pyx_v_child = 0;
31365 xmlNode *__pyx_v_c_node;
31366 xmlNode *__pyx_v_c_child;
31367 Py_ssize_t __pyx_v_c_index;
31368 const xmlChar *__pyx_v_c_name;
31369 const xmlChar *__pyx_v_c_href;
31370 struct LxmlElement *__pyx_v_element = NULL;
31371 PyObject *__pyx_r = NULL;
31372 __Pyx_RefNannyDeclarations
31374 xmlNode *__pyx_t_2;
31375 const xmlChar *__pyx_t_3;
31377 PyObject *__pyx_t_5 = NULL;
31378 Py_ssize_t __pyx_t_6;
31380 PyObject *__pyx_t_8 = NULL;
31381 PyObject *__pyx_t_9 = NULL;
31382 int __pyx_lineno = 0;
31383 const char *__pyx_filename = NULL;
31384 int __pyx_clineno = 0;
31385 __Pyx_RefNannySetupContext("_create_object_path", 0);
31387 /* "src/lxml/objectpath.pxi":232
31388 * cdef tree.xmlNode* c_child
31389 * cdef Py_ssize_t c_index
31390 * if c_path_len == 1: # <<<<<<<<<<<<<<
31391 * raise TypeError, u"cannot update root node"
31394 __pyx_t_1 = ((__pyx_v_c_path_len == 1) != 0);
31395 if (unlikely(__pyx_t_1)) {
31397 /* "src/lxml/objectpath.pxi":233
31398 * cdef Py_ssize_t c_index
31399 * if c_path_len == 1:
31400 * raise TypeError, u"cannot update root node" # <<<<<<<<<<<<<<
31402 * c_node = root._c_node
31404 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_cannot_update_root_node, 0, 0);
31405 __PYX_ERR(1, 233, __pyx_L1_error)
31407 /* "src/lxml/objectpath.pxi":232
31408 * cdef tree.xmlNode* c_child
31409 * cdef Py_ssize_t c_index
31410 * if c_path_len == 1: # <<<<<<<<<<<<<<
31411 * raise TypeError, u"cannot update root node"
31416 /* "src/lxml/objectpath.pxi":235
31417 * raise TypeError, u"cannot update root node"
31419 * c_node = root._c_node # <<<<<<<<<<<<<<
31420 * c_name = c_path[0].name
31421 * c_href = c_path[0].href
31423 __pyx_t_2 = __pyx_v_root->_c_node;
31424 __pyx_v_c_node = __pyx_t_2;
31426 /* "src/lxml/objectpath.pxi":236
31428 * c_node = root._c_node
31429 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31430 * c_href = c_path[0].href
31431 * if c_href is NULL or c_href[0] == c'\0':
31433 __pyx_t_3 = (__pyx_v_c_path[0]).name;
31434 __pyx_v_c_name = __pyx_t_3;
31436 /* "src/lxml/objectpath.pxi":237
31437 * c_node = root._c_node
31438 * c_name = c_path[0].name
31439 * c_href = c_path[0].href # <<<<<<<<<<<<<<
31440 * if c_href is NULL or c_href[0] == c'\0':
31441 * c_href = tree._getNs(c_node)
31443 __pyx_t_3 = (__pyx_v_c_path[0]).href;
31444 __pyx_v_c_href = __pyx_t_3;
31446 /* "src/lxml/objectpath.pxi":238
31447 * c_name = c_path[0].name
31448 * c_href = c_path[0].href
31449 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
31450 * c_href = tree._getNs(c_node)
31451 * if not cetree.tagMatches(c_node, c_href, c_name):
31453 __pyx_t_4 = ((__pyx_v_c_href == NULL) != 0);
31456 __pyx_t_1 = __pyx_t_4;
31457 goto __pyx_L5_bool_binop_done;
31459 __pyx_t_4 = (((__pyx_v_c_href[0]) == '\x00') != 0);
31460 __pyx_t_1 = __pyx_t_4;
31461 __pyx_L5_bool_binop_done:;
31464 /* "src/lxml/objectpath.pxi":239
31465 * c_href = c_path[0].href
31466 * if c_href is NULL or c_href[0] == c'\0':
31467 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
31468 * if not cetree.tagMatches(c_node, c_href, c_name):
31469 * raise ValueError(
31471 __pyx_v_c_href = _getNs(__pyx_v_c_node);
31473 /* "src/lxml/objectpath.pxi":238
31474 * c_name = c_path[0].name
31475 * c_href = c_path[0].href
31476 * if c_href is NULL or c_href[0] == c'\0': # <<<<<<<<<<<<<<
31477 * c_href = tree._getNs(c_node)
31478 * if not cetree.tagMatches(c_node, c_href, c_name):
31482 /* "src/lxml/objectpath.pxi":240
31483 * if c_href is NULL or c_href[0] == c'\0':
31484 * c_href = tree._getNs(c_node)
31485 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31486 * raise ValueError(
31487 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31489 __pyx_t_1 = ((!(tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name) != 0)) != 0);
31490 if (unlikely(__pyx_t_1)) {
31492 /* "src/lxml/objectpath.pxi":242
31493 * if not cetree.tagMatches(c_node, c_href, c_name):
31494 * raise ValueError(
31495 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}") # <<<<<<<<<<<<<<
31497 * while c_path_len > 1:
31499 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 242, __pyx_L1_error)
31500 __Pyx_GOTREF(__pyx_t_5);
31503 __Pyx_INCREF(__pyx_kp_u_root_element_does_not_match_need);
31505 __Pyx_GIVEREF(__pyx_kp_u_root_element_does_not_match_need);
31506 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_root_element_does_not_match_need);
31507 __pyx_t_8 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 242, __pyx_L1_error)
31508 __Pyx_GOTREF(__pyx_t_8);
31509 __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_8, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 242, __pyx_L1_error)
31510 __Pyx_GOTREF(__pyx_t_9);
31511 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31512 __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;
31513 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
31514 __Pyx_GIVEREF(__pyx_t_9);
31515 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
31517 __Pyx_INCREF(__pyx_kp_u_got);
31519 __Pyx_GIVEREF(__pyx_kp_u_got);
31520 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_got);
31521 __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)
31522 __Pyx_GOTREF(__pyx_t_9);
31523 __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 242, __pyx_L1_error)
31524 __Pyx_GOTREF(__pyx_t_8);
31525 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31526 __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;
31527 __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
31528 __Pyx_GIVEREF(__pyx_t_8);
31529 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_8);
31531 __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)
31532 __Pyx_GOTREF(__pyx_t_8);
31533 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31535 /* "src/lxml/objectpath.pxi":241
31536 * c_href = tree._getNs(c_node)
31537 * if not cetree.tagMatches(c_node, c_href, c_name):
31538 * raise ValueError( # <<<<<<<<<<<<<<
31539 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31542 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 241, __pyx_L1_error)
31543 __Pyx_GOTREF(__pyx_t_5);
31544 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31545 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
31546 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31547 __PYX_ERR(1, 241, __pyx_L1_error)
31549 /* "src/lxml/objectpath.pxi":240
31550 * if c_href is NULL or c_href[0] == c'\0':
31551 * c_href = tree._getNs(c_node)
31552 * if not cetree.tagMatches(c_node, c_href, c_name): # <<<<<<<<<<<<<<
31553 * raise ValueError(
31554 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31558 /* "src/lxml/objectpath.pxi":244
31559 * f"root element does not match: need {cetree.namespacedNameFromNsName(c_href, c_name)}, got {root.tag}")
31561 * while c_path_len > 1: # <<<<<<<<<<<<<<
31566 __pyx_t_1 = ((__pyx_v_c_path_len > 1) != 0);
31567 if (!__pyx_t_1) break;
31569 /* "src/lxml/objectpath.pxi":245
31571 * while c_path_len > 1:
31572 * c_path_len -= 1 # <<<<<<<<<<<<<<
31574 * if c_path[0].href is not NULL:
31576 __pyx_v_c_path_len = (__pyx_v_c_path_len - 1);
31578 /* "src/lxml/objectpath.pxi":246
31579 * while c_path_len > 1:
31581 * c_path += 1 # <<<<<<<<<<<<<<
31582 * if c_path[0].href is not NULL:
31583 * c_href = c_path[0].href # otherwise: keep parent namespace
31585 __pyx_v_c_path = (__pyx_v_c_path + 1);
31587 /* "src/lxml/objectpath.pxi":247
31590 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31591 * c_href = c_path[0].href # otherwise: keep parent namespace
31592 * c_index = c_path[0].index
31594 __pyx_t_1 = (((__pyx_v_c_path[0]).href != NULL) != 0);
31597 /* "src/lxml/objectpath.pxi":248
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
31602 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31604 __pyx_t_3 = (__pyx_v_c_path[0]).href;
31605 __pyx_v_c_href = __pyx_t_3;
31607 /* "src/lxml/objectpath.pxi":247
31610 * if c_path[0].href is not NULL: # <<<<<<<<<<<<<<
31611 * c_href = c_path[0].href # otherwise: keep parent namespace
31612 * c_index = c_path[0].index
31616 /* "src/lxml/objectpath.pxi":249
31617 * if c_path[0].href is not NULL:
31618 * c_href = c_path[0].href # otherwise: keep parent namespace
31619 * c_index = c_path[0].index # <<<<<<<<<<<<<<
31620 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31621 * if c_name is NULL:
31623 __pyx_t_6 = (__pyx_v_c_path[0]).index;
31624 __pyx_v_c_index = __pyx_t_6;
31626 /* "src/lxml/objectpath.pxi":250
31627 * c_href = c_path[0].href # otherwise: keep parent namespace
31628 * c_index = c_path[0].index
31629 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1) # <<<<<<<<<<<<<<
31630 * if c_name is NULL:
31631 * c_name = c_path[0].name
31633 __pyx_v_c_name = xmlDictExists(__pyx_v_c_node->doc->dict, (__pyx_v_c_path[0]).name, -1);
31635 /* "src/lxml/objectpath.pxi":251
31636 * c_index = c_path[0].index
31637 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31638 * if c_name is NULL: # <<<<<<<<<<<<<<
31639 * c_name = c_path[0].name
31642 __pyx_t_1 = ((__pyx_v_c_name == NULL) != 0);
31645 /* "src/lxml/objectpath.pxi":252
31646 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31647 * if c_name is NULL:
31648 * c_name = c_path[0].name # <<<<<<<<<<<<<<
31652 __pyx_t_3 = (__pyx_v_c_path[0]).name;
31653 __pyx_v_c_name = __pyx_t_3;
31655 /* "src/lxml/objectpath.pxi":253
31656 * if c_name is NULL:
31657 * c_name = c_path[0].name
31658 * c_child = NULL # <<<<<<<<<<<<<<
31660 * c_child = c_node.last if c_index < 0 else c_node.children
31662 __pyx_v_c_child = NULL;
31664 /* "src/lxml/objectpath.pxi":251
31665 * c_index = c_path[0].index
31666 * c_name = tree.xmlDictExists(c_node.doc.dict, c_path[0].name, -1)
31667 * if c_name is NULL: # <<<<<<<<<<<<<<
31668 * c_name = c_path[0].name
31674 /* "src/lxml/objectpath.pxi":255
31677 * c_child = c_node.last if c_index < 0 else c_node.children # <<<<<<<<<<<<<<
31678 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31682 if (((__pyx_v_c_index < 0) != 0)) {
31683 __pyx_t_2 = __pyx_v_c_node->last;
31685 __pyx_t_2 = __pyx_v_c_node->children;
31687 __pyx_v_c_child = __pyx_t_2;
31689 /* "src/lxml/objectpath.pxi":256
31691 * c_child = c_node.last if c_index < 0 else c_node.children
31692 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index) # <<<<<<<<<<<<<<
31694 * if c_child is not NULL:
31696 __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);
31700 /* "src/lxml/objectpath.pxi":258
31701 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31703 * if c_child is not NULL: # <<<<<<<<<<<<<<
31705 * elif c_index != 0:
31707 __pyx_t_1 = ((__pyx_v_c_child != NULL) != 0);
31710 /* "src/lxml/objectpath.pxi":259
31712 * if c_child is not NULL:
31713 * c_node = c_child # <<<<<<<<<<<<<<
31714 * elif c_index != 0:
31715 * raise TypeError, u"creating indexed path attributes is not supported"
31717 __pyx_v_c_node = __pyx_v_c_child;
31719 /* "src/lxml/objectpath.pxi":258
31720 * c_child = _findFollowingSibling(c_child, c_href, c_name, c_index)
31722 * if c_child is not NULL: # <<<<<<<<<<<<<<
31724 * elif c_index != 0:
31729 /* "src/lxml/objectpath.pxi":260
31730 * if c_child is not NULL:
31732 * elif c_index != 0: # <<<<<<<<<<<<<<
31733 * raise TypeError, u"creating indexed path attributes is not supported"
31734 * elif c_path_len == 1:
31736 __pyx_t_1 = ((__pyx_v_c_index != 0) != 0);
31737 if (unlikely(__pyx_t_1)) {
31739 /* "src/lxml/objectpath.pxi":261
31741 * elif c_index != 0:
31742 * raise TypeError, u"creating indexed path attributes is not supported" # <<<<<<<<<<<<<<
31743 * elif c_path_len == 1:
31744 * _appendValue(cetree.elementFactory(root._doc, c_node),
31746 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_creating_indexed_path_attributes, 0, 0);
31747 __PYX_ERR(1, 261, __pyx_L1_error)
31749 /* "src/lxml/objectpath.pxi":260
31750 * if c_child is not NULL:
31752 * elif c_index != 0: # <<<<<<<<<<<<<<
31753 * raise TypeError, u"creating indexed path attributes is not supported"
31754 * elif c_path_len == 1:
31758 /* "src/lxml/objectpath.pxi":262
31759 * elif c_index != 0:
31760 * raise TypeError, u"creating indexed path attributes is not supported"
31761 * elif c_path_len == 1: # <<<<<<<<<<<<<<
31762 * _appendValue(cetree.elementFactory(root._doc, c_node),
31763 * cetree.namespacedNameFromNsName(c_href, c_name),
31765 __pyx_t_1 = ((__pyx_v_c_path_len == 1) != 0);
31768 /* "src/lxml/objectpath.pxi":263
31769 * raise TypeError, u"creating indexed path attributes is not supported"
31770 * elif c_path_len == 1:
31771 * _appendValue(cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31772 * cetree.namespacedNameFromNsName(c_href, c_name),
31775 __pyx_t_5 = ((PyObject *)__pyx_v_root->_doc);
31776 __Pyx_INCREF(__pyx_t_5);
31777 __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)
31778 __Pyx_GOTREF(__pyx_t_8);
31779 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31781 /* "src/lxml/objectpath.pxi":264
31782 * elif c_path_len == 1:
31783 * _appendValue(cetree.elementFactory(root._doc, c_node),
31784 * cetree.namespacedNameFromNsName(c_href, c_name), # <<<<<<<<<<<<<<
31788 __pyx_t_5 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 264, __pyx_L1_error)
31789 __Pyx_GOTREF(__pyx_t_5);
31791 /* "src/lxml/objectpath.pxi":263
31792 * raise TypeError, u"creating indexed path attributes is not supported"
31793 * elif c_path_len == 1:
31794 * _appendValue(cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31795 * cetree.namespacedNameFromNsName(c_href, c_name),
31798 __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)
31799 __Pyx_GOTREF(__pyx_t_9);
31800 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31801 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31802 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31804 /* "src/lxml/objectpath.pxi":266
31805 * cetree.namespacedNameFromNsName(c_href, c_name),
31807 * return # <<<<<<<<<<<<<<
31809 * child = cetree.makeSubElement(
31811 __Pyx_XDECREF(__pyx_r);
31812 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31815 /* "src/lxml/objectpath.pxi":262
31816 * elif c_index != 0:
31817 * raise TypeError, u"creating indexed path attributes is not supported"
31818 * elif c_path_len == 1: # <<<<<<<<<<<<<<
31819 * _appendValue(cetree.elementFactory(root._doc, c_node),
31820 * cetree.namespacedNameFromNsName(c_href, c_name),
31824 /* "src/lxml/objectpath.pxi":268
31827 * child = cetree.makeSubElement( # <<<<<<<<<<<<<<
31828 * cetree.elementFactory(root._doc, c_node),
31829 * cetree.namespacedNameFromNsName(c_href, c_name),
31833 /* "src/lxml/objectpath.pxi":269
31835 * child = cetree.makeSubElement(
31836 * cetree.elementFactory(root._doc, c_node), # <<<<<<<<<<<<<<
31837 * cetree.namespacedNameFromNsName(c_href, c_name),
31838 * None, None, None, None)
31840 __pyx_t_9 = ((PyObject *)__pyx_v_root->_doc);
31841 __Pyx_INCREF(__pyx_t_9);
31842 __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)
31843 __Pyx_GOTREF(__pyx_t_5);
31844 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31846 /* "src/lxml/objectpath.pxi":270
31847 * child = cetree.makeSubElement(
31848 * cetree.elementFactory(root._doc, c_node),
31849 * cetree.namespacedNameFromNsName(c_href, c_name), # <<<<<<<<<<<<<<
31850 * None, None, None, None)
31851 * c_node = child._c_node
31853 __pyx_t_9 = namespacedNameFromNsName(__pyx_v_c_href, __pyx_v_c_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 270, __pyx_L1_error)
31854 __Pyx_GOTREF(__pyx_t_9);
31856 /* "src/lxml/objectpath.pxi":268
31859 * child = cetree.makeSubElement( # <<<<<<<<<<<<<<
31860 * cetree.elementFactory(root._doc, c_node),
31861 * cetree.namespacedNameFromNsName(c_href, c_name),
31863 __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)
31864 __Pyx_GOTREF(__pyx_t_8);
31865 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31866 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31867 __Pyx_XDECREF_SET(__pyx_v_child, ((struct LxmlElement *)__pyx_t_8));
31870 /* "src/lxml/objectpath.pxi":272
31871 * cetree.namespacedNameFromNsName(c_href, c_name),
31872 * None, None, None, None)
31873 * c_node = child._c_node # <<<<<<<<<<<<<<
31875 * # if we get here, the entire path was already there
31877 __pyx_t_2 = __pyx_v_child->_c_node;
31878 __pyx_v_c_node = __pyx_t_2;
31883 /* "src/lxml/objectpath.pxi":275
31885 * # if we get here, the entire path was already there
31886 * if replace: # <<<<<<<<<<<<<<
31887 * element = cetree.elementFactory(root._doc, c_node)
31888 * _replaceElement(element, value)
31890 __pyx_t_1 = (__pyx_v_replace != 0);
31893 /* "src/lxml/objectpath.pxi":276
31894 * # if we get here, the entire path was already there
31896 * element = cetree.elementFactory(root._doc, c_node) # <<<<<<<<<<<<<<
31897 * _replaceElement(element, value)
31900 __pyx_t_8 = ((PyObject *)__pyx_v_root->_doc);
31901 __Pyx_INCREF(__pyx_t_8);
31902 __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)
31903 __Pyx_GOTREF(__pyx_t_9);
31904 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31905 __pyx_v_element = ((struct LxmlElement *)__pyx_t_9);
31908 /* "src/lxml/objectpath.pxi":277
31910 * element = cetree.elementFactory(root._doc, c_node)
31911 * _replaceElement(element, value) # <<<<<<<<<<<<<<
31913 * _appendValue(cetree.elementFactory(root._doc, c_node.parent),
31915 __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)
31916 __Pyx_GOTREF(__pyx_t_9);
31917 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31919 /* "src/lxml/objectpath.pxi":275
31921 * # if we get here, the entire path was already there
31922 * if replace: # <<<<<<<<<<<<<<
31923 * element = cetree.elementFactory(root._doc, c_node)
31924 * _replaceElement(element, value)
31929 /* "src/lxml/objectpath.pxi":279
31930 * _replaceElement(element, value)
31932 * _appendValue(cetree.elementFactory(root._doc, c_node.parent), # <<<<<<<<<<<<<<
31933 * cetree.namespacedName(c_node), value)
31937 __pyx_t_9 = ((PyObject *)__pyx_v_root->_doc);
31938 __Pyx_INCREF(__pyx_t_9);
31939 __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)
31940 __Pyx_GOTREF(__pyx_t_8);
31941 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31943 /* "src/lxml/objectpath.pxi":280
31945 * _appendValue(cetree.elementFactory(root._doc, c_node.parent),
31946 * cetree.namespacedName(c_node), value) # <<<<<<<<<<<<<<
31950 __pyx_t_9 = namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 280, __pyx_L1_error)
31951 __Pyx_GOTREF(__pyx_t_9);
31953 /* "src/lxml/objectpath.pxi":279
31954 * _replaceElement(element, value)
31956 * _appendValue(cetree.elementFactory(root._doc, c_node.parent), # <<<<<<<<<<<<<<
31957 * cetree.namespacedName(c_node), value)
31960 __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)
31961 __Pyx_GOTREF(__pyx_t_5);
31962 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
31963 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
31964 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31968 /* "src/lxml/objectpath.pxi":222
31971 * cdef _create_object_path(_Element root, _ObjectPath* c_path, # <<<<<<<<<<<<<<
31972 * Py_ssize_t c_path_len, int replace, value):
31973 * u"""Follow the path to find the target element, build the missing children
31976 /* function exit code */
31977 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31980 __Pyx_XDECREF(__pyx_t_5);
31981 __Pyx_XDECREF(__pyx_t_8);
31982 __Pyx_XDECREF(__pyx_t_9);
31983 __Pyx_AddTraceback("lxml.objectify._create_object_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
31986 __Pyx_XDECREF((PyObject *)__pyx_v_child);
31987 __Pyx_XDECREF((PyObject *)__pyx_v_element);
31988 __Pyx_XGIVEREF(__pyx_r);
31989 __Pyx_RefNannyFinishContext();
31993 /* "src/lxml/objectpath.pxi":283
31996 * cdef list _build_descendant_paths(tree.xmlNode* c_node, prefix_string): # <<<<<<<<<<<<<<
31997 * u"""Returns a list of all descendant paths.
32001 static PyObject *__pyx_f_4lxml_9objectify__build_descendant_paths(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_prefix_string) {
32002 PyObject *__pyx_v_path = 0;
32003 PyObject *__pyx_v_path_list = 0;
32004 PyObject *__pyx_v_tag = NULL;
32005 PyObject *__pyx_r = NULL;
32006 __Pyx_RefNannyDeclarations
32007 PyObject *__pyx_t_1 = NULL;
32010 int __pyx_lineno = 0;
32011 const char *__pyx_filename = NULL;
32012 int __pyx_clineno = 0;
32013 __Pyx_RefNannySetupContext("_build_descendant_paths", 0);
32014 __Pyx_INCREF(__pyx_v_prefix_string);
32016 /* "src/lxml/objectpath.pxi":287
32018 * cdef list path, path_list
32019 * tag = cetree.namespacedName(c_node) # <<<<<<<<<<<<<<
32020 * if prefix_string:
32021 * if prefix_string[-1] != u'.':
32023 __pyx_t_1 = namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
32024 __Pyx_GOTREF(__pyx_t_1);
32025 __pyx_v_tag = __pyx_t_1;
32028 /* "src/lxml/objectpath.pxi":288
32029 * cdef list path, path_list
32030 * tag = cetree.namespacedName(c_node)
32031 * if prefix_string: # <<<<<<<<<<<<<<
32032 * if prefix_string[-1] != u'.':
32033 * prefix_string += u'.'
32035 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_prefix_string); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 288, __pyx_L1_error)
32038 /* "src/lxml/objectpath.pxi":289
32039 * tag = cetree.namespacedName(c_node)
32040 * if prefix_string:
32041 * if prefix_string[-1] != u'.': # <<<<<<<<<<<<<<
32042 * prefix_string += u'.'
32043 * prefix_string = prefix_string + tag
32045 __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)
32046 __Pyx_GOTREF(__pyx_t_1);
32047 __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)
32048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32051 /* "src/lxml/objectpath.pxi":290
32052 * if prefix_string:
32053 * if prefix_string[-1] != u'.':
32054 * prefix_string += u'.' # <<<<<<<<<<<<<<
32055 * prefix_string = prefix_string + tag
32058 __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)
32059 __Pyx_GOTREF(__pyx_t_1);
32060 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_t_1);
32063 /* "src/lxml/objectpath.pxi":289
32064 * tag = cetree.namespacedName(c_node)
32065 * if prefix_string:
32066 * if prefix_string[-1] != u'.': # <<<<<<<<<<<<<<
32067 * prefix_string += u'.'
32068 * prefix_string = prefix_string + tag
32072 /* "src/lxml/objectpath.pxi":291
32073 * if prefix_string[-1] != u'.':
32074 * prefix_string += u'.'
32075 * prefix_string = prefix_string + tag # <<<<<<<<<<<<<<
32077 * prefix_string = tag
32079 __pyx_t_1 = PyNumber_Add(__pyx_v_prefix_string, __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
32080 __Pyx_GOTREF(__pyx_t_1);
32081 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_t_1);
32084 /* "src/lxml/objectpath.pxi":288
32085 * cdef list path, path_list
32086 * tag = cetree.namespacedName(c_node)
32087 * if prefix_string: # <<<<<<<<<<<<<<
32088 * if prefix_string[-1] != u'.':
32089 * prefix_string += u'.'
32094 /* "src/lxml/objectpath.pxi":293
32095 * prefix_string = prefix_string + tag
32097 * prefix_string = tag # <<<<<<<<<<<<<<
32098 * path = [prefix_string]
32102 __Pyx_INCREF(__pyx_v_tag);
32103 __Pyx_DECREF_SET(__pyx_v_prefix_string, __pyx_v_tag);
32107 /* "src/lxml/objectpath.pxi":294
32109 * prefix_string = tag
32110 * path = [prefix_string] # <<<<<<<<<<<<<<
32112 * _recursive_build_descendant_paths(c_node, path, path_list)
32114 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 294, __pyx_L1_error)
32115 __Pyx_GOTREF(__pyx_t_1);
32116 __Pyx_INCREF(__pyx_v_prefix_string);
32117 __Pyx_GIVEREF(__pyx_v_prefix_string);
32118 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix_string);
32119 __pyx_v_path = ((PyObject*)__pyx_t_1);
32122 /* "src/lxml/objectpath.pxi":295
32123 * prefix_string = tag
32124 * path = [prefix_string]
32125 * path_list = [] # <<<<<<<<<<<<<<
32126 * _recursive_build_descendant_paths(c_node, path, path_list)
32129 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 295, __pyx_L1_error)
32130 __Pyx_GOTREF(__pyx_t_1);
32131 __pyx_v_path_list = ((PyObject*)__pyx_t_1);
32134 /* "src/lxml/objectpath.pxi":296
32135 * path = [prefix_string]
32137 * _recursive_build_descendant_paths(c_node, path, path_list) # <<<<<<<<<<<<<<
32141 __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)
32143 /* "src/lxml/objectpath.pxi":297
32145 * _recursive_build_descendant_paths(c_node, path, path_list)
32146 * return path_list # <<<<<<<<<<<<<<
32150 __Pyx_XDECREF(__pyx_r);
32151 __Pyx_INCREF(__pyx_v_path_list);
32152 __pyx_r = __pyx_v_path_list;
32155 /* "src/lxml/objectpath.pxi":283
32158 * cdef list _build_descendant_paths(tree.xmlNode* c_node, prefix_string): # <<<<<<<<<<<<<<
32159 * u"""Returns a list of all descendant paths.
32163 /* function exit code */
32165 __Pyx_XDECREF(__pyx_t_1);
32166 __Pyx_AddTraceback("lxml.objectify._build_descendant_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
32169 __Pyx_XDECREF(__pyx_v_path);
32170 __Pyx_XDECREF(__pyx_v_path_list);
32171 __Pyx_XDECREF(__pyx_v_tag);
32172 __Pyx_XDECREF(__pyx_v_prefix_string);
32173 __Pyx_XGIVEREF(__pyx_r);
32174 __Pyx_RefNannyFinishContext();
32178 /* "src/lxml/objectpath.pxi":300
32181 * cdef int _recursive_build_descendant_paths(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
32182 * list path, list path_list) except -1:
32183 * u"""Fills the list 'path_list' with all descendant paths, initial prefix
32186 static int __pyx_f_4lxml_9objectify__recursive_build_descendant_paths(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_path, PyObject *__pyx_v_path_list) {
32187 xmlNode *__pyx_v_c_child;
32188 PyObject *__pyx_v_tags = NULL;
32189 const xmlChar *__pyx_v_c_href;
32190 PyObject *__pyx_v_tag = NULL;
32191 PyObject *__pyx_v_count = NULL;
32193 __Pyx_RefNannyDeclarations
32194 PyObject *__pyx_t_1 = NULL;
32196 xmlNode *__pyx_t_3;
32199 PyObject *__pyx_t_6 = NULL;
32200 Py_ssize_t __pyx_t_7;
32203 int __pyx_lineno = 0;
32204 const char *__pyx_filename = NULL;
32205 int __pyx_clineno = 0;
32206 __Pyx_RefNannySetupContext("_recursive_build_descendant_paths", 0);
32208 /* "src/lxml/objectpath.pxi":306
32210 * cdef tree.xmlNode* c_child
32211 * tags = {} # <<<<<<<<<<<<<<
32212 * path_list.append(u'.'.join(path))
32213 * c_href = tree._getNs(c_node)
32215 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 306, __pyx_L1_error)
32216 __Pyx_GOTREF(__pyx_t_1);
32217 __pyx_v_tags = ((PyObject*)__pyx_t_1);
32220 /* "src/lxml/objectpath.pxi":307
32221 * cdef tree.xmlNode* c_child
32223 * path_list.append(u'.'.join(path)) # <<<<<<<<<<<<<<
32224 * c_href = tree._getNs(c_node)
32225 * c_child = c_node.children
32227 if (unlikely(__pyx_v_path_list == Py_None)) {
32228 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
32229 __PYX_ERR(1, 307, __pyx_L1_error)
32231 __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__2, __pyx_v_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error)
32232 __Pyx_GOTREF(__pyx_t_1);
32233 __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)
32234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32236 /* "src/lxml/objectpath.pxi":308
32238 * path_list.append(u'.'.join(path))
32239 * c_href = tree._getNs(c_node) # <<<<<<<<<<<<<<
32240 * c_child = c_node.children
32241 * while c_child is not NULL:
32243 __pyx_v_c_href = _getNs(__pyx_v_c_node);
32245 /* "src/lxml/objectpath.pxi":309
32246 * path_list.append(u'.'.join(path))
32247 * c_href = tree._getNs(c_node)
32248 * c_child = c_node.children # <<<<<<<<<<<<<<
32249 * while c_child is not NULL:
32250 * while c_child.type != tree.XML_ELEMENT_NODE:
32252 __pyx_t_3 = __pyx_v_c_node->children;
32253 __pyx_v_c_child = __pyx_t_3;
32255 /* "src/lxml/objectpath.pxi":310
32256 * c_href = tree._getNs(c_node)
32257 * c_child = c_node.children
32258 * while c_child is not NULL: # <<<<<<<<<<<<<<
32259 * while c_child.type != tree.XML_ELEMENT_NODE:
32260 * c_child = c_child.next
32263 __pyx_t_4 = ((__pyx_v_c_child != NULL) != 0);
32264 if (!__pyx_t_4) break;
32266 /* "src/lxml/objectpath.pxi":311
32267 * c_child = c_node.children
32268 * while c_child is not NULL:
32269 * while c_child.type != tree.XML_ELEMENT_NODE: # <<<<<<<<<<<<<<
32270 * c_child = c_child.next
32271 * if c_child is NULL:
32274 __pyx_t_4 = ((__pyx_v_c_child->type != XML_ELEMENT_NODE) != 0);
32275 if (!__pyx_t_4) break;
32277 /* "src/lxml/objectpath.pxi":312
32278 * while c_child is not NULL:
32279 * while c_child.type != tree.XML_ELEMENT_NODE:
32280 * c_child = c_child.next # <<<<<<<<<<<<<<
32281 * if c_child is NULL:
32284 __pyx_t_3 = __pyx_v_c_child->next;
32285 __pyx_v_c_child = __pyx_t_3;
32287 /* "src/lxml/objectpath.pxi":313
32288 * while c_child.type != tree.XML_ELEMENT_NODE:
32289 * c_child = c_child.next
32290 * if c_child is NULL: # <<<<<<<<<<<<<<
32292 * if c_href is tree._getNs(c_child):
32294 __pyx_t_4 = ((__pyx_v_c_child == NULL) != 0);
32297 /* "src/lxml/objectpath.pxi":314
32298 * c_child = c_child.next
32299 * if c_child is NULL:
32300 * return 0 # <<<<<<<<<<<<<<
32301 * if c_href is tree._getNs(c_child):
32302 * tag = pyunicode(c_child.name)
32307 /* "src/lxml/objectpath.pxi":313
32308 * while c_child.type != tree.XML_ELEMENT_NODE:
32309 * c_child = c_child.next
32310 * if c_child is NULL: # <<<<<<<<<<<<<<
32312 * if c_href is tree._getNs(c_child):
32317 /* "src/lxml/objectpath.pxi":315
32318 * if c_child is NULL:
32320 * if c_href is tree._getNs(c_child): # <<<<<<<<<<<<<<
32321 * tag = pyunicode(c_child.name)
32322 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32324 __pyx_t_4 = ((__pyx_v_c_href == _getNs(__pyx_v_c_child)) != 0);
32327 /* "src/lxml/objectpath.pxi":316
32329 * if c_href is tree._getNs(c_child):
32330 * tag = pyunicode(c_child.name) # <<<<<<<<<<<<<<
32331 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32332 * # special case: parent has namespace, child does not
32334 __pyx_t_1 = pyunicode(__pyx_v_c_child->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
32335 __Pyx_GOTREF(__pyx_t_1);
32336 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_1);
32339 /* "src/lxml/objectpath.pxi":315
32340 * if c_child is NULL:
32342 * if c_href is tree._getNs(c_child): # <<<<<<<<<<<<<<
32343 * tag = pyunicode(c_child.name)
32344 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32349 /* "src/lxml/objectpath.pxi":317
32350 * if c_href is tree._getNs(c_child):
32351 * tag = pyunicode(c_child.name)
32352 * elif c_href is not NULL and tree._getNs(c_child) is NULL: # <<<<<<<<<<<<<<
32353 * # special case: parent has namespace, child does not
32354 * tag = u'{}' + pyunicode(c_child.name)
32356 __pyx_t_5 = ((__pyx_v_c_href != NULL) != 0);
32359 __pyx_t_4 = __pyx_t_5;
32360 goto __pyx_L9_bool_binop_done;
32362 __pyx_t_5 = ((_getNs(__pyx_v_c_child) == NULL) != 0);
32363 __pyx_t_4 = __pyx_t_5;
32364 __pyx_L9_bool_binop_done:;
32367 /* "src/lxml/objectpath.pxi":319
32368 * elif c_href is not NULL and tree._getNs(c_child) is NULL:
32369 * # special case: parent has namespace, child does not
32370 * tag = u'{}' + pyunicode(c_child.name) # <<<<<<<<<<<<<<
32372 * tag = cetree.namespacedName(c_child)
32374 __pyx_t_1 = pyunicode(__pyx_v_c_child->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 319, __pyx_L1_error)
32375 __Pyx_GOTREF(__pyx_t_1);
32376 __pyx_t_6 = PyNumber_Add(__pyx_kp_u__19, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 319, __pyx_L1_error)
32377 __Pyx_GOTREF(__pyx_t_6);
32378 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32379 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_6);
32382 /* "src/lxml/objectpath.pxi":317
32383 * if c_href is tree._getNs(c_child):
32384 * tag = pyunicode(c_child.name)
32385 * elif c_href is not NULL and tree._getNs(c_child) is NULL: # <<<<<<<<<<<<<<
32386 * # special case: parent has namespace, child does not
32387 * tag = u'{}' + pyunicode(c_child.name)
32392 /* "src/lxml/objectpath.pxi":321
32393 * tag = u'{}' + pyunicode(c_child.name)
32395 * tag = cetree.namespacedName(c_child) # <<<<<<<<<<<<<<
32396 * count = tags.get(tag)
32397 * if count is None:
32400 __pyx_t_6 = namespacedName(__pyx_v_c_child); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 321, __pyx_L1_error)
32401 __Pyx_GOTREF(__pyx_t_6);
32402 __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_6);
32407 /* "src/lxml/objectpath.pxi":322
32409 * tag = cetree.namespacedName(c_child)
32410 * count = tags.get(tag) # <<<<<<<<<<<<<<
32411 * if count is None:
32414 __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)
32415 __Pyx_GOTREF(__pyx_t_6);
32416 __Pyx_XDECREF_SET(__pyx_v_count, __pyx_t_6);
32419 /* "src/lxml/objectpath.pxi":323
32420 * tag = cetree.namespacedName(c_child)
32421 * count = tags.get(tag)
32422 * if count is None: # <<<<<<<<<<<<<<
32426 __pyx_t_4 = (__pyx_v_count == Py_None);
32427 __pyx_t_5 = (__pyx_t_4 != 0);
32430 /* "src/lxml/objectpath.pxi":324
32431 * count = tags.get(tag)
32432 * if count is None:
32433 * tags[tag] = 1 # <<<<<<<<<<<<<<
32435 * tags[tag] = count + 1
32437 if (unlikely(PyDict_SetItem(__pyx_v_tags, __pyx_v_tag, __pyx_int_1) < 0)) __PYX_ERR(1, 324, __pyx_L1_error)
32439 /* "src/lxml/objectpath.pxi":323
32440 * tag = cetree.namespacedName(c_child)
32441 * count = tags.get(tag)
32442 * if count is None: # <<<<<<<<<<<<<<
32449 /* "src/lxml/objectpath.pxi":326
32452 * tags[tag] = count + 1 # <<<<<<<<<<<<<<
32453 * tag += f'[{count}]'
32457 __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)
32458 __Pyx_GOTREF(__pyx_t_6);
32459 if (unlikely(PyDict_SetItem(__pyx_v_tags, __pyx_v_tag, __pyx_t_6) < 0)) __PYX_ERR(1, 326, __pyx_L1_error)
32460 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32462 /* "src/lxml/objectpath.pxi":327
32464 * tags[tag] = count + 1
32465 * tag += f'[{count}]' # <<<<<<<<<<<<<<
32467 * _recursive_build_descendant_paths(c_child, path, path_list)
32469 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 327, __pyx_L1_error)
32470 __Pyx_GOTREF(__pyx_t_6);
32473 __Pyx_INCREF(__pyx_kp_u__20);
32475 __Pyx_GIVEREF(__pyx_kp_u__20);
32476 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u__20);
32477 __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_count, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 327, __pyx_L1_error)
32478 __Pyx_GOTREF(__pyx_t_1);
32479 __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;
32480 __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
32481 __Pyx_GIVEREF(__pyx_t_1);
32482 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
32484 __Pyx_INCREF(__pyx_kp_u__21);
32486 __Pyx_GIVEREF(__pyx_kp_u__21);
32487 PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u__21);
32488 __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)
32489 __Pyx_GOTREF(__pyx_t_1);
32490 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
32491 __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_tag, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 327, __pyx_L1_error)
32492 __Pyx_GOTREF(__pyx_t_6);
32493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32494 __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_6);
32499 /* "src/lxml/objectpath.pxi":328
32500 * tags[tag] = count + 1
32501 * tag += f'[{count}]'
32502 * path.append(tag) # <<<<<<<<<<<<<<
32503 * _recursive_build_descendant_paths(c_child, path, path_list)
32506 if (unlikely(__pyx_v_path == Py_None)) {
32507 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
32508 __PYX_ERR(1, 328, __pyx_L1_error)
32510 __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)
32512 /* "src/lxml/objectpath.pxi":329
32513 * tag += f'[{count}]'
32515 * _recursive_build_descendant_paths(c_child, path, path_list) # <<<<<<<<<<<<<<
32517 * c_child = c_child.next
32519 __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)
32521 /* "src/lxml/objectpath.pxi":330
32523 * _recursive_build_descendant_paths(c_child, path, path_list)
32524 * del path[-1] # <<<<<<<<<<<<<<
32525 * c_child = c_child.next
32528 if (unlikely(__pyx_v_path == Py_None)) {
32529 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
32530 __PYX_ERR(1, 330, __pyx_L1_error)
32532 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)
32534 /* "src/lxml/objectpath.pxi":331
32535 * _recursive_build_descendant_paths(c_child, path, path_list)
32537 * c_child = c_child.next # <<<<<<<<<<<<<<
32540 __pyx_t_3 = __pyx_v_c_child->next;
32541 __pyx_v_c_child = __pyx_t_3;
32544 /* "src/lxml/objectpath.pxi":332
32546 * c_child = c_child.next
32547 * return 0 # <<<<<<<<<<<<<<
32552 /* "src/lxml/objectpath.pxi":300
32555 * cdef int _recursive_build_descendant_paths(tree.xmlNode* c_node, # <<<<<<<<<<<<<<
32556 * list path, list path_list) except -1:
32557 * u"""Fills the list 'path_list' with all descendant paths, initial prefix
32560 /* function exit code */
32562 __Pyx_XDECREF(__pyx_t_1);
32563 __Pyx_XDECREF(__pyx_t_6);
32564 __Pyx_AddTraceback("lxml.objectify._recursive_build_descendant_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
32567 __Pyx_XDECREF(__pyx_v_tags);
32568 __Pyx_XDECREF(__pyx_v_tag);
32569 __Pyx_XDECREF(__pyx_v_count);
32570 __Pyx_RefNannyFinishContext();
32574 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32575 PyObject *o = __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase->tp_new(t, a, k);
32576 if (unlikely(!o)) return 0;
32580 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement(PyObject *o) {
32581 #if CYTHON_USE_TP_FINALIZE
32582 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32583 if (PyObject_CallFinalizerFromDealloc(o)) return;
32586 PyObject_GC_UnTrack(o);
32587 PyObject_GC_Track(o);
32588 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);
32591 static int __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement(PyObject *o, visitproc v, void *a) {
32593 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;
32597 static int __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement(PyObject *o) {
32598 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);
32601 static PyObject *__pyx_sq_item_4lxml_9objectify_ObjectifiedElement(PyObject *o, Py_ssize_t i) {
32603 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
32604 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
32609 static int __pyx_mp_ass_subscript_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *i, PyObject *v) {
32611 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_23__setitem__(o, i, v);
32614 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_25__delitem__(o, i);
32618 static PyObject *__pyx_tp_getattro_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *n) {
32619 PyObject *v = PyObject_GenericGetAttr(o, n);
32620 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
32622 v = __pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__(o, n);
32627 static int __pyx_tp_setattro_4lxml_9objectify_ObjectifiedElement(PyObject *o, PyObject *n, PyObject *v) {
32629 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_15__setattr__(o, n, v);
32632 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_17__delattr__(o, n);
32636 static PyObject *__pyx_getprop_4lxml_9objectify_18ObjectifiedElement_text(PyObject *o, CYTHON_UNUSED void *x) {
32637 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_4text_1__get__(o);
32640 static PyObject *__pyx_getprop_4lxml_9objectify_18ObjectifiedElement___dict__(PyObject *o, CYTHON_UNUSED void *x) {
32641 return __pyx_pw_4lxml_9objectify_18ObjectifiedElement_8__dict___1__get__(o);
32644 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifiedElement[] = {
32645 {"__reduce__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_5__reduce__, METH_NOARGS, 0},
32646 {"countchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_9countchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_8countchildren},
32647 {"getchildren", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_11getchildren, METH_NOARGS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_10getchildren},
32648 {"__getattr__", (PyCFunction)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_13__getattr__, METH_O|METH_COEXIST, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_12__getattr__},
32649 {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_19addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_18addattr},
32650 {"descendantpaths", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_18ObjectifiedElement_27descendantpaths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_18ObjectifiedElement_26descendantpaths},
32654 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectifiedElement[] = {
32655 {(char *)"text", __pyx_getprop_4lxml_9objectify_18ObjectifiedElement_text, 0, (char *)0, 0},
32656 {(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},
32660 static PySequenceMethods __pyx_tp_as_sequence_ObjectifiedElement = {
32661 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__, /*sq_length*/
32664 __pyx_sq_item_4lxml_9objectify_ObjectifiedElement, /*sq_item*/
32667 0, /*sq_ass_slice*/
32669 0, /*sq_inplace_concat*/
32670 0, /*sq_inplace_repeat*/
32673 static PyMappingMethods __pyx_tp_as_mapping_ObjectifiedElement = {
32674 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_7__len__, /*mp_length*/
32675 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_21__getitem__, /*mp_subscript*/
32676 __pyx_mp_ass_subscript_4lxml_9objectify_ObjectifiedElement, /*mp_ass_subscript*/
32679 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifiedElement = {
32680 PyVarObject_HEAD_INIT(0, 0)
32681 "lxml.objectify.ObjectifiedElement", /*tp_name*/
32682 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifiedElement), /*tp_basicsize*/
32684 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
32685 #if PY_VERSION_HEX < 0x030800b4
32688 #if PY_VERSION_HEX >= 0x030800b4
32689 0, /*tp_vectorcall_offset*/
32693 #if PY_MAJOR_VERSION < 3
32696 #if PY_MAJOR_VERSION >= 3
32700 0, /*tp_as_number*/
32701 &__pyx_tp_as_sequence_ObjectifiedElement, /*tp_as_sequence*/
32702 &__pyx_tp_as_mapping_ObjectifiedElement, /*tp_as_mapping*/
32705 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_3__str__, /*tp_str*/
32706 __pyx_tp_getattro_4lxml_9objectify_ObjectifiedElement, /*tp_getattro*/
32707 __pyx_tp_setattro_4lxml_9objectify_ObjectifiedElement, /*tp_setattro*/
32708 0, /*tp_as_buffer*/
32709 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32710 "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*/
32711 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
32712 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
32713 0, /*tp_richcompare*/
32714 0, /*tp_weaklistoffset*/
32715 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32717 __pyx_methods_4lxml_9objectify_ObjectifiedElement, /*tp_methods*/
32719 __pyx_getsets_4lxml_9objectify_ObjectifiedElement, /*tp_getset*/
32722 0, /*tp_descr_get*/
32723 0, /*tp_descr_set*/
32724 0, /*tp_dictoffset*/
32727 __pyx_tp_new_4lxml_9objectify_ObjectifiedElement, /*tp_new*/
32733 0, /*tp_subclasses*/
32736 0, /*tp_version_tag*/
32737 #if PY_VERSION_HEX >= 0x030400a1
32740 #if PY_VERSION_HEX >= 0x030800b1
32741 0, /*tp_vectorcall*/
32743 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32748 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32749 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedElement(t, a, k);
32750 if (unlikely(!o)) return 0;
32754 static PyObject *__pyx_getprop_4lxml_9objectify_22ObjectifiedDataElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
32755 return __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5pyval_1__get__(o);
32758 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifiedDataElement[] = {
32759 {"_setText", (PyCFunction)__pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_5_setText, METH_O, __pyx_doc_4lxml_9objectify_22ObjectifiedDataElement_4_setText},
32763 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectifiedDataElement[] = {
32764 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_22ObjectifiedDataElement_pyval, 0, (char *)0, 0},
32768 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifiedDataElement = {
32769 PyVarObject_HEAD_INIT(0, 0)
32770 "lxml.objectify.ObjectifiedDataElement", /*tp_name*/
32771 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifiedDataElement), /*tp_basicsize*/
32773 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
32774 #if PY_VERSION_HEX < 0x030800b4
32777 #if PY_VERSION_HEX >= 0x030800b4
32778 0, /*tp_vectorcall_offset*/
32782 #if PY_MAJOR_VERSION < 3
32785 #if PY_MAJOR_VERSION >= 3
32788 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_3__repr__, /*tp_repr*/
32789 0, /*tp_as_number*/
32790 0, /*tp_as_sequence*/
32791 0, /*tp_as_mapping*/
32794 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__, /*tp_str*/
32797 0, /*tp_as_buffer*/
32798 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32799 "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*/
32800 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
32801 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
32802 0, /*tp_richcompare*/
32803 0, /*tp_weaklistoffset*/
32804 #if CYTHON_COMPILING_IN_PYPY
32805 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32810 __pyx_methods_4lxml_9objectify_ObjectifiedDataElement, /*tp_methods*/
32812 __pyx_getsets_4lxml_9objectify_ObjectifiedDataElement, /*tp_getset*/
32815 0, /*tp_descr_get*/
32816 0, /*tp_descr_set*/
32817 0, /*tp_dictoffset*/
32820 __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement, /*tp_new*/
32826 0, /*tp_subclasses*/
32829 0, /*tp_version_tag*/
32830 #if PY_VERSION_HEX >= 0x030400a1
32833 #if PY_VERSION_HEX >= 0x030800b1
32834 0, /*tp_vectorcall*/
32836 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
32841 static PyObject *__pyx_tp_new_4lxml_9objectify_NumberElement(PyTypeObject *t, PyObject *a, PyObject *k) {
32842 struct __pyx_obj_4lxml_9objectify_NumberElement *p;
32843 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
32844 if (unlikely(!o)) return 0;
32845 p = ((struct __pyx_obj_4lxml_9objectify_NumberElement *)o);
32846 p->_parse_value = Py_None; Py_INCREF(Py_None);
32850 static void __pyx_tp_dealloc_4lxml_9objectify_NumberElement(PyObject *o) {
32851 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32852 #if CYTHON_USE_TP_FINALIZE
32853 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
32854 if (PyObject_CallFinalizerFromDealloc(o)) return;
32857 PyObject_GC_UnTrack(o);
32858 Py_CLEAR(p->_parse_value);
32859 PyObject_GC_Track(o);
32860 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement(o);
32863 static int __pyx_tp_traverse_4lxml_9objectify_NumberElement(PyObject *o, visitproc v, void *a) {
32865 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32866 e = __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement(o, v, a); if (e) return e;
32867 if (p->_parse_value) {
32868 e = (*v)(p->_parse_value, a); if (e) return e;
32873 static int __pyx_tp_clear_4lxml_9objectify_NumberElement(PyObject *o) {
32874 struct __pyx_obj_4lxml_9objectify_NumberElement *p = (struct __pyx_obj_4lxml_9objectify_NumberElement *)o;
32875 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement(o);
32876 Py_CLEAR(p->_parse_value);
32880 static PyObject *__pyx_getprop_4lxml_9objectify_13NumberElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
32881 return __pyx_pw_4lxml_9objectify_13NumberElement_5pyval_1__get__(o);
32884 static PyMethodDef __pyx_methods_4lxml_9objectify_NumberElement[] = {
32885 {"_setValueParser", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_1_setValueParser, METH_O, __pyx_doc_4lxml_9objectify_13NumberElement__setValueParser},
32886 {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13NumberElement_9__complex__, METH_NOARGS, 0},
32890 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_NumberElement[] = {
32891 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_13NumberElement_pyval, 0, (char *)0, 0},
32895 static PyNumberMethods __pyx_tp_as_number_NumberElement = {
32896 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
32897 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
32898 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
32899 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32900 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
32902 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
32904 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
32905 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
32906 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
32907 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
32908 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
32909 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
32910 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
32911 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
32912 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
32913 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
32914 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
32915 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32918 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
32919 #if PY_MAJOR_VERSION < 3
32920 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
32924 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
32925 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32926 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
32928 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32929 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
32931 0, /*nb_inplace_add*/
32932 0, /*nb_inplace_subtract*/
32933 0, /*nb_inplace_multiply*/
32934 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
32935 0, /*nb_inplace_divide*/
32937 0, /*nb_inplace_remainder*/
32938 0, /*nb_inplace_power*/
32939 0, /*nb_inplace_lshift*/
32940 0, /*nb_inplace_rshift*/
32941 0, /*nb_inplace_and*/
32942 0, /*nb_inplace_xor*/
32943 0, /*nb_inplace_or*/
32944 0, /*nb_floor_divide*/
32945 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
32946 0, /*nb_inplace_floor_divide*/
32947 0, /*nb_inplace_true_divide*/
32949 #if PY_VERSION_HEX >= 0x03050000
32950 0, /*nb_matrix_multiply*/
32952 #if PY_VERSION_HEX >= 0x03050000
32953 0, /*nb_inplace_matrix_multiply*/
32957 static PyTypeObject __pyx_type_4lxml_9objectify_NumberElement = {
32958 PyVarObject_HEAD_INIT(0, 0)
32959 "lxml.objectify.NumberElement", /*tp_name*/
32960 sizeof(struct __pyx_obj_4lxml_9objectify_NumberElement), /*tp_basicsize*/
32962 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
32963 #if PY_VERSION_HEX < 0x030800b4
32966 #if PY_VERSION_HEX >= 0x030800b4
32967 0, /*tp_vectorcall_offset*/
32971 #if PY_MAJOR_VERSION < 3
32974 #if PY_MAJOR_VERSION >= 3
32977 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
32978 &__pyx_tp_as_number_NumberElement, /*tp_as_number*/
32979 0, /*tp_as_sequence*/
32980 0, /*tp_as_mapping*/
32981 __pyx_pw_4lxml_9objectify_13NumberElement_21__hash__, /*tp_hash*/
32983 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
32986 0, /*tp_as_buffer*/
32987 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
32989 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
32990 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
32991 __pyx_pw_4lxml_9objectify_13NumberElement_19__richcmp__, /*tp_richcompare*/
32992 0, /*tp_weaklistoffset*/
32993 #if CYTHON_COMPILING_IN_PYPY
32994 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
32999 __pyx_methods_4lxml_9objectify_NumberElement, /*tp_methods*/
33001 __pyx_getsets_4lxml_9objectify_NumberElement, /*tp_getset*/
33004 0, /*tp_descr_get*/
33005 0, /*tp_descr_set*/
33006 0, /*tp_dictoffset*/
33009 __pyx_tp_new_4lxml_9objectify_NumberElement, /*tp_new*/
33015 0, /*tp_subclasses*/
33018 0, /*tp_version_tag*/
33019 #if PY_VERSION_HEX >= 0x030400a1
33022 #if PY_VERSION_HEX >= 0x030800b1
33023 0, /*tp_vectorcall*/
33025 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33030 static PyObject *__pyx_tp_new_4lxml_9objectify_IntElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33031 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33032 if (unlikely(!o)) return 0;
33036 static PyMethodDef __pyx_methods_4lxml_9objectify_IntElement[] = {
33037 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_10IntElement_1_init, METH_NOARGS, 0},
33041 static PyNumberMethods __pyx_tp_as_number_IntElement = {
33042 #if CYTHON_COMPILING_IN_PYPY
33043 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33047 #if CYTHON_COMPILING_IN_PYPY
33048 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33052 #if CYTHON_COMPILING_IN_PYPY
33053 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33057 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33058 #if CYTHON_COMPILING_IN_PYPY
33059 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33064 #if CYTHON_COMPILING_IN_PYPY
33065 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33067 0, /*nb_remainder*/
33070 #if CYTHON_COMPILING_IN_PYPY
33071 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33075 #if CYTHON_COMPILING_IN_PYPY
33076 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33080 #if CYTHON_COMPILING_IN_PYPY
33081 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33085 #if CYTHON_COMPILING_IN_PYPY
33086 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33090 #if CYTHON_COMPILING_IN_PYPY
33091 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
33095 #if CYTHON_COMPILING_IN_PYPY
33096 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33100 #if CYTHON_COMPILING_IN_PYPY
33101 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
33105 #if CYTHON_COMPILING_IN_PYPY
33106 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
33110 #if CYTHON_COMPILING_IN_PYPY
33111 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
33115 #if CYTHON_COMPILING_IN_PYPY
33116 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
33120 #if CYTHON_COMPILING_IN_PYPY
33121 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
33125 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33128 #if CYTHON_COMPILING_IN_PYPY
33129 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
33133 #if PY_MAJOR_VERSION < 3
33134 #if CYTHON_COMPILING_IN_PYPY
33135 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
33142 #if CYTHON_COMPILING_IN_PYPY
33143 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
33147 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33148 #if CYTHON_COMPILING_IN_PYPY
33149 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
33154 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33155 #if CYTHON_COMPILING_IN_PYPY
33156 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
33161 0, /*nb_inplace_add*/
33162 0, /*nb_inplace_subtract*/
33163 0, /*nb_inplace_multiply*/
33164 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33165 0, /*nb_inplace_divide*/
33167 0, /*nb_inplace_remainder*/
33168 0, /*nb_inplace_power*/
33169 0, /*nb_inplace_lshift*/
33170 0, /*nb_inplace_rshift*/
33171 0, /*nb_inplace_and*/
33172 0, /*nb_inplace_xor*/
33173 0, /*nb_inplace_or*/
33174 0, /*nb_floor_divide*/
33175 #if CYTHON_COMPILING_IN_PYPY
33176 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
33178 0, /*nb_true_divide*/
33180 0, /*nb_inplace_floor_divide*/
33181 0, /*nb_inplace_true_divide*/
33182 __pyx_pw_4lxml_9objectify_10IntElement_3__index__, /*nb_index*/
33183 #if PY_VERSION_HEX >= 0x03050000
33184 0, /*nb_matrix_multiply*/
33186 #if PY_VERSION_HEX >= 0x03050000
33187 0, /*nb_inplace_matrix_multiply*/
33191 static PyTypeObject __pyx_type_4lxml_9objectify_IntElement = {
33192 PyVarObject_HEAD_INIT(0, 0)
33193 "lxml.objectify.IntElement", /*tp_name*/
33194 sizeof(struct __pyx_obj_4lxml_9objectify_IntElement), /*tp_basicsize*/
33196 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33197 #if PY_VERSION_HEX < 0x030800b4
33200 #if PY_VERSION_HEX >= 0x030800b4
33201 0, /*tp_vectorcall_offset*/
33205 #if PY_MAJOR_VERSION < 3
33208 #if PY_MAJOR_VERSION >= 3
33211 #if CYTHON_COMPILING_IN_PYPY
33212 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33216 &__pyx_tp_as_number_IntElement, /*tp_as_number*/
33217 0, /*tp_as_sequence*/
33218 0, /*tp_as_mapping*/
33221 #if CYTHON_COMPILING_IN_PYPY
33222 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33228 0, /*tp_as_buffer*/
33229 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33231 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33232 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33233 0, /*tp_richcompare*/
33234 0, /*tp_weaklistoffset*/
33235 #if CYTHON_COMPILING_IN_PYPY
33236 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33241 __pyx_methods_4lxml_9objectify_IntElement, /*tp_methods*/
33246 0, /*tp_descr_get*/
33247 0, /*tp_descr_set*/
33248 0, /*tp_dictoffset*/
33251 __pyx_tp_new_4lxml_9objectify_IntElement, /*tp_new*/
33257 0, /*tp_subclasses*/
33260 0, /*tp_version_tag*/
33261 #if PY_VERSION_HEX >= 0x030400a1
33264 #if PY_VERSION_HEX >= 0x030800b1
33265 0, /*tp_vectorcall*/
33267 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33272 static PyObject *__pyx_tp_new_4lxml_9objectify_LongElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33273 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33274 if (unlikely(!o)) return 0;
33278 static PyMethodDef __pyx_methods_4lxml_9objectify_LongElement[] = {
33279 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11LongElement_1_init, METH_NOARGS, 0},
33283 static PyNumberMethods __pyx_tp_as_number_LongElement = {
33284 #if CYTHON_COMPILING_IN_PYPY
33285 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33289 #if CYTHON_COMPILING_IN_PYPY
33290 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33294 #if CYTHON_COMPILING_IN_PYPY
33295 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33299 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33300 #if CYTHON_COMPILING_IN_PYPY
33301 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33306 #if CYTHON_COMPILING_IN_PYPY
33307 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33309 0, /*nb_remainder*/
33312 #if CYTHON_COMPILING_IN_PYPY
33313 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33317 #if CYTHON_COMPILING_IN_PYPY
33318 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33322 #if CYTHON_COMPILING_IN_PYPY
33323 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33327 #if CYTHON_COMPILING_IN_PYPY
33328 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33332 #if CYTHON_COMPILING_IN_PYPY
33333 __pyx_pw_4lxml_9objectify_13NumberElement_43__nonzero__, /*nb_nonzero*/
33337 #if CYTHON_COMPILING_IN_PYPY
33338 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33342 #if CYTHON_COMPILING_IN_PYPY
33343 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
33347 #if CYTHON_COMPILING_IN_PYPY
33348 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
33352 #if CYTHON_COMPILING_IN_PYPY
33353 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
33357 #if CYTHON_COMPILING_IN_PYPY
33358 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
33362 #if CYTHON_COMPILING_IN_PYPY
33363 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
33367 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33370 #if CYTHON_COMPILING_IN_PYPY
33371 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
33375 #if PY_MAJOR_VERSION < 3
33376 #if CYTHON_COMPILING_IN_PYPY
33377 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
33384 #if CYTHON_COMPILING_IN_PYPY
33385 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
33389 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33390 #if CYTHON_COMPILING_IN_PYPY
33391 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
33396 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33397 #if CYTHON_COMPILING_IN_PYPY
33398 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
33403 0, /*nb_inplace_add*/
33404 0, /*nb_inplace_subtract*/
33405 0, /*nb_inplace_multiply*/
33406 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33407 0, /*nb_inplace_divide*/
33409 0, /*nb_inplace_remainder*/
33410 0, /*nb_inplace_power*/
33411 0, /*nb_inplace_lshift*/
33412 0, /*nb_inplace_rshift*/
33413 0, /*nb_inplace_and*/
33414 0, /*nb_inplace_xor*/
33415 0, /*nb_inplace_or*/
33416 0, /*nb_floor_divide*/
33417 #if CYTHON_COMPILING_IN_PYPY
33418 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
33420 0, /*nb_true_divide*/
33422 0, /*nb_inplace_floor_divide*/
33423 0, /*nb_inplace_true_divide*/
33424 __pyx_pw_4lxml_9objectify_11LongElement_3__index__, /*nb_index*/
33425 #if PY_VERSION_HEX >= 0x03050000
33426 0, /*nb_matrix_multiply*/
33428 #if PY_VERSION_HEX >= 0x03050000
33429 0, /*nb_inplace_matrix_multiply*/
33433 static PyTypeObject __pyx_type_4lxml_9objectify_LongElement = {
33434 PyVarObject_HEAD_INIT(0, 0)
33435 "lxml.objectify.LongElement", /*tp_name*/
33436 sizeof(struct __pyx_obj_4lxml_9objectify_LongElement), /*tp_basicsize*/
33438 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33439 #if PY_VERSION_HEX < 0x030800b4
33442 #if PY_VERSION_HEX >= 0x030800b4
33443 0, /*tp_vectorcall_offset*/
33447 #if PY_MAJOR_VERSION < 3
33450 #if PY_MAJOR_VERSION >= 3
33453 #if CYTHON_COMPILING_IN_PYPY
33454 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33458 &__pyx_tp_as_number_LongElement, /*tp_as_number*/
33459 0, /*tp_as_sequence*/
33460 0, /*tp_as_mapping*/
33463 #if CYTHON_COMPILING_IN_PYPY
33464 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33470 0, /*tp_as_buffer*/
33471 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33473 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33474 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33475 0, /*tp_richcompare*/
33476 0, /*tp_weaklistoffset*/
33477 #if CYTHON_COMPILING_IN_PYPY
33478 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33483 __pyx_methods_4lxml_9objectify_LongElement, /*tp_methods*/
33488 0, /*tp_descr_get*/
33489 0, /*tp_descr_set*/
33490 0, /*tp_dictoffset*/
33493 __pyx_tp_new_4lxml_9objectify_LongElement, /*tp_new*/
33499 0, /*tp_subclasses*/
33502 0, /*tp_version_tag*/
33503 #if PY_VERSION_HEX >= 0x030400a1
33506 #if PY_VERSION_HEX >= 0x030800b1
33507 0, /*tp_vectorcall*/
33509 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33514 static PyObject *__pyx_tp_new_4lxml_9objectify_FloatElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33515 PyObject *o = __pyx_tp_new_4lxml_9objectify_NumberElement(t, a, k);
33516 if (unlikely(!o)) return 0;
33520 static PyMethodDef __pyx_methods_4lxml_9objectify_FloatElement[] = {
33521 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_12FloatElement_1_init, METH_NOARGS, 0},
33525 static PyTypeObject __pyx_type_4lxml_9objectify_FloatElement = {
33526 PyVarObject_HEAD_INIT(0, 0)
33527 "lxml.objectify.FloatElement", /*tp_name*/
33528 sizeof(struct __pyx_obj_4lxml_9objectify_FloatElement), /*tp_basicsize*/
33530 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
33531 #if PY_VERSION_HEX < 0x030800b4
33534 #if PY_VERSION_HEX >= 0x030800b4
33535 0, /*tp_vectorcall_offset*/
33539 #if PY_MAJOR_VERSION < 3
33542 #if PY_MAJOR_VERSION >= 3
33545 #if CYTHON_COMPILING_IN_PYPY
33546 __pyx_pw_4lxml_9objectify_13NumberElement_13__repr__, /*tp_repr*/
33550 0, /*tp_as_number*/
33551 0, /*tp_as_sequence*/
33552 0, /*tp_as_mapping*/
33555 #if CYTHON_COMPILING_IN_PYPY
33556 __pyx_pw_4lxml_9objectify_13NumberElement_11__str__, /*tp_str*/
33562 0, /*tp_as_buffer*/
33563 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33565 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
33566 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
33567 0, /*tp_richcompare*/
33568 0, /*tp_weaklistoffset*/
33569 #if CYTHON_COMPILING_IN_PYPY
33570 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33575 __pyx_methods_4lxml_9objectify_FloatElement, /*tp_methods*/
33580 0, /*tp_descr_get*/
33581 0, /*tp_descr_set*/
33582 0, /*tp_dictoffset*/
33585 __pyx_tp_new_4lxml_9objectify_FloatElement, /*tp_new*/
33591 0, /*tp_subclasses*/
33594 0, /*tp_version_tag*/
33595 #if PY_VERSION_HEX >= 0x030400a1
33598 #if PY_VERSION_HEX >= 0x030800b1
33599 0, /*tp_vectorcall*/
33601 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33606 static PyObject *__pyx_tp_new_4lxml_9objectify_StringElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33607 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
33608 if (unlikely(!o)) return 0;
33612 static PyObject *__pyx_getprop_4lxml_9objectify_13StringElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33613 return __pyx_pw_4lxml_9objectify_13StringElement_5pyval_1__get__(o);
33616 static PyMethodDef __pyx_methods_4lxml_9objectify_StringElement[] = {
33617 {"strlen", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_3strlen, METH_NOARGS, 0},
33618 {"__complex__", (PyCFunction)__pyx_pw_4lxml_9objectify_13StringElement_23__complex__, METH_NOARGS, 0},
33622 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_StringElement[] = {
33623 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_13StringElement_pyval, 0, (char *)0, 0},
33627 static PyNumberMethods __pyx_tp_as_number_StringElement = {
33628 __pyx_pw_4lxml_9objectify_13StringElement_11__add__, /*nb_add*/
33630 __pyx_pw_4lxml_9objectify_13StringElement_13__mul__, /*nb_multiply*/
33631 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33634 __pyx_pw_4lxml_9objectify_13StringElement_15__mod__, /*nb_remainder*/
33640 __pyx_pw_4lxml_9objectify_13StringElement_5__nonzero__, /*nb_nonzero*/
33647 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33650 __pyx_pw_4lxml_9objectify_13StringElement_17__int__, /*nb_int*/
33651 #if PY_MAJOR_VERSION < 3
33652 __pyx_pw_4lxml_9objectify_13StringElement_19__long__, /*nb_long*/
33656 __pyx_pw_4lxml_9objectify_13StringElement_21__float__, /*nb_float*/
33657 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33660 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33663 0, /*nb_inplace_add*/
33664 0, /*nb_inplace_subtract*/
33665 0, /*nb_inplace_multiply*/
33666 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33667 0, /*nb_inplace_divide*/
33669 0, /*nb_inplace_remainder*/
33670 0, /*nb_inplace_power*/
33671 0, /*nb_inplace_lshift*/
33672 0, /*nb_inplace_rshift*/
33673 0, /*nb_inplace_and*/
33674 0, /*nb_inplace_xor*/
33675 0, /*nb_inplace_or*/
33676 0, /*nb_floor_divide*/
33677 0, /*nb_true_divide*/
33678 0, /*nb_inplace_floor_divide*/
33679 0, /*nb_inplace_true_divide*/
33681 #if PY_VERSION_HEX >= 0x03050000
33682 0, /*nb_matrix_multiply*/
33684 #if PY_VERSION_HEX >= 0x03050000
33685 0, /*nb_inplace_matrix_multiply*/
33689 static PyTypeObject __pyx_type_4lxml_9objectify_StringElement = {
33690 PyVarObject_HEAD_INIT(0, 0)
33691 "lxml.objectify.StringElement", /*tp_name*/
33692 sizeof(struct __pyx_obj_4lxml_9objectify_StringElement), /*tp_basicsize*/
33694 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
33695 #if PY_VERSION_HEX < 0x030800b4
33698 #if PY_VERSION_HEX >= 0x030800b4
33699 0, /*tp_vectorcall_offset*/
33703 #if PY_MAJOR_VERSION < 3
33706 #if PY_MAJOR_VERSION >= 3
33709 __pyx_pw_4lxml_9objectify_13StringElement_1__repr__, /*tp_repr*/
33710 &__pyx_tp_as_number_StringElement, /*tp_as_number*/
33711 0, /*tp_as_sequence*/
33712 0, /*tp_as_mapping*/
33713 __pyx_pw_4lxml_9objectify_13StringElement_9__hash__, /*tp_hash*/
33715 #if CYTHON_COMPILING_IN_PYPY
33716 __pyx_pw_4lxml_9objectify_22ObjectifiedDataElement_1__str__, /*tp_str*/
33722 0, /*tp_as_buffer*/
33723 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33724 "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*/
33725 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
33726 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
33727 __pyx_pw_4lxml_9objectify_13StringElement_7__richcmp__, /*tp_richcompare*/
33728 0, /*tp_weaklistoffset*/
33729 #if CYTHON_COMPILING_IN_PYPY
33730 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33735 __pyx_methods_4lxml_9objectify_StringElement, /*tp_methods*/
33737 __pyx_getsets_4lxml_9objectify_StringElement, /*tp_getset*/
33740 0, /*tp_descr_get*/
33741 0, /*tp_descr_set*/
33742 0, /*tp_dictoffset*/
33745 __pyx_tp_new_4lxml_9objectify_StringElement, /*tp_new*/
33751 0, /*tp_subclasses*/
33754 0, /*tp_version_tag*/
33755 #if PY_VERSION_HEX >= 0x030400a1
33758 #if PY_VERSION_HEX >= 0x030800b1
33759 0, /*tp_vectorcall*/
33761 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33766 static PyObject *__pyx_tp_new_4lxml_9objectify_NoneElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33767 PyObject *o = __pyx_tp_new_4lxml_9objectify_ObjectifiedDataElement(t, a, k);
33768 if (unlikely(!o)) return 0;
33772 static PyObject *__pyx_getprop_4lxml_9objectify_11NoneElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33773 return __pyx_pw_4lxml_9objectify_11NoneElement_5pyval_1__get__(o);
33776 static PyMethodDef __pyx_methods_4lxml_9objectify_NoneElement[] = {
33780 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_NoneElement[] = {
33781 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_11NoneElement_pyval, 0, (char *)0, 0},
33785 static PyNumberMethods __pyx_tp_as_number_NoneElement = {
33789 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33792 0, /*nb_remainder*/
33798 __pyx_pw_4lxml_9objectify_11NoneElement_5__nonzero__, /*nb_nonzero*/
33805 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33809 #if PY_MAJOR_VERSION < 3
33815 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33818 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33821 0, /*nb_inplace_add*/
33822 0, /*nb_inplace_subtract*/
33823 0, /*nb_inplace_multiply*/
33824 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33825 0, /*nb_inplace_divide*/
33827 0, /*nb_inplace_remainder*/
33828 0, /*nb_inplace_power*/
33829 0, /*nb_inplace_lshift*/
33830 0, /*nb_inplace_rshift*/
33831 0, /*nb_inplace_and*/
33832 0, /*nb_inplace_xor*/
33833 0, /*nb_inplace_or*/
33834 0, /*nb_floor_divide*/
33835 0, /*nb_true_divide*/
33836 0, /*nb_inplace_floor_divide*/
33837 0, /*nb_inplace_true_divide*/
33839 #if PY_VERSION_HEX >= 0x03050000
33840 0, /*nb_matrix_multiply*/
33842 #if PY_VERSION_HEX >= 0x03050000
33843 0, /*nb_inplace_matrix_multiply*/
33847 static PyTypeObject __pyx_type_4lxml_9objectify_NoneElement = {
33848 PyVarObject_HEAD_INIT(0, 0)
33849 "lxml.objectify.NoneElement", /*tp_name*/
33850 sizeof(struct __pyx_obj_4lxml_9objectify_NoneElement), /*tp_basicsize*/
33852 __pyx_tp_dealloc_4lxml_9objectify_ObjectifiedElement, /*tp_dealloc*/
33853 #if PY_VERSION_HEX < 0x030800b4
33856 #if PY_VERSION_HEX >= 0x030800b4
33857 0, /*tp_vectorcall_offset*/
33861 #if PY_MAJOR_VERSION < 3
33864 #if PY_MAJOR_VERSION >= 3
33867 __pyx_pw_4lxml_9objectify_11NoneElement_3__repr__, /*tp_repr*/
33868 &__pyx_tp_as_number_NoneElement, /*tp_as_number*/
33869 0, /*tp_as_sequence*/
33870 0, /*tp_as_mapping*/
33871 __pyx_pw_4lxml_9objectify_11NoneElement_9__hash__, /*tp_hash*/
33873 __pyx_pw_4lxml_9objectify_11NoneElement_1__str__, /*tp_str*/
33876 0, /*tp_as_buffer*/
33877 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
33879 __pyx_tp_traverse_4lxml_9objectify_ObjectifiedElement, /*tp_traverse*/
33880 __pyx_tp_clear_4lxml_9objectify_ObjectifiedElement, /*tp_clear*/
33881 __pyx_pw_4lxml_9objectify_11NoneElement_7__richcmp__, /*tp_richcompare*/
33882 0, /*tp_weaklistoffset*/
33883 #if CYTHON_COMPILING_IN_PYPY
33884 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
33889 __pyx_methods_4lxml_9objectify_NoneElement, /*tp_methods*/
33891 __pyx_getsets_4lxml_9objectify_NoneElement, /*tp_getset*/
33894 0, /*tp_descr_get*/
33895 0, /*tp_descr_set*/
33896 0, /*tp_dictoffset*/
33899 __pyx_tp_new_4lxml_9objectify_NoneElement, /*tp_new*/
33905 0, /*tp_subclasses*/
33908 0, /*tp_version_tag*/
33909 #if PY_VERSION_HEX >= 0x030400a1
33912 #if PY_VERSION_HEX >= 0x030800b1
33913 0, /*tp_vectorcall*/
33915 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
33920 static PyObject *__pyx_tp_new_4lxml_9objectify_BoolElement(PyTypeObject *t, PyObject *a, PyObject *k) {
33921 PyObject *o = __pyx_tp_new_4lxml_9objectify_IntElement(t, a, k);
33922 if (unlikely(!o)) return 0;
33926 static PyObject *__pyx_getprop_4lxml_9objectify_11BoolElement_pyval(PyObject *o, CYTHON_UNUSED void *x) {
33927 return __pyx_pw_4lxml_9objectify_11BoolElement_5pyval_1__get__(o);
33930 static PyMethodDef __pyx_methods_4lxml_9objectify_BoolElement[] = {
33931 {"_init", (PyCFunction)__pyx_pw_4lxml_9objectify_11BoolElement_1_init, METH_NOARGS, 0},
33935 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_BoolElement[] = {
33936 {(char *)"pyval", __pyx_getprop_4lxml_9objectify_11BoolElement_pyval, 0, (char *)0, 0},
33940 static PyNumberMethods __pyx_tp_as_number_BoolElement = {
33941 #if CYTHON_COMPILING_IN_PYPY
33942 __pyx_pw_4lxml_9objectify_13NumberElement_23__add__, /*nb_add*/
33946 #if CYTHON_COMPILING_IN_PYPY
33947 __pyx_pw_4lxml_9objectify_13NumberElement_25__sub__, /*nb_subtract*/
33951 #if CYTHON_COMPILING_IN_PYPY
33952 __pyx_pw_4lxml_9objectify_13NumberElement_27__mul__, /*nb_multiply*/
33956 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
33957 #if CYTHON_COMPILING_IN_PYPY
33958 __pyx_pw_4lxml_9objectify_13NumberElement_29__div__, /*nb_divide*/
33963 #if CYTHON_COMPILING_IN_PYPY
33964 __pyx_pw_4lxml_9objectify_13NumberElement_33__mod__, /*nb_remainder*/
33966 0, /*nb_remainder*/
33969 #if CYTHON_COMPILING_IN_PYPY
33970 __pyx_pw_4lxml_9objectify_13NumberElement_35__pow__, /*nb_power*/
33974 #if CYTHON_COMPILING_IN_PYPY
33975 __pyx_pw_4lxml_9objectify_13NumberElement_37__neg__, /*nb_negative*/
33979 #if CYTHON_COMPILING_IN_PYPY
33980 __pyx_pw_4lxml_9objectify_13NumberElement_39__pos__, /*nb_positive*/
33984 #if CYTHON_COMPILING_IN_PYPY
33985 __pyx_pw_4lxml_9objectify_13NumberElement_41__abs__, /*nb_absolute*/
33989 __pyx_pw_4lxml_9objectify_11BoolElement_3__nonzero__, /*nb_nonzero*/
33990 #if CYTHON_COMPILING_IN_PYPY
33991 __pyx_pw_4lxml_9objectify_13NumberElement_45__invert__, /*nb_invert*/
33995 #if CYTHON_COMPILING_IN_PYPY
33996 __pyx_pw_4lxml_9objectify_13NumberElement_47__lshift__, /*nb_lshift*/
34000 #if CYTHON_COMPILING_IN_PYPY
34001 __pyx_pw_4lxml_9objectify_13NumberElement_49__rshift__, /*nb_rshift*/
34005 #if CYTHON_COMPILING_IN_PYPY
34006 __pyx_pw_4lxml_9objectify_13NumberElement_51__and__, /*nb_and*/
34010 #if CYTHON_COMPILING_IN_PYPY
34011 __pyx_pw_4lxml_9objectify_13NumberElement_55__xor__, /*nb_xor*/
34015 #if CYTHON_COMPILING_IN_PYPY
34016 __pyx_pw_4lxml_9objectify_13NumberElement_53__or__, /*nb_or*/
34020 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34023 #if CYTHON_COMPILING_IN_PYPY
34024 __pyx_pw_4lxml_9objectify_13NumberElement_3__int__, /*nb_int*/
34028 #if PY_MAJOR_VERSION < 3
34029 #if CYTHON_COMPILING_IN_PYPY
34030 __pyx_pw_4lxml_9objectify_13NumberElement_5__long__, /*nb_long*/
34037 #if CYTHON_COMPILING_IN_PYPY
34038 __pyx_pw_4lxml_9objectify_13NumberElement_7__float__, /*nb_float*/
34042 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34043 #if CYTHON_COMPILING_IN_PYPY
34044 __pyx_pw_4lxml_9objectify_13NumberElement_15__oct__, /*nb_oct*/
34049 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34050 #if CYTHON_COMPILING_IN_PYPY
34051 __pyx_pw_4lxml_9objectify_13NumberElement_17__hex__, /*nb_hex*/
34056 0, /*nb_inplace_add*/
34057 0, /*nb_inplace_subtract*/
34058 0, /*nb_inplace_multiply*/
34059 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
34060 0, /*nb_inplace_divide*/
34062 0, /*nb_inplace_remainder*/
34063 0, /*nb_inplace_power*/
34064 0, /*nb_inplace_lshift*/
34065 0, /*nb_inplace_rshift*/
34066 0, /*nb_inplace_and*/
34067 0, /*nb_inplace_xor*/
34068 0, /*nb_inplace_or*/
34069 0, /*nb_floor_divide*/
34070 #if CYTHON_COMPILING_IN_PYPY
34071 __pyx_pw_4lxml_9objectify_13NumberElement_31__truediv__, /*nb_true_divide*/
34073 0, /*nb_true_divide*/
34075 0, /*nb_inplace_floor_divide*/
34076 0, /*nb_inplace_true_divide*/
34077 #if CYTHON_COMPILING_IN_PYPY
34078 __pyx_pw_4lxml_9objectify_10IntElement_3__index__, /*nb_index*/
34082 #if PY_VERSION_HEX >= 0x03050000
34083 0, /*nb_matrix_multiply*/
34085 #if PY_VERSION_HEX >= 0x03050000
34086 0, /*nb_inplace_matrix_multiply*/
34090 static PyTypeObject __pyx_type_4lxml_9objectify_BoolElement = {
34091 PyVarObject_HEAD_INIT(0, 0)
34092 "lxml.objectify.BoolElement", /*tp_name*/
34093 sizeof(struct __pyx_obj_4lxml_9objectify_BoolElement), /*tp_basicsize*/
34095 __pyx_tp_dealloc_4lxml_9objectify_NumberElement, /*tp_dealloc*/
34096 #if PY_VERSION_HEX < 0x030800b4
34099 #if PY_VERSION_HEX >= 0x030800b4
34100 0, /*tp_vectorcall_offset*/
34104 #if PY_MAJOR_VERSION < 3
34107 #if PY_MAJOR_VERSION >= 3
34110 __pyx_pw_4lxml_9objectify_11BoolElement_11__repr__, /*tp_repr*/
34111 &__pyx_tp_as_number_BoolElement, /*tp_as_number*/
34112 0, /*tp_as_sequence*/
34113 0, /*tp_as_mapping*/
34114 __pyx_pw_4lxml_9objectify_11BoolElement_7__hash__, /*tp_hash*/
34116 __pyx_pw_4lxml_9objectify_11BoolElement_9__str__, /*tp_str*/
34119 0, /*tp_as_buffer*/
34120 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34121 "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*/
34122 __pyx_tp_traverse_4lxml_9objectify_NumberElement, /*tp_traverse*/
34123 __pyx_tp_clear_4lxml_9objectify_NumberElement, /*tp_clear*/
34124 __pyx_pw_4lxml_9objectify_11BoolElement_5__richcmp__, /*tp_richcompare*/
34125 0, /*tp_weaklistoffset*/
34126 #if CYTHON_COMPILING_IN_PYPY
34127 __pyx_pw_4lxml_9objectify_18ObjectifiedElement_1__iter__, /*tp_iter*/
34132 __pyx_methods_4lxml_9objectify_BoolElement, /*tp_methods*/
34134 __pyx_getsets_4lxml_9objectify_BoolElement, /*tp_getset*/
34137 0, /*tp_descr_get*/
34138 0, /*tp_descr_set*/
34139 0, /*tp_dictoffset*/
34142 __pyx_tp_new_4lxml_9objectify_BoolElement, /*tp_new*/
34148 0, /*tp_subclasses*/
34151 0, /*tp_version_tag*/
34152 #if PY_VERSION_HEX >= 0x030400a1
34155 #if PY_VERSION_HEX >= 0x030800b1
34156 0, /*tp_vectorcall*/
34158 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34163 static PyObject *__pyx_tp_new_4lxml_9objectify_PyType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34164 struct __pyx_obj_4lxml_9objectify_PyType *p;
34166 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34167 o = (*t->tp_alloc)(t, 0);
34169 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34171 if (unlikely(!o)) return 0;
34172 p = ((struct __pyx_obj_4lxml_9objectify_PyType *)o);
34173 p->name = Py_None; Py_INCREF(Py_None);
34174 p->type_check = Py_None; Py_INCREF(Py_None);
34175 p->stringify = Py_None; Py_INCREF(Py_None);
34176 p->_type = Py_None; Py_INCREF(Py_None);
34177 p->_schema_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
34181 static void __pyx_tp_dealloc_4lxml_9objectify_PyType(PyObject *o) {
34182 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34183 #if CYTHON_USE_TP_FINALIZE
34184 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34185 if (PyObject_CallFinalizerFromDealloc(o)) return;
34188 PyObject_GC_UnTrack(o);
34190 Py_CLEAR(p->type_check);
34191 Py_CLEAR(p->stringify);
34192 Py_CLEAR(p->_type);
34193 Py_CLEAR(p->_schema_types);
34194 (*Py_TYPE(o)->tp_free)(o);
34197 static int __pyx_tp_traverse_4lxml_9objectify_PyType(PyObject *o, visitproc v, void *a) {
34199 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34201 e = (*v)(p->name, a); if (e) return e;
34203 if (p->type_check) {
34204 e = (*v)(p->type_check, a); if (e) return e;
34206 if (p->stringify) {
34207 e = (*v)(p->stringify, a); if (e) return e;
34210 e = (*v)(p->_type, a); if (e) return e;
34212 if (p->_schema_types) {
34213 e = (*v)(p->_schema_types, a); if (e) return e;
34218 static int __pyx_tp_clear_4lxml_9objectify_PyType(PyObject *o) {
34219 struct __pyx_obj_4lxml_9objectify_PyType *p = (struct __pyx_obj_4lxml_9objectify_PyType *)o;
34221 Py_CLEAR(p->type_check);
34222 Py_CLEAR(p->stringify);
34223 Py_CLEAR(p->_type);
34224 Py_CLEAR(p->_schema_types);
34228 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_xmlSchemaTypes(PyObject *o, CYTHON_UNUSED void *x) {
34229 return __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_1__get__(o);
34232 static int __pyx_setprop_4lxml_9objectify_6PyType_xmlSchemaTypes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
34234 return __pyx_pw_4lxml_9objectify_6PyType_14xmlSchemaTypes_3__set__(o, v);
34237 PyErr_SetString(PyExc_NotImplementedError, "__del__");
34242 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_name(PyObject *o, CYTHON_UNUSED void *x) {
34243 return __pyx_pw_4lxml_9objectify_6PyType_4name_1__get__(o);
34246 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_type_check(PyObject *o, CYTHON_UNUSED void *x) {
34247 return __pyx_pw_4lxml_9objectify_6PyType_10type_check_1__get__(o);
34250 static PyObject *__pyx_getprop_4lxml_9objectify_6PyType_stringify(PyObject *o, CYTHON_UNUSED void *x) {
34251 return __pyx_pw_4lxml_9objectify_6PyType_9stringify_1__get__(o);
34254 static PyMethodDef __pyx_methods_4lxml_9objectify_PyType[] = {
34255 {"register", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_6PyType_5register, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_6PyType_4register},
34256 {"unregister", (PyCFunction)__pyx_pw_4lxml_9objectify_6PyType_7unregister, METH_NOARGS, __pyx_doc_4lxml_9objectify_6PyType_6unregister},
34260 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_PyType[] = {
34261 {(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},
34262 {(char *)"name", __pyx_getprop_4lxml_9objectify_6PyType_name, 0, (char *)0, 0},
34263 {(char *)"type_check", __pyx_getprop_4lxml_9objectify_6PyType_type_check, 0, (char *)0, 0},
34264 {(char *)"stringify", __pyx_getprop_4lxml_9objectify_6PyType_stringify, 0, (char *)0, 0},
34268 static PyTypeObject __pyx_type_4lxml_9objectify_PyType = {
34269 PyVarObject_HEAD_INIT(0, 0)
34270 "lxml.objectify.PyType", /*tp_name*/
34271 sizeof(struct __pyx_obj_4lxml_9objectify_PyType), /*tp_basicsize*/
34273 __pyx_tp_dealloc_4lxml_9objectify_PyType, /*tp_dealloc*/
34274 #if PY_VERSION_HEX < 0x030800b4
34277 #if PY_VERSION_HEX >= 0x030800b4
34278 0, /*tp_vectorcall_offset*/
34282 #if PY_MAJOR_VERSION < 3
34285 #if PY_MAJOR_VERSION >= 3
34288 __pyx_pw_4lxml_9objectify_6PyType_3__repr__, /*tp_repr*/
34289 0, /*tp_as_number*/
34290 0, /*tp_as_sequence*/
34291 0, /*tp_as_mapping*/
34297 0, /*tp_as_buffer*/
34298 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34299 "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*/
34300 __pyx_tp_traverse_4lxml_9objectify_PyType, /*tp_traverse*/
34301 __pyx_tp_clear_4lxml_9objectify_PyType, /*tp_clear*/
34302 0, /*tp_richcompare*/
34303 0, /*tp_weaklistoffset*/
34306 __pyx_methods_4lxml_9objectify_PyType, /*tp_methods*/
34308 __pyx_getsets_4lxml_9objectify_PyType, /*tp_getset*/
34311 0, /*tp_descr_get*/
34312 0, /*tp_descr_set*/
34313 0, /*tp_dictoffset*/
34314 __pyx_pw_4lxml_9objectify_6PyType_1__init__, /*tp_init*/
34316 __pyx_tp_new_4lxml_9objectify_PyType, /*tp_new*/
34322 0, /*tp_subclasses*/
34325 0, /*tp_version_tag*/
34326 #if PY_VERSION_HEX >= 0x030400a1
34329 #if PY_VERSION_HEX >= 0x030800b1
34330 0, /*tp_vectorcall*/
34332 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34337 static PyObject *__pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34338 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p;
34340 o = (*t->tp_alloc)(t, 0);
34341 if (unlikely(!o)) return 0;
34342 p = ((struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o);
34343 p->_tag = Py_None; Py_INCREF(Py_None);
34344 p->_nsmap = Py_None; Py_INCREF(Py_None);
34345 p->_element_factory = Py_None; Py_INCREF(Py_None);
34349 static void __pyx_tp_dealloc_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o) {
34350 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34351 PyObject_GC_UnTrack(o);
34353 Py_CLEAR(p->_nsmap);
34354 Py_CLEAR(p->_element_factory);
34355 (*Py_TYPE(o)->tp_free)(o);
34358 static int __pyx_tp_traverse_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o, visitproc v, void *a) {
34360 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34362 e = (*v)(p->_tag, a); if (e) return e;
34365 e = (*v)(p->_nsmap, a); if (e) return e;
34367 if (p->_element_factory) {
34368 e = (*v)(p->_element_factory, a); if (e) return e;
34373 static int __pyx_tp_clear_4lxml_9objectify__ObjectifyElementMakerCaller(PyObject *o) {
34374 struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *p = (struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller *)o;
34376 Py_CLEAR(p->_nsmap);
34377 Py_CLEAR(p->_element_factory);
34381 static PyMethodDef __pyx_methods_4lxml_9objectify__ObjectifyElementMakerCaller[] = {
34385 static PyTypeObject __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller = {
34386 PyVarObject_HEAD_INIT(0, 0)
34387 "lxml.objectify._ObjectifyElementMakerCaller", /*tp_name*/
34388 sizeof(struct __pyx_obj_4lxml_9objectify__ObjectifyElementMakerCaller), /*tp_basicsize*/
34390 __pyx_tp_dealloc_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_dealloc*/
34391 #if PY_VERSION_HEX < 0x030800b4
34394 #if PY_VERSION_HEX >= 0x030800b4
34395 0, /*tp_vectorcall_offset*/
34399 #if PY_MAJOR_VERSION < 3
34402 #if PY_MAJOR_VERSION >= 3
34406 0, /*tp_as_number*/
34407 0, /*tp_as_sequence*/
34408 0, /*tp_as_mapping*/
34410 __pyx_pw_4lxml_9objectify_28_ObjectifyElementMakerCaller_1__call__, /*tp_call*/
34414 0, /*tp_as_buffer*/
34415 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34417 __pyx_tp_traverse_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_traverse*/
34418 __pyx_tp_clear_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_clear*/
34419 0, /*tp_richcompare*/
34420 0, /*tp_weaklistoffset*/
34423 __pyx_methods_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_methods*/
34428 0, /*tp_descr_get*/
34429 0, /*tp_descr_set*/
34430 0, /*tp_dictoffset*/
34433 __pyx_tp_new_4lxml_9objectify__ObjectifyElementMakerCaller, /*tp_new*/
34439 0, /*tp_subclasses*/
34442 0, /*tp_version_tag*/
34443 #if PY_VERSION_HEX >= 0x030400a1
34446 #if PY_VERSION_HEX >= 0x030800b1
34447 0, /*tp_vectorcall*/
34449 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34453 static struct __pyx_vtabstruct_4lxml_9objectify_ElementMaker __pyx_vtable_4lxml_9objectify_ElementMaker;
34455 static PyObject *__pyx_tp_new_4lxml_9objectify_ElementMaker(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34456 struct __pyx_obj_4lxml_9objectify_ElementMaker *p;
34458 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34459 o = (*t->tp_alloc)(t, 0);
34461 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34463 if (unlikely(!o)) return 0;
34464 p = ((struct __pyx_obj_4lxml_9objectify_ElementMaker *)o);
34465 p->__pyx_vtab = __pyx_vtabptr_4lxml_9objectify_ElementMaker;
34466 p->_makeelement = Py_None; Py_INCREF(Py_None);
34467 p->_namespace = Py_None; Py_INCREF(Py_None);
34468 p->_nsmap = Py_None; Py_INCREF(Py_None);
34469 p->_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
34473 static void __pyx_tp_dealloc_4lxml_9objectify_ElementMaker(PyObject *o) {
34474 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34475 #if CYTHON_USE_TP_FINALIZE
34476 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34477 if (PyObject_CallFinalizerFromDealloc(o)) return;
34480 PyObject_GC_UnTrack(o);
34481 Py_CLEAR(p->_makeelement);
34482 Py_CLEAR(p->_namespace);
34483 Py_CLEAR(p->_nsmap);
34484 Py_CLEAR(p->_cache);
34485 (*Py_TYPE(o)->tp_free)(o);
34488 static int __pyx_tp_traverse_4lxml_9objectify_ElementMaker(PyObject *o, visitproc v, void *a) {
34490 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34491 if (p->_makeelement) {
34492 e = (*v)(p->_makeelement, a); if (e) return e;
34494 if (p->_namespace) {
34495 e = (*v)(p->_namespace, a); if (e) return e;
34498 e = (*v)(p->_nsmap, a); if (e) return e;
34501 e = (*v)(p->_cache, a); if (e) return e;
34506 static int __pyx_tp_clear_4lxml_9objectify_ElementMaker(PyObject *o) {
34507 struct __pyx_obj_4lxml_9objectify_ElementMaker *p = (struct __pyx_obj_4lxml_9objectify_ElementMaker *)o;
34508 Py_CLEAR(p->_makeelement);
34509 Py_CLEAR(p->_namespace);
34510 Py_CLEAR(p->_nsmap);
34511 Py_CLEAR(p->_cache);
34515 static PyObject *__pyx_tp_getattro_4lxml_9objectify_ElementMaker(PyObject *o, PyObject *n) {
34516 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
34517 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34519 v = __pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__(o, n);
34524 static PyMethodDef __pyx_methods_4lxml_9objectify_ElementMaker[] = {
34525 {"__getattr__", (PyCFunction)__pyx_pw_4lxml_9objectify_12ElementMaker_3__getattr__, METH_O|METH_COEXIST, 0},
34529 static PyTypeObject __pyx_type_4lxml_9objectify_ElementMaker = {
34530 PyVarObject_HEAD_INIT(0, 0)
34531 "lxml.objectify.ElementMaker", /*tp_name*/
34532 sizeof(struct __pyx_obj_4lxml_9objectify_ElementMaker), /*tp_basicsize*/
34534 __pyx_tp_dealloc_4lxml_9objectify_ElementMaker, /*tp_dealloc*/
34535 #if PY_VERSION_HEX < 0x030800b4
34538 #if PY_VERSION_HEX >= 0x030800b4
34539 0, /*tp_vectorcall_offset*/
34543 #if PY_MAJOR_VERSION < 3
34546 #if PY_MAJOR_VERSION >= 3
34550 0, /*tp_as_number*/
34551 0, /*tp_as_sequence*/
34552 0, /*tp_as_mapping*/
34554 __pyx_pw_4lxml_9objectify_12ElementMaker_5__call__, /*tp_call*/
34556 __pyx_tp_getattro_4lxml_9objectify_ElementMaker, /*tp_getattro*/
34558 0, /*tp_as_buffer*/
34559 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34560 "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*/
34561 __pyx_tp_traverse_4lxml_9objectify_ElementMaker, /*tp_traverse*/
34562 __pyx_tp_clear_4lxml_9objectify_ElementMaker, /*tp_clear*/
34563 0, /*tp_richcompare*/
34564 0, /*tp_weaklistoffset*/
34567 __pyx_methods_4lxml_9objectify_ElementMaker, /*tp_methods*/
34572 0, /*tp_descr_get*/
34573 0, /*tp_descr_set*/
34574 0, /*tp_dictoffset*/
34575 __pyx_pw_4lxml_9objectify_12ElementMaker_1__init__, /*tp_init*/
34577 __pyx_tp_new_4lxml_9objectify_ElementMaker, /*tp_new*/
34583 0, /*tp_subclasses*/
34586 0, /*tp_version_tag*/
34587 #if PY_VERSION_HEX >= 0x030400a1
34590 #if PY_VERSION_HEX >= 0x030800b1
34591 0, /*tp_vectorcall*/
34593 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34598 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
34599 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p;
34600 PyObject *o = __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup->tp_new(t, a, k);
34601 if (unlikely(!o)) return 0;
34602 p = ((struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o);
34603 p->empty_data_class = Py_None; Py_INCREF(Py_None);
34604 p->tree_class = Py_None; Py_INCREF(Py_None);
34608 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o) {
34609 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34610 #if CYTHON_USE_TP_FINALIZE
34611 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34612 if (PyObject_CallFinalizerFromDealloc(o)) return;
34615 PyObject_GC_UnTrack(o);
34616 Py_CLEAR(p->empty_data_class);
34617 Py_CLEAR(p->tree_class);
34618 #if CYTHON_USE_TYPE_SLOTS
34619 if (PyType_IS_GC(Py_TYPE(o)->tp_base))
34621 PyObject_GC_Track(o);
34622 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);
34625 static int __pyx_tp_traverse_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o, visitproc v, void *a) {
34627 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34628 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;
34629 if (p->empty_data_class) {
34630 e = (*v)(p->empty_data_class, a); if (e) return e;
34632 if (p->tree_class) {
34633 e = (*v)(p->tree_class, a); if (e) return e;
34638 static int __pyx_tp_clear_4lxml_9objectify_ObjectifyElementClassLookup(PyObject *o) {
34639 struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *p = (struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup *)o;
34640 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);
34641 Py_CLEAR(p->empty_data_class);
34642 Py_CLEAR(p->tree_class);
34646 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectifyElementClassLookup[] = {
34650 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup = {
34651 PyVarObject_HEAD_INIT(0, 0)
34652 "lxml.objectify.ObjectifyElementClassLookup", /*tp_name*/
34653 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectifyElementClassLookup), /*tp_basicsize*/
34655 __pyx_tp_dealloc_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_dealloc*/
34656 #if PY_VERSION_HEX < 0x030800b4
34659 #if PY_VERSION_HEX >= 0x030800b4
34660 0, /*tp_vectorcall_offset*/
34664 #if PY_MAJOR_VERSION < 3
34667 #if PY_MAJOR_VERSION >= 3
34671 0, /*tp_as_number*/
34672 0, /*tp_as_sequence*/
34673 0, /*tp_as_mapping*/
34679 0, /*tp_as_buffer*/
34680 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34681 "ObjectifyElementClassLookup(self, tree_class=None, empty_data_class=None)\n Element class lookup method that uses the objectify classes.\n ", /*tp_doc*/
34682 __pyx_tp_traverse_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_traverse*/
34683 __pyx_tp_clear_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_clear*/
34684 0, /*tp_richcompare*/
34685 0, /*tp_weaklistoffset*/
34688 __pyx_methods_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_methods*/
34693 0, /*tp_descr_get*/
34694 0, /*tp_descr_set*/
34695 0, /*tp_dictoffset*/
34696 __pyx_pw_4lxml_9objectify_27ObjectifyElementClassLookup_1__init__, /*tp_init*/
34698 __pyx_tp_new_4lxml_9objectify_ObjectifyElementClassLookup, /*tp_new*/
34704 0, /*tp_subclasses*/
34707 0, /*tp_version_tag*/
34708 #if PY_VERSION_HEX >= 0x030400a1
34711 #if PY_VERSION_HEX >= 0x030800b1
34712 0, /*tp_vectorcall*/
34714 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34719 static PyObject *__pyx_tp_new_4lxml_9objectify_ObjectPath(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
34720 struct __pyx_obj_4lxml_9objectify_ObjectPath *p;
34722 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
34723 o = (*t->tp_alloc)(t, 0);
34725 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
34727 if (unlikely(!o)) return 0;
34728 p = ((struct __pyx_obj_4lxml_9objectify_ObjectPath *)o);
34729 p->find = Py_None; Py_INCREF(Py_None);
34730 p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None);
34731 p->_path_str = Py_None; Py_INCREF(Py_None);
34735 static void __pyx_tp_dealloc_4lxml_9objectify_ObjectPath(PyObject *o) {
34736 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34737 #if CYTHON_USE_TP_FINALIZE
34738 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
34739 if (PyObject_CallFinalizerFromDealloc(o)) return;
34742 PyObject_GC_UnTrack(o);
34744 PyObject *etype, *eval, *etb;
34745 PyErr_Fetch(&etype, &eval, &etb);
34746 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
34747 __pyx_pw_4lxml_9objectify_10ObjectPath_3__dealloc__(o);
34748 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
34749 PyErr_Restore(etype, eval, etb);
34752 Py_CLEAR(p->_path);
34753 Py_CLEAR(p->_path_str);
34754 (*Py_TYPE(o)->tp_free)(o);
34757 static int __pyx_tp_traverse_4lxml_9objectify_ObjectPath(PyObject *o, visitproc v, void *a) {
34759 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34761 e = (*v)(p->find, a); if (e) return e;
34764 e = (*v)(p->_path, a); if (e) return e;
34766 if (p->_path_str) {
34767 e = (*v)(p->_path_str, a); if (e) return e;
34772 static int __pyx_tp_clear_4lxml_9objectify_ObjectPath(PyObject *o) {
34773 struct __pyx_obj_4lxml_9objectify_ObjectPath *p = (struct __pyx_obj_4lxml_9objectify_ObjectPath *)o;
34775 Py_CLEAR(p->_path);
34776 Py_CLEAR(p->_path_str);
34780 static PyObject *__pyx_getprop_4lxml_9objectify_10ObjectPath_find(PyObject *o, CYTHON_UNUSED void *x) {
34781 return __pyx_pw_4lxml_9objectify_10ObjectPath_4find_1__get__(o);
34784 static PyMethodDef __pyx_methods_4lxml_9objectify_ObjectPath[] = {
34785 {"hasattr", (PyCFunction)__pyx_pw_4lxml_9objectify_10ObjectPath_9hasattr, METH_O, __pyx_doc_4lxml_9objectify_10ObjectPath_8hasattr},
34786 {"setattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_11setattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_10setattr},
34787 {"addattr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4lxml_9objectify_10ObjectPath_13addattr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_9objectify_10ObjectPath_12addattr},
34791 static struct PyGetSetDef __pyx_getsets_4lxml_9objectify_ObjectPath[] = {
34792 {(char *)"find", __pyx_getprop_4lxml_9objectify_10ObjectPath_find, 0, (char *)0, 0},
34796 static PyTypeObject __pyx_type_4lxml_9objectify_ObjectPath = {
34797 PyVarObject_HEAD_INIT(0, 0)
34798 "lxml.objectify.ObjectPath", /*tp_name*/
34799 sizeof(struct __pyx_obj_4lxml_9objectify_ObjectPath), /*tp_basicsize*/
34801 __pyx_tp_dealloc_4lxml_9objectify_ObjectPath, /*tp_dealloc*/
34802 #if PY_VERSION_HEX < 0x030800b4
34805 #if PY_VERSION_HEX >= 0x030800b4
34806 0, /*tp_vectorcall_offset*/
34810 #if PY_MAJOR_VERSION < 3
34813 #if PY_MAJOR_VERSION >= 3
34817 0, /*tp_as_number*/
34818 0, /*tp_as_sequence*/
34819 0, /*tp_as_mapping*/
34821 __pyx_pw_4lxml_9objectify_10ObjectPath_7__call__, /*tp_call*/
34822 __pyx_pw_4lxml_9objectify_10ObjectPath_5__str__, /*tp_str*/
34825 0, /*tp_as_buffer*/
34826 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
34827 "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*/
34828 __pyx_tp_traverse_4lxml_9objectify_ObjectPath, /*tp_traverse*/
34829 __pyx_tp_clear_4lxml_9objectify_ObjectPath, /*tp_clear*/
34830 0, /*tp_richcompare*/
34831 0, /*tp_weaklistoffset*/
34834 __pyx_methods_4lxml_9objectify_ObjectPath, /*tp_methods*/
34836 __pyx_getsets_4lxml_9objectify_ObjectPath, /*tp_getset*/
34839 0, /*tp_descr_get*/
34840 0, /*tp_descr_set*/
34841 0, /*tp_dictoffset*/
34842 __pyx_pw_4lxml_9objectify_10ObjectPath_1__init__, /*tp_init*/
34844 __pyx_tp_new_4lxml_9objectify_ObjectPath, /*tp_new*/
34850 0, /*tp_subclasses*/
34853 0, /*tp_version_tag*/
34854 #if PY_VERSION_HEX >= 0x030400a1
34857 #if PY_VERSION_HEX >= 0x030800b1
34858 0, /*tp_vectorcall*/
34860 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
34865 static PyMethodDef __pyx_methods[] = {
34869 #if PY_MAJOR_VERSION >= 3
34870 #if CYTHON_PEP489_MULTI_PHASE_INIT
34871 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
34872 static int __pyx_pymod_exec_objectify(PyObject* module); /*proto*/
34873 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
34874 {Py_mod_create, (void*)__pyx_pymod_create},
34875 {Py_mod_exec, (void*)__pyx_pymod_exec_objectify},
34880 static struct PyModuleDef __pyx_moduledef = {
34881 PyModuleDef_HEAD_INIT,
34883 __pyx_k_The_lxml_objectify_module_imple, /* m_doc */
34884 #if CYTHON_PEP489_MULTI_PHASE_INIT
34889 __pyx_methods /* m_methods */,
34890 #if CYTHON_PEP489_MULTI_PHASE_INIT
34891 __pyx_moduledef_slots, /* m_slots */
34893 NULL, /* m_reload */
34895 NULL, /* m_traverse */
34896 NULL, /* m_clear */
34897 (freefunc)__pyx_module_cleanup /* m_free */
34900 #ifndef CYTHON_SMALL_CODE
34901 #if defined(__clang__)
34902 #define CYTHON_SMALL_CODE
34903 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
34904 #define CYTHON_SMALL_CODE __attribute__((cold))
34906 #define CYTHON_SMALL_CODE
34910 static __Pyx_StringTabEntry __pyx_string_tab[] = {
34911 {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
34912 {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
34913 {&__pyx_kp_s_0, __pyx_k_0, sizeof(__pyx_k_0), 0, 0, 1, 0},
34914 {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
34915 {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
34916 {&__pyx_n_s_BoolElement, __pyx_k_BoolElement, sizeof(__pyx_k_BoolElement), 0, 0, 1, 1},
34917 {&__pyx_n_u_BoolElement, __pyx_k_BoolElement, sizeof(__pyx_k_BoolElement), 0, 1, 0, 1},
34918 {&__pyx_n_s_BoolElement__init, __pyx_k_BoolElement__init, sizeof(__pyx_k_BoolElement__init), 0, 0, 1, 1},
34919 {&__pyx_kp_u_Cannot_register_tree_type, __pyx_k_Cannot_register_tree_type, sizeof(__pyx_k_Cannot_register_tree_type), 0, 1, 0, 0},
34920 {&__pyx_n_s_DataElement, __pyx_k_DataElement, sizeof(__pyx_k_DataElement), 0, 0, 1, 1},
34921 {&__pyx_n_u_DataElement, __pyx_k_DataElement, sizeof(__pyx_k_DataElement), 0, 1, 0, 1},
34922 {&__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},
34923 {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
34924 {&__pyx_n_u_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 1, 0, 1},
34925 {&__pyx_n_u_ENTITY, __pyx_k_ENTITY, sizeof(__pyx_k_ENTITY), 0, 1, 0, 1},
34926 {&__pyx_n_s_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 0, 1, 1},
34927 {&__pyx_n_u_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 1, 0, 1},
34928 {&__pyx_n_s_ElementChildIterator, __pyx_k_ElementChildIterator, sizeof(__pyx_k_ElementChildIterator), 0, 0, 1, 1},
34929 {&__pyx_n_s_ElementMaker, __pyx_k_ElementMaker, sizeof(__pyx_k_ElementMaker), 0, 0, 1, 1},
34930 {&__pyx_n_u_ElementMaker, __pyx_k_ElementMaker, sizeof(__pyx_k_ElementMaker), 0, 1, 0, 1},
34931 {&__pyx_n_s_ElementTree, __pyx_k_ElementTree, sizeof(__pyx_k_ElementTree), 0, 0, 1, 1},
34932 {&__pyx_n_s_ElementTree_2, __pyx_k_ElementTree_2, sizeof(__pyx_k_ElementTree_2), 0, 0, 1, 1},
34933 {&__pyx_n_s_FloatElement, __pyx_k_FloatElement, sizeof(__pyx_k_FloatElement), 0, 0, 1, 1},
34934 {&__pyx_n_u_FloatElement, __pyx_k_FloatElement, sizeof(__pyx_k_FloatElement), 0, 1, 0, 1},
34935 {&__pyx_n_s_FloatElement__init, __pyx_k_FloatElement__init, sizeof(__pyx_k_FloatElement__init), 0, 0, 1, 1},
34936 {&__pyx_n_u_ID, __pyx_k_ID, sizeof(__pyx_k_ID), 0, 1, 0, 1},
34937 {&__pyx_n_u_IDREF, __pyx_k_IDREF, sizeof(__pyx_k_IDREF), 0, 1, 0, 1},
34938 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
34939 {&__pyx_n_s_IntElement, __pyx_k_IntElement, sizeof(__pyx_k_IntElement), 0, 0, 1, 1},
34940 {&__pyx_n_u_IntElement, __pyx_k_IntElement, sizeof(__pyx_k_IntElement), 0, 1, 0, 1},
34941 {&__pyx_n_s_IntElement__init, __pyx_k_IntElement__init, sizeof(__pyx_k_IntElement__init), 0, 0, 1, 1},
34942 {&__pyx_kp_u_Invalid_boolean_value, __pyx_k_Invalid_boolean_value, sizeof(__pyx_k_Invalid_boolean_value), 0, 1, 0, 0},
34943 {&__pyx_kp_u_Invalid_slice, __pyx_k_Invalid_slice, sizeof(__pyx_k_Invalid_slice), 0, 1, 0, 0},
34944 {&__pyx_n_s_LongElement, __pyx_k_LongElement, sizeof(__pyx_k_LongElement), 0, 0, 1, 1},
34945 {&__pyx_n_u_LongElement, __pyx_k_LongElement, sizeof(__pyx_k_LongElement), 0, 1, 0, 1},
34946 {&__pyx_n_s_LongElement__init, __pyx_k_LongElement__init, sizeof(__pyx_k_LongElement__init), 0, 0, 1, 1},
34947 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
34948 {&__pyx_n_u_NCName, __pyx_k_NCName, sizeof(__pyx_k_NCName), 0, 1, 0, 1},
34949 {&__pyx_n_u_NMTOKEN, __pyx_k_NMTOKEN, sizeof(__pyx_k_NMTOKEN), 0, 1, 0, 1},
34950 {&__pyx_n_u_Name, __pyx_k_Name, sizeof(__pyx_k_Name), 0, 1, 0, 1},
34951 {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
34952 {&__pyx_n_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 1},
34953 {&__pyx_n_s_NoneElement, __pyx_k_NoneElement, sizeof(__pyx_k_NoneElement), 0, 0, 1, 1},
34954 {&__pyx_n_u_NoneElement, __pyx_k_NoneElement, sizeof(__pyx_k_NoneElement), 0, 1, 0, 1},
34955 {&__pyx_n_s_NoneType, __pyx_k_NoneType, sizeof(__pyx_k_NoneType), 0, 0, 1, 1},
34956 {&__pyx_n_u_NoneType, __pyx_k_NoneType, sizeof(__pyx_k_NoneType), 0, 1, 0, 1},
34957 {&__pyx_n_s_NumberElement, __pyx_k_NumberElement, sizeof(__pyx_k_NumberElement), 0, 0, 1, 1},
34958 {&__pyx_n_u_NumberElement, __pyx_k_NumberElement, sizeof(__pyx_k_NumberElement), 0, 1, 0, 1},
34959 {&__pyx_n_s_NumberElement___complex, __pyx_k_NumberElement___complex, sizeof(__pyx_k_NumberElement___complex), 0, 0, 1, 1},
34960 {&__pyx_n_s_NumberElement__setValueParser, __pyx_k_NumberElement__setValueParser, sizeof(__pyx_k_NumberElement__setValueParser), 0, 0, 1, 1},
34961 {&__pyx_n_s_ObjectPath, __pyx_k_ObjectPath, sizeof(__pyx_k_ObjectPath), 0, 0, 1, 1},
34962 {&__pyx_n_u_ObjectPath, __pyx_k_ObjectPath, sizeof(__pyx_k_ObjectPath), 0, 1, 0, 1},
34963 {&__pyx_n_s_ObjectPath_addattr, __pyx_k_ObjectPath_addattr, sizeof(__pyx_k_ObjectPath_addattr), 0, 0, 1, 1},
34964 {&__pyx_n_s_ObjectPath_hasattr, __pyx_k_ObjectPath_hasattr, sizeof(__pyx_k_ObjectPath_hasattr), 0, 0, 1, 1},
34965 {&__pyx_n_s_ObjectPath_setattr, __pyx_k_ObjectPath_setattr, sizeof(__pyx_k_ObjectPath_setattr), 0, 0, 1, 1},
34966 {&__pyx_n_s_ObjectifiedDataElement, __pyx_k_ObjectifiedDataElement, sizeof(__pyx_k_ObjectifiedDataElement), 0, 0, 1, 1},
34967 {&__pyx_n_u_ObjectifiedDataElement, __pyx_k_ObjectifiedDataElement, sizeof(__pyx_k_ObjectifiedDataElement), 0, 1, 0, 1},
34968 {&__pyx_n_s_ObjectifiedDataElement__setText, __pyx_k_ObjectifiedDataElement__setText, sizeof(__pyx_k_ObjectifiedDataElement__setText), 0, 0, 1, 1},
34969 {&__pyx_n_s_ObjectifiedElement, __pyx_k_ObjectifiedElement, sizeof(__pyx_k_ObjectifiedElement), 0, 0, 1, 1},
34970 {&__pyx_n_u_ObjectifiedElement, __pyx_k_ObjectifiedElement, sizeof(__pyx_k_ObjectifiedElement), 0, 1, 0, 1},
34971 {&__pyx_n_s_ObjectifiedElement___reduce, __pyx_k_ObjectifiedElement___reduce, sizeof(__pyx_k_ObjectifiedElement___reduce), 0, 0, 1, 1},
34972 {&__pyx_n_s_ObjectifiedElement_addattr, __pyx_k_ObjectifiedElement_addattr, sizeof(__pyx_k_ObjectifiedElement_addattr), 0, 0, 1, 1},
34973 {&__pyx_n_s_ObjectifiedElement_countchildren, __pyx_k_ObjectifiedElement_countchildren, sizeof(__pyx_k_ObjectifiedElement_countchildren), 0, 0, 1, 1},
34974 {&__pyx_n_s_ObjectifiedElement_descendantpat, __pyx_k_ObjectifiedElement_descendantpat, sizeof(__pyx_k_ObjectifiedElement_descendantpat), 0, 0, 1, 1},
34975 {&__pyx_n_s_ObjectifiedElement_getchildren, __pyx_k_ObjectifiedElement_getchildren, sizeof(__pyx_k_ObjectifiedElement_getchildren), 0, 0, 1, 1},
34976 {&__pyx_n_s_ObjectifyElementClassLookup, __pyx_k_ObjectifyElementClassLookup, sizeof(__pyx_k_ObjectifyElementClassLookup), 0, 0, 1, 1},
34977 {&__pyx_n_u_ObjectifyElementClassLookup, __pyx_k_ObjectifyElementClassLookup, sizeof(__pyx_k_ObjectifyElementClassLookup), 0, 1, 0, 1},
34978 {&__pyx_n_s_PYTYPE_ATTRIBUTE, __pyx_k_PYTYPE_ATTRIBUTE, sizeof(__pyx_k_PYTYPE_ATTRIBUTE), 0, 0, 1, 1},
34979 {&__pyx_n_u_PYTYPE_ATTRIBUTE, __pyx_k_PYTYPE_ATTRIBUTE, sizeof(__pyx_k_PYTYPE_ATTRIBUTE), 0, 1, 0, 1},
34980 {&__pyx_n_s_PyType, __pyx_k_PyType, sizeof(__pyx_k_PyType), 0, 0, 1, 1},
34981 {&__pyx_n_u_PyType, __pyx_k_PyType, sizeof(__pyx_k_PyType), 0, 1, 0, 1},
34982 {&__pyx_n_s_PyType_register, __pyx_k_PyType_register, sizeof(__pyx_k_PyType_register), 0, 0, 1, 1},
34983 {&__pyx_kp_s_PyType_s_s, __pyx_k_PyType_s_s, sizeof(__pyx_k_PyType_s_s), 0, 0, 1, 0},
34984 {&__pyx_n_s_PyType_unregister, __pyx_k_PyType_unregister, sizeof(__pyx_k_PyType_unregister), 0, 0, 1, 1},
34985 {&__pyx_n_s_StringElement, __pyx_k_StringElement, sizeof(__pyx_k_StringElement), 0, 0, 1, 1},
34986 {&__pyx_n_u_StringElement, __pyx_k_StringElement, sizeof(__pyx_k_StringElement), 0, 1, 0, 1},
34987 {&__pyx_n_s_StringElement___complex, __pyx_k_StringElement___complex, sizeof(__pyx_k_StringElement___complex), 0, 0, 1, 1},
34988 {&__pyx_n_s_StringElement_strlen, __pyx_k_StringElement_strlen, sizeof(__pyx_k_StringElement_strlen), 0, 0, 1, 1},
34989 {&__pyx_n_s_SubElement, __pyx_k_SubElement, sizeof(__pyx_k_SubElement), 0, 0, 1, 1},
34990 {&__pyx_n_u_SubElement, __pyx_k_SubElement, sizeof(__pyx_k_SubElement), 0, 1, 0, 1},
34991 {&__pyx_n_u_TREE, __pyx_k_TREE, sizeof(__pyx_k_TREE), 0, 1, 0, 1},
34992 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
34993 {&__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},
34994 {&__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},
34995 {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
34996 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
34997 {&__pyx_n_s_XML, __pyx_k_XML, sizeof(__pyx_k_XML), 0, 0, 1, 1},
34998 {&__pyx_n_u_XML, __pyx_k_XML, sizeof(__pyx_k_XML), 0, 1, 0, 1},
34999 {&__pyx_n_s_XMLParser, __pyx_k_XMLParser, sizeof(__pyx_k_XMLParser), 0, 0, 1, 1},
35000 {&__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},
35001 {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
35002 {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
35003 {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
35004 {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
35005 {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
35006 {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0},
35007 {&__pyx_kp_b__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 0, 0},
35008 {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
35009 {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
35010 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
35011 {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
35012 {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
35013 {&__pyx_kp_u__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 1, 0, 0},
35014 {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
35015 {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
35016 {&__pyx_n_s_addattr, __pyx_k_addattr, sizeof(__pyx_k_addattr), 0, 0, 1, 1},
35017 {&__pyx_n_s_addnext, __pyx_k_addnext, sizeof(__pyx_k_addnext), 0, 0, 1, 1},
35018 {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1},
35019 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
35020 {&__pyx_n_s_annotate, __pyx_k_annotate, sizeof(__pyx_k_annotate), 0, 0, 1, 1},
35021 {&__pyx_n_u_annotate, __pyx_k_annotate, sizeof(__pyx_k_annotate), 0, 1, 0, 1},
35022 {&__pyx_n_s_annotate_pytype, __pyx_k_annotate_pytype, sizeof(__pyx_k_annotate_pytype), 0, 0, 1, 1},
35023 {&__pyx_n_s_annotate_xsi, __pyx_k_annotate_xsi, sizeof(__pyx_k_annotate_xsi), 0, 0, 1, 1},
35024 {&__pyx_kp_u_argument_of_makeelement_paramete, __pyx_k_argument_of_makeelement_paramete, sizeof(__pyx_k_argument_of_makeelement_paramete), 0, 1, 0, 0},
35025 {&__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},
35026 {&__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},
35027 {&__pyx_n_s_attrib, __pyx_k_attrib, sizeof(__pyx_k_attrib), 0, 0, 1, 1},
35028 {&__pyx_kp_u_attribute, __pyx_k_attribute, sizeof(__pyx_k_attribute), 0, 1, 0, 0},
35029 {&__pyx_n_s_attribute_names, __pyx_k_attribute_names, sizeof(__pyx_k_attribute_names), 0, 0, 1, 1},
35030 {&__pyx_n_s_attribute_tag, __pyx_k_attribute_tag, sizeof(__pyx_k_attribute_tag), 0, 0, 1, 1},
35031 {&__pyx_n_s_attributes, __pyx_k_attributes, sizeof(__pyx_k_attributes), 0, 0, 1, 1},
35032 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
35033 {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
35034 {&__pyx_n_u_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 1, 0, 1},
35035 {&__pyx_n_s_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 0, 0, 1, 1},
35036 {&__pyx_n_s_before, __pyx_k_before, sizeof(__pyx_k_before), 0, 0, 1, 1},
35037 {&__pyx_n_u_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 0, 1},
35038 {&__pyx_n_u_boolean, __pyx_k_boolean, sizeof(__pyx_k_boolean), 0, 1, 0, 1},
35039 {&__pyx_n_u_byte, __pyx_k_byte, sizeof(__pyx_k_byte), 0, 1, 0, 1},
35040 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
35041 {&__pyx_n_s_c_node, __pyx_k_c_node, sizeof(__pyx_k_c_node), 0, 0, 1, 1},
35042 {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
35043 {&__pyx_kp_u_cannot_update_root_node, __pyx_k_cannot_update_root_node, sizeof(__pyx_k_cannot_update_root_node), 0, 1, 0, 0},
35044 {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
35045 {&__pyx_n_s_checkBool, __pyx_k_checkBool, sizeof(__pyx_k_checkBool), 0, 0, 1, 1},
35046 {&__pyx_n_s_cleanup_namespaces, __pyx_k_cleanup_namespaces, sizeof(__pyx_k_cleanup_namespaces), 0, 0, 1, 1},
35047 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
35048 {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1},
35049 {&__pyx_n_s_complex, __pyx_k_complex, sizeof(__pyx_k_complex), 0, 0, 1, 1},
35050 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
35051 {&__pyx_n_s_copy_reg, __pyx_k_copy_reg, sizeof(__pyx_k_copy_reg), 0, 0, 1, 1},
35052 {&__pyx_n_s_copyreg, __pyx_k_copyreg, sizeof(__pyx_k_copyreg), 0, 0, 1, 1},
35053 {&__pyx_n_s_countchildren, __pyx_k_countchildren, sizeof(__pyx_k_countchildren), 0, 0, 1, 1},
35054 {&__pyx_kp_u_creating_indexed_path_attributes, __pyx_k_creating_indexed_path_attributes, sizeof(__pyx_k_creating_indexed_path_attributes), 0, 1, 0, 0},
35055 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
35056 {&__pyx_n_s_deannotate, __pyx_k_deannotate, sizeof(__pyx_k_deannotate), 0, 0, 1, 1},
35057 {&__pyx_n_u_deannotate, __pyx_k_deannotate, sizeof(__pyx_k_deannotate), 0, 1, 0, 1},
35058 {&__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},
35059 {&__pyx_n_s_descendantpaths, __pyx_k_descendantpaths, sizeof(__pyx_k_descendantpaths), 0, 0, 1, 1},
35060 {&__pyx_n_u_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 1, 0, 1},
35061 {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
35062 {&__pyx_n_u_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 1, 0, 1},
35063 {&__pyx_n_s_element, __pyx_k_element, sizeof(__pyx_k_element), 0, 0, 1, 1},
35064 {&__pyx_n_s_element_or_tree, __pyx_k_element_or_tree, sizeof(__pyx_k_element_or_tree), 0, 0, 1, 1},
35065 {&__pyx_n_s_empty_data_class, __pyx_k_empty_data_class, sizeof(__pyx_k_empty_data_class), 0, 0, 1, 1},
35066 {&__pyx_n_s_empty_pytype, __pyx_k_empty_pytype, sizeof(__pyx_k_empty_pytype), 0, 0, 1, 1},
35067 {&__pyx_n_s_empty_type, __pyx_k_empty_type, sizeof(__pyx_k_empty_type), 0, 0, 1, 1},
35068 {&__pyx_n_s_enable_recursive_str, __pyx_k_enable_recursive_str, sizeof(__pyx_k_enable_recursive_str), 0, 0, 1, 1},
35069 {&__pyx_n_u_enable_recursive_str, __pyx_k_enable_recursive_str, sizeof(__pyx_k_enable_recursive_str), 0, 1, 0, 1},
35070 {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
35071 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
35072 {&__pyx_n_s_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 0, 0, 1, 1},
35073 {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
35074 {&__pyx_n_s_etree, __pyx_k_etree, sizeof(__pyx_k_etree), 0, 0, 1, 1},
35075 {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
35076 {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1},
35077 {&__pyx_n_u_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 1, 0, 1},
35078 {&__pyx_n_s_first_pos, __pyx_k_first_pos, sizeof(__pyx_k_first_pos), 0, 0, 1, 1},
35079 {&__pyx_n_u_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 1, 0, 1},
35080 {&__pyx_n_s_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 0, 1, 1},
35081 {&__pyx_n_u_fromstring, __pyx_k_fromstring, sizeof(__pyx_k_fromstring), 0, 1, 0, 1},
35082 {&__pyx_n_s_function, __pyx_k_function, sizeof(__pyx_k_function), 0, 0, 1, 1},
35083 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
35084 {&__pyx_n_s_getRegisteredTypes, __pyx_k_getRegisteredTypes, sizeof(__pyx_k_getRegisteredTypes), 0, 0, 1, 1},
35085 {&__pyx_n_u_getRegisteredTypes, __pyx_k_getRegisteredTypes, sizeof(__pyx_k_getRegisteredTypes), 0, 1, 0, 1},
35086 {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
35087 {&__pyx_n_s_getchildren, __pyx_k_getchildren, sizeof(__pyx_k_getchildren), 0, 0, 1, 1},
35088 {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
35089 {&__pyx_n_s_getparent, __pyx_k_getparent, sizeof(__pyx_k_getparent), 0, 0, 1, 1},
35090 {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
35091 {&__pyx_n_s_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 0, 0, 1, 1},
35092 {&__pyx_n_s_hasattr, __pyx_k_hasattr, sizeof(__pyx_k_hasattr), 0, 0, 1, 1},
35093 {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
35094 {&__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},
35095 {&__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},
35096 {&__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},
35097 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
35098 {&__pyx_n_s_ignore_old, __pyx_k_ignore_old, sizeof(__pyx_k_ignore_old), 0, 0, 1, 1},
35099 {&__pyx_n_s_ignore_pytype, __pyx_k_ignore_pytype, sizeof(__pyx_k_ignore_pytype), 0, 0, 1, 1},
35100 {&__pyx_n_s_ignore_xsi, __pyx_k_ignore_xsi, sizeof(__pyx_k_ignore_xsi), 0, 0, 1, 1},
35101 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
35102 {&__pyx_kp_u_inconsistent_before_after_depend, __pyx_k_inconsistent_before_after_depend, sizeof(__pyx_k_inconsistent_before_after_depend), 0, 1, 0, 0},
35103 {&__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},
35104 {&__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},
35105 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
35106 {&__pyx_n_u_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 1, 0, 1},
35107 {&__pyx_n_u_integer, __pyx_k_integer, sizeof(__pyx_k_integer), 0, 1, 0, 1},
35108 {&__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},
35109 {&__pyx_kp_u_invalid_path, __pyx_k_invalid_path, sizeof(__pyx_k_invalid_path), 0, 1, 0, 0},
35110 {&__pyx_kp_u_invalid_types_for_operator, __pyx_k_invalid_types_for_operator, sizeof(__pyx_k_invalid_types_for_operator), 0, 1, 0, 0},
35111 {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
35112 {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
35113 {&__pyx_n_s_iterchildren, __pyx_k_iterchildren, sizeof(__pyx_k_iterchildren), 0, 0, 1, 1},
35114 {&__pyx_n_s_known, __pyx_k_known, sizeof(__pyx_k_known), 0, 0, 1, 1},
35115 {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
35116 {&__pyx_n_u_language, __pyx_k_language, sizeof(__pyx_k_language), 0, 1, 0, 1},
35117 {&__pyx_n_s_last_pos, __pyx_k_last_pos, sizeof(__pyx_k_last_pos), 0, 0, 1, 1},
35118 {&__pyx_n_u_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 1, 0, 1},
35119 {&__pyx_n_s_lower_bool, __pyx_k_lower_bool, sizeof(__pyx_k_lower_bool), 0, 0, 1, 1},
35120 {&__pyx_n_s_lxml, __pyx_k_lxml, sizeof(__pyx_k_lxml), 0, 0, 1, 1},
35121 {&__pyx_n_s_lxml_objectify, __pyx_k_lxml_objectify, sizeof(__pyx_k_lxml_objectify), 0, 0, 1, 1},
35122 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
35123 {&__pyx_n_s_makeelement, __pyx_k_makeelement, sizeof(__pyx_k_makeelement), 0, 0, 1, 1},
35124 {&__pyx_n_s_makeparser, __pyx_k_makeparser, sizeof(__pyx_k_makeparser), 0, 0, 1, 1},
35125 {&__pyx_n_u_makeparser, __pyx_k_makeparser, sizeof(__pyx_k_makeparser), 0, 1, 0, 1},
35126 {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
35127 {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 0, 0, 1, 1},
35128 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
35129 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
35130 {&__pyx_n_s_namespace, __pyx_k_namespace, sizeof(__pyx_k_namespace), 0, 0, 1, 1},
35131 {&__pyx_n_u_negativeInteger, __pyx_k_negativeInteger, sizeof(__pyx_k_negativeInteger), 0, 1, 0, 1},
35132 {&__pyx_n_s_new_parser, __pyx_k_new_parser, sizeof(__pyx_k_new_parser), 0, 0, 1, 1},
35133 {&__pyx_kp_u_no_such_child, __pyx_k_no_such_child, sizeof(__pyx_k_no_such_child), 0, 1, 0, 0},
35134 {&__pyx_n_u_nonNegativeInteger, __pyx_k_nonNegativeInteger, sizeof(__pyx_k_nonNegativeInteger), 0, 1, 0, 1},
35135 {&__pyx_n_u_nonPositiveInteger, __pyx_k_nonPositiveInteger, sizeof(__pyx_k_nonPositiveInteger), 0, 1, 0, 1},
35136 {&__pyx_n_s_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 0, 1, 1},
35137 {&__pyx_n_u_none, __pyx_k_none, sizeof(__pyx_k_none), 0, 1, 0, 1},
35138 {&__pyx_n_u_normalizedString, __pyx_k_normalizedString, sizeof(__pyx_k_normalizedString), 0, 1, 0, 1},
35139 {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1},
35140 {&__pyx_n_s_nsmap, __pyx_k_nsmap, sizeof(__pyx_k_nsmap), 0, 0, 1, 1},
35141 {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
35142 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
35143 {&__pyx_kp_u_objects_is_not_writable, __pyx_k_objects_is_not_writable, sizeof(__pyx_k_objects_is_not_writable), 0, 1, 0, 0},
35144 {&__pyx_n_s_oct, __pyx_k_oct, sizeof(__pyx_k_oct), 0, 0, 1, 1},
35145 {&__pyx_kp_u_of, __pyx_k_of, sizeof(__pyx_k_of), 0, 1, 0, 0},
35146 {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1},
35147 {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
35148 {&__pyx_n_u_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 1, 0, 1},
35149 {&__pyx_n_s_parseBool, __pyx_k_parseBool, sizeof(__pyx_k_parseBool), 0, 0, 1, 1},
35150 {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
35151 {&__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},
35152 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
35153 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
35154 {&__pyx_n_s_pickleReduceElementTree, __pyx_k_pickleReduceElementTree, sizeof(__pyx_k_pickleReduceElementTree), 0, 0, 1, 1},
35155 {&__pyx_n_u_positiveInteger, __pyx_k_positiveInteger, sizeof(__pyx_k_positiveInteger), 0, 1, 0, 1},
35156 {&__pyx_n_s_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 0, 0, 1, 1},
35157 {&__pyx_kp_u_py, __pyx_k_py, sizeof(__pyx_k_py), 0, 1, 0, 0},
35158 {&__pyx_n_s_py_2, __pyx_k_py_2, sizeof(__pyx_k_py_2), 0, 0, 1, 1},
35159 {&__pyx_n_s_py_type, __pyx_k_py_type, sizeof(__pyx_k_py_type), 0, 0, 1, 1},
35160 {&__pyx_n_s_pyannotate, __pyx_k_pyannotate, sizeof(__pyx_k_pyannotate), 0, 0, 1, 1},
35161 {&__pyx_n_u_pyannotate, __pyx_k_pyannotate, sizeof(__pyx_k_pyannotate), 0, 1, 0, 1},
35162 {&__pyx_n_s_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 0, 1, 1},
35163 {&__pyx_n_u_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 1, 0, 1},
35164 {&__pyx_n_s_pytype_2, __pyx_k_pytype_2, sizeof(__pyx_k_pytype_2), 0, 0, 1, 1},
35165 {&__pyx_n_s_pytypename, __pyx_k_pytypename, sizeof(__pyx_k_pytypename), 0, 0, 1, 1},
35166 {&__pyx_n_u_pytypename, __pyx_k_pytypename, sizeof(__pyx_k_pytypename), 0, 1, 0, 1},
35167 {&__pyx_n_s_pyval, __pyx_k_pyval, sizeof(__pyx_k_pyval), 0, 0, 1, 1},
35168 {&__pyx_n_u_pyval, __pyx_k_pyval, sizeof(__pyx_k_pyval), 0, 1, 0, 1},
35169 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
35170 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
35171 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
35172 {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
35173 {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
35174 {&__pyx_n_s_remove_blank_text, __pyx_k_remove_blank_text, sizeof(__pyx_k_remove_blank_text), 0, 0, 1, 1},
35175 {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
35176 {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
35177 {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
35178 {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
35179 {&__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},
35180 {&__pyx_kp_u_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 1, 0, 0},
35181 {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
35182 {&__pyx_n_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 1},
35183 {&__pyx_kp_u_s_nil, __pyx_k_s_nil, sizeof(__pyx_k_s_nil), 0, 1, 0, 0},
35184 {&__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},
35185 {&__pyx_kp_u_s_type, __pyx_k_s_type, sizeof(__pyx_k_s_type), 0, 1, 0, 0},
35186 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
35187 {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
35188 {&__pyx_n_s_setText, __pyx_k_setText, sizeof(__pyx_k_setText), 0, 0, 1, 1},
35189 {&__pyx_n_s_setValueParser, __pyx_k_setValueParser, sizeof(__pyx_k_setValueParser), 0, 0, 1, 1},
35190 {&__pyx_n_s_set_default_parser, __pyx_k_set_default_parser, sizeof(__pyx_k_set_default_parser), 0, 0, 1, 1},
35191 {&__pyx_n_u_set_default_parser, __pyx_k_set_default_parser, sizeof(__pyx_k_set_default_parser), 0, 1, 0, 1},
35192 {&__pyx_n_s_set_element_class_lookup, __pyx_k_set_element_class_lookup, sizeof(__pyx_k_set_element_class_lookup), 0, 0, 1, 1},
35193 {&__pyx_n_s_set_pytype_attribute_tag, __pyx_k_set_pytype_attribute_tag, sizeof(__pyx_k_set_pytype_attribute_tag), 0, 0, 1, 1},
35194 {&__pyx_n_u_set_pytype_attribute_tag, __pyx_k_set_pytype_attribute_tag, sizeof(__pyx_k_set_pytype_attribute_tag), 0, 1, 0, 1},
35195 {&__pyx_n_s_setattr, __pyx_k_setattr, sizeof(__pyx_k_setattr), 0, 0, 1, 1},
35196 {&__pyx_n_u_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 1, 0, 1},
35197 {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
35198 {&__pyx_kp_s_src_lxml_objectify_pyx, __pyx_k_src_lxml_objectify_pyx, sizeof(__pyx_k_src_lxml_objectify_pyx), 0, 0, 1, 0},
35199 {&__pyx_kp_s_src_lxml_objectpath_pxi, __pyx_k_src_lxml_objectpath_pxi, sizeof(__pyx_k_src_lxml_objectpath_pxi), 0, 0, 1, 0},
35200 {&__pyx_n_u_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 1, 0, 1},
35201 {&__pyx_n_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 1},
35202 {&__pyx_n_s_stringify, __pyx_k_stringify, sizeof(__pyx_k_stringify), 0, 0, 1, 1},
35203 {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
35204 {&__pyx_n_s_strip_attributes, __pyx_k_strip_attributes, sizeof(__pyx_k_strip_attributes), 0, 0, 1, 1},
35205 {&__pyx_n_s_strlen, __pyx_k_strlen, sizeof(__pyx_k_strlen), 0, 0, 1, 1},
35206 {&__pyx_n_s_strval, __pyx_k_strval, sizeof(__pyx_k_strval), 0, 0, 1, 1},
35207 {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
35208 {&__pyx_n_u_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 1, 0, 1},
35209 {&__pyx_n_s_tag_2, __pyx_k_tag_2, sizeof(__pyx_k_tag_2), 0, 0, 1, 1},
35210 {&__pyx_n_u_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 1, 0, 1},
35211 {&__pyx_n_s_temp, __pyx_k_temp, sizeof(__pyx_k_temp), 0, 0, 1, 1},
35212 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
35213 {&__pyx_n_s_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 0, 1, 1},
35214 {&__pyx_n_u_text, __pyx_k_text, sizeof(__pyx_k_text), 0, 1, 0, 1},
35215 {&__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},
35216 {&__pyx_n_u_token, __pyx_k_token, sizeof(__pyx_k_token), 0, 1, 0, 1},
35217 {&__pyx_n_s_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 0, 0, 1, 1},
35218 {&__pyx_n_s_tree_class, __pyx_k_tree_class, sizeof(__pyx_k_tree_class), 0, 0, 1, 1},
35219 {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1},
35220 {&__pyx_n_u_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 1, 0, 1},
35221 {&__pyx_n_s_type_check, __pyx_k_type_check, sizeof(__pyx_k_type_check), 0, 0, 1, 1},
35222 {&__pyx_n_s_type_class, __pyx_k_type_class, sizeof(__pyx_k_type_class), 0, 0, 1, 1},
35223 {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
35224 {&__pyx_kp_s_unicode_escape, __pyx_k_unicode_escape, sizeof(__pyx_k_unicode_escape), 0, 0, 1, 0},
35225 {&__pyx_n_s_unpickleElementTree, __pyx_k_unpickleElementTree, sizeof(__pyx_k_unpickleElementTree), 0, 0, 1, 1},
35226 {&__pyx_n_s_unregister, __pyx_k_unregister, sizeof(__pyx_k_unregister), 0, 0, 1, 1},
35227 {&__pyx_n_u_unsignedByte, __pyx_k_unsignedByte, sizeof(__pyx_k_unsignedByte), 0, 1, 0, 1},
35228 {&__pyx_n_u_unsignedInt, __pyx_k_unsignedInt, sizeof(__pyx_k_unsignedInt), 0, 1, 0, 1},
35229 {&__pyx_n_u_unsignedLong, __pyx_k_unsignedLong, sizeof(__pyx_k_unsignedLong), 0, 1, 0, 1},
35230 {&__pyx_n_u_unsignedShort, __pyx_k_unsignedShort, sizeof(__pyx_k_unsignedShort), 0, 1, 0, 1},
35231 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
35232 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
35233 {&__pyx_n_u_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 1, 0, 1},
35234 {&__pyx_n_s_value_2, __pyx_k_value_2, sizeof(__pyx_k_value_2), 0, 0, 1, 1},
35235 {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
35236 {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
35237 {&__pyx_n_s_xml, __pyx_k_xml, sizeof(__pyx_k_xml), 0, 0, 1, 1},
35238 {&__pyx_n_s_xmlSchemaTypes, __pyx_k_xmlSchemaTypes, sizeof(__pyx_k_xmlSchemaTypes), 0, 0, 1, 1},
35239 {&__pyx_n_s_xs_type, __pyx_k_xs_type, sizeof(__pyx_k_xs_type), 0, 0, 1, 1},
35240 {&__pyx_kp_u_xsd, __pyx_k_xsd, sizeof(__pyx_k_xsd), 0, 1, 0, 0},
35241 {&__pyx_n_s_xsd_2, __pyx_k_xsd_2, sizeof(__pyx_k_xsd_2), 0, 0, 1, 1},
35242 {&__pyx_kp_u_xsi, __pyx_k_xsi, sizeof(__pyx_k_xsi), 0, 1, 0, 0},
35243 {&__pyx_n_s_xsi_2, __pyx_k_xsi_2, sizeof(__pyx_k_xsi_2), 0, 0, 1, 1},
35244 {&__pyx_n_s_xsi_3, __pyx_k_xsi_3, sizeof(__pyx_k_xsi_3), 0, 0, 1, 1},
35245 {&__pyx_n_s_xsi_nil, __pyx_k_xsi_nil, sizeof(__pyx_k_xsi_nil), 0, 0, 1, 1},
35246 {&__pyx_n_s_xsiannotate, __pyx_k_xsiannotate, sizeof(__pyx_k_xsiannotate), 0, 0, 1, 1},
35247 {&__pyx_n_u_xsiannotate, __pyx_k_xsiannotate, sizeof(__pyx_k_xsiannotate), 0, 1, 0, 1},
35248 {0, 0, 0, 0, 0, 0, 0}
35250 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
35251 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 44, __pyx_L1_error)
35252 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 44, __pyx_L1_error)
35253 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 10, __pyx_L1_error)
35254 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 299, __pyx_L1_error)
35255 __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 450, __pyx_L1_error)
35256 __pyx_builtin_oct = __Pyx_GetBuiltinName(__pyx_n_s_oct); if (!__pyx_builtin_oct) __PYX_ERR(0, 644, __pyx_L1_error)
35257 __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) __PYX_ERR(0, 647, __pyx_L1_error)
35258 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 973, __pyx_L1_error)
35259 __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 1011, __pyx_L1_error)
35260 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 169, __pyx_L1_error)
35266 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
35267 __Pyx_RefNannyDeclarations
35268 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
35270 /* "lxml/objectify.pyx":467
35271 * new_element.tag = element.tag
35272 * elif isinstance(value, (list, tuple)):
35273 * element[:] = value # <<<<<<<<<<<<<<
35277 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 467, __pyx_L1_error)
35278 __Pyx_GOTREF(__pyx_slice__3);
35279 __Pyx_GIVEREF(__pyx_slice__3);
35281 /* "lxml/objectify.pyx":1033
35282 * cdef _registerPyTypes():
35283 * pytype = PyType(u'int', int, IntElement)
35284 * pytype.xmlSchemaTypes = (u"integer", u"int", u"short", u"byte", u"unsignedShort", # <<<<<<<<<<<<<<
35285 * u"unsignedByte", u"nonPositiveInteger",
35286 * u"negativeInteger", u"long", u"nonNegativeInteger",
35288 __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)
35289 __Pyx_GOTREF(__pyx_tuple__5);
35290 __Pyx_GIVEREF(__pyx_tuple__5);
35292 /* "lxml/objectify.pyx":1044
35294 * pytype = PyType(u'float', float, FloatElement, repr)
35295 * pytype.xmlSchemaTypes = (u"double", u"float") # <<<<<<<<<<<<<<
35296 * pytype.register()
35299 __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)
35300 __Pyx_GOTREF(__pyx_tuple__6);
35301 __Pyx_GIVEREF(__pyx_tuple__6);
35303 /* "lxml/objectify.pyx":1048
35305 * pytype = PyType(u'bool', __checkBool, BoolElement, __lower_bool)
35306 * pytype.xmlSchemaTypes = (u"boolean",) # <<<<<<<<<<<<<<
35307 * pytype.register()
35310 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_u_boolean); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1048, __pyx_L1_error)
35311 __Pyx_GOTREF(__pyx_tuple__7);
35312 __Pyx_GIVEREF(__pyx_tuple__7);
35314 /* "lxml/objectify.pyx":1052
35316 * pytype = PyType(u'str', None, StringElement)
35317 * pytype.xmlSchemaTypes = (u"string", u"normalizedString", u"token", u"language", # <<<<<<<<<<<<<<
35318 * u"Name", u"NCName", u"ID", u"IDREF", u"ENTITY",
35321 __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)
35322 __Pyx_GOTREF(__pyx_tuple__8);
35323 __Pyx_GIVEREF(__pyx_tuple__8);
35325 /* "lxml/objectify.pyx":1349
35326 * result += _dump(child, indent)
35328 * return result[:-1] # strip last '\n' # <<<<<<<<<<<<<<
35332 __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)
35333 __Pyx_GOTREF(__pyx_slice__16);
35334 __Pyx_GIVEREF(__pyx_slice__16);
35336 /* "lxml/objectify.pyx":1430
35337 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
35338 * if schema_type is None and u':' in value:
35339 * prefix, value = value.split(u':', 1) # <<<<<<<<<<<<<<
35340 * schema_type = <PyType>_SCHEMA_TYPE_DICT.get(value)
35341 * if schema_type is not None:
35343 __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)
35344 __Pyx_GOTREF(__pyx_tuple__18);
35345 __Pyx_GIVEREF(__pyx_tuple__18);
35347 /* "lxml/objectify.pyx":44
35350 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError) # <<<<<<<<<<<<<<
35351 * cdef object is_special_method = re.compile(u'__.*__$').match
35354 __pyx_tuple__22 = PyTuple_Pack(2, __pyx_builtin_ValueError, __pyx_builtin_TypeError); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 44, __pyx_L1_error)
35355 __Pyx_GOTREF(__pyx_tuple__22);
35356 __Pyx_GIVEREF(__pyx_tuple__22);
35358 /* "lxml/objectify.pyx":45
35360 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
35361 * cdef object is_special_method = re.compile(u'__.*__$').match # <<<<<<<<<<<<<<
35365 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u__23); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 45, __pyx_L1_error)
35366 __Pyx_GOTREF(__pyx_tuple__24);
35367 __Pyx_GIVEREF(__pyx_tuple__24);
35369 /* "lxml/objectify.pyx":82
35370 * return s, python.PyUnicode_AsUTF8String(s)
35372 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
35373 * u"""set_pytype_attribute_tag(attribute_tag=None)
35374 * Change name and namespace of the XML attribute that holds Python type
35376 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_attribute_tag); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 82, __pyx_L1_error)
35377 __Pyx_GOTREF(__pyx_tuple__25);
35378 __Pyx_GIVEREF(__pyx_tuple__25);
35379 __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)
35380 __pyx_tuple__27 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 82, __pyx_L1_error)
35381 __Pyx_GOTREF(__pyx_tuple__27);
35382 __Pyx_GIVEREF(__pyx_tuple__27);
35384 /* "lxml/objectify.pyx":162
35386 * # pickle support for objectified Element
35387 * def __reduce__(self): # <<<<<<<<<<<<<<
35388 * return fromstring, (etree.tostring(self),)
35391 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 162, __pyx_L1_error)
35392 __Pyx_GOTREF(__pyx_tuple__28);
35393 __Pyx_GIVEREF(__pyx_tuple__28);
35394 __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)
35396 /* "lxml/objectify.pyx":193
35397 * return _countSiblings(self._c_node)
35399 * def countchildren(self): # <<<<<<<<<<<<<<
35400 * u"""countchildren(self)
35403 __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)
35404 __Pyx_GOTREF(__pyx_tuple__30);
35405 __Pyx_GIVEREF(__pyx_tuple__30);
35406 __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)
35408 /* "lxml/objectify.pyx":210
35411 * def getchildren(self): # <<<<<<<<<<<<<<
35412 * u"""getchildren(self)
35415 __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)
35416 __Pyx_GOTREF(__pyx_tuple__32);
35417 __Pyx_GIVEREF(__pyx_tuple__32);
35418 __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)
35420 /* "lxml/objectify.pyx":263
35421 * self.remove(child)
35423 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
35424 * u"""addattr(self, tag, value)
35427 __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)
35428 __Pyx_GOTREF(__pyx_tuple__34);
35429 __Pyx_GIVEREF(__pyx_tuple__34);
35430 __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)
35432 /* "lxml/objectify.pyx":369
35433 * parent.remove(sibling)
35435 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
35436 * u"""descendantpaths(self, prefix=None)
35439 __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)
35440 __Pyx_GOTREF(__pyx_tuple__36);
35441 __Pyx_GIVEREF(__pyx_tuple__36);
35442 __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)
35444 /* "lxml/objectify.pyx":606
35445 * return strrepr(textOf(self._c_node) or '')
35447 * def _setText(self, s): # <<<<<<<<<<<<<<
35448 * u"""For use in subclasses only. Don't use unless you know what you are
35451 __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)
35452 __Pyx_GOTREF(__pyx_tuple__38);
35453 __Pyx_GIVEREF(__pyx_tuple__38);
35454 __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)
35456 /* "lxml/objectify.pyx":614
35457 * cdef class NumberElement(ObjectifiedDataElement):
35458 * cdef object _parse_value
35459 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
35460 * u"""Set the function that parses the Python value from a string.
35463 __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)
35464 __Pyx_GOTREF(__pyx_tuple__40);
35465 __Pyx_GIVEREF(__pyx_tuple__40);
35466 __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)
35468 /* "lxml/objectify.pyx":634
35469 * return float(_parseNumber(self))
35471 * def __complex__(self): # <<<<<<<<<<<<<<
35472 * return complex(_parseNumber(self))
35475 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 634, __pyx_L1_error)
35476 __Pyx_GOTREF(__pyx_tuple__42);
35477 __Pyx_GIVEREF(__pyx_tuple__42);
35478 __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)
35480 /* "lxml/objectify.pyx":710
35482 * cdef class IntElement(NumberElement):
35483 * def _init(self): # <<<<<<<<<<<<<<
35484 * self._parse_value = int
35487 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 710, __pyx_L1_error)
35488 __Pyx_GOTREF(__pyx_tuple__44);
35489 __Pyx_GIVEREF(__pyx_tuple__44);
35490 __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)
35492 /* "lxml/objectify.pyx":717
35494 * cdef class LongElement(NumberElement):
35495 * def _init(self): # <<<<<<<<<<<<<<
35496 * self._parse_value = long
35499 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 717, __pyx_L1_error)
35500 __Pyx_GOTREF(__pyx_tuple__46);
35501 __Pyx_GIVEREF(__pyx_tuple__46);
35502 __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)
35504 /* "lxml/objectify.pyx":724
35506 * cdef class FloatElement(NumberElement):
35507 * def _init(self): # <<<<<<<<<<<<<<
35508 * self._parse_value = float
35511 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 724, __pyx_L1_error)
35512 __Pyx_GOTREF(__pyx_tuple__48);
35513 __Pyx_GIVEREF(__pyx_tuple__48);
35514 __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)
35516 /* "lxml/objectify.pyx":741
35517 * return repr(textOf(self._c_node) or u'')
35519 * def strlen(self): # <<<<<<<<<<<<<<
35520 * text = textOf(self._c_node)
35523 __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)
35524 __Pyx_GOTREF(__pyx_tuple__50);
35525 __Pyx_GIVEREF(__pyx_tuple__50);
35526 __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)
35528 /* "lxml/objectify.pyx":786
35529 * return float(textOf(self._c_node))
35531 * def __complex__(self): # <<<<<<<<<<<<<<
35532 * return complex(textOf(self._c_node))
35535 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 786, __pyx_L1_error)
35536 __Pyx_GOTREF(__pyx_tuple__52);
35537 __Pyx_GIVEREF(__pyx_tuple__52);
35538 __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)
35540 /* "lxml/objectify.pyx":821
35541 * Python's bool type.
35543 * def _init(self): # <<<<<<<<<<<<<<
35544 * self._parse_value = __parseBool
35547 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 821, __pyx_L1_error)
35548 __Pyx_GOTREF(__pyx_tuple__54);
35549 __Pyx_GIVEREF(__pyx_tuple__54);
35550 __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)
35552 /* "lxml/objectify.pyx":843
35553 * return __parseBool(textOf(self._c_node))
35555 * def __checkBool(s): # <<<<<<<<<<<<<<
35556 * cdef int value = -1
35557 * if s is not None:
35559 __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)
35560 __Pyx_GOTREF(__pyx_tuple__56);
35561 __Pyx_GIVEREF(__pyx_tuple__56);
35562 __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)
35564 /* "lxml/objectify.pyx":850
35567 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
35571 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_s_3); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 850, __pyx_L1_error)
35572 __Pyx_GOTREF(__pyx_tuple__58);
35573 __Pyx_GIVEREF(__pyx_tuple__58);
35574 __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)
35576 /* "lxml/objectify.pyx":948
35577 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
35579 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
35580 * u"""register(self, before=None, after=None)
35583 __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)
35584 __Pyx_GOTREF(__pyx_tuple__60);
35585 __Pyx_GIVEREF(__pyx_tuple__60);
35586 __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)
35588 /* "lxml/objectify.pyx":989
35589 * _SCHEMA_TYPE_DICT[xs_type] = self
35591 * def unregister(self): # <<<<<<<<<<<<<<
35592 * u"unregister(self)"
35593 * if _PYTYPE_DICT.get(self.name) is self:
35595 __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)
35596 __Pyx_GOTREF(__pyx_tuple__62);
35597 __Pyx_GIVEREF(__pyx_tuple__62);
35598 __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)
35600 /* "lxml/objectify.pyx":1018
35601 * cdef list _TYPE_CHECKS = []
35603 * def __lower_bool(b): # <<<<<<<<<<<<<<
35604 * return u"true" if b else u"false"
35607 __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1018, __pyx_L1_error)
35608 __Pyx_GOTREF(__pyx_tuple__64);
35609 __Pyx_GIVEREF(__pyx_tuple__64);
35610 __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)
35612 /* "lxml/objectify.pyx":1024
35613 * return u"str" if python._isString(obj) else _typename(obj)
35615 * def pytypename(obj): # <<<<<<<<<<<<<<
35616 * u"""pytypename(obj)
35619 __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1024, __pyx_L1_error)
35620 __Pyx_GOTREF(__pyx_tuple__66);
35621 __Pyx_GIVEREF(__pyx_tuple__66);
35622 __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)
35624 /* "lxml/objectify.pyx":1070
35625 * _registerPyTypes()
35627 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
35628 * u"""getRegisteredTypes()
35631 __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)
35632 __Pyx_GOTREF(__pyx_tuple__68);
35633 __Pyx_GIVEREF(__pyx_tuple__68);
35634 __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)
35636 /* "lxml/objectify.pyx":1305
35637 * cdef bint __RECURSIVE_STR = 0 # default: off
35639 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
35640 * u"""enable_recursive_str(on=True)
35643 __pyx_tuple__70 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1305, __pyx_L1_error)
35644 __Pyx_GOTREF(__pyx_tuple__70);
35645 __Pyx_GIVEREF(__pyx_tuple__70);
35646 __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)
35647 __pyx_tuple__72 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1305, __pyx_L1_error)
35648 __Pyx_GOTREF(__pyx_tuple__72);
35649 __Pyx_GIVEREF(__pyx_tuple__72);
35651 /* "lxml/objectify.pyx":1314
35652 * __RECURSIVE_STR = on
35654 * def dump(_Element element not None): # <<<<<<<<<<<<<<
35655 * u"""dump(_Element element not None)
35658 __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_element); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1314, __pyx_L1_error)
35659 __Pyx_GOTREF(__pyx_tuple__73);
35660 __Pyx_GIVEREF(__pyx_tuple__73);
35661 __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)
35663 /* "lxml/objectify.pyx":1357
35664 * # Pickle support for objectified ElementTree
35666 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
35667 * return etree.ElementTree(fromstring(data))
35670 __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_data); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1357, __pyx_L1_error)
35671 __Pyx_GOTREF(__pyx_tuple__75);
35672 __Pyx_GIVEREF(__pyx_tuple__75);
35673 __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)
35675 /* "lxml/objectify.pyx":1368
35676 * elementTreeReduceFunction, __unpickleElementTree)
35678 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
35679 * return __unpickleElementTree, (etree.tostring(obj),)
35682 __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1368, __pyx_L1_error)
35683 __Pyx_GOTREF(__pyx_tuple__77);
35684 __Pyx_GIVEREF(__pyx_tuple__77);
35685 __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)
35687 /* "lxml/objectify.pyx":1462
35690 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
35691 * empty_pytype=None):
35692 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
35694 __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)
35695 __Pyx_GOTREF(__pyx_tuple__79);
35696 __Pyx_GIVEREF(__pyx_tuple__79);
35697 __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)
35699 /* "lxml/objectify.pyx":1485
35700 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
35702 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
35703 * empty_type=None):
35704 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
35706 __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)
35707 __Pyx_GOTREF(__pyx_tuple__81);
35708 __Pyx_GIVEREF(__pyx_tuple__81);
35709 __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)
35711 /* "lxml/objectify.pyx":1513
35712 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
35714 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
35715 * empty_pytype=None, empty_type=None, annotate_xsi=0,
35716 * annotate_pytype=1):
35718 __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)
35719 __Pyx_GOTREF(__pyx_tuple__83);
35720 __Pyx_GIVEREF(__pyx_tuple__83);
35721 __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)
35723 /* "lxml/objectify.pyx":1709
35724 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
35726 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
35727 * bint xsi_nil=False, bint cleanup_namespaces=False):
35728 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
35730 __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)
35731 __Pyx_GOTREF(__pyx_tuple__85);
35732 __Pyx_GIVEREF(__pyx_tuple__85);
35733 __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)
35735 /* "lxml/objectify.pyx":1749
35736 * objectify_parser = __DEFAULT_PARSER
35738 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
35739 * u"""set_default_parser(new_parser = None)
35742 __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_new_parser); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 1749, __pyx_L1_error)
35743 __Pyx_GOTREF(__pyx_tuple__87);
35744 __Pyx_GIVEREF(__pyx_tuple__87);
35745 __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)
35746 __pyx_tuple__89 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 1749, __pyx_L1_error)
35747 __Pyx_GOTREF(__pyx_tuple__89);
35748 __Pyx_GIVEREF(__pyx_tuple__89);
35750 /* "lxml/objectify.pyx":1767
35751 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
35753 * def makeparser(**kw): # <<<<<<<<<<<<<<
35754 * u"""makeparser(remove_blank_text=True, **kw)
35757 __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)
35758 __Pyx_GOTREF(__pyx_tuple__90);
35759 __Pyx_GIVEREF(__pyx_tuple__90);
35760 __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)
35762 /* "lxml/objectify.pyx":1794
35763 * SubElement = etree.SubElement
35765 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35766 * u"""fromstring(xml, parser=None, base_url=None)
35769 __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)
35770 __Pyx_GOTREF(__pyx_tuple__92);
35771 __Pyx_GIVEREF(__pyx_tuple__92);
35772 __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)
35773 __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1794, __pyx_L1_error)
35774 __Pyx_GOTREF(__pyx_tuple__94);
35775 __Pyx_GIVEREF(__pyx_tuple__94);
35777 /* "lxml/objectify.pyx":1810
35778 * return _fromstring(xml, parser, base_url=base_url)
35780 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35781 * u"""XML(xml, parser=None, base_url=None)
35784 __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)
35785 __Pyx_GOTREF(__pyx_tuple__95);
35786 __Pyx_GIVEREF(__pyx_tuple__95);
35787 __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)
35788 __pyx_tuple__97 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1810, __pyx_L1_error)
35789 __Pyx_GOTREF(__pyx_tuple__97);
35790 __Pyx_GIVEREF(__pyx_tuple__97);
35792 /* "lxml/objectify.pyx":1829
35793 * _parse = etree.parse
35795 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
35796 * u"""parse(f, parser=None, base_url=None)
35799 __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)
35800 __Pyx_GOTREF(__pyx_tuple__98);
35801 __Pyx_GIVEREF(__pyx_tuple__98);
35802 __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)
35803 __pyx_tuple__100 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 1829, __pyx_L1_error)
35804 __Pyx_GOTREF(__pyx_tuple__100);
35805 __Pyx_GIVEREF(__pyx_tuple__100);
35807 /* "lxml/objectify.pyx":1852
35808 * E = ElementMaker()
35810 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
35811 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
35814 __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)
35815 __Pyx_GOTREF(__pyx_tuple__101);
35816 __Pyx_GIVEREF(__pyx_tuple__101);
35817 __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)
35818 __pyx_tuple__103 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1852, __pyx_L1_error)
35819 __Pyx_GOTREF(__pyx_tuple__103);
35820 __Pyx_GIVEREF(__pyx_tuple__103);
35822 /* "lxml/objectify.pyx":1872
35823 * return _makeElement(_tag, None, _attributes, nsmap)
35825 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
35827 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
35829 __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)
35830 __Pyx_GOTREF(__pyx_tuple__104);
35831 __Pyx_GIVEREF(__pyx_tuple__104);
35832 __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)
35833 __pyx_tuple__106 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 1872, __pyx_L1_error)
35834 __Pyx_GOTREF(__pyx_tuple__106);
35835 __Pyx_GIVEREF(__pyx_tuple__106);
35837 /* "src/lxml/objectpath.pxi":57
35838 * return _find_object_path(root, self._c_path, self._path_len, default)
35840 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
35841 * u"hasattr(self, root)"
35844 __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)
35845 __Pyx_GOTREF(__pyx_tuple__107);
35846 __Pyx_GIVEREF(__pyx_tuple__107);
35847 __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)
35849 /* "src/lxml/objectpath.pxi":65
35852 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
35853 * u"""setattr(self, root, value)
35856 __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)
35857 __Pyx_GOTREF(__pyx_tuple__109);
35858 __Pyx_GIVEREF(__pyx_tuple__109);
35859 __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)
35861 /* "src/lxml/objectpath.pxi":74
35862 * _create_object_path(root, self._c_path, self._path_len, 1, value)
35864 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
35865 * u"""addattr(self, root, value)
35868 __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)
35869 __Pyx_GOTREF(__pyx_tuple__111);
35870 __Pyx_GIVEREF(__pyx_tuple__111);
35871 __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)
35873 /* "src/lxml/objectpath.pxi":88
35876 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0) # <<<<<<<<<<<<<<
35880 __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)
35881 __Pyx_GOTREF(__pyx_tuple__113);
35882 __Pyx_GIVEREF(__pyx_tuple__113);
35883 __Pyx_RefNannyFinishContext();
35886 __Pyx_RefNannyFinishContext();
35890 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
35891 __pyx_umethod_PyBytes_Type_split.type = (PyObject*)&PyBytes_Type;
35892 __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
35893 __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
35894 __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
35895 __pyx_umethod_PyList_Type_remove.type = (PyObject*)&PyList_Type;
35896 __pyx_umethod_PyUnicode_Type_strip.type = (PyObject*)&PyUnicode_Type;
35897 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
35898 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
35899 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35900 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35906 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
35907 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
35908 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
35909 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
35910 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
35911 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
35912 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
35914 static int __Pyx_modinit_global_init_code(void) {
35915 __Pyx_RefNannyDeclarations
35916 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
35917 /*--- Global init code ---*/
35918 __pyx_v_4lxml_9objectify_etree = Py_None; Py_INCREF(Py_None);
35919 __pyx_v_4lxml_9objectify_re = Py_None; Py_INCREF(Py_None);
35920 __pyx_v_4lxml_9objectify_IGNORABLE_ERRORS = ((PyObject*)Py_None); Py_INCREF(Py_None);
35921 __pyx_v_4lxml_9objectify_is_special_method = Py_None; Py_INCREF(Py_None);
35922 __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE = Py_None; Py_INCREF(Py_None);
35923 __pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
35924 __pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME = Py_None; Py_INCREF(Py_None);
35925 __pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8 = ((PyObject*)Py_None); Py_INCREF(Py_None);
35926 __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME = ((PyObject*)Py_None); Py_INCREF(Py_None);
35927 __pyx_v_4lxml_9objectify_XML_SCHEMA_NS = Py_None; Py_INCREF(Py_None);
35928 __pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8 = Py_None; Py_INCREF(Py_None);
35929 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS = Py_None; Py_INCREF(Py_None);
35930 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8 = Py_None; Py_INCREF(Py_None);
35931 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR = Py_None; Py_INCREF(Py_None);
35932 __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR = Py_None; Py_INCREF(Py_None);
35933 __pyx_v_4lxml_9objectify__PYTYPE_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35934 __pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35935 __pyx_v_4lxml_9objectify__TYPE_CHECKS = ((PyObject*)Py_None); Py_INCREF(Py_None);
35936 __pyx_v_4lxml_9objectify_TREE_PYTYPE = ((struct __pyx_obj_4lxml_9objectify_PyType *)Py_None); Py_INCREF(Py_None);
35937 __pyx_v_4lxml_9objectify__strip_attributes = Py_None; Py_INCREF(Py_None);
35938 __pyx_v_4lxml_9objectify__cleanup_namespaces = Py_None; Py_INCREF(Py_None);
35939 __pyx_v_4lxml_9objectify___DEFAULT_PARSER = Py_None; Py_INCREF(Py_None);
35940 __pyx_v_4lxml_9objectify_objectify_parser = Py_None; Py_INCREF(Py_None);
35941 __pyx_v_4lxml_9objectify__fromstring = Py_None; Py_INCREF(Py_None);
35942 __pyx_v_4lxml_9objectify__parse = Py_None; Py_INCREF(Py_None);
35943 __pyx_v_4lxml_9objectify__DEFAULT_NSMAP = ((PyObject*)Py_None); Py_INCREF(Py_None);
35944 __pyx_v_4lxml_9objectify__NO_DEFAULT = Py_None; Py_INCREF(Py_None);
35945 __pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT = Py_None; Py_INCREF(Py_None);
35946 __pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT = ((PyObject*)Py_None); Py_INCREF(Py_None);
35947 __Pyx_RefNannyFinishContext();
35951 static int __Pyx_modinit_variable_export_code(void) {
35952 __Pyx_RefNannyDeclarations
35953 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
35954 /*--- Variable export code ---*/
35955 __Pyx_RefNannyFinishContext();
35959 static int __Pyx_modinit_function_export_code(void) {
35960 __Pyx_RefNannyDeclarations
35961 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
35962 /*--- Function export code ---*/
35963 __Pyx_RefNannyFinishContext();
35967 static int __Pyx_modinit_type_init_code(void) {
35968 __Pyx_RefNannyDeclarations
35969 PyObject *__pyx_t_1 = NULL;
35970 int __pyx_lineno = 0;
35971 const char *__pyx_filename = NULL;
35972 int __pyx_clineno = 0;
35973 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
35974 /*--- Type init code ---*/
35975 __pyx_t_1 = PyImport_ImportModule("lxml.etree"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
35976 __Pyx_GOTREF(__pyx_t_1);
35977 __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "ElementBase", sizeof(struct LxmlElementBase), __Pyx_ImportType_CheckSize_Warn);
35978 if (!__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase) __PYX_ERR(0, 1, __pyx_L1_error)
35979 __pyx_type_4lxml_9objectify_ObjectifiedElement.tp_base = __pyx_ptype_4lxml_8includes_11etreepublic_ElementBase;
35980 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifiedElement) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
35981 #if PY_VERSION_HEX < 0x030800B1
35982 __pyx_type_4lxml_9objectify_ObjectifiedElement.tp_print = 0;
35984 #if CYTHON_COMPILING_IN_CPYTHON
35986 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
35987 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
35988 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
35989 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement___iter__;
35990 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement___iter__;
35994 #if CYTHON_COMPILING_IN_CPYTHON
35996 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
35997 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
35998 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
35999 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_6__len__;
36000 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_6__len__;
36004 #if CYTHON_COMPILING_IN_CPYTHON
36006 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__getattr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36007 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36008 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36009 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
36010 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_12__getattr__;
36014 #if CYTHON_COMPILING_IN_CPYTHON
36016 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__setattr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36017 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36018 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36019 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
36020 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_14__setattr__;
36024 #if CYTHON_COMPILING_IN_CPYTHON
36026 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36027 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36028 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36029 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
36030 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_20__getitem__;
36034 #if CYTHON_COMPILING_IN_CPYTHON
36036 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement, "__setitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 133, __pyx_L1_error)
36037 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36038 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36039 __pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__.doc = __pyx_doc_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
36040 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_18ObjectifiedElement_22__setitem__;
36044 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifiedElement, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedElement) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
36045 __pyx_ptype_4lxml_9objectify_ObjectifiedElement = &__pyx_type_4lxml_9objectify_ObjectifiedElement;
36046 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedElement;
36047 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifiedDataElement) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
36048 #if PY_VERSION_HEX < 0x030800B1
36049 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_print = 0;
36051 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)) {
36052 __pyx_type_4lxml_9objectify_ObjectifiedDataElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36054 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifiedDataElement, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifiedDataElement) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
36055 __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement = &__pyx_type_4lxml_9objectify_ObjectifiedDataElement;
36056 __pyx_type_4lxml_9objectify_NumberElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36057 if (PyType_Ready(&__pyx_type_4lxml_9objectify_NumberElement) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
36058 #if PY_VERSION_HEX < 0x030800B1
36059 __pyx_type_4lxml_9objectify_NumberElement.tp_print = 0;
36061 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)) {
36062 __pyx_type_4lxml_9objectify_NumberElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36064 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumberElement, (PyObject *)&__pyx_type_4lxml_9objectify_NumberElement) < 0) __PYX_ERR(0, 612, __pyx_L1_error)
36065 __pyx_ptype_4lxml_9objectify_NumberElement = &__pyx_type_4lxml_9objectify_NumberElement;
36066 __pyx_type_4lxml_9objectify_IntElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36067 if (PyType_Ready(&__pyx_type_4lxml_9objectify_IntElement) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
36068 #if PY_VERSION_HEX < 0x030800B1
36069 __pyx_type_4lxml_9objectify_IntElement.tp_print = 0;
36071 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)) {
36072 __pyx_type_4lxml_9objectify_IntElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36074 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntElement, (PyObject *)&__pyx_type_4lxml_9objectify_IntElement) < 0) __PYX_ERR(0, 709, __pyx_L1_error)
36075 __pyx_ptype_4lxml_9objectify_IntElement = &__pyx_type_4lxml_9objectify_IntElement;
36076 __pyx_type_4lxml_9objectify_LongElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36077 if (PyType_Ready(&__pyx_type_4lxml_9objectify_LongElement) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
36078 #if PY_VERSION_HEX < 0x030800B1
36079 __pyx_type_4lxml_9objectify_LongElement.tp_print = 0;
36081 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)) {
36082 __pyx_type_4lxml_9objectify_LongElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36084 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LongElement, (PyObject *)&__pyx_type_4lxml_9objectify_LongElement) < 0) __PYX_ERR(0, 716, __pyx_L1_error)
36085 __pyx_ptype_4lxml_9objectify_LongElement = &__pyx_type_4lxml_9objectify_LongElement;
36086 __pyx_type_4lxml_9objectify_FloatElement.tp_base = __pyx_ptype_4lxml_9objectify_NumberElement;
36087 if (PyType_Ready(&__pyx_type_4lxml_9objectify_FloatElement) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
36088 #if PY_VERSION_HEX < 0x030800B1
36089 __pyx_type_4lxml_9objectify_FloatElement.tp_print = 0;
36091 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)) {
36092 __pyx_type_4lxml_9objectify_FloatElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36094 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatElement, (PyObject *)&__pyx_type_4lxml_9objectify_FloatElement) < 0) __PYX_ERR(0, 723, __pyx_L1_error)
36095 __pyx_ptype_4lxml_9objectify_FloatElement = &__pyx_type_4lxml_9objectify_FloatElement;
36096 __pyx_type_4lxml_9objectify_StringElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36097 if (PyType_Ready(&__pyx_type_4lxml_9objectify_StringElement) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
36098 #if PY_VERSION_HEX < 0x030800B1
36099 __pyx_type_4lxml_9objectify_StringElement.tp_print = 0;
36101 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)) {
36102 __pyx_type_4lxml_9objectify_StringElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36104 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringElement, (PyObject *)&__pyx_type_4lxml_9objectify_StringElement) < 0) __PYX_ERR(0, 727, __pyx_L1_error)
36105 __pyx_ptype_4lxml_9objectify_StringElement = &__pyx_type_4lxml_9objectify_StringElement;
36106 __pyx_type_4lxml_9objectify_NoneElement.tp_base = __pyx_ptype_4lxml_9objectify_ObjectifiedDataElement;
36107 if (PyType_Ready(&__pyx_type_4lxml_9objectify_NoneElement) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
36108 #if PY_VERSION_HEX < 0x030800B1
36109 __pyx_type_4lxml_9objectify_NoneElement.tp_print = 0;
36111 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)) {
36112 __pyx_type_4lxml_9objectify_NoneElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36114 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NoneElement, (PyObject *)&__pyx_type_4lxml_9objectify_NoneElement) < 0) __PYX_ERR(0, 789, __pyx_L1_error)
36115 __pyx_ptype_4lxml_9objectify_NoneElement = &__pyx_type_4lxml_9objectify_NoneElement;
36116 __pyx_type_4lxml_9objectify_BoolElement.tp_base = __pyx_ptype_4lxml_9objectify_IntElement;
36117 if (PyType_Ready(&__pyx_type_4lxml_9objectify_BoolElement) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
36118 #if PY_VERSION_HEX < 0x030800B1
36119 __pyx_type_4lxml_9objectify_BoolElement.tp_print = 0;
36121 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)) {
36122 __pyx_type_4lxml_9objectify_BoolElement.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36124 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BoolElement, (PyObject *)&__pyx_type_4lxml_9objectify_BoolElement) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
36125 __pyx_ptype_4lxml_9objectify_BoolElement = &__pyx_type_4lxml_9objectify_BoolElement;
36126 if (PyType_Ready(&__pyx_type_4lxml_9objectify_PyType) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
36127 #if PY_VERSION_HEX < 0x030800B1
36128 __pyx_type_4lxml_9objectify_PyType.tp_print = 0;
36130 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)) {
36131 __pyx_type_4lxml_9objectify_PyType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36133 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PyType, (PyObject *)&__pyx_type_4lxml_9objectify_PyType) < 0) __PYX_ERR(0, 901, __pyx_L1_error)
36134 __pyx_ptype_4lxml_9objectify_PyType = &__pyx_type_4lxml_9objectify_PyType;
36135 if (PyType_Ready(&__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller) < 0) __PYX_ERR(0, 1131, __pyx_L1_error)
36136 #if PY_VERSION_HEX < 0x030800B1
36137 __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_print = 0;
36139 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)) {
36140 __pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
36142 #if CYTHON_COMPILING_IN_CPYTHON
36144 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1131, __pyx_L1_error)
36145 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36146 __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36147 __pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__.doc = __pyx_doc_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
36148 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_28_ObjectifyElementMakerCaller___call__;
36152 __pyx_ptype_4lxml_9objectify__ObjectifyElementMakerCaller = &__pyx_type_4lxml_9objectify__ObjectifyElementMakerCaller;
36153 __pyx_vtabptr_4lxml_9objectify_ElementMaker = &__pyx_vtable_4lxml_9objectify_ElementMaker;
36154 __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;
36155 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36156 #if PY_VERSION_HEX < 0x030800B1
36157 __pyx_type_4lxml_9objectify_ElementMaker.tp_print = 0;
36159 if (__Pyx_SetVtable(__pyx_type_4lxml_9objectify_ElementMaker.tp_dict, __pyx_vtabptr_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36160 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementMaker, (PyObject *)&__pyx_type_4lxml_9objectify_ElementMaker) < 0) __PYX_ERR(0, 1221, __pyx_L1_error)
36161 __pyx_ptype_4lxml_9objectify_ElementMaker = &__pyx_type_4lxml_9objectify_ElementMaker;
36162 __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "ElementClassLookup", sizeof(struct LxmlElementClassLookup), __Pyx_ImportType_CheckSize_Warn);
36163 if (!__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup) __PYX_ERR(0, 1, __pyx_L1_error)
36164 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_base = __pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup;
36165 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
36166 #if PY_VERSION_HEX < 0x030800B1
36167 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_print = 0;
36169 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)) {
36170 __pyx_type_4lxml_9objectify_ObjectifyElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36172 #if CYTHON_COMPILING_IN_CPYTHON
36174 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1377, __pyx_L1_error)
36175 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36176 __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36177 __pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__.doc = __pyx_doc_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
36178 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_27ObjectifyElementClassLookup___init__;
36182 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectifyElementClassLookup, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
36183 __pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup = &__pyx_type_4lxml_9objectify_ObjectifyElementClassLookup;
36184 if (PyType_Ready(&__pyx_type_4lxml_9objectify_ObjectPath) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
36185 #if PY_VERSION_HEX < 0x030800B1
36186 __pyx_type_4lxml_9objectify_ObjectPath.tp_print = 0;
36188 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)) {
36189 __pyx_type_4lxml_9objectify_ObjectPath.tp_getattro = __Pyx_PyObject_GenericGetAttr;
36191 #if CYTHON_COMPILING_IN_CPYTHON
36193 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_9objectify_ObjectPath, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(1, 13, __pyx_L1_error)
36194 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
36195 __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
36196 __pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__.doc = __pyx_doc_4lxml_9objectify_10ObjectPath_6__call__;
36197 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4lxml_9objectify_10ObjectPath_6__call__;
36201 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectPath, (PyObject *)&__pyx_type_4lxml_9objectify_ObjectPath) < 0) __PYX_ERR(1, 13, __pyx_L1_error)
36202 __pyx_ptype_4lxml_9objectify_ObjectPath = &__pyx_type_4lxml_9objectify_ObjectPath;
36203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36204 __Pyx_RefNannyFinishContext();
36207 __Pyx_XDECREF(__pyx_t_1);
36208 __Pyx_RefNannyFinishContext();
36212 static int __Pyx_modinit_type_import_code(void) {
36213 __Pyx_RefNannyDeclarations
36214 PyObject *__pyx_t_1 = NULL;
36215 int __pyx_lineno = 0;
36216 const char *__pyx_filename = NULL;
36217 int __pyx_clineno = 0;
36218 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
36219 /*--- Type import code ---*/
36220 __pyx_t_1 = PyImport_ImportModule("lxml.etree"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 30, __pyx_L1_error)
36221 __Pyx_GOTREF(__pyx_t_1);
36222 __pyx_ptype_4lxml_8includes_11etreepublic__Document = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_Document", sizeof(struct LxmlDocument), __Pyx_ImportType_CheckSize_Warn);
36223 if (!__pyx_ptype_4lxml_8includes_11etreepublic__Document) __PYX_ERR(2, 30, __pyx_L1_error)
36224 __pyx_ptype_4lxml_8includes_11etreepublic__Element = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_Element", sizeof(struct LxmlElement), __Pyx_ImportType_CheckSize_Warn);
36225 if (!__pyx_ptype_4lxml_8includes_11etreepublic__Element) __PYX_ERR(2, 33, __pyx_L1_error)
36226 __pyx_ptype_4lxml_8includes_11etreepublic__ElementTree = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementTree", sizeof(struct LxmlElementTree), __Pyx_ImportType_CheckSize_Warn);
36227 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree) __PYX_ERR(2, 40, __pyx_L1_error)
36228 __pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "FallbackElementClassLookup", sizeof(struct LxmlFallbackElementClassLookup), __Pyx_ImportType_CheckSize_Warn);
36229 if (!__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup) __PYX_ERR(2, 47, __pyx_L1_error)
36230 __pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementTagMatcher", sizeof(struct LxmlElementTagMatcher), __Pyx_ImportType_CheckSize_Warn);
36231 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher) __PYX_ERR(2, 159, __pyx_L1_error)
36232 __pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator = __Pyx_ImportType(__pyx_t_1, "lxml.etree", "_ElementIterator", sizeof(struct LxmlElementIterator), __Pyx_ImportType_CheckSize_Warn);
36233 if (!__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator) __PYX_ERR(2, 168, __pyx_L1_error)
36234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36235 __Pyx_RefNannyFinishContext();
36238 __Pyx_XDECREF(__pyx_t_1);
36239 __Pyx_RefNannyFinishContext();
36243 static int __Pyx_modinit_variable_import_code(void) {
36244 __Pyx_RefNannyDeclarations
36245 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
36246 /*--- Variable import code ---*/
36247 __Pyx_RefNannyFinishContext();
36251 static int __Pyx_modinit_function_import_code(void) {
36252 __Pyx_RefNannyDeclarations
36253 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
36254 /*--- Function import code ---*/
36255 __Pyx_RefNannyFinishContext();
36260 #ifndef CYTHON_NO_PYINIT_EXPORT
36261 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
36262 #elif PY_MAJOR_VERSION < 3
36264 #define __Pyx_PyMODINIT_FUNC extern "C" void
36266 #define __Pyx_PyMODINIT_FUNC void
36270 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
36272 #define __Pyx_PyMODINIT_FUNC PyObject *
36277 #if PY_MAJOR_VERSION < 3
36278 __Pyx_PyMODINIT_FUNC initobjectify(void) CYTHON_SMALL_CODE; /*proto*/
36279 __Pyx_PyMODINIT_FUNC initobjectify(void)
36281 __Pyx_PyMODINIT_FUNC PyInit_objectify(void) CYTHON_SMALL_CODE; /*proto*/
36282 __Pyx_PyMODINIT_FUNC PyInit_objectify(void)
36283 #if CYTHON_PEP489_MULTI_PHASE_INIT
36285 return PyModuleDef_Init(&__pyx_moduledef);
36287 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
36288 #if PY_VERSION_HEX >= 0x030700A1
36289 static PY_INT64_T main_interpreter_id = -1;
36290 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
36291 if (main_interpreter_id == -1) {
36292 main_interpreter_id = current_id;
36293 return (unlikely(current_id == -1)) ? -1 : 0;
36294 } else if (unlikely(main_interpreter_id != current_id))
36296 static PyInterpreterState *main_interpreter = NULL;
36297 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
36298 if (!main_interpreter) {
36299 main_interpreter = current_interpreter;
36300 } else if (unlikely(main_interpreter != current_interpreter))
36305 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
36310 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) {
36311 PyObject *value = PyObject_GetAttrString(spec, from_name);
36313 if (likely(value)) {
36314 if (allow_none || value != Py_None) {
36315 result = PyDict_SetItemString(moddict, to_name, value);
36318 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
36325 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
36326 PyObject *module = NULL, *moddict, *modname;
36327 if (__Pyx_check_single_interpreter())
36330 return __Pyx_NewRef(__pyx_m);
36331 modname = PyObject_GetAttrString(spec, "name");
36332 if (unlikely(!modname)) goto bad;
36333 module = PyModule_NewObject(modname);
36334 Py_DECREF(modname);
36335 if (unlikely(!module)) goto bad;
36336 moddict = PyModule_GetDict(module);
36337 if (unlikely(!moddict)) goto bad;
36338 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
36339 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
36340 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
36341 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
36344 Py_XDECREF(module);
36349 static CYTHON_SMALL_CODE int __pyx_pymod_exec_objectify(PyObject *__pyx_pyinit_module)
36353 PyObject *__pyx_t_1 = NULL;
36354 PyObject *__pyx_t_2 = NULL;
36356 PyObject *__pyx_t_4 = NULL;
36357 int __pyx_lineno = 0;
36358 const char *__pyx_filename = NULL;
36359 int __pyx_clineno = 0;
36360 __Pyx_RefNannyDeclarations
36361 #if CYTHON_PEP489_MULTI_PHASE_INIT
36363 if (__pyx_m == __pyx_pyinit_module) return 0;
36364 PyErr_SetString(PyExc_RuntimeError, "Module 'objectify' has already been imported. Re-initialisation is not supported.");
36367 #elif PY_MAJOR_VERSION >= 3
36368 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
36370 #if CYTHON_REFNANNY
36371 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
36372 if (!__Pyx_RefNanny) {
36374 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
36375 if (!__Pyx_RefNanny)
36376 Py_FatalError("failed to import 'refnanny' module");
36379 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_objectify(void)", 0);
36380 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36381 #ifdef __Pxy_PyFrame_Initialize_Offsets
36382 __Pxy_PyFrame_Initialize_Offsets();
36384 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
36385 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
36386 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
36387 #ifdef __Pyx_CyFunction_USED
36388 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36390 #ifdef __Pyx_FusedFunction_USED
36391 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36393 #ifdef __Pyx_Coroutine_USED
36394 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36396 #ifdef __Pyx_Generator_USED
36397 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36399 #ifdef __Pyx_AsyncGen_USED
36400 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36402 #ifdef __Pyx_StopAsyncIteration_USED
36403 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36405 /*--- Library function declarations ---*/
36406 /*--- Threads initialization code ---*/
36407 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
36408 #ifdef WITH_THREAD /* Python build with threading support? */
36409 PyEval_InitThreads();
36412 /*--- Module creation code ---*/
36413 #if CYTHON_PEP489_MULTI_PHASE_INIT
36414 __pyx_m = __pyx_pyinit_module;
36415 Py_INCREF(__pyx_m);
36417 #if PY_MAJOR_VERSION < 3
36418 __pyx_m = Py_InitModule4("objectify", __pyx_methods, __pyx_k_The_lxml_objectify_module_imple, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
36420 __pyx_m = PyModule_Create(&__pyx_moduledef);
36422 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
36424 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
36425 Py_INCREF(__pyx_d);
36426 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
36427 Py_INCREF(__pyx_b);
36428 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
36429 Py_INCREF(__pyx_cython_runtime);
36430 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
36431 /*--- Initialize various global constants etc. ---*/
36432 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36433 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
36434 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36436 if (__pyx_module_is_main_lxml__objectify) {
36437 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36439 #if PY_MAJOR_VERSION >= 3
36441 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
36442 if (!PyDict_GetItemString(modules, "lxml.objectify")) {
36443 if (unlikely(PyDict_SetItemString(modules, "lxml.objectify", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36447 /*--- Builtin init code ---*/
36448 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36449 /*--- Constants init code ---*/
36450 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36451 /*--- Global type/function init code ---*/
36452 (void)__Pyx_modinit_global_init_code();
36453 (void)__Pyx_modinit_variable_export_code();
36454 (void)__Pyx_modinit_function_export_code();
36455 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36456 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
36457 (void)__Pyx_modinit_variable_import_code();
36458 (void)__Pyx_modinit_function_import_code();
36459 /*--- Execution code ---*/
36460 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
36461 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
36464 /* "lxml/objectify.pyx":24
36465 * from libc.string cimport const_char
36467 * __all__ = [u'BoolElement', u'DataElement', u'E', u'Element', u'ElementMaker', # <<<<<<<<<<<<<<
36468 * u'FloatElement', u'IntElement', u'LongElement', u'NoneElement',
36469 * u'NumberElement', u'ObjectPath', u'ObjectifiedDataElement',
36471 __pyx_t_1 = PyList_New(32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
36472 __Pyx_GOTREF(__pyx_t_1);
36473 __Pyx_INCREF(__pyx_n_u_BoolElement);
36474 __Pyx_GIVEREF(__pyx_n_u_BoolElement);
36475 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_BoolElement);
36476 __Pyx_INCREF(__pyx_n_u_DataElement);
36477 __Pyx_GIVEREF(__pyx_n_u_DataElement);
36478 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_DataElement);
36479 __Pyx_INCREF(__pyx_n_u_E);
36480 __Pyx_GIVEREF(__pyx_n_u_E);
36481 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_E);
36482 __Pyx_INCREF(__pyx_n_u_Element);
36483 __Pyx_GIVEREF(__pyx_n_u_Element);
36484 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_u_Element);
36485 __Pyx_INCREF(__pyx_n_u_ElementMaker);
36486 __Pyx_GIVEREF(__pyx_n_u_ElementMaker);
36487 PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_u_ElementMaker);
36488 __Pyx_INCREF(__pyx_n_u_FloatElement);
36489 __Pyx_GIVEREF(__pyx_n_u_FloatElement);
36490 PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_u_FloatElement);
36491 __Pyx_INCREF(__pyx_n_u_IntElement);
36492 __Pyx_GIVEREF(__pyx_n_u_IntElement);
36493 PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_IntElement);
36494 __Pyx_INCREF(__pyx_n_u_LongElement);
36495 __Pyx_GIVEREF(__pyx_n_u_LongElement);
36496 PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_u_LongElement);
36497 __Pyx_INCREF(__pyx_n_u_NoneElement);
36498 __Pyx_GIVEREF(__pyx_n_u_NoneElement);
36499 PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_u_NoneElement);
36500 __Pyx_INCREF(__pyx_n_u_NumberElement);
36501 __Pyx_GIVEREF(__pyx_n_u_NumberElement);
36502 PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_u_NumberElement);
36503 __Pyx_INCREF(__pyx_n_u_ObjectPath);
36504 __Pyx_GIVEREF(__pyx_n_u_ObjectPath);
36505 PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_u_ObjectPath);
36506 __Pyx_INCREF(__pyx_n_u_ObjectifiedDataElement);
36507 __Pyx_GIVEREF(__pyx_n_u_ObjectifiedDataElement);
36508 PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_u_ObjectifiedDataElement);
36509 __Pyx_INCREF(__pyx_n_u_ObjectifiedElement);
36510 __Pyx_GIVEREF(__pyx_n_u_ObjectifiedElement);
36511 PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_u_ObjectifiedElement);
36512 __Pyx_INCREF(__pyx_n_u_ObjectifyElementClassLookup);
36513 __Pyx_GIVEREF(__pyx_n_u_ObjectifyElementClassLookup);
36514 PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_u_ObjectifyElementClassLookup);
36515 __Pyx_INCREF(__pyx_n_u_PYTYPE_ATTRIBUTE);
36516 __Pyx_GIVEREF(__pyx_n_u_PYTYPE_ATTRIBUTE);
36517 PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_u_PYTYPE_ATTRIBUTE);
36518 __Pyx_INCREF(__pyx_n_u_PyType);
36519 __Pyx_GIVEREF(__pyx_n_u_PyType);
36520 PyList_SET_ITEM(__pyx_t_1, 15, __pyx_n_u_PyType);
36521 __Pyx_INCREF(__pyx_n_u_StringElement);
36522 __Pyx_GIVEREF(__pyx_n_u_StringElement);
36523 PyList_SET_ITEM(__pyx_t_1, 16, __pyx_n_u_StringElement);
36524 __Pyx_INCREF(__pyx_n_u_SubElement);
36525 __Pyx_GIVEREF(__pyx_n_u_SubElement);
36526 PyList_SET_ITEM(__pyx_t_1, 17, __pyx_n_u_SubElement);
36527 __Pyx_INCREF(__pyx_n_u_XML);
36528 __Pyx_GIVEREF(__pyx_n_u_XML);
36529 PyList_SET_ITEM(__pyx_t_1, 18, __pyx_n_u_XML);
36530 __Pyx_INCREF(__pyx_n_u_annotate);
36531 __Pyx_GIVEREF(__pyx_n_u_annotate);
36532 PyList_SET_ITEM(__pyx_t_1, 19, __pyx_n_u_annotate);
36533 __Pyx_INCREF(__pyx_n_u_deannotate);
36534 __Pyx_GIVEREF(__pyx_n_u_deannotate);
36535 PyList_SET_ITEM(__pyx_t_1, 20, __pyx_n_u_deannotate);
36536 __Pyx_INCREF(__pyx_n_u_dump);
36537 __Pyx_GIVEREF(__pyx_n_u_dump);
36538 PyList_SET_ITEM(__pyx_t_1, 21, __pyx_n_u_dump);
36539 __Pyx_INCREF(__pyx_n_u_enable_recursive_str);
36540 __Pyx_GIVEREF(__pyx_n_u_enable_recursive_str);
36541 PyList_SET_ITEM(__pyx_t_1, 22, __pyx_n_u_enable_recursive_str);
36542 __Pyx_INCREF(__pyx_n_u_fromstring);
36543 __Pyx_GIVEREF(__pyx_n_u_fromstring);
36544 PyList_SET_ITEM(__pyx_t_1, 23, __pyx_n_u_fromstring);
36545 __Pyx_INCREF(__pyx_n_u_getRegisteredTypes);
36546 __Pyx_GIVEREF(__pyx_n_u_getRegisteredTypes);
36547 PyList_SET_ITEM(__pyx_t_1, 24, __pyx_n_u_getRegisteredTypes);
36548 __Pyx_INCREF(__pyx_n_u_makeparser);
36549 __Pyx_GIVEREF(__pyx_n_u_makeparser);
36550 PyList_SET_ITEM(__pyx_t_1, 25, __pyx_n_u_makeparser);
36551 __Pyx_INCREF(__pyx_n_u_parse);
36552 __Pyx_GIVEREF(__pyx_n_u_parse);
36553 PyList_SET_ITEM(__pyx_t_1, 26, __pyx_n_u_parse);
36554 __Pyx_INCREF(__pyx_n_u_pyannotate);
36555 __Pyx_GIVEREF(__pyx_n_u_pyannotate);
36556 PyList_SET_ITEM(__pyx_t_1, 27, __pyx_n_u_pyannotate);
36557 __Pyx_INCREF(__pyx_n_u_pytypename);
36558 __Pyx_GIVEREF(__pyx_n_u_pytypename);
36559 PyList_SET_ITEM(__pyx_t_1, 28, __pyx_n_u_pytypename);
36560 __Pyx_INCREF(__pyx_n_u_set_default_parser);
36561 __Pyx_GIVEREF(__pyx_n_u_set_default_parser);
36562 PyList_SET_ITEM(__pyx_t_1, 29, __pyx_n_u_set_default_parser);
36563 __Pyx_INCREF(__pyx_n_u_set_pytype_attribute_tag);
36564 __Pyx_GIVEREF(__pyx_n_u_set_pytype_attribute_tag);
36565 PyList_SET_ITEM(__pyx_t_1, 30, __pyx_n_u_set_pytype_attribute_tag);
36566 __Pyx_INCREF(__pyx_n_u_xsiannotate);
36567 __Pyx_GIVEREF(__pyx_n_u_xsiannotate);
36568 PyList_SET_ITEM(__pyx_t_1, 31, __pyx_n_u_xsiannotate);
36569 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
36570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36572 /* "lxml/objectify.pyx":35
36574 * cdef object etree
36575 * from lxml import etree # <<<<<<<<<<<<<<
36576 * # initialize C-API of lxml.etree
36577 * import_lxml__etree()
36579 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
36580 __Pyx_GOTREF(__pyx_t_1);
36581 __Pyx_INCREF(__pyx_n_s_etree);
36582 __Pyx_GIVEREF(__pyx_n_s_etree);
36583 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_etree);
36584 __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)
36585 __Pyx_GOTREF(__pyx_t_2);
36586 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36587 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
36588 __Pyx_GOTREF(__pyx_t_1);
36589 __Pyx_INCREF(__pyx_t_1);
36590 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_etree);
36591 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_etree, __pyx_t_1);
36592 __Pyx_GIVEREF(__pyx_t_1);
36593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36594 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36596 /* "lxml/objectify.pyx":37
36597 * from lxml import etree
36598 * # initialize C-API of lxml.etree
36599 * import_lxml__etree() # <<<<<<<<<<<<<<
36601 * __version__ = etree.__version__
36603 __pyx_t_3 = import_lxml__etree(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 37, __pyx_L1_error)
36605 /* "lxml/objectify.pyx":39
36606 * import_lxml__etree()
36608 * __version__ = etree.__version__ # <<<<<<<<<<<<<<
36612 __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)
36613 __Pyx_GOTREF(__pyx_t_2);
36614 if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
36615 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36617 /* "lxml/objectify.pyx":42
36620 * import re # <<<<<<<<<<<<<<
36622 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
36624 __pyx_t_2 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
36625 __Pyx_GOTREF(__pyx_t_2);
36626 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_re);
36627 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_re, __pyx_t_2);
36628 __Pyx_GIVEREF(__pyx_t_2);
36631 /* "lxml/objectify.pyx":44
36634 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError) # <<<<<<<<<<<<<<
36635 * cdef object is_special_method = re.compile(u'__.*__$').match
36638 __Pyx_INCREF(__pyx_tuple__22);
36639 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
36640 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS, __pyx_tuple__22);
36641 __Pyx_GIVEREF(__pyx_tuple__22);
36643 /* "lxml/objectify.pyx":45
36645 * cdef tuple IGNORABLE_ERRORS = (ValueError, TypeError)
36646 * cdef object is_special_method = re.compile(u'__.*__$').match # <<<<<<<<<<<<<<
36650 __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)
36651 __Pyx_GOTREF(__pyx_t_2);
36652 __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)
36653 __Pyx_GOTREF(__pyx_t_1);
36654 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36655 __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)
36656 __Pyx_GOTREF(__pyx_t_2);
36657 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36658 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_is_special_method);
36659 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_is_special_method, __pyx_t_2);
36660 __Pyx_GIVEREF(__pyx_t_2);
36663 /* "lxml/objectify.pyx":75
36664 * cdef const_xmlChar* _PYTYPE_ATTRIBUTE_NAME
36666 * PYTYPE_ATTRIBUTE = None # <<<<<<<<<<<<<<
36668 * cdef unicode TREE_PYTYPE_NAME = u"TREE"
36670 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PYTYPE_ATTRIBUTE, Py_None) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
36672 /* "lxml/objectify.pyx":77
36673 * PYTYPE_ATTRIBUTE = None
36675 * cdef unicode TREE_PYTYPE_NAME = u"TREE" # <<<<<<<<<<<<<<
36677 * cdef tuple _unicodeAndUtf8(s):
36679 __Pyx_INCREF(__pyx_n_u_TREE);
36680 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
36681 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME, __pyx_n_u_TREE);
36682 __Pyx_GIVEREF(__pyx_n_u_TREE);
36684 /* "lxml/objectify.pyx":82
36685 * return s, python.PyUnicode_AsUTF8String(s)
36687 * def set_pytype_attribute_tag(attribute_tag=None): # <<<<<<<<<<<<<<
36688 * u"""set_pytype_attribute_tag(attribute_tag=None)
36689 * Change name and namespace of the XML attribute that holds Python type
36691 __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)
36692 __Pyx_GOTREF(__pyx_t_2);
36693 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__27);
36694 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pytype_attribute_tag, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
36695 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36697 /* "lxml/objectify.pyx":112
36698 * _PYTYPE_NAMESPACE, _PYTYPE_ATTRIBUTE_NAME)
36700 * set_pytype_attribute_tag() # <<<<<<<<<<<<<<
36704 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_pytype_attribute_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
36705 __Pyx_GOTREF(__pyx_t_2);
36706 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
36707 __Pyx_GOTREF(__pyx_t_1);
36708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36711 /* "lxml/objectify.pyx":118
36712 * cdef object XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8
36713 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \
36714 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema") # <<<<<<<<<<<<<<
36715 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8)
36718 __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)
36719 __Pyx_GOTREF(__pyx_t_1);
36720 if (likely(__pyx_t_1 != Py_None)) {
36721 PyObject* sequence = __pyx_t_1;
36722 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36723 if (unlikely(size != 2)) {
36724 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36725 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36726 __PYX_ERR(0, 117, __pyx_L1_error)
36728 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36729 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
36730 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
36731 __Pyx_INCREF(__pyx_t_2);
36732 __Pyx_INCREF(__pyx_t_4);
36734 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
36735 __Pyx_GOTREF(__pyx_t_2);
36736 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
36737 __Pyx_GOTREF(__pyx_t_4);
36739 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36741 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 117, __pyx_L1_error)
36744 /* "lxml/objectify.pyx":117
36745 * # namespaces for XML Schema
36746 * cdef object XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8
36747 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \ # <<<<<<<<<<<<<<
36748 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema")
36749 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8)
36751 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS);
36752 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS, __pyx_t_2);
36753 __Pyx_GIVEREF(__pyx_t_2);
36755 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8);
36756 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8, __pyx_t_4);
36757 __Pyx_GIVEREF(__pyx_t_4);
36760 /* "lxml/objectify.pyx":119
36761 * XML_SCHEMA_NS, XML_SCHEMA_NS_UTF8 = \
36762 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema")
36763 * cdef const_xmlChar* _XML_SCHEMA_NS = _xcstr(XML_SCHEMA_NS_UTF8) # <<<<<<<<<<<<<<
36765 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36767 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8;
36768 __Pyx_INCREF(__pyx_t_1);
36769 __pyx_v_4lxml_9objectify__XML_SCHEMA_NS = (const xmlChar*)PyBytes_AS_STRING(__pyx_t_1);
36770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36772 /* "lxml/objectify.pyx":123
36773 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36774 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \
36775 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance") # <<<<<<<<<<<<<<
36776 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36779 __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)
36780 __Pyx_GOTREF(__pyx_t_1);
36781 if (likely(__pyx_t_1 != Py_None)) {
36782 PyObject* sequence = __pyx_t_1;
36783 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36784 if (unlikely(size != 2)) {
36785 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36786 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
36787 __PYX_ERR(0, 122, __pyx_L1_error)
36789 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36790 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
36791 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
36792 __Pyx_INCREF(__pyx_t_4);
36793 __Pyx_INCREF(__pyx_t_2);
36795 __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
36796 __Pyx_GOTREF(__pyx_t_4);
36797 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
36798 __Pyx_GOTREF(__pyx_t_2);
36800 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36802 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 122, __pyx_L1_error)
36805 /* "lxml/objectify.pyx":122
36807 * cdef object XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8
36808 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \ # <<<<<<<<<<<<<<
36809 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance")
36810 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36812 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS);
36813 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS, __pyx_t_4);
36814 __Pyx_GIVEREF(__pyx_t_4);
36816 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8);
36817 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8, __pyx_t_2);
36818 __Pyx_GIVEREF(__pyx_t_2);
36821 /* "lxml/objectify.pyx":124
36822 * XML_SCHEMA_INSTANCE_NS, XML_SCHEMA_INSTANCE_NS_UTF8 = \
36823 * _unicodeAndUtf8(u"http://www.w3.org/2001/XMLSchema-instance")
36824 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8) # <<<<<<<<<<<<<<
36826 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS
36828 __pyx_t_1 = __pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8;
36829 __Pyx_INCREF(__pyx_t_1);
36830 __pyx_v_4lxml_9objectify__XML_SCHEMA_INSTANCE_NS = (const xmlChar*)PyBytes_AS_STRING(__pyx_t_1);
36831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36833 /* "lxml/objectify.pyx":126
36834 * cdef const_xmlChar* _XML_SCHEMA_INSTANCE_NS = _xcstr(XML_SCHEMA_INSTANCE_NS_UTF8)
36836 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS # <<<<<<<<<<<<<<
36837 * cdef object XML_SCHEMA_INSTANCE_TYPE_ATTR = u"{%s}type" % XML_SCHEMA_INSTANCE_NS
36840 __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)
36841 __Pyx_GOTREF(__pyx_t_1);
36842 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR);
36843 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR, __pyx_t_1);
36844 __Pyx_GIVEREF(__pyx_t_1);
36847 /* "lxml/objectify.pyx":127
36849 * cdef object XML_SCHEMA_INSTANCE_NIL_ATTR = u"{%s}nil" % XML_SCHEMA_INSTANCE_NS
36850 * cdef object XML_SCHEMA_INSTANCE_TYPE_ATTR = u"{%s}type" % XML_SCHEMA_INSTANCE_NS # <<<<<<<<<<<<<<
36854 __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)
36855 __Pyx_GOTREF(__pyx_t_1);
36856 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR);
36857 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR, __pyx_t_1);
36858 __Pyx_GIVEREF(__pyx_t_1);
36861 /* "lxml/objectify.pyx":162
36863 * # pickle support for objectified Element
36864 * def __reduce__(self): # <<<<<<<<<<<<<<
36865 * return fromstring, (etree.tostring(self),)
36868 __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)
36869 __Pyx_GOTREF(__pyx_t_1);
36870 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)
36871 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36872 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36874 /* "lxml/objectify.pyx":193
36875 * return _countSiblings(self._c_node)
36877 * def countchildren(self): # <<<<<<<<<<<<<<
36878 * u"""countchildren(self)
36881 __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)
36882 __Pyx_GOTREF(__pyx_t_1);
36883 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)
36884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36885 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36887 /* "lxml/objectify.pyx":210
36890 * def getchildren(self): # <<<<<<<<<<<<<<
36891 * u"""getchildren(self)
36894 __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)
36895 __Pyx_GOTREF(__pyx_t_1);
36896 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)
36897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36898 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36900 /* "lxml/objectify.pyx":263
36901 * self.remove(child)
36903 * def addattr(self, tag, value): # <<<<<<<<<<<<<<
36904 * u"""addattr(self, tag, value)
36907 __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)
36908 __Pyx_GOTREF(__pyx_t_1);
36909 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)
36910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36911 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36913 /* "lxml/objectify.pyx":369
36914 * parent.remove(sibling)
36916 * def descendantpaths(self, prefix=None): # <<<<<<<<<<<<<<
36917 * u"""descendantpaths(self, prefix=None)
36920 __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)
36921 __Pyx_GOTREF(__pyx_t_1);
36922 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)
36923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36924 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedElement);
36926 /* "lxml/objectify.pyx":606
36927 * return strrepr(textOf(self._c_node) or '')
36929 * def _setText(self, s): # <<<<<<<<<<<<<<
36930 * u"""For use in subclasses only. Don't use unless you know what you are
36933 __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)
36934 __Pyx_GOTREF(__pyx_t_1);
36935 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)
36936 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36937 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectifiedDataElement);
36939 /* "lxml/objectify.pyx":614
36940 * cdef class NumberElement(ObjectifiedDataElement):
36941 * cdef object _parse_value
36942 * def _setValueParser(self, function): # <<<<<<<<<<<<<<
36943 * u"""Set the function that parses the Python value from a string.
36946 __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)
36947 __Pyx_GOTREF(__pyx_t_1);
36948 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)
36949 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36950 PyType_Modified(__pyx_ptype_4lxml_9objectify_NumberElement);
36952 /* "lxml/objectify.pyx":634
36953 * return float(_parseNumber(self))
36955 * def __complex__(self): # <<<<<<<<<<<<<<
36956 * return complex(_parseNumber(self))
36959 __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)
36960 __Pyx_GOTREF(__pyx_t_1);
36961 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)
36962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36963 PyType_Modified(__pyx_ptype_4lxml_9objectify_NumberElement);
36965 /* "lxml/objectify.pyx":710
36967 * cdef class IntElement(NumberElement):
36968 * def _init(self): # <<<<<<<<<<<<<<
36969 * self._parse_value = int
36972 __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)
36973 __Pyx_GOTREF(__pyx_t_1);
36974 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)
36975 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36976 PyType_Modified(__pyx_ptype_4lxml_9objectify_IntElement);
36978 /* "lxml/objectify.pyx":717
36980 * cdef class LongElement(NumberElement):
36981 * def _init(self): # <<<<<<<<<<<<<<
36982 * self._parse_value = long
36985 __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)
36986 __Pyx_GOTREF(__pyx_t_1);
36987 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)
36988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36989 PyType_Modified(__pyx_ptype_4lxml_9objectify_LongElement);
36991 /* "lxml/objectify.pyx":724
36993 * cdef class FloatElement(NumberElement):
36994 * def _init(self): # <<<<<<<<<<<<<<
36995 * self._parse_value = float
36998 __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)
36999 __Pyx_GOTREF(__pyx_t_1);
37000 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)
37001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37002 PyType_Modified(__pyx_ptype_4lxml_9objectify_FloatElement);
37004 /* "lxml/objectify.pyx":741
37005 * return repr(textOf(self._c_node) or u'')
37007 * def strlen(self): # <<<<<<<<<<<<<<
37008 * text = textOf(self._c_node)
37011 __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)
37012 __Pyx_GOTREF(__pyx_t_1);
37013 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)
37014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37015 PyType_Modified(__pyx_ptype_4lxml_9objectify_StringElement);
37017 /* "lxml/objectify.pyx":786
37018 * return float(textOf(self._c_node))
37020 * def __complex__(self): # <<<<<<<<<<<<<<
37021 * return complex(textOf(self._c_node))
37024 __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)
37025 __Pyx_GOTREF(__pyx_t_1);
37026 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)
37027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37028 PyType_Modified(__pyx_ptype_4lxml_9objectify_StringElement);
37030 /* "lxml/objectify.pyx":821
37031 * Python's bool type.
37033 * def _init(self): # <<<<<<<<<<<<<<
37034 * self._parse_value = __parseBool
37037 __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)
37038 __Pyx_GOTREF(__pyx_t_1);
37039 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)
37040 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37041 PyType_Modified(__pyx_ptype_4lxml_9objectify_BoolElement);
37043 /* "lxml/objectify.pyx":843
37044 * return __parseBool(textOf(self._c_node))
37046 * def __checkBool(s): # <<<<<<<<<<<<<<
37047 * cdef int value = -1
37048 * if s is not None:
37050 __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)
37051 __Pyx_GOTREF(__pyx_t_1);
37052 if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkBool, __pyx_t_1) < 0) __PYX_ERR(0, 843, __pyx_L1_error)
37053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37055 /* "lxml/objectify.pyx":850
37058 * cpdef bint __parseBool(s) except -1: # <<<<<<<<<<<<<<
37062 __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)
37063 __Pyx_GOTREF(__pyx_t_1);
37064 if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseBool, __pyx_t_1) < 0) __PYX_ERR(0, 850, __pyx_L1_error)
37065 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37067 /* "lxml/objectify.pyx":948
37068 * return "PyType(%s, %s)" % (self.name, self._type.__name__)
37070 * def register(self, before=None, after=None): # <<<<<<<<<<<<<<
37071 * u"""register(self, before=None, after=None)
37074 __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)
37075 __Pyx_GOTREF(__pyx_t_1);
37076 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)
37077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37078 PyType_Modified(__pyx_ptype_4lxml_9objectify_PyType);
37080 /* "lxml/objectify.pyx":989
37081 * _SCHEMA_TYPE_DICT[xs_type] = self
37083 * def unregister(self): # <<<<<<<<<<<<<<
37084 * u"unregister(self)"
37085 * if _PYTYPE_DICT.get(self.name) is self:
37087 __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)
37088 __Pyx_GOTREF(__pyx_t_1);
37089 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)
37090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37091 PyType_Modified(__pyx_ptype_4lxml_9objectify_PyType);
37093 /* "lxml/objectify.pyx":1014
37096 * cdef dict _PYTYPE_DICT = {} # <<<<<<<<<<<<<<
37097 * cdef dict _SCHEMA_TYPE_DICT = {}
37098 * cdef list _TYPE_CHECKS = []
37100 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
37101 __Pyx_GOTREF(__pyx_t_1);
37102 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__PYTYPE_DICT);
37103 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__PYTYPE_DICT, ((PyObject*)__pyx_t_1));
37104 __Pyx_GIVEREF(__pyx_t_1);
37107 /* "lxml/objectify.pyx":1015
37109 * cdef dict _PYTYPE_DICT = {}
37110 * cdef dict _SCHEMA_TYPE_DICT = {} # <<<<<<<<<<<<<<
37111 * cdef list _TYPE_CHECKS = []
37114 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
37115 __Pyx_GOTREF(__pyx_t_1);
37116 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT);
37117 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT, ((PyObject*)__pyx_t_1));
37118 __Pyx_GIVEREF(__pyx_t_1);
37121 /* "lxml/objectify.pyx":1016
37122 * cdef dict _PYTYPE_DICT = {}
37123 * cdef dict _SCHEMA_TYPE_DICT = {}
37124 * cdef list _TYPE_CHECKS = [] # <<<<<<<<<<<<<<
37126 * def __lower_bool(b):
37128 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
37129 __Pyx_GOTREF(__pyx_t_1);
37130 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__TYPE_CHECKS);
37131 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__TYPE_CHECKS, ((PyObject*)__pyx_t_1));
37132 __Pyx_GIVEREF(__pyx_t_1);
37135 /* "lxml/objectify.pyx":1018
37136 * cdef list _TYPE_CHECKS = []
37138 * def __lower_bool(b): # <<<<<<<<<<<<<<
37139 * return u"true" if b else u"false"
37142 __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)
37143 __Pyx_GOTREF(__pyx_t_1);
37144 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lower_bool, __pyx_t_1) < 0) __PYX_ERR(0, 1018, __pyx_L1_error)
37145 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37147 /* "lxml/objectify.pyx":1024
37148 * return u"str" if python._isString(obj) else _typename(obj)
37150 * def pytypename(obj): # <<<<<<<<<<<<<<
37151 * u"""pytypename(obj)
37154 __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)
37155 __Pyx_GOTREF(__pyx_t_1);
37156 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pytypename, __pyx_t_1) < 0) __PYX_ERR(0, 1024, __pyx_L1_error)
37157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37159 /* "lxml/objectify.pyx":1066
37161 * # non-registered PyType for inner tree elements
37162 * cdef PyType TREE_PYTYPE = PyType(TREE_PYTYPE_NAME, None, ObjectifiedElement) # <<<<<<<<<<<<<<
37164 * _registerPyTypes()
37166 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
37167 __Pyx_GOTREF(__pyx_t_1);
37168 __Pyx_INCREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37169 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37170 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37171 __Pyx_INCREF(Py_None);
37172 __Pyx_GIVEREF(Py_None);
37173 PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
37174 __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37175 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37176 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifiedElement));
37177 __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)
37178 __Pyx_GOTREF(__pyx_t_2);
37179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37180 __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_9objectify_TREE_PYTYPE));
37181 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_TREE_PYTYPE, ((struct __pyx_obj_4lxml_9objectify_PyType *)__pyx_t_2));
37182 __Pyx_GIVEREF(__pyx_t_2);
37185 /* "lxml/objectify.pyx":1068
37186 * cdef PyType TREE_PYTYPE = PyType(TREE_PYTYPE_NAME, None, ObjectifiedElement)
37188 * _registerPyTypes() # <<<<<<<<<<<<<<
37190 * def getRegisteredTypes():
37192 __pyx_t_2 = __pyx_f_4lxml_9objectify__registerPyTypes(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error)
37193 __Pyx_GOTREF(__pyx_t_2);
37194 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37196 /* "lxml/objectify.pyx":1070
37197 * _registerPyTypes()
37199 * def getRegisteredTypes(): # <<<<<<<<<<<<<<
37200 * u"""getRegisteredTypes()
37203 __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)
37204 __Pyx_GOTREF(__pyx_t_2);
37205 if (PyDict_SetItem(__pyx_d, __pyx_n_s_getRegisteredTypes, __pyx_t_2) < 0) __PYX_ERR(0, 1070, __pyx_L1_error)
37206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37208 /* "lxml/objectify.pyx":1303
37209 * # Recursive element dumping
37211 * cdef bint __RECURSIVE_STR = 0 # default: off # <<<<<<<<<<<<<<
37213 * def enable_recursive_str(on=True):
37215 __pyx_v_4lxml_9objectify___RECURSIVE_STR = 0;
37217 /* "lxml/objectify.pyx":1305
37218 * cdef bint __RECURSIVE_STR = 0 # default: off
37220 * def enable_recursive_str(on=True): # <<<<<<<<<<<<<<
37221 * u"""enable_recursive_str(on=True)
37224 __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)
37225 __Pyx_GOTREF(__pyx_t_2);
37226 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__72);
37227 if (PyDict_SetItem(__pyx_d, __pyx_n_s_enable_recursive_str, __pyx_t_2) < 0) __PYX_ERR(0, 1305, __pyx_L1_error)
37228 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37230 /* "lxml/objectify.pyx":1314
37231 * __RECURSIVE_STR = on
37233 * def dump(_Element element not None): # <<<<<<<<<<<<<<
37234 * u"""dump(_Element element not None)
37237 __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)
37238 __Pyx_GOTREF(__pyx_t_2);
37239 if (PyDict_SetItem(__pyx_d, __pyx_n_s_dump, __pyx_t_2) < 0) __PYX_ERR(0, 1314, __pyx_L1_error)
37240 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37242 /* "lxml/objectify.pyx":1357
37243 * # Pickle support for objectified ElementTree
37245 * def __unpickleElementTree(data): # <<<<<<<<<<<<<<
37246 * return etree.ElementTree(fromstring(data))
37249 __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)
37250 __Pyx_GOTREF(__pyx_t_2);
37251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpickleElementTree, __pyx_t_2) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
37252 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37254 /* "lxml/objectify.pyx":1368
37255 * elementTreeReduceFunction, __unpickleElementTree)
37257 * def pickleReduceElementTree(obj): # <<<<<<<<<<<<<<
37258 * return __unpickleElementTree, (etree.tostring(obj),)
37261 __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)
37262 __Pyx_GOTREF(__pyx_t_2);
37263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickleReduceElementTree, __pyx_t_2) < 0) __PYX_ERR(0, 1368, __pyx_L1_error)
37264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37266 /* "lxml/objectify.pyx":1371
37267 * return __unpickleElementTree, (etree.tostring(obj),)
37269 * _setupPickle(pickleReduceElementTree) # <<<<<<<<<<<<<<
37270 * del pickleReduceElementTree
37273 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pickleReduceElementTree); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1371, __pyx_L1_error)
37274 __Pyx_GOTREF(__pyx_t_2);
37275 __pyx_t_1 = __pyx_f_4lxml_9objectify__setupPickle(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1371, __pyx_L1_error)
37276 __Pyx_GOTREF(__pyx_t_1);
37277 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37278 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37280 /* "lxml/objectify.pyx":1372
37282 * _setupPickle(pickleReduceElementTree)
37283 * del pickleReduceElementTree # <<<<<<<<<<<<<<
37285 * ################################################################################
37287 if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_n_s_pickleReduceElementTree) < 0) __PYX_ERR(0, 1372, __pyx_L1_error)
37289 /* "lxml/objectify.pyx":1462
37292 * def pyannotate(element_or_tree, *, ignore_old=False, ignore_xsi=False, # <<<<<<<<<<<<<<
37293 * empty_pytype=None):
37294 * u"""pyannotate(element_or_tree, ignore_old=False, ignore_xsi=False, empty_pytype=None)
37296 __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error)
37297 __Pyx_GOTREF(__pyx_t_1);
37298 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37299 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37300 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_pytype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37301 __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)
37302 __Pyx_GOTREF(__pyx_t_2);
37303 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37304 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37305 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyannotate, __pyx_t_2) < 0) __PYX_ERR(0, 1462, __pyx_L1_error)
37306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37308 /* "lxml/objectify.pyx":1485
37309 * _annotate(element, 0, 1, ignore_xsi, ignore_old, None, empty_pytype)
37311 * def xsiannotate(element_or_tree, *, ignore_old=False, ignore_pytype=False, # <<<<<<<<<<<<<<
37312 * empty_type=None):
37313 * u"""xsiannotate(element_or_tree, ignore_old=False, ignore_pytype=False, empty_type=None)
37315 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1485, __pyx_L1_error)
37316 __Pyx_GOTREF(__pyx_t_2);
37317 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_old, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37318 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ignore_pytype, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37319 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37320 __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)
37321 __Pyx_GOTREF(__pyx_t_1);
37322 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37324 if (PyDict_SetItem(__pyx_d, __pyx_n_s_xsiannotate, __pyx_t_1) < 0) __PYX_ERR(0, 1485, __pyx_L1_error)
37325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37327 /* "lxml/objectify.pyx":1513
37328 * _annotate(element, 1, 0, ignore_old, ignore_pytype, empty_type, None)
37330 * def annotate(element_or_tree, *, ignore_old=True, ignore_xsi=False, # <<<<<<<<<<<<<<
37331 * empty_pytype=None, empty_type=None, annotate_xsi=0,
37332 * annotate_pytype=1):
37334 __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
37335 __Pyx_GOTREF(__pyx_t_1);
37336 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_old, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37337 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ignore_xsi, ((PyObject *)Py_False)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37338 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_pytype, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37339 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_empty_type, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37340 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_annotate_xsi, ((PyObject *)__pyx_int_0)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37341 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_annotate_pytype, ((PyObject *)__pyx_int_1)) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37342 __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)
37343 __Pyx_GOTREF(__pyx_t_2);
37344 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37345 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37346 if (PyDict_SetItem(__pyx_d, __pyx_n_s_annotate, __pyx_t_2) < 0) __PYX_ERR(0, 1513, __pyx_L1_error)
37347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37349 /* "lxml/objectify.pyx":1706
37352 * cdef object _strip_attributes = etree.strip_attributes # <<<<<<<<<<<<<<
37353 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37356 __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)
37357 __Pyx_GOTREF(__pyx_t_2);
37358 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__strip_attributes);
37359 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__strip_attributes, __pyx_t_2);
37360 __Pyx_GIVEREF(__pyx_t_2);
37363 /* "lxml/objectify.pyx":1707
37365 * cdef object _strip_attributes = etree.strip_attributes
37366 * cdef object _cleanup_namespaces = etree.cleanup_namespaces # <<<<<<<<<<<<<<
37368 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
37370 __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)
37371 __Pyx_GOTREF(__pyx_t_2);
37372 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__cleanup_namespaces);
37373 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__cleanup_namespaces, __pyx_t_2);
37374 __Pyx_GIVEREF(__pyx_t_2);
37377 /* "lxml/objectify.pyx":1709
37378 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37380 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
37381 * bint xsi_nil=False, bint cleanup_namespaces=False):
37382 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37384 __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error)
37385 __Pyx_GOTREF(__pyx_t_2);
37386 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error)
37387 __Pyx_GOTREF(__pyx_t_1);
37388 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pytype, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37390 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1709, __pyx_L1_error)
37391 __Pyx_GOTREF(__pyx_t_1);
37392 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsi_2, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37395 /* "lxml/objectify.pyx":1710
37397 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True,
37398 * bint xsi_nil=False, bint cleanup_namespaces=False): # <<<<<<<<<<<<<<
37399 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37402 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
37403 __Pyx_GOTREF(__pyx_t_1);
37404 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_xsi_nil, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37406 __pyx_t_1 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
37407 __Pyx_GOTREF(__pyx_t_1);
37408 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_cleanup_namespaces, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37409 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37411 /* "lxml/objectify.pyx":1709
37412 * cdef object _cleanup_namespaces = etree.cleanup_namespaces
37414 * def deannotate(element_or_tree, *, bint pytype=True, bint xsi=True, # <<<<<<<<<<<<<<
37415 * bint xsi_nil=False, bint cleanup_namespaces=False):
37416 * u"""deannotate(element_or_tree, pytype=True, xsi=True, xsi_nil=False, cleanup_namespaces=False)
37418 __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)
37419 __Pyx_GOTREF(__pyx_t_1);
37420 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37422 if (PyDict_SetItem(__pyx_d, __pyx_n_s_deannotate, __pyx_t_1) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
37423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37425 /* "lxml/objectify.pyx":1743
37427 * cdef object __DEFAULT_PARSER
37428 * __DEFAULT_PARSER = etree.XMLParser(remove_blank_text=True) # <<<<<<<<<<<<<<
37429 * __DEFAULT_PARSER.set_element_class_lookup( ObjectifyElementClassLookup() )
37432 __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)
37433 __Pyx_GOTREF(__pyx_t_1);
37434 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error)
37435 __Pyx_GOTREF(__pyx_t_2);
37436 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_remove_blank_text, Py_True) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
37437 __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)
37438 __Pyx_GOTREF(__pyx_t_4);
37439 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37440 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37441 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37442 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify___DEFAULT_PARSER, __pyx_t_4);
37443 __Pyx_GIVEREF(__pyx_t_4);
37446 /* "lxml/objectify.pyx":1744
37447 * cdef object __DEFAULT_PARSER
37448 * __DEFAULT_PARSER = etree.XMLParser(remove_blank_text=True)
37449 * __DEFAULT_PARSER.set_element_class_lookup( ObjectifyElementClassLookup() ) # <<<<<<<<<<<<<<
37451 * cdef object objectify_parser
37453 __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)
37454 __Pyx_GOTREF(__pyx_t_4);
37455 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ObjectifyElementClassLookup)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1744, __pyx_L1_error)
37456 __Pyx_GOTREF(__pyx_t_2);
37457 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1744, __pyx_L1_error)
37458 __Pyx_GOTREF(__pyx_t_1);
37459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37463 /* "lxml/objectify.pyx":1747
37465 * cdef object objectify_parser
37466 * objectify_parser = __DEFAULT_PARSER # <<<<<<<<<<<<<<
37468 * def set_default_parser(new_parser = None):
37470 __Pyx_INCREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37471 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify_objectify_parser);
37472 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify_objectify_parser, __pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37473 __Pyx_GIVEREF(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37475 /* "lxml/objectify.pyx":1749
37476 * objectify_parser = __DEFAULT_PARSER
37478 * def set_default_parser(new_parser = None): # <<<<<<<<<<<<<<
37479 * u"""set_default_parser(new_parser = None)
37482 __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)
37483 __Pyx_GOTREF(__pyx_t_1);
37484 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__89);
37485 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_default_parser, __pyx_t_1) < 0) __PYX_ERR(0, 1749, __pyx_L1_error)
37486 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37488 /* "lxml/objectify.pyx":1767
37489 * raise TypeError, u"parser must inherit from lxml.etree.XMLParser"
37491 * def makeparser(**kw): # <<<<<<<<<<<<<<
37492 * u"""makeparser(remove_blank_text=True, **kw)
37495 __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)
37496 __Pyx_GOTREF(__pyx_t_1);
37497 if (PyDict_SetItem(__pyx_d, __pyx_n_s_makeparser, __pyx_t_1) < 0) __PYX_ERR(0, 1767, __pyx_L1_error)
37498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37500 /* "lxml/objectify.pyx":1790
37502 * cdef object _fromstring
37503 * _fromstring = etree.fromstring # <<<<<<<<<<<<<<
37505 * SubElement = etree.SubElement
37507 __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)
37508 __Pyx_GOTREF(__pyx_t_1);
37509 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__fromstring);
37510 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__fromstring, __pyx_t_1);
37511 __Pyx_GIVEREF(__pyx_t_1);
37514 /* "lxml/objectify.pyx":1792
37515 * _fromstring = etree.fromstring
37517 * SubElement = etree.SubElement # <<<<<<<<<<<<<<
37519 * def fromstring(xml, parser=None, *, base_url=None):
37521 __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)
37522 __Pyx_GOTREF(__pyx_t_1);
37523 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SubElement, __pyx_t_1) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
37524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37526 /* "lxml/objectify.pyx":1794
37527 * SubElement = etree.SubElement
37529 * def fromstring(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37530 * u"""fromstring(xml, parser=None, base_url=None)
37533 __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error)
37534 __Pyx_GOTREF(__pyx_t_1);
37535 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1794, __pyx_L1_error)
37536 __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)
37537 __Pyx_GOTREF(__pyx_t_2);
37538 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__94);
37539 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37540 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37541 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_2) < 0) __PYX_ERR(0, 1794, __pyx_L1_error)
37542 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37544 /* "lxml/objectify.pyx":1810
37545 * return _fromstring(xml, parser, base_url=base_url)
37547 * def XML(xml, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37548 * u"""XML(xml, parser=None, base_url=None)
37551 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error)
37552 __Pyx_GOTREF(__pyx_t_2);
37553 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
37554 __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)
37555 __Pyx_GOTREF(__pyx_t_1);
37556 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__97);
37557 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37559 if (PyDict_SetItem(__pyx_d, __pyx_n_s_XML, __pyx_t_1) < 0) __PYX_ERR(0, 1810, __pyx_L1_error)
37560 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37562 /* "lxml/objectify.pyx":1827
37564 * cdef object _parse
37565 * _parse = etree.parse # <<<<<<<<<<<<<<
37567 * def parse(f, parser=None, *, base_url=None):
37569 __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)
37570 __Pyx_GOTREF(__pyx_t_1);
37571 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__parse);
37572 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__parse, __pyx_t_1);
37573 __Pyx_GIVEREF(__pyx_t_1);
37576 /* "lxml/objectify.pyx":1829
37577 * _parse = etree.parse
37579 * def parse(f, parser=None, *, base_url=None): # <<<<<<<<<<<<<<
37580 * u"""parse(f, parser=None, base_url=None)
37583 __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error)
37584 __Pyx_GOTREF(__pyx_t_1);
37585 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1829, __pyx_L1_error)
37586 __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)
37587 __Pyx_GOTREF(__pyx_t_2);
37588 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__100);
37589 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37590 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37591 if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse, __pyx_t_2) < 0) __PYX_ERR(0, 1829, __pyx_L1_error)
37592 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37594 /* "lxml/objectify.pyx":1845
37596 * cdef dict _DEFAULT_NSMAP = {
37597 * "py" : PYTYPE_NAMESPACE, # <<<<<<<<<<<<<<
37598 * "xsi" : XML_SCHEMA_INSTANCE_NS,
37599 * "xsd" : XML_SCHEMA_NS
37601 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1845, __pyx_L1_error)
37602 __Pyx_GOTREF(__pyx_t_2);
37603 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)
37605 /* "lxml/objectify.pyx":1846
37606 * cdef dict _DEFAULT_NSMAP = {
37607 * "py" : PYTYPE_NAMESPACE,
37608 * "xsi" : XML_SCHEMA_INSTANCE_NS, # <<<<<<<<<<<<<<
37609 * "xsd" : XML_SCHEMA_NS
37612 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)
37614 /* "lxml/objectify.pyx":1847
37615 * "py" : PYTYPE_NAMESPACE,
37616 * "xsi" : XML_SCHEMA_INSTANCE_NS,
37617 * "xsd" : XML_SCHEMA_NS # <<<<<<<<<<<<<<
37621 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)
37622 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
37623 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP, ((PyObject*)__pyx_t_2));
37624 __Pyx_GIVEREF(__pyx_t_2);
37627 /* "lxml/objectify.pyx":1850
37630 * E = ElementMaker() # <<<<<<<<<<<<<<
37632 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes):
37634 __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_9objectify_ElementMaker)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1850, __pyx_L1_error)
37635 __Pyx_GOTREF(__pyx_t_2);
37636 if (PyDict_SetItem(__pyx_d, __pyx_n_s_E, __pyx_t_2) < 0) __PYX_ERR(0, 1850, __pyx_L1_error)
37637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37639 /* "lxml/objectify.pyx":1852
37640 * E = ElementMaker()
37642 * def Element(_tag, attrib=None, nsmap=None, *, _pytype=None, **_attributes): # <<<<<<<<<<<<<<
37643 * u"""Element(_tag, attrib=None, nsmap=None, _pytype=None, **_attributes)
37646 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1852, __pyx_L1_error)
37647 __Pyx_GOTREF(__pyx_t_2);
37648 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1852, __pyx_L1_error)
37649 __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)
37650 __Pyx_GOTREF(__pyx_t_1);
37651 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__103);
37652 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
37653 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37654 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Element, __pyx_t_1) < 0) __PYX_ERR(0, 1852, __pyx_L1_error)
37655 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37657 /* "lxml/objectify.pyx":1872
37658 * return _makeElement(_tag, None, _attributes, nsmap)
37660 * def DataElement(_value, attrib=None, nsmap=None, *, _pytype=None, _xsi=None, # <<<<<<<<<<<<<<
37662 * u"""DataElement(_value, attrib=None, nsmap=None, _pytype=None, _xsi=None, **_attributes)
37664 __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1872, __pyx_L1_error)
37665 __Pyx_GOTREF(__pyx_t_1);
37666 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pytype_2, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37667 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_xsi_3, ((PyObject *)Py_None)) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37668 __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)
37669 __Pyx_GOTREF(__pyx_t_2);
37670 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__106);
37671 __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
37672 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37673 if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataElement, __pyx_t_2) < 0) __PYX_ERR(0, 1872, __pyx_L1_error)
37674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37676 /* "src/lxml/objectpath.pxi":10
37679 * cdef object _NO_DEFAULT = object() # <<<<<<<<<<<<<<
37683 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 10, __pyx_L1_error)
37684 __Pyx_GOTREF(__pyx_t_2);
37685 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__NO_DEFAULT);
37686 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__NO_DEFAULT, __pyx_t_2);
37687 __Pyx_GIVEREF(__pyx_t_2);
37690 /* "src/lxml/objectpath.pxi":57
37691 * return _find_object_path(root, self._c_path, self._path_len, default)
37693 * def hasattr(self, _Element root not None): # <<<<<<<<<<<<<<
37694 * u"hasattr(self, root)"
37697 __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)
37698 __Pyx_GOTREF(__pyx_t_2);
37699 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)
37700 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37701 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37703 /* "src/lxml/objectpath.pxi":65
37706 * def setattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
37707 * u"""setattr(self, root, value)
37710 __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)
37711 __Pyx_GOTREF(__pyx_t_2);
37712 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)
37713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37714 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37716 /* "src/lxml/objectpath.pxi":74
37717 * _create_object_path(root, self._c_path, self._path_len, 1, value)
37719 * def addattr(self, _Element root not None, value): # <<<<<<<<<<<<<<
37720 * u"""addattr(self, root, value)
37723 __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)
37724 __Pyx_GOTREF(__pyx_t_2);
37725 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)
37726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37727 PyType_Modified(__pyx_ptype_4lxml_9objectify_ObjectPath);
37729 /* "src/lxml/objectpath.pxi":84
37732 * cdef object __MATCH_PATH_SEGMENT = re.compile( # <<<<<<<<<<<<<<
37733 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37736 __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)
37737 __Pyx_GOTREF(__pyx_t_2);
37739 /* "src/lxml/objectpath.pxi":86
37740 * cdef object __MATCH_PATH_SEGMENT = re.compile(
37741 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37742 * re.U).match # <<<<<<<<<<<<<<
37744 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0)
37746 __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)
37747 __Pyx_GOTREF(__pyx_t_1);
37749 /* "src/lxml/objectpath.pxi":84
37752 * cdef object __MATCH_PATH_SEGMENT = re.compile( # <<<<<<<<<<<<<<
37753 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37756 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
37757 __Pyx_GOTREF(__pyx_t_4);
37758 __Pyx_INCREF(__pyx_kp_u_s_s_s_s_s_0_9_s);
37759 __Pyx_GIVEREF(__pyx_kp_u_s_s_s_s_s_0_9_s);
37760 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_s_s_s_s_s_0_9_s);
37761 __Pyx_GIVEREF(__pyx_t_1);
37762 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
37764 __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)
37765 __Pyx_GOTREF(__pyx_t_1);
37766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37767 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37769 /* "src/lxml/objectpath.pxi":86
37770 * cdef object __MATCH_PATH_SEGMENT = re.compile(
37771 * ur"(\.?)\s*(?:\{([^}]*)\})?\s*([^.{}\[\]\s]+)\s*(?:\[\s*([-0-9]+)\s*\])?",
37772 * re.U).match # <<<<<<<<<<<<<<
37774 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0)
37776 __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)
37777 __Pyx_GOTREF(__pyx_t_4);
37778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37779 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
37780 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT, __pyx_t_4);
37781 __Pyx_GIVEREF(__pyx_t_4);
37784 /* "src/lxml/objectpath.pxi":88
37787 * cdef tuple _RELATIVE_PATH_SEGMENT = (None, None, 0) # <<<<<<<<<<<<<<
37791 __Pyx_INCREF(__pyx_tuple__113);
37792 __Pyx_XGOTREF(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
37793 __Pyx_DECREF_SET(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT, __pyx_tuple__113);
37794 __Pyx_GIVEREF(__pyx_tuple__113);
37796 /* "lxml/objectify.pyx":1
37797 * # cython: binding=True # <<<<<<<<<<<<<<
37798 * # cython: auto_pickle=False
37799 * # cython: language_level=2
37801 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
37802 __Pyx_GOTREF(__pyx_t_4);
37803 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
37804 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37806 /*--- Wrapped vars code ---*/
37808 if (__Pyx_RegisterCleanup()) __PYX_ERR(0, 1, __pyx_L1_error);
37811 __Pyx_XDECREF(__pyx_t_1);
37812 __Pyx_XDECREF(__pyx_t_2);
37813 __Pyx_XDECREF(__pyx_t_4);
37816 __Pyx_AddTraceback("init lxml.objectify", __pyx_clineno, __pyx_lineno, __pyx_filename);
37819 } else if (!PyErr_Occurred()) {
37820 PyErr_SetString(PyExc_ImportError, "init lxml.objectify");
37823 __Pyx_RefNannyFinishContext();
37824 #if CYTHON_PEP489_MULTI_PHASE_INIT
37825 return (__pyx_m != NULL) ? 0 : -1;
37826 #elif PY_MAJOR_VERSION >= 3
37833 static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {
37834 Py_CLEAR(__pyx_slice__3);
37835 Py_CLEAR(__pyx_tuple__5);
37836 Py_CLEAR(__pyx_tuple__6);
37837 Py_CLEAR(__pyx_tuple__7);
37838 Py_CLEAR(__pyx_tuple__8);
37839 Py_CLEAR(__pyx_slice__16);
37840 Py_CLEAR(__pyx_tuple__18);
37841 Py_CLEAR(__pyx_tuple__22);
37842 Py_CLEAR(__pyx_tuple__24);
37843 Py_CLEAR(__pyx_tuple__25);
37844 Py_CLEAR(__pyx_codeobj__26);
37845 Py_CLEAR(__pyx_tuple__27);
37846 Py_CLEAR(__pyx_tuple__28);
37847 Py_CLEAR(__pyx_codeobj__29);
37848 Py_CLEAR(__pyx_tuple__30);
37849 Py_CLEAR(__pyx_codeobj__31);
37850 Py_CLEAR(__pyx_tuple__32);
37851 Py_CLEAR(__pyx_codeobj__33);
37852 Py_CLEAR(__pyx_tuple__34);
37853 Py_CLEAR(__pyx_codeobj__35);
37854 Py_CLEAR(__pyx_tuple__36);
37855 Py_CLEAR(__pyx_codeobj__37);
37856 Py_CLEAR(__pyx_tuple__38);
37857 Py_CLEAR(__pyx_codeobj__39);
37858 Py_CLEAR(__pyx_tuple__40);
37859 Py_CLEAR(__pyx_codeobj__41);
37860 Py_CLEAR(__pyx_tuple__42);
37861 Py_CLEAR(__pyx_codeobj__43);
37862 Py_CLEAR(__pyx_tuple__44);
37863 Py_CLEAR(__pyx_codeobj__45);
37864 Py_CLEAR(__pyx_tuple__46);
37865 Py_CLEAR(__pyx_codeobj__47);
37866 Py_CLEAR(__pyx_tuple__48);
37867 Py_CLEAR(__pyx_codeobj__49);
37868 Py_CLEAR(__pyx_tuple__50);
37869 Py_CLEAR(__pyx_codeobj__51);
37870 Py_CLEAR(__pyx_tuple__52);
37871 Py_CLEAR(__pyx_codeobj__53);
37872 Py_CLEAR(__pyx_tuple__54);
37873 Py_CLEAR(__pyx_codeobj__55);
37874 Py_CLEAR(__pyx_tuple__56);
37875 Py_CLEAR(__pyx_codeobj__57);
37876 Py_CLEAR(__pyx_tuple__58);
37877 Py_CLEAR(__pyx_codeobj__59);
37878 Py_CLEAR(__pyx_tuple__60);
37879 Py_CLEAR(__pyx_codeobj__61);
37880 Py_CLEAR(__pyx_tuple__62);
37881 Py_CLEAR(__pyx_codeobj__63);
37882 Py_CLEAR(__pyx_tuple__64);
37883 Py_CLEAR(__pyx_codeobj__65);
37884 Py_CLEAR(__pyx_tuple__66);
37885 Py_CLEAR(__pyx_codeobj__67);
37886 Py_CLEAR(__pyx_tuple__68);
37887 Py_CLEAR(__pyx_codeobj__69);
37888 Py_CLEAR(__pyx_tuple__70);
37889 Py_CLEAR(__pyx_codeobj__71);
37890 Py_CLEAR(__pyx_tuple__72);
37891 Py_CLEAR(__pyx_tuple__73);
37892 Py_CLEAR(__pyx_codeobj__74);
37893 Py_CLEAR(__pyx_tuple__75);
37894 Py_CLEAR(__pyx_codeobj__76);
37895 Py_CLEAR(__pyx_tuple__77);
37896 Py_CLEAR(__pyx_codeobj__78);
37897 Py_CLEAR(__pyx_tuple__79);
37898 Py_CLEAR(__pyx_codeobj__80);
37899 Py_CLEAR(__pyx_tuple__81);
37900 Py_CLEAR(__pyx_codeobj__82);
37901 Py_CLEAR(__pyx_tuple__83);
37902 Py_CLEAR(__pyx_codeobj__84);
37903 Py_CLEAR(__pyx_tuple__85);
37904 Py_CLEAR(__pyx_codeobj__86);
37905 Py_CLEAR(__pyx_tuple__87);
37906 Py_CLEAR(__pyx_codeobj__88);
37907 Py_CLEAR(__pyx_tuple__89);
37908 Py_CLEAR(__pyx_tuple__90);
37909 Py_CLEAR(__pyx_codeobj__91);
37910 Py_CLEAR(__pyx_tuple__92);
37911 Py_CLEAR(__pyx_codeobj__93);
37912 Py_CLEAR(__pyx_tuple__94);
37913 Py_CLEAR(__pyx_tuple__95);
37914 Py_CLEAR(__pyx_codeobj__96);
37915 Py_CLEAR(__pyx_tuple__97);
37916 Py_CLEAR(__pyx_tuple__98);
37917 Py_CLEAR(__pyx_codeobj__99);
37918 Py_CLEAR(__pyx_tuple__100);
37919 Py_CLEAR(__pyx_tuple__101);
37920 Py_CLEAR(__pyx_codeobj__102);
37921 Py_CLEAR(__pyx_tuple__103);
37922 Py_CLEAR(__pyx_tuple__104);
37923 Py_CLEAR(__pyx_codeobj__105);
37924 Py_CLEAR(__pyx_tuple__106);
37925 Py_CLEAR(__pyx_tuple__107);
37926 Py_CLEAR(__pyx_codeobj__108);
37927 Py_CLEAR(__pyx_tuple__109);
37928 Py_CLEAR(__pyx_codeobj__110);
37929 Py_CLEAR(__pyx_tuple__111);
37930 Py_CLEAR(__pyx_codeobj__112);
37931 Py_CLEAR(__pyx_tuple__113);
37932 /* CodeObjectCache.cleanup */
37933 if (__pyx_code_cache.entries) {
37934 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
37935 int i, count = __pyx_code_cache.count;
37936 __pyx_code_cache.count = 0;
37937 __pyx_code_cache.max_count = 0;
37938 __pyx_code_cache.entries = NULL;
37939 for (i=0; i<count; i++) {
37940 Py_DECREF(entries[i].code_object);
37942 PyMem_Free(entries);
37945 Py_CLEAR(__pyx_umethod_PyBytes_Type_split.method);
37946 Py_CLEAR(__pyx_umethod_PyDict_Type_get.method);
37947 Py_CLEAR(__pyx_umethod_PyDict_Type_items.method);
37948 Py_CLEAR(__pyx_umethod_PyDict_Type_values.method);
37949 Py_CLEAR(__pyx_umethod_PyList_Type_remove.method);
37950 Py_CLEAR(__pyx_umethod_PyUnicode_Type_strip.method);
37952 static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
37953 /*--- Global cleanup code ---*/
37954 Py_CLEAR(__pyx_v_4lxml_9objectify__RELATIVE_PATH_SEGMENT);
37955 Py_CLEAR(__pyx_v_4lxml_9objectify___MATCH_PATH_SEGMENT);
37956 Py_CLEAR(__pyx_v_4lxml_9objectify__NO_DEFAULT);
37957 Py_CLEAR(__pyx_v_4lxml_9objectify__DEFAULT_NSMAP);
37958 Py_CLEAR(__pyx_v_4lxml_9objectify__parse);
37959 Py_CLEAR(__pyx_v_4lxml_9objectify__fromstring);
37960 Py_CLEAR(__pyx_v_4lxml_9objectify_objectify_parser);
37961 Py_CLEAR(__pyx_v_4lxml_9objectify___DEFAULT_PARSER);
37962 Py_CLEAR(__pyx_v_4lxml_9objectify__cleanup_namespaces);
37963 Py_CLEAR(__pyx_v_4lxml_9objectify__strip_attributes);
37964 Py_CLEAR(__pyx_v_4lxml_9objectify_TREE_PYTYPE);
37965 Py_CLEAR(__pyx_v_4lxml_9objectify__TYPE_CHECKS);
37966 Py_CLEAR(__pyx_v_4lxml_9objectify__SCHEMA_TYPE_DICT);
37967 Py_CLEAR(__pyx_v_4lxml_9objectify__PYTYPE_DICT);
37968 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_TYPE_ATTR);
37969 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NIL_ATTR);
37970 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS_UTF8);
37971 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_INSTANCE_NS);
37972 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS_UTF8);
37973 Py_CLEAR(__pyx_v_4lxml_9objectify_XML_SCHEMA_NS);
37974 Py_CLEAR(__pyx_v_4lxml_9objectify_TREE_PYTYPE_NAME);
37975 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME_UTF8);
37976 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_ATTRIBUTE_NAME);
37977 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE_UTF8);
37978 Py_CLEAR(__pyx_v_4lxml_9objectify_PYTYPE_NAMESPACE);
37979 Py_CLEAR(__pyx_v_4lxml_9objectify_is_special_method);
37980 Py_CLEAR(__pyx_v_4lxml_9objectify_IGNORABLE_ERRORS);
37981 Py_CLEAR(__pyx_v_4lxml_9objectify_re);
37982 Py_CLEAR(__pyx_v_4lxml_9objectify_etree);
37983 __Pyx_CleanupGlobals();
37984 /*--- Type import cleanup code ---*/
37985 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_ElementBase);
37986 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_ElementClassLookup);
37987 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic_FallbackElementClassLookup);
37988 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__Document);
37989 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__Element);
37990 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementIterator);
37991 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementTagMatcher);
37992 Py_CLEAR(__pyx_ptype_4lxml_8includes_11etreepublic__ElementTree);
37993 /*--- Builtin cleanup code ---*/
37994 Py_CLEAR(__pyx_builtin_ValueError);
37995 Py_CLEAR(__pyx_builtin_TypeError);
37996 Py_CLEAR(__pyx_builtin_object);
37997 Py_CLEAR(__pyx_builtin_IndexError);
37998 Py_CLEAR(__pyx_builtin_AttributeError);
37999 Py_CLEAR(__pyx_builtin_oct);
38000 Py_CLEAR(__pyx_builtin_hex);
38001 Py_CLEAR(__pyx_builtin_enumerate);
38002 Py_CLEAR(__pyx_builtin_map);
38003 Py_CLEAR(__pyx_builtin_MemoryError);
38004 /*--- Intern cleanup code ---*/
38005 Py_CLEAR(__pyx_empty_tuple);
38007 Py_CLEAR(__pyx_cython_runtime);
38011 /* --- Runtime support code --- */
38013 #if CYTHON_REFNANNY
38014 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
38015 PyObject *m = NULL, *p = NULL;
38017 m = PyImport_ImportModule(modname);
38019 p = PyObject_GetAttrString(m, "RefNannyAPI");
38021 r = PyLong_AsVoidPtr(p);
38025 return (__Pyx_RefNannyAPIStruct *)r;
38029 /* PyObjectGetAttrStr */
38030 #if CYTHON_USE_TYPE_SLOTS
38031 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
38032 PyTypeObject* tp = Py_TYPE(obj);
38033 if (likely(tp->tp_getattro))
38034 return tp->tp_getattro(obj, attr_name);
38035 #if PY_MAJOR_VERSION < 3
38036 if (likely(tp->tp_getattr))
38037 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
38039 return PyObject_GetAttr(obj, attr_name);
38043 /* GetBuiltinName */
38044 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
38045 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
38046 if (unlikely(!result)) {
38047 PyErr_Format(PyExc_NameError,
38048 #if PY_MAJOR_VERSION >= 3
38049 "name '%U' is not defined", name);
38051 "name '%.200s' is not defined", PyString_AS_STRING(name));
38057 /* PyCFunctionFastCall */
38058 #if CYTHON_FAST_PYCCALL
38059 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
38060 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
38061 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
38062 PyObject *self = PyCFunction_GET_SELF(func);
38063 int flags = PyCFunction_GET_FLAGS(func);
38064 assert(PyCFunction_Check(func));
38065 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
38066 assert(nargs >= 0);
38067 assert(nargs == 0 || args != NULL);
38068 /* _PyCFunction_FastCallDict() must not be called with an exception set,
38069 because it may clear it (directly or indirectly) and so the
38070 caller loses its exception */
38071 assert(!PyErr_Occurred());
38072 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
38073 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
38075 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
38080 /* PyFunctionFastCall */
38081 #if CYTHON_FAST_PYCALL
38082 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
38083 PyObject *globals) {
38085 PyThreadState *tstate = __Pyx_PyThreadState_Current;
38086 PyObject **fastlocals;
38089 assert(globals != NULL);
38090 /* XXX Perhaps we should create a specialized
38091 PyFrame_New() that doesn't take locals, but does
38092 take builtins without sanity checking them.
38094 assert(tstate != NULL);
38095 f = PyFrame_New(tstate, co, globals, NULL);
38099 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
38100 for (i = 0; i < na; i++) {
38102 fastlocals[i] = *args++;
38104 result = PyEval_EvalFrameEx(f,0);
38105 ++tstate->recursion_depth;
38107 --tstate->recursion_depth;
38110 #if 1 || PY_VERSION_HEX < 0x030600B1
38111 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
38112 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
38113 PyObject *globals = PyFunction_GET_GLOBALS(func);
38114 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
38116 #if PY_MAJOR_VERSION >= 3
38119 PyObject *kwtuple, **k;
38124 assert(kwargs == NULL || PyDict_Check(kwargs));
38125 nk = kwargs ? PyDict_Size(kwargs) : 0;
38126 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
38130 #if PY_MAJOR_VERSION >= 3
38131 co->co_kwonlyargcount == 0 &&
38133 likely(kwargs == NULL || nk == 0) &&
38134 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
38135 if (argdefs == NULL && co->co_argcount == nargs) {
38136 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
38139 else if (nargs == 0 && argdefs != NULL
38140 && co->co_argcount == Py_SIZE(argdefs)) {
38141 /* function called with no arguments, but all parameters have
38142 a default value: use default values as arguments .*/
38143 args = &PyTuple_GET_ITEM(argdefs, 0);
38144 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
38148 if (kwargs != NULL) {
38150 kwtuple = PyTuple_New(2 * nk);
38151 if (kwtuple == NULL) {
38155 k = &PyTuple_GET_ITEM(kwtuple, 0);
38157 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
38168 closure = PyFunction_GET_CLOSURE(func);
38169 #if PY_MAJOR_VERSION >= 3
38170 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
38172 if (argdefs != NULL) {
38173 d = &PyTuple_GET_ITEM(argdefs, 0);
38174 nd = Py_SIZE(argdefs);
38180 #if PY_MAJOR_VERSION >= 3
38181 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
38184 d, (int)nd, kwdefs, closure);
38186 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
38189 d, (int)nd, closure);
38191 Py_XDECREF(kwtuple);
38193 Py_LeaveRecursiveCall();
38200 #if CYTHON_COMPILING_IN_CPYTHON
38201 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
38203 ternaryfunc call = func->ob_type->tp_call;
38204 if (unlikely(!call))
38205 return PyObject_Call(func, arg, kw);
38206 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
38208 result = (*call)(func, arg, kw);
38209 Py_LeaveRecursiveCall();
38210 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
38213 "NULL result without error in PyObject_Call");
38219 /* PyObjectCall2Args */
38220 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
38221 PyObject *args, *result = NULL;
38222 #if CYTHON_FAST_PYCALL
38223 if (PyFunction_Check(function)) {
38224 PyObject *args[2] = {arg1, arg2};
38225 return __Pyx_PyFunction_FastCall(function, args, 2);
38228 #if CYTHON_FAST_PYCCALL
38229 if (__Pyx_PyFastCFunction_Check(function)) {
38230 PyObject *args[2] = {arg1, arg2};
38231 return __Pyx_PyCFunction_FastCall(function, args, 2);
38234 args = PyTuple_New(2);
38235 if (unlikely(!args)) goto done;
38237 PyTuple_SET_ITEM(args, 0, arg1);
38239 PyTuple_SET_ITEM(args, 1, arg2);
38240 Py_INCREF(function);
38241 result = __Pyx_PyObject_Call(function, args, NULL);
38243 Py_DECREF(function);
38248 /* PyObjectCallMethO */
38249 #if CYTHON_COMPILING_IN_CPYTHON
38250 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
38251 PyObject *self, *result;
38253 cfunc = PyCFunction_GET_FUNCTION(func);
38254 self = PyCFunction_GET_SELF(func);
38255 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
38257 result = cfunc(self, arg);
38258 Py_LeaveRecursiveCall();
38259 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
38262 "NULL result without error in PyObject_Call");
38268 /* PyObjectCallOneArg */
38269 #if CYTHON_COMPILING_IN_CPYTHON
38270 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38272 PyObject *args = PyTuple_New(1);
38273 if (unlikely(!args)) return NULL;
38275 PyTuple_SET_ITEM(args, 0, arg);
38276 result = __Pyx_PyObject_Call(func, args, NULL);
38280 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38281 #if CYTHON_FAST_PYCALL
38282 if (PyFunction_Check(func)) {
38283 return __Pyx_PyFunction_FastCall(func, &arg, 1);
38286 if (likely(PyCFunction_Check(func))) {
38287 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
38288 return __Pyx_PyObject_CallMethO(func, arg);
38289 #if CYTHON_FAST_PYCCALL
38290 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
38291 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
38295 return __Pyx__PyObject_CallOneArg(func, arg);
38298 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38300 PyObject *args = PyTuple_Pack(1, arg);
38301 if (unlikely(!args)) return NULL;
38302 result = __Pyx_PyObject_Call(func, args, NULL);
38308 /* RaiseDoubleKeywords */
38309 static void __Pyx_RaiseDoubleKeywordsError(
38310 const char* func_name,
38313 PyErr_Format(PyExc_TypeError,
38314 #if PY_MAJOR_VERSION >= 3
38315 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
38317 "%s() got multiple values for keyword argument '%s'", func_name,
38318 PyString_AsString(kw_name));
38322 /* ParseKeywords */
38323 static int __Pyx_ParseOptionalKeywords(
38325 PyObject **argnames[],
38327 PyObject *values[],
38328 Py_ssize_t num_pos_args,
38329 const char* function_name)
38331 PyObject *key = 0, *value = 0;
38332 Py_ssize_t pos = 0;
38334 PyObject*** first_kw_arg = argnames + num_pos_args;
38335 while (PyDict_Next(kwds, &pos, &key, &value)) {
38336 name = first_kw_arg;
38337 while (*name && (**name != key)) name++;
38339 values[name-argnames] = value;
38342 name = first_kw_arg;
38343 #if PY_MAJOR_VERSION < 3
38344 if (likely(PyString_Check(key))) {
38346 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
38347 && _PyString_Eq(**name, key)) {
38348 values[name-argnames] = value;
38353 if (*name) continue;
38355 PyObject*** argname = argnames;
38356 while (argname != first_kw_arg) {
38357 if ((**argname == key) || (
38358 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
38359 && _PyString_Eq(**argname, key))) {
38360 goto arg_passed_twice;
38367 if (likely(PyUnicode_Check(key))) {
38369 int cmp = (**name == key) ? 0 :
38370 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
38371 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
38373 PyUnicode_Compare(**name, key);
38374 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
38376 values[name-argnames] = value;
38381 if (*name) continue;
38383 PyObject*** argname = argnames;
38384 while (argname != first_kw_arg) {
38385 int cmp = (**argname == key) ? 0 :
38386 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
38387 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
38389 PyUnicode_Compare(**argname, key);
38390 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
38391 if (cmp == 0) goto arg_passed_twice;
38396 goto invalid_keyword_type;
38398 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
38400 goto invalid_keyword;
38405 __Pyx_RaiseDoubleKeywordsError(function_name, key);
38407 invalid_keyword_type:
38408 PyErr_Format(PyExc_TypeError,
38409 "%.200s() keywords must be strings", function_name);
38412 PyErr_Format(PyExc_TypeError,
38413 #if PY_MAJOR_VERSION < 3
38414 "%.200s() got an unexpected keyword argument '%.200s'",
38415 function_name, PyString_AsString(key));
38417 "%s() got an unexpected keyword argument '%U'",
38418 function_name, key);
38424 /* RaiseArgTupleInvalid */
38425 static void __Pyx_RaiseArgtupleInvalid(
38426 const char* func_name,
38428 Py_ssize_t num_min,
38429 Py_ssize_t num_max,
38430 Py_ssize_t num_found)
38432 Py_ssize_t num_expected;
38433 const char *more_or_less;
38434 if (num_found < num_min) {
38435 num_expected = num_min;
38436 more_or_less = "at least";
38438 num_expected = num_max;
38439 more_or_less = "at most";
38442 more_or_less = "exactly";
38444 PyErr_Format(PyExc_TypeError,
38445 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
38446 func_name, more_or_less, num_expected,
38447 (num_expected == 1) ? "" : "s", num_found);
38450 /* RaiseTooManyValuesToUnpack */
38451 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
38452 PyErr_Format(PyExc_ValueError,
38453 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
38456 /* RaiseNeedMoreValuesToUnpack */
38457 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
38458 PyErr_Format(PyExc_ValueError,
38459 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
38460 index, (index == 1) ? "" : "s");
38463 /* RaiseNoneIterError */
38464 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
38465 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
38468 /* decode_c_bytes */
38469 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
38470 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
38471 const char* encoding, const char* errors,
38472 PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
38473 if (unlikely((start < 0) | (stop < 0))) {
38484 if (unlikely(stop <= start))
38485 return __Pyx_NewRef(__pyx_empty_unicode);
38486 length = stop - start;
38489 return decode_func(cstring, length, errors);
38491 return PyUnicode_Decode(cstring, length, encoding, errors);
38495 /* PyObjectCallNoArg */
38496 #if CYTHON_COMPILING_IN_CPYTHON
38497 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
38498 #if CYTHON_FAST_PYCALL
38499 if (PyFunction_Check(func)) {
38500 return __Pyx_PyFunction_FastCall(func, NULL, 0);
38503 #ifdef __Pyx_CyFunction_USED
38504 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
38506 if (likely(PyCFunction_Check(func)))
38509 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
38510 return __Pyx_PyObject_CallMethO(func, NULL);
38513 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
38517 /* PyDictVersioning */
38518 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
38519 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
38520 PyObject *dict = Py_TYPE(obj)->tp_dict;
38521 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
38523 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
38524 PyObject **dictptr = NULL;
38525 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
38527 #if CYTHON_COMPILING_IN_CPYTHON
38528 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
38530 dictptr = _PyObject_GetDictPtr(obj);
38533 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
38535 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
38536 PyObject *dict = Py_TYPE(obj)->tp_dict;
38537 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
38539 return obj_dict_version == __Pyx_get_object_dict_version(obj);
38543 /* GetModuleGlobalName */
38544 #if CYTHON_USE_DICT_VERSIONS
38545 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
38547 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
38551 #if !CYTHON_AVOID_BORROWED_REFS
38552 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
38553 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
38554 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38555 if (likely(result)) {
38556 return __Pyx_NewRef(result);
38557 } else if (unlikely(PyErr_Occurred())) {
38561 result = PyDict_GetItem(__pyx_d, name);
38562 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38563 if (likely(result)) {
38564 return __Pyx_NewRef(result);
38568 result = PyObject_GetItem(__pyx_d, name);
38569 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
38570 if (likely(result)) {
38571 return __Pyx_NewRef(result);
38575 return __Pyx_GetBuiltinName(name);
38579 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
38580 if (unlikely(!type)) {
38581 PyErr_SetString(PyExc_SystemError, "Missing type object");
38584 if (likely(__Pyx_TypeCheck(obj, type)))
38586 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
38587 Py_TYPE(obj)->tp_name, type->tp_name);
38592 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
38593 #if CYTHON_COMPILING_IN_PYPY
38594 return PyObject_RichCompareBool(s1, s2, equals);
38597 return (equals == Py_EQ);
38598 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
38599 const char *ps1, *ps2;
38600 Py_ssize_t length = PyBytes_GET_SIZE(s1);
38601 if (length != PyBytes_GET_SIZE(s2))
38602 return (equals == Py_NE);
38603 ps1 = PyBytes_AS_STRING(s1);
38604 ps2 = PyBytes_AS_STRING(s2);
38605 if (ps1[0] != ps2[0]) {
38606 return (equals == Py_NE);
38607 } else if (length == 1) {
38608 return (equals == Py_EQ);
38611 #if CYTHON_USE_UNICODE_INTERNALS
38612 Py_hash_t hash1, hash2;
38613 hash1 = ((PyBytesObject*)s1)->ob_shash;
38614 hash2 = ((PyBytesObject*)s2)->ob_shash;
38615 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38616 return (equals == Py_NE);
38619 result = memcmp(ps1, ps2, (size_t)length);
38620 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38622 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
38623 return (equals == Py_NE);
38624 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
38625 return (equals == Py_NE);
38628 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38631 result = __Pyx_PyObject_IsTrue(py_result);
38632 Py_DECREF(py_result);
38638 /* UnicodeEquals */
38639 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
38640 #if CYTHON_COMPILING_IN_PYPY
38641 return PyObject_RichCompareBool(s1, s2, equals);
38643 #if PY_MAJOR_VERSION < 3
38644 PyObject* owned_ref = NULL;
38646 int s1_is_unicode, s2_is_unicode;
38650 s1_is_unicode = PyUnicode_CheckExact(s1);
38651 s2_is_unicode = PyUnicode_CheckExact(s2);
38652 #if PY_MAJOR_VERSION < 3
38653 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
38654 owned_ref = PyUnicode_FromObject(s2);
38655 if (unlikely(!owned_ref))
38659 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
38660 owned_ref = PyUnicode_FromObject(s1);
38661 if (unlikely(!owned_ref))
38665 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
38666 return __Pyx_PyBytes_Equals(s1, s2, equals);
38669 if (s1_is_unicode & s2_is_unicode) {
38672 void *data1, *data2;
38673 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
38675 length = __Pyx_PyUnicode_GET_LENGTH(s1);
38676 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
38679 #if CYTHON_USE_UNICODE_INTERNALS
38681 Py_hash_t hash1, hash2;
38682 #if CYTHON_PEP393_ENABLED
38683 hash1 = ((PyASCIIObject*)s1)->hash;
38684 hash2 = ((PyASCIIObject*)s2)->hash;
38686 hash1 = ((PyUnicodeObject*)s1)->hash;
38687 hash2 = ((PyUnicodeObject*)s2)->hash;
38689 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
38694 kind = __Pyx_PyUnicode_KIND(s1);
38695 if (kind != __Pyx_PyUnicode_KIND(s2)) {
38698 data1 = __Pyx_PyUnicode_DATA(s1);
38699 data2 = __Pyx_PyUnicode_DATA(s2);
38700 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
38702 } else if (length == 1) {
38705 int result = memcmp(data1, data2, (size_t)(length * kind));
38706 #if PY_MAJOR_VERSION < 3
38707 Py_XDECREF(owned_ref);
38709 return (equals == Py_EQ) ? (result == 0) : (result != 0);
38711 } else if ((s1 == Py_None) & s2_is_unicode) {
38713 } else if ((s2 == Py_None) & s1_is_unicode) {
38717 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
38718 #if PY_MAJOR_VERSION < 3
38719 Py_XDECREF(owned_ref);
38723 result = __Pyx_PyObject_IsTrue(py_result);
38724 Py_DECREF(py_result);
38728 #if PY_MAJOR_VERSION < 3
38729 Py_XDECREF(owned_ref);
38731 return (equals == Py_EQ);
38733 #if PY_MAJOR_VERSION < 3
38734 Py_XDECREF(owned_ref);
38736 return (equals == Py_NE);
38740 /* JoinPyUnicode */
38741 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
38742 CYTHON_UNUSED Py_UCS4 max_char) {
38743 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38744 PyObject *result_uval;
38746 Py_ssize_t i, char_pos;
38747 void *result_udata;
38748 #if CYTHON_PEP393_ENABLED
38749 result_uval = PyUnicode_New(result_ulength, max_char);
38750 if (unlikely(!result_uval)) return NULL;
38751 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
38752 result_udata = PyUnicode_DATA(result_uval);
38754 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
38755 if (unlikely(!result_uval)) return NULL;
38756 result_ukind = sizeof(Py_UNICODE);
38757 result_udata = PyUnicode_AS_UNICODE(result_uval);
38760 for (i=0; i < value_count; i++) {
38762 Py_ssize_t ulength;
38764 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
38765 if (unlikely(__Pyx_PyUnicode_READY(uval)))
38767 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
38768 if (unlikely(!ulength))
38770 if (unlikely(char_pos + ulength < 0))
38772 ukind = __Pyx_PyUnicode_KIND(uval);
38773 udata = __Pyx_PyUnicode_DATA(uval);
38774 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
38775 memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
38777 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
38778 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
38781 for (j=0; j < ulength; j++) {
38782 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
38783 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
38787 char_pos += ulength;
38789 return result_uval;
38791 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
38793 Py_DECREF(result_uval);
38798 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
38802 /* PyErrFetchRestore */
38803 #if CYTHON_FAST_THREAD_STATE
38804 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
38805 PyObject *tmp_type, *tmp_value, *tmp_tb;
38806 tmp_type = tstate->curexc_type;
38807 tmp_value = tstate->curexc_value;
38808 tmp_tb = tstate->curexc_traceback;
38809 tstate->curexc_type = type;
38810 tstate->curexc_value = value;
38811 tstate->curexc_traceback = tb;
38812 Py_XDECREF(tmp_type);
38813 Py_XDECREF(tmp_value);
38814 Py_XDECREF(tmp_tb);
38816 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
38817 *type = tstate->curexc_type;
38818 *value = tstate->curexc_value;
38819 *tb = tstate->curexc_traceback;
38820 tstate->curexc_type = 0;
38821 tstate->curexc_value = 0;
38822 tstate->curexc_traceback = 0;
38826 /* RaiseException */
38827 #if PY_MAJOR_VERSION < 3
38828 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
38829 CYTHON_UNUSED PyObject *cause) {
38830 __Pyx_PyThreadState_declare
38832 if (!value || value == Py_None)
38836 if (!tb || tb == Py_None)
38840 if (!PyTraceBack_Check(tb)) {
38841 PyErr_SetString(PyExc_TypeError,
38842 "raise: arg 3 must be a traceback or None");
38846 if (PyType_Check(type)) {
38847 #if CYTHON_COMPILING_IN_PYPY
38849 Py_INCREF(Py_None);
38853 PyErr_NormalizeException(&type, &value, &tb);
38856 PyErr_SetString(PyExc_TypeError,
38857 "instance exception may not have a separate value");
38861 type = (PyObject*) Py_TYPE(type);
38863 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
38864 PyErr_SetString(PyExc_TypeError,
38865 "raise: exception class must be a subclass of BaseException");
38869 __Pyx_PyThreadState_assign
38870 __Pyx_ErrRestore(type, value, tb);
38879 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
38880 PyObject* owned_instance = NULL;
38881 if (tb == Py_None) {
38883 } else if (tb && !PyTraceBack_Check(tb)) {
38884 PyErr_SetString(PyExc_TypeError,
38885 "raise: arg 3 must be a traceback or None");
38888 if (value == Py_None)
38890 if (PyExceptionInstance_Check(type)) {
38892 PyErr_SetString(PyExc_TypeError,
38893 "instance exception may not have a separate value");
38897 type = (PyObject*) Py_TYPE(value);
38898 } else if (PyExceptionClass_Check(type)) {
38899 PyObject *instance_class = NULL;
38900 if (value && PyExceptionInstance_Check(value)) {
38901 instance_class = (PyObject*) Py_TYPE(value);
38902 if (instance_class != type) {
38903 int is_subclass = PyObject_IsSubclass(instance_class, type);
38904 if (!is_subclass) {
38905 instance_class = NULL;
38906 } else if (unlikely(is_subclass == -1)) {
38909 type = instance_class;
38913 if (!instance_class) {
38916 args = PyTuple_New(0);
38917 else if (PyTuple_Check(value)) {
38921 args = PyTuple_Pack(1, value);
38924 owned_instance = PyObject_Call(type, args, NULL);
38926 if (!owned_instance)
38928 value = owned_instance;
38929 if (!PyExceptionInstance_Check(value)) {
38930 PyErr_Format(PyExc_TypeError,
38931 "calling %R should have returned an instance of "
38932 "BaseException, not %R",
38933 type, Py_TYPE(value));
38938 PyErr_SetString(PyExc_TypeError,
38939 "raise: exception class must be a subclass of BaseException");
38943 PyObject *fixed_cause;
38944 if (cause == Py_None) {
38945 fixed_cause = NULL;
38946 } else if (PyExceptionClass_Check(cause)) {
38947 fixed_cause = PyObject_CallObject(cause, NULL);
38948 if (fixed_cause == NULL)
38950 } else if (PyExceptionInstance_Check(cause)) {
38951 fixed_cause = cause;
38952 Py_INCREF(fixed_cause);
38954 PyErr_SetString(PyExc_TypeError,
38955 "exception causes must derive from "
38959 PyException_SetCause(value, fixed_cause);
38961 PyErr_SetObject(type, value);
38963 #if CYTHON_COMPILING_IN_PYPY
38964 PyObject *tmp_type, *tmp_value, *tmp_tb;
38965 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
38967 PyErr_Restore(tmp_type, tmp_value, tb);
38968 Py_XDECREF(tmp_tb);
38970 PyThreadState *tstate = __Pyx_PyThreadState_Current;
38971 PyObject* tmp_tb = tstate->curexc_traceback;
38972 if (tb != tmp_tb) {
38974 tstate->curexc_traceback = tb;
38975 Py_XDECREF(tmp_tb);
38980 Py_XDECREF(owned_instance);
38986 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
38988 if (!j) return NULL;
38989 r = PyObject_GetItem(o, j);
38993 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
38994 CYTHON_NCP_UNUSED int wraparound,
38995 CYTHON_NCP_UNUSED int boundscheck) {
38996 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38997 Py_ssize_t wrapped_i = i;
38998 if (wraparound & unlikely(i < 0)) {
38999 wrapped_i += PyList_GET_SIZE(o);
39001 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
39002 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
39006 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
39008 return PySequence_GetItem(o, i);
39011 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
39012 CYTHON_NCP_UNUSED int wraparound,
39013 CYTHON_NCP_UNUSED int boundscheck) {
39014 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
39015 Py_ssize_t wrapped_i = i;
39016 if (wraparound & unlikely(i < 0)) {
39017 wrapped_i += PyTuple_GET_SIZE(o);
39019 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
39020 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
39024 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
39026 return PySequence_GetItem(o, i);
39029 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
39030 CYTHON_NCP_UNUSED int wraparound,
39031 CYTHON_NCP_UNUSED int boundscheck) {
39032 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
39033 if (is_list || PyList_CheckExact(o)) {
39034 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
39035 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
39036 PyObject *r = PyList_GET_ITEM(o, n);
39041 else if (PyTuple_CheckExact(o)) {
39042 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
39043 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
39044 PyObject *r = PyTuple_GET_ITEM(o, n);
39049 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
39050 if (likely(m && m->sq_item)) {
39051 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
39052 Py_ssize_t l = m->sq_length(o);
39053 if (likely(l >= 0)) {
39056 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
39061 return m->sq_item(o, i);
39065 if (is_list || PySequence_Check(o)) {
39066 return PySequence_GetItem(o, i);
39069 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
39072 /* ObjectGetItem */
39073 #if CYTHON_USE_TYPE_SLOTS
39074 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
39076 Py_ssize_t key_value;
39077 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
39078 if (unlikely(!(m && m->sq_item))) {
39079 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
39082 key_value = __Pyx_PyIndex_AsSsize_t(index);
39083 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
39084 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
39086 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
39088 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
39092 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
39093 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
39094 if (likely(m && m->mp_subscript)) {
39095 return m->mp_subscript(obj, key);
39097 return __Pyx_PyObject_GetIndex(obj, key);
39101 /* PyObjectSetAttrStr */
39102 #if CYTHON_USE_TYPE_SLOTS
39103 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
39104 PyTypeObject* tp = Py_TYPE(obj);
39105 if (likely(tp->tp_setattro))
39106 return tp->tp_setattro(obj, attr_name, value);
39107 #if PY_MAJOR_VERSION < 3
39108 if (likely(tp->tp_setattr))
39109 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
39111 return PyObject_SetAttr(obj, attr_name, value);
39116 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
39117 Py_ssize_t cstart, Py_ssize_t cstop,
39118 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
39119 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
39120 #if CYTHON_USE_TYPE_SLOTS
39121 PyMappingMethods* mp;
39122 #if PY_MAJOR_VERSION < 3
39123 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
39124 if (likely(ms && ms->sq_ass_slice)) {
39126 if (_py_start && (*_py_start != Py_None)) {
39127 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
39128 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
39133 if (_py_stop && (*_py_stop != Py_None)) {
39134 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
39135 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
39137 cstop = PY_SSIZE_T_MAX;
39139 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
39140 Py_ssize_t l = ms->sq_length(obj);
39141 if (likely(l >= 0)) {
39144 if (cstop < 0) cstop = 0;
39148 if (cstart < 0) cstart = 0;
39151 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
39156 return ms->sq_ass_slice(obj, cstart, cstop, value);
39159 mp = Py_TYPE(obj)->tp_as_mapping;
39160 if (likely(mp && mp->mp_ass_subscript))
39164 PyObject *py_slice, *py_start, *py_stop;
39166 py_slice = *_py_slice;
39168 PyObject* owned_start = NULL;
39169 PyObject* owned_stop = NULL;
39171 py_start = *_py_start;
39174 owned_start = py_start = PyInt_FromSsize_t(cstart);
39175 if (unlikely(!py_start)) goto bad;
39177 py_start = Py_None;
39180 py_stop = *_py_stop;
39183 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
39184 if (unlikely(!py_stop)) {
39185 Py_XDECREF(owned_start);
39191 py_slice = PySlice_New(py_start, py_stop, Py_None);
39192 Py_XDECREF(owned_start);
39193 Py_XDECREF(owned_stop);
39194 if (unlikely(!py_slice)) goto bad;
39196 #if CYTHON_USE_TYPE_SLOTS
39197 result = mp->mp_ass_subscript(obj, py_slice, value);
39199 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
39202 Py_DECREF(py_slice);
39206 PyErr_Format(PyExc_TypeError,
39207 "'%.200s' object does not support slice %.10s",
39208 Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
39213 /* UnpackUnboundCMethod */
39214 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
39216 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
39217 if (unlikely(!method))
39219 target->method = method;
39220 #if CYTHON_COMPILING_IN_CPYTHON
39221 #if PY_MAJOR_VERSION >= 3
39222 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
39225 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
39226 target->func = descr->d_method->ml_meth;
39227 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
39233 /* CallUnboundCMethod1 */
39234 #if CYTHON_COMPILING_IN_CPYTHON
39235 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
39236 if (likely(cfunc->func)) {
39237 int flag = cfunc->flag;
39238 if (flag == METH_O) {
39239 return (*(cfunc->func))(self, arg);
39240 } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
39241 if (PY_VERSION_HEX >= 0x030700A0) {
39242 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
39244 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
39246 } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
39247 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
39250 return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
39253 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
39254 PyObject *args, *result = NULL;
39255 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
39256 #if CYTHON_COMPILING_IN_CPYTHON
39257 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
39258 args = PyTuple_New(1);
39259 if (unlikely(!args)) goto bad;
39261 PyTuple_SET_ITEM(args, 0, arg);
39262 if (cfunc->flag & METH_KEYWORDS)
39263 result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
39265 result = (*cfunc->func)(self, args);
39267 args = PyTuple_New(2);
39268 if (unlikely(!args)) goto bad;
39270 PyTuple_SET_ITEM(args, 0, self);
39272 PyTuple_SET_ITEM(args, 1, arg);
39273 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39276 args = PyTuple_Pack(2, self, arg);
39277 if (unlikely(!args)) goto bad;
39278 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39285 /* CallUnboundCMethod2 */
39286 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
39287 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
39288 if (likely(cfunc->func)) {
39289 PyObject *args[2] = {arg1, arg2};
39290 if (cfunc->flag == METH_FASTCALL) {
39291 #if PY_VERSION_HEX >= 0x030700A0
39292 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
39294 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
39297 #if PY_VERSION_HEX >= 0x030700A0
39298 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
39299 return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
39302 return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
39305 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
39306 PyObject *args, *result = NULL;
39307 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
39308 #if CYTHON_COMPILING_IN_CPYTHON
39309 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
39310 args = PyTuple_New(2);
39311 if (unlikely(!args)) goto bad;
39313 PyTuple_SET_ITEM(args, 0, arg1);
39315 PyTuple_SET_ITEM(args, 1, arg2);
39316 if (cfunc->flag & METH_KEYWORDS)
39317 result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
39319 result = (*cfunc->func)(self, args);
39321 args = PyTuple_New(3);
39322 if (unlikely(!args)) goto bad;
39324 PyTuple_SET_ITEM(args, 0, self);
39326 PyTuple_SET_ITEM(args, 1, arg1);
39328 PyTuple_SET_ITEM(args, 2, arg2);
39329 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39332 args = PyTuple_Pack(3, self, arg1, arg2);
39333 if (unlikely(!args)) goto bad;
39334 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
39341 /* dict_getitem_default */
39342 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
39344 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
39345 value = PyDict_GetItemWithError(d, key);
39346 if (unlikely(!value)) {
39347 if (unlikely(PyErr_Occurred()))
39349 value = default_value;
39354 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
39355 value = PyDict_GetItem(d, key);
39356 if (unlikely(!value)) {
39357 value = default_value;
39363 if (default_value == Py_None)
39364 value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
39366 value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
39372 static const char DIGIT_PAIRS_10[2*10*10+1] = {
39373 "00010203040506070809"
39374 "10111213141516171819"
39375 "20212223242526272829"
39376 "30313233343536373839"
39377 "40414243444546474849"
39378 "50515253545556575859"
39379 "60616263646566676869"
39380 "70717273747576777879"
39381 "80818283848586878889"
39382 "90919293949596979899"
39384 static const char DIGIT_PAIRS_8[2*8*8+1] = {
39394 static const char DIGITS_HEX[2*16+1] = {
39399 /* BuildPyUnicode */
39400 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
39401 int prepend_sign, char padding_char) {
39403 Py_ssize_t uoffset = ulength - clength;
39404 #if CYTHON_USE_UNICODE_INTERNALS
39406 #if CYTHON_PEP393_ENABLED
39408 uval = PyUnicode_New(ulength, 127);
39409 if (unlikely(!uval)) return NULL;
39410 udata = PyUnicode_DATA(uval);
39413 uval = PyUnicode_FromUnicode(NULL, ulength);
39414 if (unlikely(!uval)) return NULL;
39415 udata = PyUnicode_AS_UNICODE(uval);
39419 if (prepend_sign) {
39420 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
39423 for (; i < uoffset; i++) {
39424 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
39427 for (i=0; i < clength; i++) {
39428 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
39432 PyObject *sign = NULL, *padding = NULL;
39435 prepend_sign = !!prepend_sign;
39436 if (uoffset > prepend_sign) {
39437 padding = PyUnicode_FromOrdinal(padding_char);
39438 if (likely(padding) && uoffset > prepend_sign + 1) {
39440 PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
39441 if (unlikely(!repeat)) goto done_or_error;
39442 tmp = PyNumber_Multiply(padding, repeat);
39444 Py_DECREF(padding);
39447 if (unlikely(!padding)) goto done_or_error;
39449 if (prepend_sign) {
39450 sign = PyUnicode_FromOrdinal('-');
39451 if (unlikely(!sign)) goto done_or_error;
39454 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
39455 if (likely(uval) && padding) {
39456 PyObject *tmp = PyNumber_Add(padding, uval);
39460 if (likely(uval) && sign) {
39461 PyObject *tmp = PyNumber_Add(sign, uval);
39466 Py_XDECREF(padding);
39473 /* CIntToPyUnicode */
39475 #ifndef _MSC_STDINT_H_
39476 #if _MSC_VER < 1300
39477 typedef unsigned short uint16_t;
39479 typedef unsigned __int16 uint16_t;
39483 #include <stdint.h>
39485 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
39486 #define GCC_DIAGNOSTIC
39488 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
39489 char digits[sizeof(Py_ssize_t)*3+2];
39490 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
39491 const char *hex_digits = DIGITS_HEX;
39492 Py_ssize_t length, ulength;
39493 int prepend_sign, last_one_off;
39494 Py_ssize_t remaining;
39495 #ifdef GCC_DIAGNOSTIC
39496 #pragma GCC diagnostic push
39497 #pragma GCC diagnostic ignored "-Wconversion"
39499 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
39500 #ifdef GCC_DIAGNOSTIC
39501 #pragma GCC diagnostic pop
39503 const int is_unsigned = neg_one > const_zero;
39504 if (format_char == 'X') {
39513 switch (format_char) {
39515 digit_pos = abs((int)(remaining % (8*8)));
39516 remaining = (Py_ssize_t) (remaining / (8*8));
39518 *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos];
39519 last_one_off = (digit_pos < 8);
39522 digit_pos = abs((int)(remaining % (10*10)));
39523 remaining = (Py_ssize_t) (remaining / (10*10));
39525 *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos];
39526 last_one_off = (digit_pos < 10);
39529 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
39530 remaining = (Py_ssize_t) (remaining / 16);
39536 } while (unlikely(remaining != 0));
39537 if (last_one_off) {
39538 assert(*dpos == '0');
39541 length = end - dpos;
39544 if (!is_unsigned && value <= neg_one) {
39545 if (padding_char == ' ' || width <= length + 1) {
39553 if (width > ulength) {
39556 if (ulength == 1) {
39557 return PyUnicode_FromOrdinal(*dpos);
39559 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
39563 #if !CYTHON_COMPILING_IN_PYPY
39564 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
39566 (void)zerodivision_check;
39567 #if PY_MAJOR_VERSION < 3
39568 if (likely(PyInt_CheckExact(op1))) {
39569 const long b = intval;
39571 long a = PyInt_AS_LONG(op1);
39572 x = (long)((unsigned long)a - b);
39573 if (likely((x^a) >= 0 || (x^~b) >= 0))
39574 return PyInt_FromLong(x);
39575 return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
39578 #if CYTHON_USE_PYLONG_INTERNALS
39579 if (likely(PyLong_CheckExact(op1))) {
39580 const long b = intval;
39582 #ifdef HAVE_LONG_LONG
39583 const PY_LONG_LONG llb = intval;
39584 PY_LONG_LONG lla, llx;
39586 const digit* digits = ((PyLongObject*)op1)->ob_digit;
39587 const Py_ssize_t size = Py_SIZE(op1);
39588 if (likely(__Pyx_sst_abs(size) <= 1)) {
39589 a = likely(size) ? digits[0] : 0;
39590 if (size == -1) a = -a;
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 > 2 * PyLong_SHIFT) {
39606 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39608 #ifdef HAVE_LONG_LONG
39609 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39610 lla = (PY_LONG_LONG) (((((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 > 3 * PyLong_SHIFT) {
39628 a = (long) (((((((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 > 3 * PyLong_SHIFT) {
39632 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]));
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;
39649 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39650 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39652 #ifdef HAVE_LONG_LONG
39653 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39654 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]));
39658 CYTHON_FALLTHROUGH;
39659 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
39663 return PyLong_FromLong(x);
39664 #ifdef HAVE_LONG_LONG
39667 return PyLong_FromLongLong(llx);
39673 if (PyFloat_CheckExact(op1)) {
39674 const long b = intval;
39675 double a = PyFloat_AS_DOUBLE(op1);
39677 PyFPE_START_PROTECT("subtract", return NULL)
39678 result = ((double)a) - (double)b;
39679 PyFPE_END_PROTECT(result)
39680 return PyFloat_FromDouble(result);
39682 return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
39687 #if CYTHON_USE_PYLONG_INTERNALS
39688 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
39689 if (likely(Py_SIZE(n) == -1)) {
39690 return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
39692 #if CYTHON_COMPILING_IN_CPYTHON
39694 PyObject *copy = _PyLong_Copy((PyLongObject*)n);
39695 if (likely(copy)) {
39696 __Pyx_SET_SIZE(copy, -Py_SIZE(copy));
39701 return PyNumber_Negative(n);
39706 /* GetTopmostException */
39707 #if CYTHON_USE_EXC_INFO_STACK
39708 static _PyErr_StackItem *
39709 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
39711 _PyErr_StackItem *exc_info = tstate->exc_info;
39712 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
39713 exc_info->previous_item != NULL)
39715 exc_info = exc_info->previous_item;
39721 /* SaveResetException */
39722 #if CYTHON_FAST_THREAD_STATE
39723 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
39724 #if CYTHON_USE_EXC_INFO_STACK
39725 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
39726 *type = exc_info->exc_type;
39727 *value = exc_info->exc_value;
39728 *tb = exc_info->exc_traceback;
39730 *type = tstate->exc_type;
39731 *value = tstate->exc_value;
39732 *tb = tstate->exc_traceback;
39735 Py_XINCREF(*value);
39738 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
39739 PyObject *tmp_type, *tmp_value, *tmp_tb;
39740 #if CYTHON_USE_EXC_INFO_STACK
39741 _PyErr_StackItem *exc_info = tstate->exc_info;
39742 tmp_type = exc_info->exc_type;
39743 tmp_value = exc_info->exc_value;
39744 tmp_tb = exc_info->exc_traceback;
39745 exc_info->exc_type = type;
39746 exc_info->exc_value = value;
39747 exc_info->exc_traceback = tb;
39749 tmp_type = tstate->exc_type;
39750 tmp_value = tstate->exc_value;
39751 tmp_tb = tstate->exc_traceback;
39752 tstate->exc_type = type;
39753 tstate->exc_value = value;
39754 tstate->exc_traceback = tb;
39756 Py_XDECREF(tmp_type);
39757 Py_XDECREF(tmp_value);
39758 Py_XDECREF(tmp_tb);
39762 /* PyErrExceptionMatches */
39763 #if CYTHON_FAST_THREAD_STATE
39764 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
39766 n = PyTuple_GET_SIZE(tuple);
39767 #if PY_MAJOR_VERSION >= 3
39768 for (i=0; i<n; i++) {
39769 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
39772 for (i=0; i<n; i++) {
39773 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
39777 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
39778 PyObject *exc_type = tstate->curexc_type;
39779 if (exc_type == err) return 1;
39780 if (unlikely(!exc_type)) return 0;
39781 if (unlikely(PyTuple_Check(err)))
39782 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
39783 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
39788 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
39789 #if CYTHON_USE_TYPE_SLOTS
39790 #if PY_MAJOR_VERSION >= 3
39791 if (likely(PyUnicode_Check(n)))
39793 if (likely(PyString_Check(n)))
39795 return __Pyx_PyObject_GetAttrStr(o, n);
39797 return PyObject_GetAttr(o, n);
39801 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
39802 __Pyx_PyThreadState_declare
39803 __Pyx_PyThreadState_assign
39804 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
39806 __Pyx_PyErr_Clear();
39810 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
39811 PyObject *r = __Pyx_GetAttr(o, n);
39812 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
39816 static CYTHON_INLINE int __Pyx_IterFinish(void) {
39817 #if CYTHON_FAST_THREAD_STATE
39818 PyThreadState *tstate = __Pyx_PyThreadState_Current;
39819 PyObject* exc_type = tstate->curexc_type;
39820 if (unlikely(exc_type)) {
39821 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
39822 PyObject *exc_value, *exc_tb;
39823 exc_value = tstate->curexc_value;
39824 exc_tb = tstate->curexc_traceback;
39825 tstate->curexc_type = 0;
39826 tstate->curexc_value = 0;
39827 tstate->curexc_traceback = 0;
39828 Py_DECREF(exc_type);
39829 Py_XDECREF(exc_value);
39830 Py_XDECREF(exc_tb);
39838 if (unlikely(PyErr_Occurred())) {
39839 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
39850 /* UnpackItemEndCheck */
39851 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
39852 if (unlikely(retval)) {
39854 __Pyx_RaiseTooManyValuesError(expected);
39857 return __Pyx_IterFinish();
39863 #if !CYTHON_COMPILING_IN_PYPY
39864 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
39866 (void)zerodivision_check;
39867 #if PY_MAJOR_VERSION < 3
39868 if (likely(PyInt_CheckExact(op1))) {
39869 const long b = intval;
39871 long a = PyInt_AS_LONG(op1);
39872 x = (long)((unsigned long)a + b);
39873 if (likely((x^a) >= 0 || (x^b) >= 0))
39874 return PyInt_FromLong(x);
39875 return PyLong_Type.tp_as_number->nb_add(op1, op2);
39878 #if CYTHON_USE_PYLONG_INTERNALS
39879 if (likely(PyLong_CheckExact(op1))) {
39880 const long b = intval;
39882 #ifdef HAVE_LONG_LONG
39883 const PY_LONG_LONG llb = intval;
39884 PY_LONG_LONG lla, llx;
39886 const digit* digits = ((PyLongObject*)op1)->ob_digit;
39887 const Py_ssize_t size = Py_SIZE(op1);
39888 if (likely(__Pyx_sst_abs(size) <= 1)) {
39889 a = likely(size) ? digits[0] : 0;
39890 if (size == -1) a = -a;
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 > 2 * PyLong_SHIFT) {
39906 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39908 #ifdef HAVE_LONG_LONG
39909 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
39910 lla = (PY_LONG_LONG) (((((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 > 3 * PyLong_SHIFT) {
39928 a = (long) (((((((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 > 3 * PyLong_SHIFT) {
39932 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]));
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;
39949 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
39950 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
39952 #ifdef HAVE_LONG_LONG
39953 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
39954 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]));
39958 CYTHON_FALLTHROUGH;
39959 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
39963 return PyLong_FromLong(x);
39964 #ifdef HAVE_LONG_LONG
39967 return PyLong_FromLongLong(llx);
39973 if (PyFloat_CheckExact(op1)) {
39974 const long b = intval;
39975 double a = PyFloat_AS_DOUBLE(op1);
39977 PyFPE_START_PROTECT("add", return NULL)
39978 result = ((double)a) + (double)b;
39979 PyFPE_END_PROTECT(result)
39980 return PyFloat_FromDouble(result);
39982 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
39987 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
39991 #if PY_MAJOR_VERSION < 3
39992 if (likely(PyInt_CheckExact(op1))) {
39993 const long b = intval;
39994 long a = PyInt_AS_LONG(op1);
39995 if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
39998 #if CYTHON_USE_PYLONG_INTERNALS
39999 if (likely(PyLong_CheckExact(op1))) {
40001 unsigned long uintval;
40002 Py_ssize_t size = Py_SIZE(op1);
40003 const digit* digits = ((PyLongObject*)op1)->ob_digit;
40005 if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40006 } else if (intval < 0) {
40015 uintval = (unsigned long) intval;
40016 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
40017 if (uintval >> (PyLong_SHIFT * 4)) {
40018 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40019 | (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));
40022 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
40023 if (uintval >> (PyLong_SHIFT * 3)) {
40024 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40025 | (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));
40028 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
40029 if (uintval >> (PyLong_SHIFT * 2)) {
40030 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40031 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40034 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
40035 if (uintval >> (PyLong_SHIFT * 1)) {
40036 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40037 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40040 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
40041 if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40044 if (PyFloat_CheckExact(op1)) {
40045 const long b = intval;
40046 double a = PyFloat_AS_DOUBLE(op1);
40047 if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40050 PyObject_RichCompare(op1, op2, Py_EQ));
40053 /* CallUnboundCMethod0 */
40054 static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
40055 PyObject *args, *result = NULL;
40056 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
40057 #if CYTHON_ASSUME_SAFE_MACROS
40058 args = PyTuple_New(1);
40059 if (unlikely(!args)) goto bad;
40061 PyTuple_SET_ITEM(args, 0, self);
40063 args = PyTuple_Pack(1, self);
40064 if (unlikely(!args)) goto bad;
40066 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
40072 /* py_dict_items */
40073 static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
40074 if (PY_MAJOR_VERSION >= 3)
40075 return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
40077 return PyDict_Items(d);
40080 /* pyfrozenset_new */
40081 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
40084 #if CYTHON_COMPILING_IN_PYPY
40086 args = PyTuple_Pack(1, it);
40087 if (unlikely(!args))
40089 result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
40093 if (PyFrozenSet_CheckExact(it)) {
40097 result = PyFrozenSet_New(it);
40098 if (unlikely(!result))
40100 if (likely(PySet_GET_SIZE(result)))
40105 #if CYTHON_USE_TYPE_SLOTS
40106 return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
40108 return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
40112 /* PySetContains */
40113 static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
40115 if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
40118 tmpkey = __Pyx_PyFrozenSet_New(key);
40119 if (tmpkey != NULL) {
40120 result = PySet_Contains(set, tmpkey);
40126 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
40127 int result = PySet_Contains(set, key);
40128 if (unlikely(result < 0)) {
40129 result = __Pyx_PySet_ContainsUnhashable(set, key);
40131 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
40134 /* py_dict_values */
40135 static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
40136 if (PY_MAJOR_VERSION >= 3)
40137 return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
40139 return PyDict_Values(d);
40142 /* KeywordStringCheck */
40143 static int __Pyx_CheckKeywordStrings(
40145 const char* function_name,
40149 Py_ssize_t pos = 0;
40150 #if CYTHON_COMPILING_IN_PYPY
40151 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
40152 goto invalid_keyword;
40155 while (PyDict_Next(kwdict, &pos, &key, 0)) {
40156 #if PY_MAJOR_VERSION < 3
40157 if (unlikely(!PyString_Check(key)))
40159 if (unlikely(!PyUnicode_Check(key)))
40160 goto invalid_keyword_type;
40162 if ((!kw_allowed) && unlikely(key))
40163 goto invalid_keyword;
40165 invalid_keyword_type:
40166 PyErr_Format(PyExc_TypeError,
40167 "%.200s() keywords must be strings", function_name);
40171 PyErr_Format(PyExc_TypeError,
40172 #if PY_MAJOR_VERSION < 3
40173 "%.200s() got an unexpected keyword argument '%.200s'",
40174 function_name, PyString_AsString(key));
40176 "%s() got an unexpected keyword argument '%U'",
40177 function_name, key);
40183 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
40185 if (unlikely(!type)) {
40186 PyErr_SetString(PyExc_SystemError, "Missing type object");
40190 #if PY_MAJOR_VERSION == 2
40191 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
40195 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
40197 PyErr_Format(PyExc_TypeError,
40198 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
40199 name, type->tp_name, Py_TYPE(obj)->tp_name);
40203 /* PyUnicode_Unicode */
40204 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
40205 if (unlikely(obj == Py_None))
40206 obj = __pyx_n_u_None;
40207 return __Pyx_NewRef(obj);
40210 /* PyObjectFormatAndDecref */
40211 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
40212 if (unlikely(!s)) return NULL;
40213 if (likely(PyUnicode_CheckExact(s))) return s;
40214 #if PY_MAJOR_VERSION < 3
40215 if (likely(PyString_CheckExact(s))) {
40216 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
40221 return __Pyx_PyObject_FormatAndDecref(s, f);
40223 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
40224 PyObject *result = PyObject_Format(s, f);
40230 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
40231 Py_ssize_t cstart, Py_ssize_t cstop,
40232 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
40233 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
40234 #if CYTHON_USE_TYPE_SLOTS
40235 PyMappingMethods* mp;
40236 #if PY_MAJOR_VERSION < 3
40237 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
40238 if (likely(ms && ms->sq_slice)) {
40240 if (_py_start && (*_py_start != Py_None)) {
40241 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
40242 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
40247 if (_py_stop && (*_py_stop != Py_None)) {
40248 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
40249 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
40251 cstop = PY_SSIZE_T_MAX;
40253 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
40254 Py_ssize_t l = ms->sq_length(obj);
40255 if (likely(l >= 0)) {
40258 if (cstop < 0) cstop = 0;
40262 if (cstart < 0) cstart = 0;
40265 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
40270 return ms->sq_slice(obj, cstart, cstop);
40273 mp = Py_TYPE(obj)->tp_as_mapping;
40274 if (likely(mp && mp->mp_subscript))
40278 PyObject *py_slice, *py_start, *py_stop;
40280 py_slice = *_py_slice;
40282 PyObject* owned_start = NULL;
40283 PyObject* owned_stop = NULL;
40285 py_start = *_py_start;
40288 owned_start = py_start = PyInt_FromSsize_t(cstart);
40289 if (unlikely(!py_start)) goto bad;
40291 py_start = Py_None;
40294 py_stop = *_py_stop;
40297 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
40298 if (unlikely(!py_stop)) {
40299 Py_XDECREF(owned_start);
40305 py_slice = PySlice_New(py_start, py_stop, Py_None);
40306 Py_XDECREF(owned_start);
40307 Py_XDECREF(owned_stop);
40308 if (unlikely(!py_slice)) goto bad;
40310 #if CYTHON_USE_TYPE_SLOTS
40311 result = mp->mp_subscript(obj, py_slice);
40313 result = PyObject_GetItem(obj, py_slice);
40316 Py_DECREF(py_slice);
40320 PyErr_Format(PyExc_TypeError,
40321 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
40327 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
40328 PyObject *empty_list = 0;
40329 PyObject *module = 0;
40330 PyObject *global_dict = 0;
40331 PyObject *empty_dict = 0;
40333 #if PY_MAJOR_VERSION < 3
40334 PyObject *py_import;
40335 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
40342 empty_list = PyList_New(0);
40347 global_dict = PyModule_GetDict(__pyx_m);
40350 empty_dict = PyDict_New();
40354 #if PY_MAJOR_VERSION >= 3
40356 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
40357 module = PyImport_ImportModuleLevelObject(
40358 name, global_dict, empty_dict, list, 1);
40360 if (!PyErr_ExceptionMatches(PyExc_ImportError))
40369 #if PY_MAJOR_VERSION < 3
40370 PyObject *py_level = PyInt_FromLong(level);
40373 module = PyObject_CallFunctionObjArgs(py_import,
40374 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
40375 Py_DECREF(py_level);
40377 module = PyImport_ImportModuleLevelObject(
40378 name, global_dict, empty_dict, list, level);
40383 #if PY_MAJOR_VERSION < 3
40384 Py_XDECREF(py_import);
40386 Py_XDECREF(empty_list);
40387 Py_XDECREF(empty_dict);
40392 #if CYTHON_FAST_THREAD_STATE
40393 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
40395 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
40398 PyObject *local_type, *local_value, *local_tb;
40399 #if CYTHON_FAST_THREAD_STATE
40400 PyObject *tmp_type, *tmp_value, *tmp_tb;
40401 local_type = tstate->curexc_type;
40402 local_value = tstate->curexc_value;
40403 local_tb = tstate->curexc_traceback;
40404 tstate->curexc_type = 0;
40405 tstate->curexc_value = 0;
40406 tstate->curexc_traceback = 0;
40408 PyErr_Fetch(&local_type, &local_value, &local_tb);
40410 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
40411 #if CYTHON_FAST_THREAD_STATE
40412 if (unlikely(tstate->curexc_type))
40414 if (unlikely(PyErr_Occurred()))
40417 #if PY_MAJOR_VERSION >= 3
40419 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
40423 Py_XINCREF(local_tb);
40424 Py_XINCREF(local_type);
40425 Py_XINCREF(local_value);
40426 *type = local_type;
40427 *value = local_value;
40429 #if CYTHON_FAST_THREAD_STATE
40430 #if CYTHON_USE_EXC_INFO_STACK
40432 _PyErr_StackItem *exc_info = tstate->exc_info;
40433 tmp_type = exc_info->exc_type;
40434 tmp_value = exc_info->exc_value;
40435 tmp_tb = exc_info->exc_traceback;
40436 exc_info->exc_type = local_type;
40437 exc_info->exc_value = local_value;
40438 exc_info->exc_traceback = local_tb;
40441 tmp_type = tstate->exc_type;
40442 tmp_value = tstate->exc_value;
40443 tmp_tb = tstate->exc_traceback;
40444 tstate->exc_type = local_type;
40445 tstate->exc_value = local_value;
40446 tstate->exc_traceback = local_tb;
40448 Py_XDECREF(tmp_type);
40449 Py_XDECREF(tmp_value);
40450 Py_XDECREF(tmp_tb);
40452 PyErr_SetExcInfo(local_type, local_value, local_tb);
40459 Py_XDECREF(local_type);
40460 Py_XDECREF(local_value);
40461 Py_XDECREF(local_tb);
40466 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
40470 #if PY_MAJOR_VERSION < 3
40471 if (likely(PyInt_CheckExact(op1))) {
40472 const long b = intval;
40473 long a = PyInt_AS_LONG(op1);
40474 if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40477 #if CYTHON_USE_PYLONG_INTERNALS
40478 if (likely(PyLong_CheckExact(op1))) {
40480 unsigned long uintval;
40481 Py_ssize_t size = Py_SIZE(op1);
40482 const digit* digits = ((PyLongObject*)op1)->ob_digit;
40484 if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40485 } else if (intval < 0) {
40494 uintval = (unsigned long) intval;
40495 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
40496 if (uintval >> (PyLong_SHIFT * 4)) {
40497 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40498 | (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));
40501 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
40502 if (uintval >> (PyLong_SHIFT * 3)) {
40503 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40504 | (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));
40507 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
40508 if (uintval >> (PyLong_SHIFT * 2)) {
40509 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40510 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40513 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
40514 if (uintval >> (PyLong_SHIFT * 1)) {
40515 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
40516 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
40519 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
40520 if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40523 if (PyFloat_CheckExact(op1)) {
40524 const long b = intval;
40525 double a = PyFloat_AS_DOUBLE(op1);
40526 if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
40529 PyObject_RichCompare(op1, op2, Py_NE));
40533 static int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
40536 r = PyObject_DelItem(o, j);
40540 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
40541 CYTHON_UNUSED int is_list, CYTHON_NCP_UNUSED int wraparound) {
40542 #if !CYTHON_USE_TYPE_SLOTS
40543 if (is_list || PySequence_Check(o)) {
40544 return PySequence_DelItem(o, i);
40547 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
40548 if (likely(m && m->sq_ass_item)) {
40549 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
40550 Py_ssize_t l = m->sq_length(o);
40551 if (likely(l >= 0)) {
40554 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
40559 return m->sq_ass_item(o, i, (PyObject *)NULL);
40562 return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i));
40565 /* CallNextTpDealloc */
40566 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
40567 PyTypeObject* type = Py_TYPE(obj);
40568 while (type && type->tp_dealloc != current_tp_dealloc)
40569 type = type->tp_base;
40570 while (type && type->tp_dealloc == current_tp_dealloc)
40571 type = type->tp_base;
40573 type->tp_dealloc(obj);
40576 /* CallNextTpTraverse */
40577 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
40578 PyTypeObject* type = Py_TYPE(obj);
40579 while (type && type->tp_traverse != current_tp_traverse)
40580 type = type->tp_base;
40581 while (type && type->tp_traverse == current_tp_traverse)
40582 type = type->tp_base;
40583 if (type && type->tp_traverse)
40584 return type->tp_traverse(obj, v, a);
40588 /* CallNextTpClear */
40589 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
40590 PyTypeObject* type = Py_TYPE(obj);
40591 while (type && type->tp_clear != current_tp_clear)
40592 type = type->tp_base;
40593 while (type && type->tp_clear == current_tp_clear)
40594 type = type->tp_base;
40595 if (type && type->tp_clear)
40596 type->tp_clear(obj);
40599 /* PyObject_GenericGetAttrNoDict */
40600 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
40601 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
40602 PyErr_Format(PyExc_AttributeError,
40603 #if PY_MAJOR_VERSION >= 3
40604 "'%.50s' object has no attribute '%U'",
40605 tp->tp_name, attr_name);
40607 "'%.50s' object has no attribute '%.400s'",
40608 tp->tp_name, PyString_AS_STRING(attr_name));
40612 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
40614 PyTypeObject *tp = Py_TYPE(obj);
40615 if (unlikely(!PyString_Check(attr_name))) {
40616 return PyObject_GenericGetAttr(obj, attr_name);
40618 assert(!tp->tp_dictoffset);
40619 descr = _PyType_Lookup(tp, attr_name);
40620 if (unlikely(!descr)) {
40621 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
40624 #if PY_MAJOR_VERSION < 3
40625 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
40628 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
40630 PyObject *res = f(descr, obj, (PyObject *)tp);
40639 /* PyObject_GenericGetAttr */
40640 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
40641 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
40642 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
40643 return PyObject_GenericGetAttr(obj, attr_name);
40645 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
40650 #ifndef __PYX_HAVE_RT_ImportType
40651 #define __PYX_HAVE_RT_ImportType
40652 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
40653 size_t size, enum __Pyx_ImportType_CheckSize check_size)
40655 PyObject *result = 0;
40657 Py_ssize_t basicsize;
40658 #ifdef Py_LIMITED_API
40659 PyObject *py_basicsize;
40661 result = PyObject_GetAttrString(module, class_name);
40664 if (!PyType_Check(result)) {
40665 PyErr_Format(PyExc_TypeError,
40666 "%.200s.%.200s is not a type object",
40667 module_name, class_name);
40670 #ifndef Py_LIMITED_API
40671 basicsize = ((PyTypeObject *)result)->tp_basicsize;
40673 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
40676 basicsize = PyLong_AsSsize_t(py_basicsize);
40677 Py_DECREF(py_basicsize);
40679 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
40682 if ((size_t)basicsize < size) {
40683 PyErr_Format(PyExc_ValueError,
40684 "%.200s.%.200s size changed, may indicate binary incompatibility. "
40685 "Expected %zd from C header, got %zd from PyObject",
40686 module_name, class_name, size, basicsize);
40689 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
40690 PyErr_Format(PyExc_ValueError,
40691 "%.200s.%.200s size changed, may indicate binary incompatibility. "
40692 "Expected %zd from C header, got %zd from PyObject",
40693 module_name, class_name, size, basicsize);
40696 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
40697 PyOS_snprintf(warning, sizeof(warning),
40698 "%s.%s size changed, may indicate binary incompatibility. "
40699 "Expected %zd from C header, got %zd from PyObject",
40700 module_name, class_name, size, basicsize);
40701 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
40703 return (PyTypeObject *)result;
40705 Py_XDECREF(result);
40711 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
40712 #if PY_VERSION_HEX >= 0x02070000
40713 PyObject *ob = PyCapsule_New(vtable, 0, 0);
40715 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
40719 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
40729 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
40730 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
40731 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
40732 PyErr_Format(PyExc_ImportError,
40733 #if PY_MAJOR_VERSION < 3
40734 "cannot import name %.230s", PyString_AS_STRING(name));
40736 "cannot import name %S", name);
40742 /* FetchCommonType */
40743 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
40744 PyObject* fake_module;
40745 PyTypeObject* cached_type = NULL;
40746 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
40747 if (!fake_module) return NULL;
40748 Py_INCREF(fake_module);
40749 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
40751 if (!PyType_Check((PyObject*)cached_type)) {
40752 PyErr_Format(PyExc_TypeError,
40753 "Shared Cython type %.200s is not a type object",
40757 if (cached_type->tp_basicsize != type->tp_basicsize) {
40758 PyErr_Format(PyExc_TypeError,
40759 "Shared Cython type %.200s has the wrong size, try recompiling",
40764 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
40766 if (PyType_Ready(type) < 0) goto bad;
40767 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
40770 cached_type = type;
40773 Py_DECREF(fake_module);
40774 return cached_type;
40776 Py_XDECREF(cached_type);
40777 cached_type = NULL;
40781 /* CythonFunctionShared */
40782 #include <structmember.h>
40784 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
40786 if (unlikely(op->func_doc == NULL)) {
40787 if (op->func.m_ml->ml_doc) {
40788 #if PY_MAJOR_VERSION >= 3
40789 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
40791 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
40793 if (unlikely(op->func_doc == NULL))
40796 Py_INCREF(Py_None);
40800 Py_INCREF(op->func_doc);
40801 return op->func_doc;
40804 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40806 PyObject *tmp = op->func_doc;
40807 if (value == NULL) {
40811 op->func_doc = value;
40816 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40818 if (unlikely(op->func_name == NULL)) {
40819 #if PY_MAJOR_VERSION >= 3
40820 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
40822 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
40824 if (unlikely(op->func_name == NULL))
40827 Py_INCREF(op->func_name);
40828 return op->func_name;
40831 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40834 #if PY_MAJOR_VERSION >= 3
40835 if (unlikely(value == NULL || !PyUnicode_Check(value)))
40837 if (unlikely(value == NULL || !PyString_Check(value)))
40840 PyErr_SetString(PyExc_TypeError,
40841 "__name__ must be set to a string object");
40844 tmp = op->func_name;
40846 op->func_name = value;
40851 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40853 Py_INCREF(op->func_qualname);
40854 return op->func_qualname;
40857 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40860 #if PY_MAJOR_VERSION >= 3
40861 if (unlikely(value == NULL || !PyUnicode_Check(value)))
40863 if (unlikely(value == NULL || !PyString_Check(value)))
40866 PyErr_SetString(PyExc_TypeError,
40867 "__qualname__ must be set to a string object");
40870 tmp = op->func_qualname;
40872 op->func_qualname = value;
40877 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
40880 self = m->func_closure;
40887 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40889 if (unlikely(op->func_dict == NULL)) {
40890 op->func_dict = PyDict_New();
40891 if (unlikely(op->func_dict == NULL))
40894 Py_INCREF(op->func_dict);
40895 return op->func_dict;
40898 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
40901 if (unlikely(value == NULL)) {
40902 PyErr_SetString(PyExc_TypeError,
40903 "function's dictionary may not be deleted");
40906 if (unlikely(!PyDict_Check(value))) {
40907 PyErr_SetString(PyExc_TypeError,
40908 "setting function's dictionary to a non-dict");
40911 tmp = op->func_dict;
40913 op->func_dict = value;
40918 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40920 Py_INCREF(op->func_globals);
40921 return op->func_globals;
40924 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40926 Py_INCREF(Py_None);
40930 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
40932 PyObject* result = (op->func_code) ? op->func_code : Py_None;
40937 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
40939 PyObject *res = op->defaults_getter((PyObject *) op);
40940 if (unlikely(!res))
40942 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40943 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
40944 Py_INCREF(op->defaults_tuple);
40945 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
40946 Py_INCREF(op->defaults_kwdict);
40948 op->defaults_tuple = PySequence_ITEM(res, 0);
40949 if (unlikely(!op->defaults_tuple)) result = -1;
40951 op->defaults_kwdict = PySequence_ITEM(res, 1);
40952 if (unlikely(!op->defaults_kwdict)) result = -1;
40959 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
40963 } else if (value != Py_None && !PyTuple_Check(value)) {
40964 PyErr_SetString(PyExc_TypeError,
40965 "__defaults__ must be set to a tuple object");
40969 tmp = op->defaults_tuple;
40970 op->defaults_tuple = value;
40975 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
40976 PyObject* result = op->defaults_tuple;
40977 if (unlikely(!result)) {
40978 if (op->defaults_getter) {
40979 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
40980 result = op->defaults_tuple;
40989 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
40993 } else if (value != Py_None && !PyDict_Check(value)) {
40994 PyErr_SetString(PyExc_TypeError,
40995 "__kwdefaults__ must be set to a dict object");
40999 tmp = op->defaults_kwdict;
41000 op->defaults_kwdict = value;
41005 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
41006 PyObject* result = op->defaults_kwdict;
41007 if (unlikely(!result)) {
41008 if (op->defaults_getter) {
41009 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
41010 result = op->defaults_kwdict;
41019 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
41021 if (!value || value == Py_None) {
41023 } else if (!PyDict_Check(value)) {
41024 PyErr_SetString(PyExc_TypeError,
41025 "__annotations__ must be set to a dict object");
41029 tmp = op->func_annotations;
41030 op->func_annotations = value;
41035 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
41036 PyObject* result = op->func_annotations;
41037 if (unlikely(!result)) {
41038 result = PyDict_New();
41039 if (unlikely(!result)) return NULL;
41040 op->func_annotations = result;
41045 static PyGetSetDef __pyx_CyFunction_getsets[] = {
41046 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
41047 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
41048 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
41049 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
41050 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
41051 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
41052 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
41053 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
41054 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
41055 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
41056 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
41057 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
41058 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
41059 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
41060 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
41061 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
41062 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
41063 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
41066 static PyMemberDef __pyx_CyFunction_members[] = {
41067 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
41071 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
41073 #if PY_MAJOR_VERSION >= 3
41074 return PyUnicode_FromString(m->func.m_ml->ml_name);
41076 return PyString_FromString(m->func.m_ml->ml_name);
41079 static PyMethodDef __pyx_CyFunction_methods[] = {
41080 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
41083 #if PY_VERSION_HEX < 0x030500A0
41084 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
41086 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
41088 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
41089 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
41090 if (unlikely(op == NULL))
41093 __Pyx_CyFunction_weakreflist(op) = NULL;
41094 op->func.m_ml = ml;
41095 op->func.m_self = (PyObject *) op;
41096 Py_XINCREF(closure);
41097 op->func_closure = closure;
41098 Py_XINCREF(module);
41099 op->func.m_module = module;
41100 op->func_dict = NULL;
41101 op->func_name = NULL;
41102 Py_INCREF(qualname);
41103 op->func_qualname = qualname;
41104 op->func_doc = NULL;
41105 op->func_classobj = NULL;
41106 op->func_globals = globals;
41107 Py_INCREF(op->func_globals);
41109 op->func_code = code;
41110 op->defaults_pyobjects = 0;
41111 op->defaults_size = 0;
41112 op->defaults = NULL;
41113 op->defaults_tuple = NULL;
41114 op->defaults_kwdict = NULL;
41115 op->defaults_getter = NULL;
41116 op->func_annotations = NULL;
41117 return (PyObject *) op;
41120 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
41122 Py_CLEAR(m->func_closure);
41123 Py_CLEAR(m->func.m_module);
41124 Py_CLEAR(m->func_dict);
41125 Py_CLEAR(m->func_name);
41126 Py_CLEAR(m->func_qualname);
41127 Py_CLEAR(m->func_doc);
41128 Py_CLEAR(m->func_globals);
41129 Py_CLEAR(m->func_code);
41130 Py_CLEAR(m->func_classobj);
41131 Py_CLEAR(m->defaults_tuple);
41132 Py_CLEAR(m->defaults_kwdict);
41133 Py_CLEAR(m->func_annotations);
41135 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
41137 for (i = 0; i < m->defaults_pyobjects; i++)
41138 Py_XDECREF(pydefaults[i]);
41139 PyObject_Free(m->defaults);
41140 m->defaults = NULL;
41144 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
41146 if (__Pyx_CyFunction_weakreflist(m) != NULL)
41147 PyObject_ClearWeakRefs((PyObject *) m);
41148 __Pyx_CyFunction_clear(m);
41149 PyObject_GC_Del(m);
41151 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
41153 PyObject_GC_UnTrack(m);
41154 __Pyx__CyFunction_dealloc(m);
41156 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
41158 Py_VISIT(m->func_closure);
41159 Py_VISIT(m->func.m_module);
41160 Py_VISIT(m->func_dict);
41161 Py_VISIT(m->func_name);
41162 Py_VISIT(m->func_qualname);
41163 Py_VISIT(m->func_doc);
41164 Py_VISIT(m->func_globals);
41165 Py_VISIT(m->func_code);
41166 Py_VISIT(m->func_classobj);
41167 Py_VISIT(m->defaults_tuple);
41168 Py_VISIT(m->defaults_kwdict);
41170 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
41172 for (i = 0; i < m->defaults_pyobjects; i++)
41173 Py_VISIT(pydefaults[i]);
41177 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
41179 #if PY_MAJOR_VERSION < 3
41180 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41181 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
41185 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
41187 type = (PyObject *)(Py_TYPE(obj));
41188 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
41190 if (obj == Py_None)
41193 return __Pyx_PyMethod_New(func, obj, type);
41196 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
41198 #if PY_MAJOR_VERSION >= 3
41199 return PyUnicode_FromFormat("<cyfunction %U at %p>",
41200 op->func_qualname, (void *)op);
41202 return PyString_FromFormat("<cyfunction %s at %p>",
41203 PyString_AsString(op->func_qualname), (void *)op);
41206 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
41207 PyCFunctionObject* f = (PyCFunctionObject*)func;
41208 PyCFunction meth = f->m_ml->ml_meth;
41210 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
41212 if (likely(kw == NULL || PyDict_Size(kw) == 0))
41213 return (*meth)(self, arg);
41215 case METH_VARARGS | METH_KEYWORDS:
41216 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
41218 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
41219 size = PyTuple_GET_SIZE(arg);
41220 if (likely(size == 0))
41221 return (*meth)(self, NULL);
41222 PyErr_Format(PyExc_TypeError,
41223 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
41224 f->m_ml->ml_name, size);
41229 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
41230 size = PyTuple_GET_SIZE(arg);
41231 if (likely(size == 1)) {
41232 PyObject *result, *arg0;
41233 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41234 arg0 = PyTuple_GET_ITEM(arg, 0);
41236 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
41238 result = (*meth)(self, arg0);
41239 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
41244 PyErr_Format(PyExc_TypeError,
41245 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
41246 f->m_ml->ml_name, size);
41251 PyErr_SetString(PyExc_SystemError, "Bad call flags in "
41252 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
41253 "longer supported!");
41256 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
41260 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
41261 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
41263 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
41265 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
41266 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
41268 PyObject *new_args;
41270 argc = PyTuple_GET_SIZE(args);
41271 new_args = PyTuple_GetSlice(args, 1, argc);
41272 if (unlikely(!new_args))
41274 self = PyTuple_GetItem(args, 0);
41275 if (unlikely(!self)) {
41276 Py_DECREF(new_args);
41279 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
41280 Py_DECREF(new_args);
41282 result = __Pyx_CyFunction_Call(func, args, kw);
41286 static PyTypeObject __pyx_CyFunctionType_type = {
41287 PyVarObject_HEAD_INIT(0, 0)
41288 "cython_function_or_method",
41289 sizeof(__pyx_CyFunctionObject),
41291 (destructor) __Pyx_CyFunction_dealloc,
41295 #if PY_MAJOR_VERSION < 3
41300 (reprfunc) __Pyx_CyFunction_repr,
41305 __Pyx_CyFunction_CallAsMethod,
41310 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
41312 (traverseproc) __Pyx_CyFunction_traverse,
41313 (inquiry) __Pyx_CyFunction_clear,
41315 #if PY_VERSION_HEX < 0x030500A0
41316 offsetof(__pyx_CyFunctionObject, func_weakreflist),
41318 offsetof(PyCFunctionObject, m_weakreflist),
41322 __pyx_CyFunction_methods,
41323 __pyx_CyFunction_members,
41324 __pyx_CyFunction_getsets,
41327 __Pyx_CyFunction_descr_get,
41329 offsetof(__pyx_CyFunctionObject, func_dict),
41342 #if PY_VERSION_HEX >= 0x030400a1
41345 #if PY_VERSION_HEX >= 0x030800b1
41348 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
41352 static int __pyx_CyFunction_init(void) {
41353 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
41354 if (unlikely(__pyx_CyFunctionType == NULL)) {
41359 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
41360 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41361 m->defaults = PyObject_Malloc(size);
41362 if (unlikely(!m->defaults))
41363 return PyErr_NoMemory();
41364 memset(m->defaults, 0, size);
41365 m->defaults_pyobjects = pyobjects;
41366 m->defaults_size = size;
41367 return m->defaults;
41369 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
41370 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41371 m->defaults_tuple = tuple;
41374 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
41375 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41376 m->defaults_kwdict = dict;
41379 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
41380 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
41381 m->func_annotations = dict;
41385 /* CythonFunction */
41386 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
41387 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
41388 PyObject *op = __Pyx_CyFunction_Init(
41389 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
41390 ml, flags, qualname, closure, module, globals, code
41393 PyObject_GC_Track(op);
41398 /* RegisterModuleCleanup */
41399 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
41400 static PyObject* __pyx_module_cleanup_atexit(PyObject *module, CYTHON_UNUSED PyObject *unused) {
41401 __pyx_module_cleanup(module);
41402 Py_INCREF(Py_None); return Py_None;
41404 static int __Pyx_RegisterCleanup(void) {
41405 static PyMethodDef cleanup_def = {
41406 "__cleanup", (PyCFunction)__pyx_module_cleanup_atexit, METH_NOARGS, 0};
41407 PyObject *cleanup_func = 0;
41408 PyObject *atexit = 0;
41410 PyObject *args = 0;
41413 cleanup_func = PyCFunction_New(&cleanup_def, 0);
41416 atexit = PyImport_ImportModule("atexit");
41419 reg = PyObject_GetAttrString(atexit, "_exithandlers");
41420 if (reg && PyList_Check(reg)) {
41422 a = PyTuple_New(0);
41429 args = PyTuple_Pack(3, cleanup_func, a, kw);
41434 ret = PyList_Insert(reg, 0, args);
41439 reg = PyObject_GetAttrString(atexit, "register");
41442 args = PyTuple_Pack(1, cleanup_func);
41445 res = PyObject_CallObject(reg, args);
41451 Py_XDECREF(cleanup_func);
41452 Py_XDECREF(atexit);
41460 /* CLineInTraceback */
41461 #ifndef CYTHON_CLINE_IN_TRACEBACK
41462 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
41463 PyObject *use_cline;
41464 PyObject *ptype, *pvalue, *ptraceback;
41465 #if CYTHON_COMPILING_IN_CPYTHON
41466 PyObject **cython_runtime_dict;
41468 if (unlikely(!__pyx_cython_runtime)) {
41471 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
41472 #if CYTHON_COMPILING_IN_CPYTHON
41473 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
41474 if (likely(cython_runtime_dict)) {
41475 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
41476 use_cline, *cython_runtime_dict,
41477 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
41481 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
41482 if (use_cline_obj) {
41483 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
41484 Py_DECREF(use_cline_obj);
41492 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
41494 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
41497 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
41502 /* CodeObjectCache */
41503 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
41504 int start = 0, mid = 0, end = count - 1;
41505 if (end >= 0 && code_line > entries[end].code_line) {
41508 while (start < end) {
41509 mid = start + (end - start) / 2;
41510 if (code_line < entries[mid].code_line) {
41512 } else if (code_line > entries[mid].code_line) {
41518 if (code_line <= entries[mid].code_line) {
41524 static PyCodeObject *__pyx_find_code_object(int code_line) {
41525 PyCodeObject* code_object;
41527 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
41530 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
41531 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
41534 code_object = __pyx_code_cache.entries[pos].code_object;
41535 Py_INCREF(code_object);
41536 return code_object;
41538 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
41540 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
41541 if (unlikely(!code_line)) {
41544 if (unlikely(!entries)) {
41545 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
41546 if (likely(entries)) {
41547 __pyx_code_cache.entries = entries;
41548 __pyx_code_cache.max_count = 64;
41549 __pyx_code_cache.count = 1;
41550 entries[0].code_line = code_line;
41551 entries[0].code_object = code_object;
41552 Py_INCREF(code_object);
41556 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
41557 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
41558 PyCodeObject* tmp = entries[pos].code_object;
41559 entries[pos].code_object = code_object;
41563 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
41564 int new_max = __pyx_code_cache.max_count + 64;
41565 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
41566 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
41567 if (unlikely(!entries)) {
41570 __pyx_code_cache.entries = entries;
41571 __pyx_code_cache.max_count = new_max;
41573 for (i=__pyx_code_cache.count; i>pos; i--) {
41574 entries[i] = entries[i-1];
41576 entries[pos].code_line = code_line;
41577 entries[pos].code_object = code_object;
41578 __pyx_code_cache.count++;
41579 Py_INCREF(code_object);
41583 #include "compile.h"
41584 #include "frameobject.h"
41585 #include "traceback.h"
41586 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
41587 const char *funcname, int c_line,
41588 int py_line, const char *filename) {
41589 PyCodeObject *py_code = 0;
41590 PyObject *py_srcfile = 0;
41591 PyObject *py_funcname = 0;
41592 #if PY_MAJOR_VERSION < 3
41593 py_srcfile = PyString_FromString(filename);
41595 py_srcfile = PyUnicode_FromString(filename);
41597 if (!py_srcfile) goto bad;
41599 #if PY_MAJOR_VERSION < 3
41600 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
41602 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
41606 #if PY_MAJOR_VERSION < 3
41607 py_funcname = PyString_FromString(funcname);
41609 py_funcname = PyUnicode_FromString(funcname);
41612 if (!py_funcname) goto bad;
41613 py_code = __Pyx_PyCode_New(
41619 __pyx_empty_bytes, /*PyObject *code,*/
41620 __pyx_empty_tuple, /*PyObject *consts,*/
41621 __pyx_empty_tuple, /*PyObject *names,*/
41622 __pyx_empty_tuple, /*PyObject *varnames,*/
41623 __pyx_empty_tuple, /*PyObject *freevars,*/
41624 __pyx_empty_tuple, /*PyObject *cellvars,*/
41625 py_srcfile, /*PyObject *filename,*/
41626 py_funcname, /*PyObject *name,*/
41628 __pyx_empty_bytes /*PyObject *lnotab*/
41630 Py_DECREF(py_srcfile);
41631 Py_DECREF(py_funcname);
41634 Py_XDECREF(py_srcfile);
41635 Py_XDECREF(py_funcname);
41638 static void __Pyx_AddTraceback(const char *funcname, int c_line,
41639 int py_line, const char *filename) {
41640 PyCodeObject *py_code = 0;
41641 PyFrameObject *py_frame = 0;
41642 PyThreadState *tstate = __Pyx_PyThreadState_Current;
41644 c_line = __Pyx_CLineForTraceback(tstate, c_line);
41646 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
41648 py_code = __Pyx_CreateCodeObjectForTraceback(
41649 funcname, c_line, py_line, filename);
41650 if (!py_code) goto bad;
41651 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
41653 py_frame = PyFrame_New(
41654 tstate, /*PyThreadState *tstate,*/
41655 py_code, /*PyCodeObject *code,*/
41656 __pyx_d, /*PyObject *globals,*/
41657 0 /*PyObject *locals*/
41659 if (!py_frame) goto bad;
41660 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
41661 PyTraceBack_Here(py_frame);
41663 Py_XDECREF(py_code);
41664 Py_XDECREF(py_frame);
41667 /* CIntFromPyVerify */
41668 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
41669 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
41670 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
41671 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
41672 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
41674 func_type value = func_value;\
41675 if (sizeof(target_type) < sizeof(func_type)) {\
41676 if (unlikely(value != (func_type) (target_type) value)) {\
41677 func_type zero = 0;\
41678 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
41679 return (target_type) -1;\
41680 if (is_unsigned && unlikely(value < zero))\
41681 goto raise_neg_overflow;\
41683 goto raise_overflow;\
41686 return (target_type) value;\
41690 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
41691 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
41692 const int is_unsigned = neg_one > const_zero;
41694 if (sizeof(long) < sizeof(long)) {
41695 return PyInt_FromLong((long) value);
41696 } else if (sizeof(long) <= sizeof(unsigned long)) {
41697 return PyLong_FromUnsignedLong((unsigned long) value);
41698 #ifdef HAVE_LONG_LONG
41699 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
41700 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41704 if (sizeof(long) <= sizeof(long)) {
41705 return PyInt_FromLong((long) value);
41706 #ifdef HAVE_LONG_LONG
41707 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
41708 return PyLong_FromLongLong((PY_LONG_LONG) value);
41713 int one = 1; int little = (int)*(unsigned char *)&one;
41714 unsigned char *bytes = (unsigned char *)&value;
41715 return _PyLong_FromByteArray(bytes, sizeof(long),
41716 little, !is_unsigned);
41721 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
41722 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
41723 const int is_unsigned = neg_one > const_zero;
41725 if (sizeof(int) < sizeof(long)) {
41726 return PyInt_FromLong((long) value);
41727 } else if (sizeof(int) <= sizeof(unsigned long)) {
41728 return PyLong_FromUnsignedLong((unsigned long) value);
41729 #ifdef HAVE_LONG_LONG
41730 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41731 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41735 if (sizeof(int) <= sizeof(long)) {
41736 return PyInt_FromLong((long) value);
41737 #ifdef HAVE_LONG_LONG
41738 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41739 return PyLong_FromLongLong((PY_LONG_LONG) value);
41744 int one = 1; int little = (int)*(unsigned char *)&one;
41745 unsigned char *bytes = (unsigned char *)&value;
41746 return _PyLong_FromByteArray(bytes, sizeof(int),
41747 little, !is_unsigned);
41752 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
41753 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
41754 const int is_unsigned = neg_one > const_zero;
41755 #if PY_MAJOR_VERSION < 3
41756 if (likely(PyInt_Check(x))) {
41757 if (sizeof(int) < sizeof(long)) {
41758 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
41760 long val = PyInt_AS_LONG(x);
41761 if (is_unsigned && unlikely(val < 0)) {
41762 goto raise_neg_overflow;
41768 if (likely(PyLong_Check(x))) {
41770 #if CYTHON_USE_PYLONG_INTERNALS
41771 const digit* digits = ((PyLongObject*)x)->ob_digit;
41772 switch (Py_SIZE(x)) {
41773 case 0: return (int) 0;
41774 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
41776 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41777 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41778 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41779 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
41780 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41785 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41786 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41787 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41788 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
41789 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41794 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41795 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41796 __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])))
41797 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
41798 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
41804 #if CYTHON_COMPILING_IN_CPYTHON
41805 if (unlikely(Py_SIZE(x) < 0)) {
41806 goto raise_neg_overflow;
41810 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41811 if (unlikely(result < 0))
41813 if (unlikely(result == 1))
41814 goto raise_neg_overflow;
41817 if (sizeof(int) <= sizeof(unsigned long)) {
41818 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
41819 #ifdef HAVE_LONG_LONG
41820 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
41821 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41825 #if CYTHON_USE_PYLONG_INTERNALS
41826 const digit* digits = ((PyLongObject*)x)->ob_digit;
41827 switch (Py_SIZE(x)) {
41828 case 0: return (int) 0;
41829 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
41830 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
41832 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
41833 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41834 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41835 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41836 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41841 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
41842 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41843 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41844 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41845 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41850 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
41851 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41852 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41853 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41854 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41859 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
41860 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41861 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41862 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41863 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41868 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
41869 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41870 __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])))
41871 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41872 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41877 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
41878 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41879 __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])))
41880 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
41881 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
41887 if (sizeof(int) <= sizeof(long)) {
41888 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
41889 #ifdef HAVE_LONG_LONG
41890 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
41891 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
41896 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
41897 PyErr_SetString(PyExc_RuntimeError,
41898 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
41901 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
41902 #if PY_MAJOR_VERSION < 3
41903 if (likely(v) && !PyLong_Check(v)) {
41905 v = PyNumber_Long(tmp);
41910 int one = 1; int is_little = (int)*(unsigned char *)&one;
41911 unsigned char *bytes = (unsigned char *)&val;
41912 int ret = _PyLong_AsByteArray((PyLongObject *)v,
41913 bytes, sizeof(val),
41914 is_little, !is_unsigned);
41924 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41925 if (!tmp) return (int) -1;
41926 val = __Pyx_PyInt_As_int(tmp);
41931 PyErr_SetString(PyExc_OverflowError,
41932 "value too large to convert to int");
41934 raise_neg_overflow:
41935 PyErr_SetString(PyExc_OverflowError,
41936 "can't convert negative value to int");
41941 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
41942 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
41943 const int is_unsigned = neg_one > const_zero;
41944 #if PY_MAJOR_VERSION < 3
41945 if (likely(PyInt_Check(x))) {
41946 if (sizeof(long) < sizeof(long)) {
41947 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
41949 long val = PyInt_AS_LONG(x);
41950 if (is_unsigned && unlikely(val < 0)) {
41951 goto raise_neg_overflow;
41957 if (likely(PyLong_Check(x))) {
41959 #if CYTHON_USE_PYLONG_INTERNALS
41960 const digit* digits = ((PyLongObject*)x)->ob_digit;
41961 switch (Py_SIZE(x)) {
41962 case 0: return (long) 0;
41963 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
41965 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
41966 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
41967 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41968 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
41969 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41974 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
41975 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
41976 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41977 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
41978 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41983 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
41984 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
41985 __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])))
41986 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
41987 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41993 #if CYTHON_COMPILING_IN_CPYTHON
41994 if (unlikely(Py_SIZE(x) < 0)) {
41995 goto raise_neg_overflow;
41999 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
42000 if (unlikely(result < 0))
42002 if (unlikely(result == 1))
42003 goto raise_neg_overflow;
42006 if (sizeof(long) <= sizeof(unsigned long)) {
42007 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
42008 #ifdef HAVE_LONG_LONG
42009 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
42010 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
42014 #if CYTHON_USE_PYLONG_INTERNALS
42015 const digit* digits = ((PyLongObject*)x)->ob_digit;
42016 switch (Py_SIZE(x)) {
42017 case 0: return (long) 0;
42018 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
42019 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
42021 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
42022 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
42023 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42024 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42025 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42030 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
42031 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
42032 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42033 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42034 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42039 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
42040 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
42041 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42042 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42043 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42048 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
42049 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
42050 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42051 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42052 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42057 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
42058 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
42059 __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])))
42060 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
42061 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42066 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
42067 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
42068 __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])))
42069 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
42070 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42076 if (sizeof(long) <= sizeof(long)) {
42077 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
42078 #ifdef HAVE_LONG_LONG
42079 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
42080 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
42085 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
42086 PyErr_SetString(PyExc_RuntimeError,
42087 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
42090 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
42091 #if PY_MAJOR_VERSION < 3
42092 if (likely(v) && !PyLong_Check(v)) {
42094 v = PyNumber_Long(tmp);
42099 int one = 1; int is_little = (int)*(unsigned char *)&one;
42100 unsigned char *bytes = (unsigned char *)&val;
42101 int ret = _PyLong_AsByteArray((PyLongObject *)v,
42102 bytes, sizeof(val),
42103 is_little, !is_unsigned);
42113 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
42114 if (!tmp) return (long) -1;
42115 val = __Pyx_PyInt_As_long(tmp);
42120 PyErr_SetString(PyExc_OverflowError,
42121 "value too large to convert to long");
42123 raise_neg_overflow:
42124 PyErr_SetString(PyExc_OverflowError,
42125 "can't convert negative value to long");
42129 /* FastTypeChecks */
42130 #if CYTHON_COMPILING_IN_CPYTHON
42131 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
42137 return b == &PyBaseObject_Type;
42139 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
42141 if (a == b) return 1;
42145 n = PyTuple_GET_SIZE(mro);
42146 for (i = 0; i < n; i++) {
42147 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
42152 return __Pyx_InBases(a, b);
42154 #if PY_MAJOR_VERSION == 2
42155 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
42156 PyObject *exception, *value, *tb;
42158 __Pyx_PyThreadState_declare
42159 __Pyx_PyThreadState_assign
42160 __Pyx_ErrFetch(&exception, &value, &tb);
42161 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
42162 if (unlikely(res == -1)) {
42163 PyErr_WriteUnraisable(err);
42167 res = PyObject_IsSubclass(err, exc_type2);
42168 if (unlikely(res == -1)) {
42169 PyErr_WriteUnraisable(err);
42173 __Pyx_ErrRestore(exception, value, tb);
42177 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
42178 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
42180 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
42185 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
42187 assert(PyExceptionClass_Check(exc_type));
42188 n = PyTuple_GET_SIZE(tuple);
42189 #if PY_MAJOR_VERSION >= 3
42190 for (i=0; i<n; i++) {
42191 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
42194 for (i=0; i<n; i++) {
42195 PyObject *t = PyTuple_GET_ITEM(tuple, i);
42196 #if PY_MAJOR_VERSION < 3
42197 if (likely(exc_type == t)) return 1;
42199 if (likely(PyExceptionClass_Check(t))) {
42200 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
42206 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
42207 if (likely(err == exc_type)) return 1;
42208 if (likely(PyExceptionClass_Check(err))) {
42209 if (likely(PyExceptionClass_Check(exc_type))) {
42210 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
42211 } else if (likely(PyTuple_Check(exc_type))) {
42212 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
42216 return PyErr_GivenExceptionMatches(err, exc_type);
42218 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
42219 assert(PyExceptionClass_Check(exc_type1));
42220 assert(PyExceptionClass_Check(exc_type2));
42221 if (likely(err == exc_type1 || err == exc_type2)) return 1;
42222 if (likely(PyExceptionClass_Check(err))) {
42223 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
42225 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
42229 /* CheckBinaryVersion */
42230 static int __Pyx_check_binary_version(void) {
42231 char ctversion[4], rtversion[4];
42232 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
42233 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
42234 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
42236 PyOS_snprintf(message, sizeof(message),
42237 "compiletime version %s of module '%.100s' "
42238 "does not match runtime version %s",
42239 ctversion, __Pyx_MODULE_NAME, rtversion);
42240 return PyErr_WarnEx(NULL, message, 1);
42246 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
42248 #if PY_MAJOR_VERSION < 3
42249 if (t->is_unicode) {
42250 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
42251 } else if (t->intern) {
42252 *t->p = PyString_InternFromString(t->s);
42254 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
42257 if (t->is_unicode | t->is_str) {
42259 *t->p = PyUnicode_InternFromString(t->s);
42260 } else if (t->encoding) {
42261 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
42263 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
42266 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
42271 if (PyObject_Hash(*t->p) == -1)
42278 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
42279 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
42281 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
42283 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
42285 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42286 #if !CYTHON_PEP393_ENABLED
42287 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42289 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
42290 if (!defenc) return NULL;
42291 defenc_c = PyBytes_AS_STRING(defenc);
42292 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42294 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
42296 for (c = defenc_c; c < end; c++) {
42297 if ((unsigned char) (*c) >= 128) {
42298 PyUnicode_AsASCIIString(o);
42304 *length = PyBytes_GET_SIZE(defenc);
42308 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42309 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
42310 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42311 if (likely(PyUnicode_IS_ASCII(o))) {
42312 *length = PyUnicode_GET_LENGTH(o);
42313 return PyUnicode_AsUTF8(o);
42315 PyUnicode_AsASCIIString(o);
42319 return PyUnicode_AsUTF8AndSize(o, length);
42324 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42325 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42327 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42328 __Pyx_sys_getdefaultencoding_not_ascii &&
42330 PyUnicode_Check(o)) {
42331 return __Pyx_PyUnicode_AsStringAndSize(o, length);
42334 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
42335 if (PyByteArray_Check(o)) {
42336 *length = PyByteArray_GET_SIZE(o);
42337 return PyByteArray_AS_STRING(o);
42342 int r = PyBytes_AsStringAndSize(o, &result, length);
42343 if (unlikely(r < 0)) {
42350 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
42351 int is_true = x == Py_True;
42352 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
42353 else return PyObject_IsTrue(x);
42355 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
42357 if (unlikely(!x)) return -1;
42358 retval = __Pyx_PyObject_IsTrue(x);
42362 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
42363 #if PY_MAJOR_VERSION >= 3
42364 if (PyLong_Check(result)) {
42365 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
42366 "__int__ returned non-int (type %.200s). "
42367 "The ability to return an instance of a strict subclass of int "
42368 "is deprecated, and may be removed in a future version of Python.",
42369 Py_TYPE(result)->tp_name)) {
42376 PyErr_Format(PyExc_TypeError,
42377 "__%.4s__ returned non-%.4s (type %.200s)",
42378 type_name, type_name, Py_TYPE(result)->tp_name);
42382 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
42383 #if CYTHON_USE_TYPE_SLOTS
42384 PyNumberMethods *m;
42386 const char *name = NULL;
42387 PyObject *res = NULL;
42388 #if PY_MAJOR_VERSION < 3
42389 if (likely(PyInt_Check(x) || PyLong_Check(x)))
42391 if (likely(PyLong_Check(x)))
42393 return __Pyx_NewRef(x);
42394 #if CYTHON_USE_TYPE_SLOTS
42395 m = Py_TYPE(x)->tp_as_number;
42396 #if PY_MAJOR_VERSION < 3
42397 if (m && m->nb_int) {
42399 res = m->nb_int(x);
42401 else if (m && m->nb_long) {
42403 res = m->nb_long(x);
42406 if (likely(m && m->nb_int)) {
42408 res = m->nb_int(x);
42412 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
42413 res = PyNumber_Int(x);
42417 #if PY_MAJOR_VERSION < 3
42418 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
42420 if (unlikely(!PyLong_CheckExact(res))) {
42422 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
42425 else if (!PyErr_Occurred()) {
42426 PyErr_SetString(PyExc_TypeError,
42427 "an integer is required");
42431 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
42434 #if PY_MAJOR_VERSION < 3
42435 if (likely(PyInt_CheckExact(b))) {
42436 if (sizeof(Py_ssize_t) >= sizeof(long))
42437 return PyInt_AS_LONG(b);
42439 return PyInt_AsSsize_t(b);
42442 if (likely(PyLong_CheckExact(b))) {
42443 #if CYTHON_USE_PYLONG_INTERNALS
42444 const digit* digits = ((PyLongObject*)b)->ob_digit;
42445 const Py_ssize_t size = Py_SIZE(b);
42446 if (likely(__Pyx_sst_abs(size) <= 1)) {
42447 ival = likely(size) ? digits[0] : 0;
42448 if (size == -1) ival = -ival;
42453 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42454 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42458 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42459 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42463 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42464 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42468 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42469 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42473 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42474 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]));
42478 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42479 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]));
42485 return PyLong_AsSsize_t(b);
42487 x = PyNumber_Index(b);
42489 ival = PyInt_AsSsize_t(x);
42493 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
42494 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
42496 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
42497 return PyInt_FromSize_t(ival);
42501 #endif /* Py_PYTHON_H */