Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / cython / src / Cython / Utility / ObjectHandling.c
blobe20fc9ba5c56b586abe3df81bda3327c9e1bd03f
1 /*
2 * General object operations and protocol implementations,
3 * including their specialisations for certain builtins.
5 * Optional optimisations for builtins are in Optimize.c.
7 * Required replacements of builtins are in Builtins.c.
8 */
10 /////////////// RaiseNoneIterError.proto ///////////////
12 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
14 /////////////// RaiseNoneIterError ///////////////
16 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
17 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
20 /////////////// RaiseTooManyValuesToUnpack.proto ///////////////
22 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
24 /////////////// RaiseTooManyValuesToUnpack ///////////////
26 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
27 PyErr_Format(PyExc_ValueError,
28 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
31 /////////////// RaiseNeedMoreValuesToUnpack.proto ///////////////
33 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
35 /////////////// RaiseNeedMoreValuesToUnpack ///////////////
37 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
38 PyErr_Format(PyExc_ValueError,
39 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
40 index, (index == 1) ? "" : "s");
43 /////////////// UnpackTupleError.proto ///////////////
45 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
47 /////////////// UnpackTupleError ///////////////
48 //@requires: RaiseNoneIterError
49 //@requires: RaiseNeedMoreValuesToUnpack
50 //@requires: RaiseTooManyValuesToUnpack
52 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
53 if (t == Py_None) {
54 __Pyx_RaiseNoneNotIterableError();
55 } else if (PyTuple_GET_SIZE(t) < index) {
56 __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
57 } else {
58 __Pyx_RaiseTooManyValuesError(index);
62 /////////////// UnpackItemEndCheck.proto ///////////////
64 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
66 /////////////// UnpackItemEndCheck ///////////////
67 //@requires: RaiseTooManyValuesToUnpack
68 //@requires: IterFinish
70 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
71 if (unlikely(retval)) {
72 Py_DECREF(retval);
73 __Pyx_RaiseTooManyValuesError(expected);
74 return -1;
75 } else {
76 return __Pyx_IterFinish();
78 return 0;
81 /////////////// UnpackTuple2.proto ///////////////
83 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
84 int is_tuple, int has_known_size, int decref_tuple);
86 /////////////// UnpackTuple2 ///////////////
87 //@requires: UnpackItemEndCheck
88 //@requires: UnpackTupleError
89 //@requires: RaiseNeedMoreValuesToUnpack
91 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
92 int is_tuple, int has_known_size, int decref_tuple) {
93 Py_ssize_t index;
94 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
95 if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
96 iternextfunc iternext;
97 iter = PyObject_GetIter(tuple);
98 if (unlikely(!iter)) goto bad;
99 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
100 iternext = Py_TYPE(iter)->tp_iternext;
101 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
102 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
103 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
104 Py_DECREF(iter);
105 } else {
106 if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
107 __Pyx_UnpackTupleError(tuple, 2);
108 goto bad;
110 #if CYTHON_COMPILING_IN_PYPY
111 value1 = PySequence_ITEM(tuple, 0);
112 if (unlikely(!value1)) goto bad;
113 value2 = PySequence_ITEM(tuple, 1);
114 if (unlikely(!value2)) goto bad;
115 #else
116 value1 = PyTuple_GET_ITEM(tuple, 0);
117 value2 = PyTuple_GET_ITEM(tuple, 1);
118 Py_INCREF(value1);
119 Py_INCREF(value2);
120 #endif
121 if (decref_tuple) { Py_DECREF(tuple); }
123 *pvalue1 = value1;
124 *pvalue2 = value2;
125 return 0;
126 unpacking_failed:
127 if (!has_known_size && __Pyx_IterFinish() == 0)
128 __Pyx_RaiseNeedMoreValuesError(index);
129 bad:
130 Py_XDECREF(iter);
131 Py_XDECREF(value1);
132 Py_XDECREF(value2);
133 if (decref_tuple) { Py_XDECREF(tuple); }
134 return -1;
137 /////////////// IterNext.proto ///////////////
139 #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
140 static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /*proto*/
142 /////////////// IterNext ///////////////
144 // originally copied from Py3's builtin_next()
145 static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
146 PyObject* next;
147 iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
148 #if CYTHON_COMPILING_IN_CPYTHON
149 if (unlikely(!iternext)) {
150 #else
151 if (unlikely(!iternext) || unlikely(!PyIter_Check(iterator))) {
152 #endif
153 PyErr_Format(PyExc_TypeError,
154 "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
155 return NULL;
157 next = iternext(iterator);
158 if (likely(next))
159 return next;
160 #if CYTHON_COMPILING_IN_CPYTHON
161 #if PY_VERSION_HEX >= 0x03010000 || (PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000)
162 if (unlikely(iternext == &_PyObject_NextNotImplemented))
163 return NULL;
164 #endif
165 #endif
166 if (defval) {
167 PyObject* exc_type = PyErr_Occurred();
168 if (exc_type) {
169 if (unlikely(exc_type != PyExc_StopIteration) &&
170 !PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))
171 return NULL;
172 PyErr_Clear();
174 Py_INCREF(defval);
175 return defval;
177 if (!PyErr_Occurred())
178 PyErr_SetNone(PyExc_StopIteration);
179 return NULL;
182 /////////////// IterFinish.proto ///////////////
184 static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
186 /////////////// IterFinish ///////////////
188 // When PyIter_Next(iter) has returned NULL in order to signal termination,
189 // this function does the right cleanup and returns 0 on success. If it
190 // detects an error that occurred in the iterator, it returns -1.
192 static CYTHON_INLINE int __Pyx_IterFinish(void) {
193 #if CYTHON_COMPILING_IN_CPYTHON
194 PyThreadState *tstate = PyThreadState_GET();
195 PyObject* exc_type = tstate->curexc_type;
196 if (unlikely(exc_type)) {
197 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
198 PyObject *exc_value, *exc_tb;
199 exc_value = tstate->curexc_value;
200 exc_tb = tstate->curexc_traceback;
201 tstate->curexc_type = 0;
202 tstate->curexc_value = 0;
203 tstate->curexc_traceback = 0;
204 Py_DECREF(exc_type);
205 Py_XDECREF(exc_value);
206 Py_XDECREF(exc_tb);
207 return 0;
208 } else {
209 return -1;
212 return 0;
213 #else
214 if (unlikely(PyErr_Occurred())) {
215 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
216 PyErr_Clear();
217 return 0;
218 } else {
219 return -1;
222 return 0;
223 #endif
226 /////////////// DictGetItem.proto ///////////////
228 #if PY_MAJOR_VERSION >= 3
229 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
230 PyObject *value;
231 value = PyDict_GetItemWithError(d, key);
232 if (unlikely(!value)) {
233 if (!PyErr_Occurred()) {
234 PyObject* args = PyTuple_Pack(1, key);
235 if (likely(args))
236 PyErr_SetObject(PyExc_KeyError, args);
237 Py_XDECREF(args);
239 return NULL;
241 Py_INCREF(value);
242 return value;
244 #else
245 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
246 #endif
248 /////////////// GetItemInt.proto ///////////////
250 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
251 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
252 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
253 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
254 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
256 {{for type in ['List', 'Tuple']}}
257 #define __Pyx_GetItemInt_{{type}}(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
258 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
259 __Pyx_GetItemInt_{{type}}_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
260 (PyErr_SetString(PyExc_IndexError, "{{ type.lower() }} index out of range"), (PyObject*)NULL))
262 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_{{type}}_Fast(PyObject *o, Py_ssize_t i,
263 int wraparound, int boundscheck);
264 {{endfor}}
266 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
267 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
268 int is_list, int wraparound, int boundscheck);
270 /////////////// GetItemInt ///////////////
272 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
273 PyObject *r;
274 if (!j) return NULL;
275 r = PyObject_GetItem(o, j);
276 Py_DECREF(j);
277 return r;
280 {{for type in ['List', 'Tuple']}}
281 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_{{type}}_Fast(PyObject *o, Py_ssize_t i,
282 int wraparound, int boundscheck) {
283 #if CYTHON_COMPILING_IN_CPYTHON
284 if (wraparound & unlikely(i < 0)) i += Py{{type}}_GET_SIZE(o);
285 if ((!boundscheck) || likely((0 <= i) & (i < Py{{type}}_GET_SIZE(o)))) {
286 PyObject *r = Py{{type}}_GET_ITEM(o, i);
287 Py_INCREF(r);
288 return r;
290 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
291 #else
292 return PySequence_GetItem(o, i);
293 #endif
295 {{endfor}}
297 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
298 int is_list, int wraparound, int boundscheck) {
299 #if CYTHON_COMPILING_IN_CPYTHON
300 if (is_list || PyList_CheckExact(o)) {
301 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
302 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
303 PyObject *r = PyList_GET_ITEM(o, n);
304 Py_INCREF(r);
305 return r;
308 else if (PyTuple_CheckExact(o)) {
309 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
310 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
311 PyObject *r = PyTuple_GET_ITEM(o, n);
312 Py_INCREF(r);
313 return r;
315 } else {
316 // inlined PySequence_GetItem() + special cased length overflow
317 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
318 if (likely(m && m->sq_item)) {
319 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
320 Py_ssize_t l = m->sq_length(o);
321 if (likely(l >= 0)) {
322 i += l;
323 } else {
324 // if length > max(Py_ssize_t), maybe the object can wrap around itself?
325 if (PyErr_ExceptionMatches(PyExc_OverflowError))
326 PyErr_Clear();
327 else
328 return NULL;
331 return m->sq_item(o, i);
334 #else
335 if (is_list || PySequence_Check(o)) {
336 return PySequence_GetItem(o, i);
338 #endif
339 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
342 /////////////// SetItemInt.proto ///////////////
344 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
345 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
346 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
347 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
348 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
350 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
351 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
352 int is_list, int wraparound, int boundscheck);
354 /////////////// SetItemInt ///////////////
356 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
357 int r;
358 if (!j) return -1;
359 r = PyObject_SetItem(o, j, v);
360 Py_DECREF(j);
361 return r;
364 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
365 int is_list, int wraparound, int boundscheck) {
366 #if CYTHON_COMPILING_IN_CPYTHON
367 if (is_list || PyList_CheckExact(o)) {
368 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
369 if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
370 PyObject* old = PyList_GET_ITEM(o, n);
371 Py_INCREF(v);
372 PyList_SET_ITEM(o, n, v);
373 Py_DECREF(old);
374 return 1;
376 } else {
377 // inlined PySequence_SetItem() + special cased length overflow
378 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
379 if (likely(m && m->sq_ass_item)) {
380 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
381 Py_ssize_t l = m->sq_length(o);
382 if (likely(l >= 0)) {
383 i += l;
384 } else {
385 // if length > max(Py_ssize_t), maybe the object can wrap around itself?
386 if (PyErr_ExceptionMatches(PyExc_OverflowError))
387 PyErr_Clear();
388 else
389 return -1;
392 return m->sq_ass_item(o, i, v);
395 #else
396 #if CYTHON_COMPILING_IN_PYPY
397 if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
398 #else
399 if (is_list || PySequence_Check(o)) {
400 #endif
401 return PySequence_SetItem(o, i, v);
403 #endif
404 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
408 /////////////// DelItemInt.proto ///////////////
410 #define __Pyx_DelItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
411 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
412 __Pyx_DelItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound) : \
413 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
414 __Pyx_DelItem_Generic(o, to_py_func(i))))
416 static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j);
417 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
418 CYTHON_UNUSED int is_list, int wraparound);
420 /////////////// DelItemInt ///////////////
422 static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
423 int r;
424 if (!j) return -1;
425 r = PyObject_DelItem(o, j);
426 Py_DECREF(j);
427 return r;
430 static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i,
431 CYTHON_UNUSED int is_list, int wraparound) {
432 #if CYTHON_COMPILING_IN_PYPY
433 if (is_list || PySequence_Check(o)) {
434 return PySequence_DelItem(o, i);
436 #else
437 // inlined PySequence_DelItem() + special cased length overflow
438 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
439 if (likely(m && m->sq_ass_item)) {
440 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
441 Py_ssize_t l = m->sq_length(o);
442 if (likely(l >= 0)) {
443 i += l;
444 } else {
445 // if length > max(Py_ssize_t), maybe the object can wrap around itself?
446 if (PyErr_ExceptionMatches(PyExc_OverflowError))
447 PyErr_Clear();
448 else
449 return -1;
452 return m->sq_ass_item(o, i, (PyObject *)NULL);
454 #endif
455 return __Pyx_DelItem_Generic(o, PyInt_FromSsize_t(i));
459 /////////////// SliceObject.proto ///////////////
461 // we pass pointer addresses to show the C compiler what is NULL and what isn't
462 {{if access == 'Get'}}
463 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
464 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
465 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
466 int has_cstart, int has_cstop, int wraparound);
467 {{else}}
468 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
469 __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
471 // we pass pointer addresses to show the C compiler what is NULL and what isn't
472 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
473 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
474 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
475 int has_cstart, int has_cstop, int wraparound);
476 {{endif}}
478 /////////////// SliceObject ///////////////
480 {{if access == 'Get'}}
481 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
482 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
483 {{else}}
484 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
485 PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
486 {{endif}}
487 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
488 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
489 #if CYTHON_COMPILING_IN_CPYTHON
490 PyMappingMethods* mp;
491 #if PY_MAJOR_VERSION < 3
492 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
493 if (likely(ms && ms->sq_{{if access == 'Set'}}ass_{{endif}}slice)) {
494 if (!has_cstart) {
495 if (_py_start && (*_py_start != Py_None)) {
496 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
497 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
498 } else
499 cstart = 0;
501 if (!has_cstop) {
502 if (_py_stop && (*_py_stop != Py_None)) {
503 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
504 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
505 } else
506 cstop = PY_SSIZE_T_MAX;
508 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
509 Py_ssize_t l = ms->sq_length(obj);
510 if (likely(l >= 0)) {
511 if (cstop < 0) {
512 cstop += l;
513 if (cstop < 0) cstop = 0;
515 if (cstart < 0) {
516 cstart += l;
517 if (cstart < 0) cstart = 0;
519 } else {
520 // if length > max(Py_ssize_t), maybe the object can wrap around itself?
521 if (PyErr_ExceptionMatches(PyExc_OverflowError))
522 PyErr_Clear();
523 else
524 goto bad;
527 {{if access == 'Get'}}
528 return ms->sq_slice(obj, cstart, cstop);
529 {{else}}
530 return ms->sq_ass_slice(obj, cstart, cstop, value);
531 {{endif}}
533 #endif
535 mp = Py_TYPE(obj)->tp_as_mapping;
536 {{if access == 'Get'}}
537 if (likely(mp && mp->mp_subscript))
538 {{else}}
539 if (likely(mp && mp->mp_ass_subscript))
540 {{endif}}
541 #endif
543 {{if access == 'Get'}}PyObject*{{else}}int{{endif}} result;
544 PyObject *py_slice, *py_start, *py_stop;
545 if (_py_slice) {
546 py_slice = *_py_slice;
547 } else {
548 PyObject* owned_start = NULL;
549 PyObject* owned_stop = NULL;
550 if (_py_start) {
551 py_start = *_py_start;
552 } else {
553 if (has_cstart) {
554 owned_start = py_start = PyInt_FromSsize_t(cstart);
555 if (unlikely(!py_start)) goto bad;
556 } else
557 py_start = Py_None;
559 if (_py_stop) {
560 py_stop = *_py_stop;
561 } else {
562 if (has_cstop) {
563 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
564 if (unlikely(!py_stop)) {
565 Py_XDECREF(owned_start);
566 goto bad;
568 } else
569 py_stop = Py_None;
571 py_slice = PySlice_New(py_start, py_stop, Py_None);
572 Py_XDECREF(owned_start);
573 Py_XDECREF(owned_stop);
574 if (unlikely(!py_slice)) goto bad;
576 #if CYTHON_COMPILING_IN_CPYTHON
577 {{if access == 'Get'}}
578 result = mp->mp_subscript(obj, py_slice);
579 #else
580 result = PyObject_GetItem(obj, py_slice);
581 {{else}}
582 result = mp->mp_ass_subscript(obj, py_slice, value);
583 #else
584 result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
585 {{endif}}
586 #endif
587 if (!_py_slice) {
588 Py_DECREF(py_slice);
590 return result;
592 PyErr_Format(PyExc_TypeError,
593 {{if access == 'Get'}}
594 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
595 {{else}}
596 "'%.200s' object does not support slice %.10s",
597 Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
598 {{endif}}
600 bad:
601 return {{if access == 'Get'}}NULL{{else}}-1{{endif}};
605 /////////////// SliceTupleAndList.proto ///////////////
607 #if CYTHON_COMPILING_IN_CPYTHON
608 static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
609 static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
610 #else
611 #define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
612 #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
613 #endif
615 /////////////// SliceTupleAndList ///////////////
617 #if CYTHON_COMPILING_IN_CPYTHON
618 static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
619 Py_ssize_t start = *_start, stop = *_stop, length = *_length;
620 if (start < 0) {
621 start += length;
622 if (start < 0)
623 start = 0;
626 if (stop < 0)
627 stop += length;
628 else if (stop > length)
629 stop = length;
631 *_length = stop - start;
632 *_start = start;
633 *_stop = stop;
636 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
637 PyObject *v;
638 Py_ssize_t i;
639 for (i = 0; i < length; i++) {
640 v = dest[i] = src[i];
641 Py_INCREF(v);
645 {{for type in ['List', 'Tuple']}}
646 static CYTHON_INLINE PyObject* __Pyx_Py{{type}}_GetSlice(
647 PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
648 PyObject* dest;
649 Py_ssize_t length = Py{{type}}_GET_SIZE(src);
650 __Pyx_crop_slice(&start, &stop, &length);
651 if (unlikely(length <= 0))
652 return Py{{type}}_New(0);
654 dest = Py{{type}}_New(length);
655 if (unlikely(!dest))
656 return NULL;
657 __Pyx_copy_object_array(
658 ((Py{{type}}Object*)src)->ob_item + start,
659 ((Py{{type}}Object*)dest)->ob_item,
660 length);
661 return dest;
663 {{endfor}}
664 #endif
667 /////////////// CalculateMetaclass.proto ///////////////
669 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
671 /////////////// CalculateMetaclass ///////////////
673 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
674 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
675 for (i=0; i < nbases; i++) {
676 PyTypeObject *tmptype;
677 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
678 tmptype = Py_TYPE(tmp);
679 #if PY_MAJOR_VERSION < 3
680 if (tmptype == &PyClass_Type)
681 continue;
682 #endif
683 if (!metaclass) {
684 metaclass = tmptype;
685 continue;
687 if (PyType_IsSubtype(metaclass, tmptype))
688 continue;
689 if (PyType_IsSubtype(tmptype, metaclass)) {
690 metaclass = tmptype;
691 continue;
693 // else:
694 PyErr_SetString(PyExc_TypeError,
695 "metaclass conflict: "
696 "the metaclass of a derived class "
697 "must be a (non-strict) subclass "
698 "of the metaclasses of all its bases");
699 return NULL;
701 if (!metaclass) {
702 #if PY_MAJOR_VERSION < 3
703 metaclass = &PyClass_Type;
704 #else
705 metaclass = &PyType_Type;
706 #endif
708 // make owned reference
709 Py_INCREF((PyObject*) metaclass);
710 return (PyObject*) metaclass;
714 /////////////// FindInheritedMetaclass.proto ///////////////
716 static PyObject *__Pyx_FindInheritedMetaclass(PyObject *bases); /*proto*/
718 /////////////// FindInheritedMetaclass ///////////////
719 //@requires: PyObjectGetAttrStr
720 //@requires: CalculateMetaclass
722 static PyObject *__Pyx_FindInheritedMetaclass(PyObject *bases) {
723 PyObject *metaclass;
724 if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
725 PyTypeObject *metatype;
726 PyObject *base = PyTuple_GET_ITEM(bases, 0);
727 #if PY_MAJOR_VERSION < 3
728 PyObject* basetype = __Pyx_PyObject_GetAttrStr(base, PYIDENT("__class__"));
729 if (basetype) {
730 metatype = (PyType_Check(basetype)) ? ((PyTypeObject*) basetype) : NULL;
731 } else {
732 PyErr_Clear();
733 metatype = Py_TYPE(base);
734 basetype = (PyObject*) metatype;
735 Py_INCREF(basetype);
737 #else
738 metatype = Py_TYPE(base);
739 #endif
740 metaclass = __Pyx_CalculateMetaclass(metatype, bases);
741 #if PY_MAJOR_VERSION < 3
742 Py_DECREF(basetype);
743 #endif
744 } else {
745 // no bases => use default metaclass
746 #if PY_MAJOR_VERSION < 3
747 metaclass = (PyObject *) &PyClass_Type;
748 #else
749 metaclass = (PyObject *) &PyType_Type;
750 #endif
751 Py_INCREF(metaclass);
753 return metaclass;
756 /////////////// Py3MetaclassGet.proto ///////////////
758 static PyObject *__Pyx_Py3MetaclassGet(PyObject *bases, PyObject *mkw); /*proto*/
760 /////////////// Py3MetaclassGet ///////////////
761 //@requires: FindInheritedMetaclass
762 //@requires: CalculateMetaclass
764 static PyObject *__Pyx_Py3MetaclassGet(PyObject *bases, PyObject *mkw) {
765 PyObject *metaclass = PyDict_GetItem(mkw, PYIDENT("metaclass"));
766 if (metaclass) {
767 Py_INCREF(metaclass);
768 if (PyDict_DelItem(mkw, PYIDENT("metaclass")) < 0) {
769 Py_DECREF(metaclass);
770 return NULL;
772 if (PyType_Check(metaclass)) {
773 PyObject* orig = metaclass;
774 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
775 Py_DECREF(orig);
777 return metaclass;
779 return __Pyx_FindInheritedMetaclass(bases);
782 /////////////// CreateClass.proto ///////////////
784 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
785 PyObject *qualname, PyObject *modname); /*proto*/
787 /////////////// CreateClass ///////////////
788 //@requires: FindInheritedMetaclass
789 //@requires: CalculateMetaclass
791 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
792 PyObject *qualname, PyObject *modname) {
793 PyObject *result;
794 PyObject *metaclass;
796 if (PyDict_SetItem(dict, PYIDENT("__module__"), modname) < 0)
797 return NULL;
798 if (PyDict_SetItem(dict, PYIDENT("__qualname__"), qualname) < 0)
799 return NULL;
801 /* Python2 __metaclass__ */
802 metaclass = PyDict_GetItem(dict, PYIDENT("__metaclass__"));
803 if (metaclass) {
804 Py_INCREF(metaclass);
805 if (PyType_Check(metaclass)) {
806 PyObject* orig = metaclass;
807 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
808 Py_DECREF(orig);
810 } else {
811 metaclass = __Pyx_FindInheritedMetaclass(bases);
813 if (unlikely(!metaclass))
814 return NULL;
815 result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
816 Py_DECREF(metaclass);
817 return result;
820 /////////////// Py3ClassCreate.proto ///////////////
822 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
823 PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
824 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
825 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
827 /////////////// Py3ClassCreate ///////////////
828 //@requires: PyObjectGetAttrStr
829 //@requires: CalculateMetaclass
831 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
832 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
833 PyObject *ns;
834 if (metaclass) {
835 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, PYIDENT("__prepare__"));
836 if (prep) {
837 PyObject *pargs = PyTuple_Pack(2, name, bases);
838 if (unlikely(!pargs)) {
839 Py_DECREF(prep);
840 return NULL;
842 ns = PyObject_Call(prep, pargs, mkw);
843 Py_DECREF(prep);
844 Py_DECREF(pargs);
845 } else {
846 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
847 return NULL;
848 PyErr_Clear();
849 ns = PyDict_New();
851 } else {
852 ns = PyDict_New();
855 if (unlikely(!ns))
856 return NULL;
858 /* Required here to emulate assignment order */
859 if (unlikely(PyObject_SetItem(ns, PYIDENT("__module__"), modname) < 0)) goto bad;
860 if (unlikely(PyObject_SetItem(ns, PYIDENT("__qualname__"), qualname) < 0)) goto bad;
861 if (unlikely(doc && PyObject_SetItem(ns, PYIDENT("__doc__"), doc) < 0)) goto bad;
862 return ns;
863 bad:
864 Py_DECREF(ns);
865 return NULL;
868 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
869 PyObject *dict, PyObject *mkw,
870 int calculate_metaclass, int allow_py2_metaclass) {
871 PyObject *result, *margs;
872 PyObject *owned_metaclass = NULL;
873 if (allow_py2_metaclass) {
874 /* honour Python2 __metaclass__ for backward compatibility */
875 owned_metaclass = PyObject_GetItem(dict, PYIDENT("__metaclass__"));
876 if (owned_metaclass) {
877 metaclass = owned_metaclass;
878 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
879 PyErr_Clear();
880 } else {
881 return NULL;
884 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
885 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
886 Py_XDECREF(owned_metaclass);
887 if (unlikely(!metaclass))
888 return NULL;
889 owned_metaclass = metaclass;
891 margs = PyTuple_Pack(3, name, bases, dict);
892 if (unlikely(!margs)) {
893 result = NULL;
894 } else {
895 result = PyObject_Call(metaclass, margs, mkw);
896 Py_DECREF(margs);
898 Py_XDECREF(owned_metaclass);
899 return result;
902 /////////////// ExtTypeTest.proto ///////////////
904 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
906 /////////////// ExtTypeTest ///////////////
908 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
909 if (unlikely(!type)) {
910 PyErr_SetString(PyExc_SystemError, "Missing type object");
911 return 0;
913 if (likely(PyObject_TypeCheck(obj, type)))
914 return 1;
915 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
916 Py_TYPE(obj)->tp_name, type->tp_name);
917 return 0;
920 /////////////// CallableCheck.proto ///////////////
922 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
923 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL)
924 #else
925 #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
926 #endif
928 /////////////// PyDictContains.proto ///////////////
930 static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
931 int result = PyDict_Contains(dict, item);
932 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
935 /////////////// PySequenceContains.proto ///////////////
937 static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
938 int result = PySequence_Contains(seq, item);
939 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
942 /////////////// PyBoolOrNullFromLong.proto ///////////////
944 static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
945 return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
948 /////////////// GetBuiltinName.proto ///////////////
950 static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
952 /////////////// GetBuiltinName ///////////////
953 //@requires: PyObjectGetAttrStr
954 //@substitute: naming
956 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
957 PyObject* result = __Pyx_PyObject_GetAttrStr($builtins_cname, name);
958 if (unlikely(!result)) {
959 PyErr_Format(PyExc_NameError,
960 #if PY_MAJOR_VERSION >= 3
961 "name '%U' is not defined", name);
962 #else
963 "name '%.200s' is not defined", PyString_AS_STRING(name));
964 #endif
966 return result;
969 /////////////// GetNameInClass.proto ///////////////
971 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/
973 /////////////// GetNameInClass ///////////////
974 //@requires: PyObjectGetAttrStr
975 //@requires: GetModuleGlobalName
977 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
978 PyObject *result;
979 result = __Pyx_PyObject_GetAttrStr(nmspace, name);
980 if (!result)
981 result = __Pyx_GetModuleGlobalName(name);
982 return result;
985 /////////////// GetModuleGlobalName.proto ///////////////
987 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
989 /////////////// GetModuleGlobalName ///////////////
990 //@requires: GetBuiltinName
991 //@substitute: naming
993 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
994 PyObject *result;
995 #if CYTHON_COMPILING_IN_CPYTHON
996 result = PyDict_GetItem($moddict_cname, name);
997 if (result) {
998 Py_INCREF(result);
999 } else {
1000 #else
1001 result = PyObject_GetItem($moddict_cname, name);
1002 if (!result) {
1003 PyErr_Clear();
1004 #endif
1005 result = __Pyx_GetBuiltinName(name);
1007 return result;
1010 //////////////////// GetAttr.proto ////////////////////
1012 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/
1014 //////////////////// GetAttr ////////////////////
1015 //@requires: PyObjectGetAttrStr
1017 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
1018 #if CYTHON_COMPILING_IN_CPYTHON
1019 #if PY_MAJOR_VERSION >= 3
1020 if (likely(PyUnicode_Check(n)))
1021 #else
1022 if (likely(PyString_Check(n)))
1023 #endif
1024 return __Pyx_PyObject_GetAttrStr(o, n);
1025 #endif
1026 return PyObject_GetAttr(o, n);
1029 /////////////// PyObjectLookupSpecial.proto ///////////////
1030 //@requires: PyObjectGetAttrStr
1032 #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX >= 0x03020000 || PY_MAJOR_VERSION < 3 && PY_VERSION_HEX >= 0x02070000)
1033 // looks like calling _PyType_Lookup() isn't safe in Py<=2.6/3.1
1034 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1035 PyObject *res;
1036 PyTypeObject *tp = Py_TYPE(obj);
1037 #if PY_MAJOR_VERSION < 3
1038 if (unlikely(PyInstance_Check(obj)))
1039 return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1040 #endif
1041 // adapted from CPython's special_lookup() in ceval.c
1042 res = _PyType_Lookup(tp, attr_name);
1043 if (likely(res)) {
1044 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
1045 if (!f) {
1046 Py_INCREF(res);
1047 } else {
1048 res = f(res, obj, (PyObject *)tp);
1050 } else {
1051 PyErr_SetObject(PyExc_AttributeError, attr_name);
1053 return res;
1055 #else
1056 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1057 #endif
1059 /////////////// PyObjectGetAttrStr.proto ///////////////
1061 #if CYTHON_COMPILING_IN_CPYTHON
1062 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1063 PyTypeObject* tp = Py_TYPE(obj);
1064 if (likely(tp->tp_getattro))
1065 return tp->tp_getattro(obj, attr_name);
1066 #if PY_MAJOR_VERSION < 3
1067 if (likely(tp->tp_getattr))
1068 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1069 #endif
1070 return PyObject_GetAttr(obj, attr_name);
1072 #else
1073 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1074 #endif
1076 /////////////// PyObjectSetAttrStr.proto ///////////////
1078 #if CYTHON_COMPILING_IN_CPYTHON
1079 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
1080 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
1081 PyTypeObject* tp = Py_TYPE(obj);
1082 if (likely(tp->tp_setattro))
1083 return tp->tp_setattro(obj, attr_name, value);
1084 #if PY_MAJOR_VERSION < 3
1085 if (likely(tp->tp_setattr))
1086 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
1087 #endif
1088 return PyObject_SetAttr(obj, attr_name, value);
1090 #else
1091 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1092 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1093 #endif
1095 /////////////// PyObjectCallMethod.proto ///////////////
1096 //@requires: PyObjectGetAttrStr
1097 //@requires: PyObjectCall
1098 //@substitute: naming
1100 static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
1101 PyObject *method, *result = NULL;
1102 if (unlikely(!args)) return NULL;
1103 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
1104 if (unlikely(!method)) goto bad;
1105 result = __Pyx_PyObject_Call(method, args, NULL);
1106 Py_DECREF(method);
1107 bad:
1108 Py_DECREF(args);
1109 return result;
1112 #define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
1113 __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
1114 #define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
1115 __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
1116 #define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
1117 __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
1118 #define __Pyx_PyObject_CallMethod0(obj, name) \
1119 __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF($empty_tuple), $empty_tuple))
1122 /////////////// tp_new.proto ///////////////
1124 #define __Pyx_tp_new(type_obj, args) __Pyx_tp_new_kwargs(type_obj, args, NULL)
1125 static CYTHON_INLINE PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs) {
1126 return (PyObject*) (((PyTypeObject*)type_obj)->tp_new((PyTypeObject*)type_obj, args, kwargs));
1130 /////////////// PyObjectCall.proto ///////////////
1132 #if CYTHON_COMPILING_IN_CPYTHON
1133 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
1134 #else
1135 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1136 #endif
1138 /////////////// PyObjectCall ///////////////
1140 #if CYTHON_COMPILING_IN_CPYTHON
1141 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
1142 PyObject *result;
1143 ternaryfunc call = func->ob_type->tp_call;
1145 if (unlikely(!call))
1146 return PyObject_Call(func, arg, kw);
1147 #if PY_VERSION_HEX >= 0x02060000
1148 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
1149 return NULL;
1150 #endif
1151 result = (*call)(func, arg, kw);
1152 #if PY_VERSION_HEX >= 0x02060000
1153 Py_LeaveRecursiveCall();
1154 #endif
1155 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
1156 PyErr_SetString(
1157 PyExc_SystemError,
1158 "NULL result without error in PyObject_Call");
1160 return result;
1162 #endif