diff --git a/constraint/constraints.c b/constraint/constraints.c index 83adcf2..b707139 100644 --- a/constraint/constraints.c +++ b/constraint/constraints.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.0a1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_0a1" +#define CYTHON_HEX_VERSION 0x030100A1 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,8 +178,13 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,7 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -248,11 +246,17 @@ END: Cython Metadata */ #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -262,80 +266,20 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 - #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +288,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +309,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +342,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +519,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +536,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,62 +551,12 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif @@ -673,31 +578,6 @@ END: Cython Metadata */ #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) @@ -757,7 +637,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +675,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -836,8 +716,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +730,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +742,40 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +799,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +815,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +844,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +857,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +867,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,26 +884,69 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && PY_VERSION_HEX >= 0x030d00b1 +#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS +#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +#endif +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItem(dict, key); + if (*result == NULL) { + return 0; + } + Py_INCREF(*result); + return 1; +} +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (PyErr_Occurred()) { + return -1; + } else if (*result == NULL) { + return 0; + } + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) @@ -1132,64 +957,48 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#define PyBoolObject PyLongObject +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_pyiter_sendfunc sendfunc #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND && __PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_SlotTpAsAsync(s) (&(s)) +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)&(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1209,8 +1018,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1060,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1104,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1127,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1211,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,67 +1228,68 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/constraints.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ +struct __pyx_defaults; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr; -struct __pyx_defaults; -typedef struct __pyx_defaults __pyx_defaults; -struct __pyx_defaults1; -typedef struct __pyx_defaults1 __pyx_defaults1; -struct __pyx_defaults2; -typedef struct __pyx_defaults2 __pyx_defaults2; -struct __pyx_defaults3; -typedef struct __pyx_defaults3 __pyx_defaults3; -struct __pyx_defaults4; -typedef struct __pyx_defaults4 __pyx_defaults4; + +/* "constraint/constraints.py":63 + * vconstraints[variable].remove((self, variables)) + * + * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< + * """Helper method for generic forward checking. + * +*/ struct __pyx_defaults { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults1 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults2 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults3 { - PyObject *__pyx_arg__unassigned; -}; -struct __pyx_defaults4 { - PyObject *__pyx_arg__unassigned; + PyObject_HEAD + PyObject *arg0; }; + /* "constraint/constraints.py":307 * variable_with_negative = None * for variable in variables: * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_negative.append(contains_negative) * if contains_negative: - */ +*/ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1543,7 +1303,7 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr { * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_lt1.append(contains_lt1) * if contains_lt1 is True: - */ +*/ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1569,7 +1329,6 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1583,11 +1342,6 @@ struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1699,6 +1453,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1732,10 +1488,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) @@ -1754,9 +1510,12 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1802,7 +1561,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ @@ -1833,12 +1592,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1869,6 +1622,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; @@ -1879,6 +1635,7 @@ typedef struct { } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); @@ -1922,16 +1679,16 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif -/* PyIntCompare.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* PyLongCompare.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); @@ -1940,8 +1697,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* CallUnboundCMethod2.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) @@ -1978,12 +1736,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2046,7 +1800,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2062,11 +1816,18 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif -/* PyIntCompare.proto */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); +/* PyLongCompare.proto */ +static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace); -/* IncludeStructmemberH.proto */ -#include +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); +#endif + +/* PyVersionSanityCheck.proto */ +static int __Pyx_VersionSanityCheck(void); /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS @@ -2081,12 +1842,8 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); @@ -2105,34 +1862,10 @@ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec #endif /* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2166,10 +1899,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2182,9 +1916,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2193,9 +1925,9 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) @@ -2205,9 +1937,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2220,7 +1951,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2235,7 +1966,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2248,9 +1979,6 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - /* PyObjectLookupSpecial.proto */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0) @@ -2271,16 +1999,20 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { @@ -2290,9 +2022,8 @@ struct __Pyx_CodeObjectCache { }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2303,8 +2034,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) PyDict_New() +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API @@ -2320,10 +2069,10 @@ typedef const char *__Pyx_TypeName; #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2337,10 +2086,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE @@ -2366,9 +2122,18 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* IterNextPlain.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); +#endif + /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2389,11 +2154,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2405,8 +2175,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2431,28 +2202,45 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #define __PYX_LIMITED_ABI_SUFFIX "limited" +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.constraints" */ /* #### Code section: typeinfo ### */ @@ -2468,11 +2256,14 @@ static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_round; static PyObject *__pyx_builtin_RuntimeError; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; +static const char __pyx_k_L[] = "\320\004 \240\001\360\014\000\t\r\210L\230\001"; +static const char __pyx_k_Q[] = "\240Q"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_x[] = "x"; -static const char __pyx_k__4[] = "."; +static const char __pyx_k__2[] = "?"; +static const char __pyx_k__3[] = "\250!"; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__68[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_n_2[] = "_n"; @@ -2480,7 +2271,7 @@ static const char __pyx_k_set[] = "set"; static const char __pyx_k_str[] = "str"; static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_args[] = "args"; +static const char __pyx_k_A_HA[] = "\200A\360\014\000\t\r\210H\220A"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_call[] = "__call__"; static const char __pyx_k_dict[] = "dict"; @@ -2488,11 +2279,14 @@ static const char __pyx_k_func[] = "func"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; static const char __pyx_k_prod[] = "prod"; static const char __pyx_k_seen[] = "seen"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_88XXY[] = "\320\0048\3208X\320XY\330\010\016\320\016!\240\021\240!"; +static const char __pyx_k_8_l_1[] = "\320\0048\270\001\340\010\016\210l\230!\2301"; static const char __pyx_k_Union[] = "Union"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_exact[] = "exact"; @@ -2500,19 +2294,20 @@ static const char __pyx_k_found[] = "found"; static const char __pyx_k_parms[] = "parms"; static const char __pyx_k_round[] = "round"; static const char __pyx_k_set_2[] = "_set"; -static const char __pyx_k_super[] = "super"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_value[] = "value"; -static const char __pyx_k_dict_2[] = "__dict__"; +static const char __pyx_k_4M_M_A[] = "\320\004!\320!4\260M\300\021\360\022\000\t\r\210M\230\021\330\010\014\320\014\034\230A"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_func_2[] = "_func"; -static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_func_3[] = "__func__"; static const char __pyx_k_maxsum[] = "maxsum"; static const char __pyx_k_minsum[] = "minsum"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_typing[] = "typing"; +static const char __pyx_k_55H_a_q[] = "\320\004\"\320\"5\3205H\310\006\310a\360.\000\t\020\210q"; +static const char __pyx_k_Zz_IQ_M[] = "\320\004\035\230Z\240z\260\021\360\022\000\t\r\210I\220Q\330\010\014\210M\230\021"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_domains[] = "domains"; static const char __pyx_k_exact_2[] = "_exact"; @@ -2521,16 +2316,19 @@ static const char __pyx_k_maxprod[] = "maxprod"; static const char __pyx_k_minprod[] = "minprod"; static const char __pyx_k_missing[] = "missing"; static const char __pyx_k_prepare[] = "__prepare__"; +static const char __pyx_k_2_q_Kq_A[] = "\320\004\037\320\0372\260-\270q\360\022\000\t\r\210K\220q\330\010\014\320\014\034\230A"; static const char __pyx_k_Callable[] = "Callable"; static const char __pyx_k_Optional[] = "Optional"; static const char __pyx_k_Sequence[] = "Sequence"; +static const char __pyx_k_U_A_IQ_M[] = "\320\004\035\230U\240*\250A\330\010\014\210I\220Q\330\010\014\210M\230\021"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_assigned[] = "assigned"; static const char __pyx_k_exactsum[] = "exactsum"; static const char __pyx_k_maxsum_2[] = "_maxsum"; static const char __pyx_k_minsum_2[] = "_minsum"; static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_variable[] = "variable"; +static const char __pyx_k_E_HA_F_Ja[] = "\320\004\034\230E\240\021\360\024\000\t\r\210H\220A\330\010\014\210F\220!\330\010\014\210J\220a"; static const char __pyx_k_hideValue[] = "hideValue"; static const char __pyx_k_isenabled[] = "isenabled"; static const char __pyx_k_maxprod_2[] = "_maxprod"; @@ -2557,7 +2355,6 @@ static const char __pyx_k_forwardCheck[] = "forwardCheck"; static const char __pyx_k_forwardcheck[] = "forwardcheck"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_vconstraints[] = "vconstraints"; -static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_multipliers_2[] = "_multipliers"; static const char __pyx_k_InSetConstraint[] = "InSetConstraint"; static const char __pyx_k_Union_int_float[] = "Union[int, float]"; @@ -2597,6 +2394,7 @@ static const char __pyx_k_MaxProdConstraint___call[] = "MaxProdConstraint.__call static const char __pyx_k_MaxProdConstraint___init[] = "MaxProdConstraint.__init__"; static const char __pyx_k_MinProdConstraint___call[] = "MinProdConstraint.__call__"; static const char __pyx_k_MinProdConstraint___init[] = "MinProdConstraint.__init__"; +static const char __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\027\240\001\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!"; static const char __pyx_k_AllEqualConstraint___call[] = "AllEqualConstraint.__call__"; static const char __pyx_k_ExactSumConstraint___call[] = "ExactSumConstraint.__call__"; static const char __pyx_k_ExactSumConstraint___init[] = "ExactSumConstraint.__init__"; @@ -2609,6 +2407,7 @@ static const char __pyx_k_InSetConstraint_preProcess[] = "InSetConstraint.prePro static const char __pyx_k_SomeInSetConstraint___call[] = "SomeInSetConstraint.__call__"; static const char __pyx_k_SomeInSetConstraint___init[] = "SomeInSetConstraint.__init__"; static const char __pyx_k_variable_contains_negative[] = "variable_contains_negative"; +static const char __pyx_k_77JJeef_d_L_WAQ_q_6_A_6_7_F[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\016\210d\220!\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230A\330\024\032\230'\240\021\240!\330\014\030\230\001\230\031\240'\250\022\2506\260\021\330\010\023\2207\230\"\230F\240!"; static const char __pyx_k_MaxSumConstraint_preProcess[] = "MaxSumConstraint.preProcess"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; static const char __pyx_k_MaxProdConstraint_preProcess[] = "MaxProdConstraint.preProcess"; @@ -2618,6 +2417,22 @@ static const char __pyx_k_ExactSumConstraint_preProcess[] = "ExactSumConstraint. static const char __pyx_k_NotInSetConstraint_preProcess[] = "NotInSetConstraint.preProcess"; static const char __pyx_k_SomeNotInSetConstraint___call[] = "SomeNotInSetConstraint.__call__"; static const char __pyx_k_SomeNotInSetConstraint___init[] = "SomeNotInSetConstraint.__init__"; +static const char __pyx_k_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q[] = "\320\004\"\320\"5\3205H\310\006\310a\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\027\220q\360\006\000\t\023\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230q\240\001\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\017\210u\220C\220q"; +static const char __pyx_k_55H_a_L_y_q_q_d_Q_a_1_1Kq_Rq_A[] = "\320\004\"\320\"5\3205H\310\006\310a\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\027\220q\360\006\000\t\027\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\027\220{\240!\240:\250R\250q\340\014\020\220\014\230A\330\020\027\220{\240!\2401\330\010\013\210:\220Q\220e\2301\330\014\022\220%\220q\230\005\230Q\330\010\017\210t\2203\220a"; +static const char __pyx_k_55H_a_a_q_L_y_1_1A_QfA_5_q_5_1[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\022\220$\220a\330\010\017\210q\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\030\230\013\2401\240A\330\010\013\210:\220Q\220f\230A\330\014\023\2205\230\001\230\026\230q\330\010\013\2105\220\002\220!\330\014\023\2201\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\030\230\t\240\026\240q\330\030\033\2305\240\002\240&\250\002\250!\330\034\"\240*\250A\250Q\330\024\027\220t\2301\330\030\037\230q\330\010\017\210q"; +static const char __pyx_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\021\220\024\220Q\330\010\016\210a\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210q\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210q\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\017\210q"; +static const char __pyx_k_55H_a_d_4q_a_1_1Kq_9Cq_az_1_a_z[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\026\220d\230!\330\010\023\2204\220q\330\010\016\210a\330\010\022\220!\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\2209\230C\230q\330\024\033\230;\240a\240z\260\022\2601\340\024\036\230a\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210}\230D\240\001\330\020\024\220J\230n\250C\250q\260\013\2701\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250[\270\002\270!\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\020\220\014\230A\330\020\023\2209\230C\230q\330\024\033\230;\240a\240q\340\024\036\230a\330\014\017\210z\230\021\230%\230q\330\020\026\220e\2301\230E\240\021\330\014\017\210t\2202\220Q\330\020\027\220q\330\014\017\210}\230D\240\001\330\020\024\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230t\2402\240V\2502\250Q\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\330\010\013\2101\330\014\023\2204\220s\230!\340\014\023\2204\220s\230!"; +static const char __pyx_k_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250s\260!\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240W\250A\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q"; +static const char __pyx_k_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W[] = "\320\004\"\320\"5\3205H\310\006\310a\330\010\016\210d\220!\330\010\022\220!\330\010\020\220\001\330\010\014\210L\230\001\330\014\017\210y\230\003\2301\330\020\031\230\033\240A\240Z\250w\260a\340\020\033\2301\330\010\013\2101\330\014\017\210t\2201\330\020\023\2205\230\006\230c\240\024\240W\250H\260B\260a\330\024\033\2301\340\020\023\2204\220t\2302\230X\240R\240q\330\024\033\2301\330\014\017\210}\230D\240\004\240D\250\002\250&\260\003\2601\360\006\000\021\025\220L\240\001\330\024\027\220y\240\007\240q\330\030!\240\027\250\001\250\021\330\030\034\230I\240V\2501\330\034\037\230v\240S\250\001\330 &\240j\260\001\260\021\330\030\033\2304\230q\330\034#\2401\340\014\017\210t\2201\330\020\023\2206\230\023\230D\240\001\330\024\033\2301\340\020\023\2206\230\022\2304\230q\330\024\033\2301\330\010\017\210q"; +static const char __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb[] = "\320\004$\320$7\3207J\320Je\320ef\360&\000\t\014\2103\210a\210{\230#\230Q\330\014\027\220y\240\001\240\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2204\220t\2301\230K\240z\260\032\2701\330\024\032\230'\240\021\240!\330\014\027\220w\230b\240\006\240a\330\014\030\230\001\230\031\240'\250\022\2506\260\021"; +static const char __pyx_k_77JJeef_QfKy_Q_1_A_L_gQ_Cq_WA_A[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t1\260\001\330\010\034\230A\330\010\014\210L\230\001\330\014\036\230g\240Q\330\014!\240\027\250\001\250\021\330\014\017\210}\230C\230q\330\020\023\320\023%\240W\250A\340\024\025\330\020$\240A\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\017\320\017!\240\027\250\005\250T\3201C\3003\300a\330\020\021\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\022\2301\330\024\032\230'\240\021\240!\330\025\033\2303\230b\240\004\240H\250B\250a\330\024\032\230'\240\021\240!"; +static const char __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t6\260Q\330\010!\240\021\330\010\014\210L\230\001\330\014#\2407\250!\330\014&\240g\250Q\250a\330\014\017\210q\330\020\023\320\023*\250'\260\021\340\024\025\330\020)\250\021\360\006\000\t\027\220d\230!\330\010\021\220\024\220Q\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\023\320\023*\250'\260\025\260d\320:Q\320QT\320TU\330\024\025\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250A\330\030\036\230g\240Q\240a\340\014\020\220\014\230A\330\020\023\320\023*\250'\260\025\260d\320:Q\320QT\320TU\330\024\025\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230q\330\030\036\230g\240Q\240a"; +static const char __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\360\006\000\t\023\220$\220a\330\010\014\210L\230\001\330\014\025\220W\230A\230Q\330\014\020\220\t\230\026\230q\330\020\023\2206\230\023\230B\230d\240(\250\"\250A\330\024\032\230'\240\021\240!"; +static const char __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v[] = "\320\004$\320$7\3207J\320Je\320ef\330\010\022\220+\230Q\230f\240K\250y\270\r\300Q\330\010\026\220d\230!\330\010\023\2204\220q\330\010\013\2101\330\014\020\220\n\230.\250\003\2501\250K\260q\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230{\250\"\250A\330\030\036\230g\240Q\240a\340\014\020\220\014\230A\330\020\031\230\027\240\001\240\021\330\020\024\220I\230V\2401\330\024\027\220v\230R\230q\330\030\036\230g\240Q\240a"; +static const char __pyx_k_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ[] = "\320\004&\320&9\3209L\320L^\320^_\360$\000\t\036\230Q\330\010\014\210L\230\001\330\014\017\210y\230\007\230q\330\020\023\320\023&\240c\250\021\330\024)\250\021\340\024\025\340\014\017\320\017\"\240'\250\021\360\006\000\021\032\230\027\240\001\240\021\330\020\023\2201\330\024\030\230\t\240\026\240q\330\030#\2401\320$:\270!\330\030\033\2304\230t\2401\240K\250y\270\001\330\034\"\240*\250A\250Q\330\024\030\230\013\2401\240A\330\020\023\2204\220q\330\024\033\2301\330\010\017\210q"; +static const char __pyx_k_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\026\220a\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210|\2303\230a\330\020\036\230a\330\021\027\220w\230l\250$\250f\260C\260q\330\020\027\220q\330\010\013\210=\230\004\230L\250\007\250q\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\027\220|\2407\250!\330\030\037\230q\330\024\030\230\t\240\026\240q\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\010\017\210q"; +static const char __pyx_k_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\360>\000\t\025\220A\330\010\022\220!\330\010\014\210E\220\021\330\014\017\210r\220\023\220A\330\020\025\220W\230A\230[\250\001\250\021\340\020\025\220W\230A\230Q\330\020\033\2301\360\006\000\t\014\2108\2202\220Q\330\014\024\220D\230\013\2403\240d\250&\260\002\260(\270!\330\020\024\220M\240\023\240H\250C\250r\260\023\260D\270\r\300Q\300k\320QZ\320Z[\340\010\017\210t\2206\230\022\2301"; +static const char __pyx_k_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G[] = "\200A\340\023\024\330\021\022\330\025\026\330\010\t\330\024\025\340\010\017\210q\330\010\014\210L\230\001\330\014\024\220K\230t\2401\240J\250a\330\014\017\210v\220W\230A\330\020\023\2206\230\023\230A\330\024\033\2301\330\020\024\220A\220Y\230a\330\010\013\2101\330\014\020\220\014\230A\330\020\023\2209\230G\2401\330\024\035\230W\240A\240Q\330\024\030\230\t\240\021\330\030\033\2306\240\023\240A\330\034\"\240*\250A\250Q\330\034\037\230t\2401\330 '\240q\330\010\017\210q"; static const char __pyx_k_Abstract_base_class_for_constrai[] = "Abstract base class for constraints."; static const char __pyx_k_CompilableFunctionConstraint___c[] = "CompilableFunctionConstraint.__call__"; static const char __pyx_k_CompilableFunctionConstraint___i[] = "CompilableFunctionConstraint.__init__"; @@ -2628,6 +2443,7 @@ static const char __pyx_k_Constraint_which_wraps_a_functio[] = "Constraint which static const char __pyx_k_MaxProdConstraint_preProcess_loc[] = "MaxProdConstraint.preProcess..genexpr"; static const char __pyx_k_MaxSumConstraint_preProcess_loca[] = "MaxSumConstraint.preProcess..genexpr"; static const char __pyx_k_Module_containing_the_code_for_c[] = "Module containing the code for constraint definitions."; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; static const char __pyx_k_Wrapper_function_for_picklable_s[] = "Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on."; static const char __pyx_k_Constraint_enforcing_that_at_lea_2[] = "Constraint enforcing that at least some of the values of given variables must not be present in a given set.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(SomeNotInSetConstraint([1]))\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 2)], [('a', 2), ('b', 1)], [('a', 2), ('b', 2)]]\n "; static const char __pyx_k_Constraint_enforcing_that_values_2[] = "Constraint enforcing that values of all given variables are equal.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2])\n >>> problem.addConstraint(AllEqualConstraint())\n >>> sorted(sorted(x.items()) for x in problem.getSolutions())\n [[('a', 1), ('b', 1)], [('a', 2), ('b', 2)]]\n "; @@ -2679,12 +2495,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_set, PyObject *__pyx_v_n, PyObject *__pyx_v_exact); /* proto */ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2__call__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_assignments, PyObject *__pyx_v_forwardcheck); /* proto */ +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_remove = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2710,279 +2536,238 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_10constraint_11constraints___pyx_defaults; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; PyObject *__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr; - #endif + PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_defaults; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr; - PyObject *__pyx_kp_s_Abstract_base_class_for_constrai; - PyObject *__pyx_n_s_AllDifferentConstraint; - PyObject *__pyx_n_s_AllDifferentConstraint___call; - PyObject *__pyx_n_s_AllEqualConstraint; - PyObject *__pyx_n_s_AllEqualConstraint___call; - PyObject *__pyx_n_s_Callable; - PyObject *__pyx_kp_u_Can_t_happen; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_CompilableFunctionConstraint___c; - PyObject *__pyx_n_s_CompilableFunctionConstraint___i; - PyObject *__pyx_kp_u_CompilableFunctionConstraint_can; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_Constraint___call; - PyObject *__pyx_kp_s_Constraint_enforcing_that_at_lea; - PyObject *__pyx_kp_s_Constraint_enforcing_that_at_lea_2; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_2; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_3; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_4; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_5; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_6; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_7; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_8; - PyObject *__pyx_kp_s_Constraint_enforcing_that_values_9; - PyObject *__pyx_n_s_Constraint_forwardCheck; - PyObject *__pyx_n_s_Constraint_preProcess; - PyObject *__pyx_kp_s_Constraint_which_wraps_a_functio; - PyObject *__pyx_n_s_ExactSumConstraint; - PyObject *__pyx_n_s_ExactSumConstraint___call; - PyObject *__pyx_n_s_ExactSumConstraint___init; - PyObject *__pyx_n_s_ExactSumConstraint_preProcess; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionConstraint___call; - PyObject *__pyx_n_s_FunctionConstraint___init; - PyObject *__pyx_n_s_InSetConstraint; - PyObject *__pyx_n_s_InSetConstraint___call; - PyObject *__pyx_n_s_InSetConstraint___init; - PyObject *__pyx_n_s_InSetConstraint_preProcess; - PyObject *__pyx_n_s_MaxProdConstraint; - PyObject *__pyx_n_s_MaxProdConstraint___call; - PyObject *__pyx_n_s_MaxProdConstraint___init; - PyObject *__pyx_n_s_MaxProdConstraint_preProcess; - PyObject *__pyx_n_s_MaxProdConstraint_preProcess_loc; - PyObject *__pyx_n_s_MaxSumConstraint; - PyObject *__pyx_n_s_MaxSumConstraint___call; - PyObject *__pyx_n_s_MaxSumConstraint___init; - PyObject *__pyx_n_s_MaxSumConstraint_preProcess; - PyObject *__pyx_n_s_MaxSumConstraint_preProcess_loca; - PyObject *__pyx_n_s_MinProdConstraint; - PyObject *__pyx_n_s_MinProdConstraint___call; - PyObject *__pyx_n_s_MinProdConstraint___init; - PyObject *__pyx_n_s_MinProdConstraint_preProcess; - PyObject *__pyx_n_s_MinSumConstraint; - PyObject *__pyx_n_s_MinSumConstraint___call; - PyObject *__pyx_n_s_MinSumConstraint___init; - PyObject *__pyx_n_s_NotImplementedError; - PyObject *__pyx_n_s_NotInSetConstraint; - PyObject *__pyx_n_s_NotInSetConstraint___call; - PyObject *__pyx_n_s_NotInSetConstraint___init; - PyObject *__pyx_n_s_NotInSetConstraint_preProcess; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Sequence; - PyObject *__pyx_n_s_RuntimeError; - PyObject *__pyx_n_s_Sequence; - PyObject *__pyx_n_s_SomeInSetConstraint; - PyObject *__pyx_n_s_SomeInSetConstraint___call; - PyObject *__pyx_n_s_SomeInSetConstraint___init; - PyObject *__pyx_n_s_SomeNotInSetConstraint; - PyObject *__pyx_n_s_SomeNotInSetConstraint___call; - PyObject *__pyx_n_s_SomeNotInSetConstraint___init; - PyObject *__pyx_n_s_Unassigned; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_kp_s_Union_int_float; - PyObject *__pyx_kp_s_Wrapper_function_for_picklable_s; - PyObject *__pyx_kp_u__4; - PyObject *__pyx_n_s__68; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_assigned; - PyObject *__pyx_n_s_assigned_2; - PyObject *__pyx_n_s_assignments; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_call; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_kp_s_constraint_constraints_py; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_contains_lt1; - PyObject *__pyx_n_s_contains_negative; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_dict_2; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_exact; - PyObject *__pyx_n_s_exact_2; - PyObject *__pyx_n_s_exactsum; - PyObject *__pyx_n_s_exactsum_2; - PyObject *__pyx_n_s_forwardCheck; - PyObject *__pyx_n_s_forwardcheck; - PyObject *__pyx_n_s_found; - PyObject *__pyx_n_s_func; - PyObject *__pyx_n_s_func_2; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_get; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_maxprod; - PyObject *__pyx_n_s_maxprod_2; - PyObject *__pyx_n_s_maxsum; - PyObject *__pyx_n_s_maxsum_2; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_minprod; - PyObject *__pyx_n_s_minprod_2; - PyObject *__pyx_n_s_minsum; - PyObject *__pyx_n_s_minsum_2; - PyObject *__pyx_n_s_missing; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_multiplier; - PyObject *__pyx_n_s_multipliers; - PyObject *__pyx_n_s_multipliers_2; - PyObject *__pyx_n_s_n; - PyObject *__pyx_n_s_n_2; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_parms; - PyObject *__pyx_n_s_preProcess; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_prod; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_remove; - PyObject *__pyx_n_s_round; - PyObject *__pyx_n_s_seen; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_set; - PyObject *__pyx_n_s_set_2; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_singlevalue; - PyObject *__pyx_n_s_str; - PyObject *__pyx_n_s_sum; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_unassigned; - PyObject *__pyx_n_s_unassignedvariable; - PyObject *__pyx_n_s_value; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variable_contains_lt1; - PyObject *__pyx_n_s_variable_contains_negative; - PyObject *__pyx_n_s_variable_with_lt1; - PyObject *__pyx_n_s_variable_with_negative; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_x; - PyObject *__pyx_n_s_zip; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type__remove; + PyObject *__pyx_slice[1]; + PyObject *__pyx_tuple[6]; + PyObject *__pyx_codeobj_tab[35]; + PyObject *__pyx_string_tab[167]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_10; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_tuple__15; - PyObject *__pyx_tuple__18; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__33; - PyObject *__pyx_tuple__35; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_tuple__43; - PyObject *__pyx_tuple__45; - PyObject *__pyx_tuple__47; - PyObject *__pyx_tuple__49; - PyObject *__pyx_tuple__51; - PyObject *__pyx_tuple__53; - PyObject *__pyx_tuple__56; - PyObject *__pyx_tuple__61; - PyObject *__pyx_tuple__63; - PyObject *__pyx_tuple__64; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__17; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__34; - PyObject *__pyx_codeobj__36; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__42; - PyObject *__pyx_codeobj__44; - PyObject *__pyx_codeobj__46; - PyObject *__pyx_codeobj__48; - PyObject *__pyx_codeobj__50; - PyObject *__pyx_codeobj__52; - PyObject *__pyx_codeobj__54; - PyObject *__pyx_codeobj__55; - PyObject *__pyx_codeobj__57; - PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__59; - PyObject *__pyx_codeobj__60; - PyObject *__pyx_codeobj__62; - PyObject *__pyx_codeobj__65; - PyObject *__pyx_codeobj__66; - PyObject *__pyx_codeobj__67; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[8]; +int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr; +#endif +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_Abstract_base_class_for_constrai __pyx_string_tab[1] +#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[2] +#define __pyx_n_u_AllDifferentConstraint___call __pyx_string_tab[3] +#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[4] +#define __pyx_n_u_AllEqualConstraint___call __pyx_string_tab[5] +#define __pyx_n_u_Callable __pyx_string_tab[6] +#define __pyx_kp_u_Can_t_happen __pyx_string_tab[7] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[8] +#define __pyx_n_u_CompilableFunctionConstraint___c __pyx_string_tab[9] +#define __pyx_n_u_CompilableFunctionConstraint___i __pyx_string_tab[10] +#define __pyx_kp_u_CompilableFunctionConstraint_can __pyx_string_tab[11] +#define __pyx_n_u_Constraint __pyx_string_tab[12] +#define __pyx_n_u_Constraint___call __pyx_string_tab[13] +#define __pyx_kp_u_Constraint_enforcing_that_at_lea __pyx_string_tab[14] +#define __pyx_kp_u_Constraint_enforcing_that_at_lea_2 __pyx_string_tab[15] +#define __pyx_kp_u_Constraint_enforcing_that_values __pyx_string_tab[16] +#define __pyx_kp_u_Constraint_enforcing_that_values_2 __pyx_string_tab[17] +#define __pyx_kp_u_Constraint_enforcing_that_values_3 __pyx_string_tab[18] +#define __pyx_kp_u_Constraint_enforcing_that_values_4 __pyx_string_tab[19] +#define __pyx_kp_u_Constraint_enforcing_that_values_5 __pyx_string_tab[20] +#define __pyx_kp_u_Constraint_enforcing_that_values_6 __pyx_string_tab[21] +#define __pyx_kp_u_Constraint_enforcing_that_values_7 __pyx_string_tab[22] +#define __pyx_kp_u_Constraint_enforcing_that_values_8 __pyx_string_tab[23] +#define __pyx_kp_u_Constraint_enforcing_that_values_9 __pyx_string_tab[24] +#define __pyx_n_u_Constraint_forwardCheck __pyx_string_tab[25] +#define __pyx_n_u_Constraint_preProcess __pyx_string_tab[26] +#define __pyx_kp_u_Constraint_which_wraps_a_functio __pyx_string_tab[27] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[28] +#define __pyx_n_u_ExactSumConstraint___call __pyx_string_tab[29] +#define __pyx_n_u_ExactSumConstraint___init __pyx_string_tab[30] +#define __pyx_n_u_ExactSumConstraint_preProcess __pyx_string_tab[31] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[32] +#define __pyx_n_u_FunctionConstraint___call __pyx_string_tab[33] +#define __pyx_n_u_FunctionConstraint___init __pyx_string_tab[34] +#define __pyx_n_u_InSetConstraint __pyx_string_tab[35] +#define __pyx_n_u_InSetConstraint___call __pyx_string_tab[36] +#define __pyx_n_u_InSetConstraint___init __pyx_string_tab[37] +#define __pyx_n_u_InSetConstraint_preProcess __pyx_string_tab[38] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[39] +#define __pyx_n_u_MaxProdConstraint___call __pyx_string_tab[40] +#define __pyx_n_u_MaxProdConstraint___init __pyx_string_tab[41] +#define __pyx_n_u_MaxProdConstraint_preProcess __pyx_string_tab[42] +#define __pyx_n_u_MaxProdConstraint_preProcess_loc __pyx_string_tab[43] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[44] +#define __pyx_n_u_MaxSumConstraint___call __pyx_string_tab[45] +#define __pyx_n_u_MaxSumConstraint___init __pyx_string_tab[46] +#define __pyx_n_u_MaxSumConstraint_preProcess __pyx_string_tab[47] +#define __pyx_n_u_MaxSumConstraint_preProcess_loca __pyx_string_tab[48] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[49] +#define __pyx_n_u_MinProdConstraint___call __pyx_string_tab[50] +#define __pyx_n_u_MinProdConstraint___init __pyx_string_tab[51] +#define __pyx_n_u_MinProdConstraint_preProcess __pyx_string_tab[52] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[53] +#define __pyx_n_u_MinSumConstraint___call __pyx_string_tab[54] +#define __pyx_n_u_MinSumConstraint___init __pyx_string_tab[55] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[56] +#define __pyx_n_u_NotInSetConstraint __pyx_string_tab[57] +#define __pyx_n_u_NotInSetConstraint___call __pyx_string_tab[58] +#define __pyx_n_u_NotInSetConstraint___init __pyx_string_tab[59] +#define __pyx_n_u_NotInSetConstraint_preProcess __pyx_string_tab[60] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[61] +#define __pyx_n_u_Optional __pyx_string_tab[62] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[63] +#define __pyx_n_u_RuntimeError __pyx_string_tab[64] +#define __pyx_n_u_Sequence __pyx_string_tab[65] +#define __pyx_n_u_SomeInSetConstraint __pyx_string_tab[66] +#define __pyx_n_u_SomeInSetConstraint___call __pyx_string_tab[67] +#define __pyx_n_u_SomeInSetConstraint___init __pyx_string_tab[68] +#define __pyx_n_u_SomeNotInSetConstraint __pyx_string_tab[69] +#define __pyx_n_u_SomeNotInSetConstraint___call __pyx_string_tab[70] +#define __pyx_n_u_SomeNotInSetConstraint___init __pyx_string_tab[71] +#define __pyx_n_u_Unassigned __pyx_string_tab[72] +#define __pyx_n_u_Union __pyx_string_tab[73] +#define __pyx_kp_u_Union_int_float __pyx_string_tab[74] +#define __pyx_kp_u_Wrapper_function_for_picklable_s __pyx_string_tab[75] +#define __pyx_kp_u__2 __pyx_string_tab[76] +#define __pyx_kp_u_add_note __pyx_string_tab[77] +#define __pyx_n_u_assigned __pyx_string_tab[78] +#define __pyx_n_u_assigned_2 __pyx_string_tab[79] +#define __pyx_n_u_assignments __pyx_string_tab[80] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[81] +#define __pyx_n_u_bool __pyx_string_tab[82] +#define __pyx_n_u_call __pyx_string_tab[83] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[84] +#define __pyx_n_u_close __pyx_string_tab[85] +#define __pyx_n_u_collections_abc __pyx_string_tab[86] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[87] +#define __pyx_kp_u_constraint_constraints_py __pyx_string_tab[88] +#define __pyx_n_u_constraint_domain __pyx_string_tab[89] +#define __pyx_n_u_constraints __pyx_string_tab[90] +#define __pyx_n_u_contains_lt1 __pyx_string_tab[91] +#define __pyx_n_u_contains_negative __pyx_string_tab[92] +#define __pyx_n_u_dict __pyx_string_tab[93] +#define __pyx_kp_u_disable __pyx_string_tab[94] +#define __pyx_n_u_doc __pyx_string_tab[95] +#define __pyx_n_u_domain __pyx_string_tab[96] +#define __pyx_n_u_domains __pyx_string_tab[97] +#define __pyx_kp_u_enable __pyx_string_tab[98] +#define __pyx_n_u_exact __pyx_string_tab[99] +#define __pyx_n_u_exact_2 __pyx_string_tab[100] +#define __pyx_n_u_exactsum __pyx_string_tab[101] +#define __pyx_n_u_exactsum_2 __pyx_string_tab[102] +#define __pyx_n_u_forwardCheck __pyx_string_tab[103] +#define __pyx_n_u_forwardcheck __pyx_string_tab[104] +#define __pyx_n_u_found __pyx_string_tab[105] +#define __pyx_n_u_func __pyx_string_tab[106] +#define __pyx_n_u_func_2 __pyx_string_tab[107] +#define __pyx_n_u_func_3 __pyx_string_tab[108] +#define __pyx_kp_u_gc __pyx_string_tab[109] +#define __pyx_n_u_genexpr __pyx_string_tab[110] +#define __pyx_n_u_get __pyx_string_tab[111] +#define __pyx_n_u_hideValue __pyx_string_tab[112] +#define __pyx_n_u_init __pyx_string_tab[113] +#define __pyx_n_u_is_coroutine __pyx_string_tab[114] +#define __pyx_kp_u_isenabled __pyx_string_tab[115] +#define __pyx_kp_u_list_tuple __pyx_string_tab[116] +#define __pyx_n_u_main __pyx_string_tab[117] +#define __pyx_n_u_maxprod __pyx_string_tab[118] +#define __pyx_n_u_maxprod_2 __pyx_string_tab[119] +#define __pyx_n_u_maxsum __pyx_string_tab[120] +#define __pyx_n_u_maxsum_2 __pyx_string_tab[121] +#define __pyx_n_u_metaclass __pyx_string_tab[122] +#define __pyx_n_u_minprod __pyx_string_tab[123] +#define __pyx_n_u_minprod_2 __pyx_string_tab[124] +#define __pyx_n_u_minsum __pyx_string_tab[125] +#define __pyx_n_u_minsum_2 __pyx_string_tab[126] +#define __pyx_n_u_missing __pyx_string_tab[127] +#define __pyx_n_u_module __pyx_string_tab[128] +#define __pyx_n_u_mro_entries __pyx_string_tab[129] +#define __pyx_n_u_multiplier __pyx_string_tab[130] +#define __pyx_n_u_multipliers __pyx_string_tab[131] +#define __pyx_n_u_multipliers_2 __pyx_string_tab[132] +#define __pyx_n_u_n __pyx_string_tab[133] +#define __pyx_n_u_n_2 __pyx_string_tab[134] +#define __pyx_n_u_name __pyx_string_tab[135] +#define __pyx_n_u_next __pyx_string_tab[136] +#define __pyx_n_u_parms __pyx_string_tab[137] +#define __pyx_n_u_preProcess __pyx_string_tab[138] +#define __pyx_n_u_prepare __pyx_string_tab[139] +#define __pyx_n_u_prod __pyx_string_tab[140] +#define __pyx_n_u_qualname __pyx_string_tab[141] +#define __pyx_n_u_remove __pyx_string_tab[142] +#define __pyx_n_u_round __pyx_string_tab[143] +#define __pyx_n_u_seen __pyx_string_tab[144] +#define __pyx_n_u_self __pyx_string_tab[145] +#define __pyx_n_u_send __pyx_string_tab[146] +#define __pyx_n_u_set __pyx_string_tab[147] +#define __pyx_n_u_set_2 __pyx_string_tab[148] +#define __pyx_n_u_singlevalue __pyx_string_tab[149] +#define __pyx_n_u_str __pyx_string_tab[150] +#define __pyx_n_u_sum __pyx_string_tab[151] +#define __pyx_n_u_test __pyx_string_tab[152] +#define __pyx_n_u_throw __pyx_string_tab[153] +#define __pyx_n_u_typing __pyx_string_tab[154] +#define __pyx_n_u_unassigned __pyx_string_tab[155] +#define __pyx_n_u_unassignedvariable __pyx_string_tab[156] +#define __pyx_n_u_value __pyx_string_tab[157] +#define __pyx_n_u_variable __pyx_string_tab[158] +#define __pyx_n_u_variable_contains_lt1 __pyx_string_tab[159] +#define __pyx_n_u_variable_contains_negative __pyx_string_tab[160] +#define __pyx_n_u_variable_with_lt1 __pyx_string_tab[161] +#define __pyx_n_u_variable_with_negative __pyx_string_tab[162] +#define __pyx_n_u_variables __pyx_string_tab[163] +#define __pyx_n_u_vconstraints __pyx_string_tab[164] +#define __pyx_n_u_x __pyx_string_tab[165] +#define __pyx_n_u_zip __pyx_string_tab[166] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -2996,782 +2781,55 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif + Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_defaults); + Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_s_Abstract_base_class_for_constrai); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_Callable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Can_t_happen); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint___c); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint___i); - Py_CLEAR(clear_module_state->__pyx_kp_u_CompilableFunctionConstraint_can); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint___call); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_3); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_4); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_5); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_6); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_7); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_8); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_enforcing_that_values_9); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_forwardCheck); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_kp_s_Constraint_which_wraps_a_functio); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_InSetConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint_preProcess_loc); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint_preProcess_loca); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_NotInSetConstraint_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint___call); - Py_CLEAR(clear_module_state->__pyx_n_s_SomeNotInSetConstraint___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_int_float); - Py_CLEAR(clear_module_state->__pyx_kp_s_Wrapper_function_for_picklable_s); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_n_s__68); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_assigned); - Py_CLEAR(clear_module_state->__pyx_n_s_assigned_2); - Py_CLEAR(clear_module_state->__pyx_n_s_assignments); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_call); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_constraints_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_contains_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_contains_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_exact); - Py_CLEAR(clear_module_state->__pyx_n_s_exact_2); - Py_CLEAR(clear_module_state->__pyx_n_s_exactsum); - Py_CLEAR(clear_module_state->__pyx_n_s_exactsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardCheck); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck); - Py_CLEAR(clear_module_state->__pyx_n_s_found); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_n_s_func_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_get); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_maxprod); - Py_CLEAR(clear_module_state->__pyx_n_s_maxprod_2); - Py_CLEAR(clear_module_state->__pyx_n_s_maxsum); - Py_CLEAR(clear_module_state->__pyx_n_s_maxsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_minprod); - Py_CLEAR(clear_module_state->__pyx_n_s_minprod_2); - Py_CLEAR(clear_module_state->__pyx_n_s_minsum); - Py_CLEAR(clear_module_state->__pyx_n_s_minsum_2); - Py_CLEAR(clear_module_state->__pyx_n_s_missing); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_multiplier); - Py_CLEAR(clear_module_state->__pyx_n_s_multipliers); - Py_CLEAR(clear_module_state->__pyx_n_s_multipliers_2); - Py_CLEAR(clear_module_state->__pyx_n_s_n); - Py_CLEAR(clear_module_state->__pyx_n_s_n_2); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_parms); - Py_CLEAR(clear_module_state->__pyx_n_s_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_prod); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_remove); - Py_CLEAR(clear_module_state->__pyx_n_s_round); - Py_CLEAR(clear_module_state->__pyx_n_s_seen); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_set); - Py_CLEAR(clear_module_state->__pyx_n_s_set_2); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_singlevalue); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_n_s_sum); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_unassignedvariable); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_contains_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_contains_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_with_lt1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable_with_negative); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_x); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<6; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<35; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<167; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_10); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_tuple__15); - Py_CLEAR(clear_module_state->__pyx_tuple__18); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__33); - Py_CLEAR(clear_module_state->__pyx_tuple__35); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_tuple__43); - Py_CLEAR(clear_module_state->__pyx_tuple__45); - Py_CLEAR(clear_module_state->__pyx_tuple__47); - Py_CLEAR(clear_module_state->__pyx_tuple__49); - Py_CLEAR(clear_module_state->__pyx_tuple__51); - Py_CLEAR(clear_module_state->__pyx_tuple__53); - Py_CLEAR(clear_module_state->__pyx_tuple__56); - Py_CLEAR(clear_module_state->__pyx_tuple__61); - Py_CLEAR(clear_module_state->__pyx_tuple__63); - Py_CLEAR(clear_module_state->__pyx_tuple__64); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__17); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__34); - Py_CLEAR(clear_module_state->__pyx_codeobj__36); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__42); - Py_CLEAR(clear_module_state->__pyx_codeobj__44); - Py_CLEAR(clear_module_state->__pyx_codeobj__46); - Py_CLEAR(clear_module_state->__pyx_codeobj__48); - Py_CLEAR(clear_module_state->__pyx_codeobj__50); - Py_CLEAR(clear_module_state->__pyx_codeobj__52); - Py_CLEAR(clear_module_state->__pyx_codeobj__54); - Py_CLEAR(clear_module_state->__pyx_codeobj__55); - Py_CLEAR(clear_module_state->__pyx_codeobj__57); - Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__60); - Py_CLEAR(clear_module_state->__pyx_codeobj__62); - Py_CLEAR(clear_module_state->__pyx_codeobj__65); - Py_CLEAR(clear_module_state->__pyx_codeobj__66); - Py_CLEAR(clear_module_state->__pyx_codeobj__67); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif + Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_defaults); + Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_defaults); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_s_Abstract_base_class_for_constrai); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_Callable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Can_t_happen); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint___c); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint___i); - Py_VISIT(traverse_module_state->__pyx_kp_u_CompilableFunctionConstraint_can); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint___call); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_at_lea_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_3); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_4); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_5); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_6); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_7); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_8); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_enforcing_that_values_9); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_forwardCheck); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_kp_s_Constraint_which_wraps_a_functio); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_InSetConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint_preProcess_loc); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint_preProcess_loca); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_NotInSetConstraint_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint___call); - Py_VISIT(traverse_module_state->__pyx_n_s_SomeNotInSetConstraint___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_int_float); - Py_VISIT(traverse_module_state->__pyx_kp_s_Wrapper_function_for_picklable_s); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_n_s__68); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_assigned); - Py_VISIT(traverse_module_state->__pyx_n_s_assigned_2); - Py_VISIT(traverse_module_state->__pyx_n_s_assignments); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_call); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_constraints_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_contains_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_contains_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_exact); - Py_VISIT(traverse_module_state->__pyx_n_s_exact_2); - Py_VISIT(traverse_module_state->__pyx_n_s_exactsum); - Py_VISIT(traverse_module_state->__pyx_n_s_exactsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardCheck); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck); - Py_VISIT(traverse_module_state->__pyx_n_s_found); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_n_s_func_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_get); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_maxprod); - Py_VISIT(traverse_module_state->__pyx_n_s_maxprod_2); - Py_VISIT(traverse_module_state->__pyx_n_s_maxsum); - Py_VISIT(traverse_module_state->__pyx_n_s_maxsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_minprod); - Py_VISIT(traverse_module_state->__pyx_n_s_minprod_2); - Py_VISIT(traverse_module_state->__pyx_n_s_minsum); - Py_VISIT(traverse_module_state->__pyx_n_s_minsum_2); - Py_VISIT(traverse_module_state->__pyx_n_s_missing); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_multiplier); - Py_VISIT(traverse_module_state->__pyx_n_s_multipliers); - Py_VISIT(traverse_module_state->__pyx_n_s_multipliers_2); - Py_VISIT(traverse_module_state->__pyx_n_s_n); - Py_VISIT(traverse_module_state->__pyx_n_s_n_2); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_parms); - Py_VISIT(traverse_module_state->__pyx_n_s_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_prod); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_remove); - Py_VISIT(traverse_module_state->__pyx_n_s_round); - Py_VISIT(traverse_module_state->__pyx_n_s_seen); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_set); - Py_VISIT(traverse_module_state->__pyx_n_s_set_2); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_singlevalue); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_n_s_sum); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_unassignedvariable); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_contains_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_contains_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_with_lt1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable_with_negative); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_10); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_tuple__15); - Py_VISIT(traverse_module_state->__pyx_tuple__18); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__33); - Py_VISIT(traverse_module_state->__pyx_tuple__35); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_tuple__43); - Py_VISIT(traverse_module_state->__pyx_tuple__45); - Py_VISIT(traverse_module_state->__pyx_tuple__47); - Py_VISIT(traverse_module_state->__pyx_tuple__49); - Py_VISIT(traverse_module_state->__pyx_tuple__51); - Py_VISIT(traverse_module_state->__pyx_tuple__53); - Py_VISIT(traverse_module_state->__pyx_tuple__56); - Py_VISIT(traverse_module_state->__pyx_tuple__61); - Py_VISIT(traverse_module_state->__pyx_tuple__63); - Py_VISIT(traverse_module_state->__pyx_tuple__64); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__17); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__34); - Py_VISIT(traverse_module_state->__pyx_codeobj__36); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__42); - Py_VISIT(traverse_module_state->__pyx_codeobj__44); - Py_VISIT(traverse_module_state->__pyx_codeobj__46); - Py_VISIT(traverse_module_state->__pyx_codeobj__48); - Py_VISIT(traverse_module_state->__pyx_codeobj__50); - Py_VISIT(traverse_module_state->__pyx_codeobj__52); - Py_VISIT(traverse_module_state->__pyx_codeobj__54); - Py_VISIT(traverse_module_state->__pyx_codeobj__55); - Py_VISIT(traverse_module_state->__pyx_codeobj__57); - Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__60); - Py_VISIT(traverse_module_state->__pyx_codeobj__62); - Py_VISIT(traverse_module_state->__pyx_codeobj__65); - Py_VISIT(traverse_module_state->__pyx_codeobj__66); - Py_VISIT(traverse_module_state->__pyx_codeobj__67); + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<6; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<35; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<167; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_10); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr -#define __pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr -#endif -#define __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr -#define __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr -#define __pyx_kp_s_Abstract_base_class_for_constrai __pyx_mstate_global->__pyx_kp_s_Abstract_base_class_for_constrai -#define __pyx_n_s_AllDifferentConstraint __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint -#define __pyx_n_s_AllDifferentConstraint___call __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint___call -#define __pyx_n_s_AllEqualConstraint __pyx_mstate_global->__pyx_n_s_AllEqualConstraint -#define __pyx_n_s_AllEqualConstraint___call __pyx_mstate_global->__pyx_n_s_AllEqualConstraint___call -#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable -#define __pyx_kp_u_Can_t_happen __pyx_mstate_global->__pyx_kp_u_Can_t_happen -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_CompilableFunctionConstraint___c __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint___c -#define __pyx_n_s_CompilableFunctionConstraint___i __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint___i -#define __pyx_kp_u_CompilableFunctionConstraint_can __pyx_mstate_global->__pyx_kp_u_CompilableFunctionConstraint_can -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_Constraint___call __pyx_mstate_global->__pyx_n_s_Constraint___call -#define __pyx_kp_s_Constraint_enforcing_that_at_lea __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_at_lea -#define __pyx_kp_s_Constraint_enforcing_that_at_lea_2 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_at_lea_2 -#define __pyx_kp_s_Constraint_enforcing_that_values __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values -#define __pyx_kp_s_Constraint_enforcing_that_values_2 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_2 -#define __pyx_kp_s_Constraint_enforcing_that_values_3 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_3 -#define __pyx_kp_s_Constraint_enforcing_that_values_4 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_4 -#define __pyx_kp_s_Constraint_enforcing_that_values_5 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_5 -#define __pyx_kp_s_Constraint_enforcing_that_values_6 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_6 -#define __pyx_kp_s_Constraint_enforcing_that_values_7 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_7 -#define __pyx_kp_s_Constraint_enforcing_that_values_8 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_8 -#define __pyx_kp_s_Constraint_enforcing_that_values_9 __pyx_mstate_global->__pyx_kp_s_Constraint_enforcing_that_values_9 -#define __pyx_n_s_Constraint_forwardCheck __pyx_mstate_global->__pyx_n_s_Constraint_forwardCheck -#define __pyx_n_s_Constraint_preProcess __pyx_mstate_global->__pyx_n_s_Constraint_preProcess -#define __pyx_kp_s_Constraint_which_wraps_a_functio __pyx_mstate_global->__pyx_kp_s_Constraint_which_wraps_a_functio -#define __pyx_n_s_ExactSumConstraint __pyx_mstate_global->__pyx_n_s_ExactSumConstraint -#define __pyx_n_s_ExactSumConstraint___call __pyx_mstate_global->__pyx_n_s_ExactSumConstraint___call -#define __pyx_n_s_ExactSumConstraint___init __pyx_mstate_global->__pyx_n_s_ExactSumConstraint___init -#define __pyx_n_s_ExactSumConstraint_preProcess __pyx_mstate_global->__pyx_n_s_ExactSumConstraint_preProcess -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionConstraint___call __pyx_mstate_global->__pyx_n_s_FunctionConstraint___call -#define __pyx_n_s_FunctionConstraint___init __pyx_mstate_global->__pyx_n_s_FunctionConstraint___init -#define __pyx_n_s_InSetConstraint __pyx_mstate_global->__pyx_n_s_InSetConstraint -#define __pyx_n_s_InSetConstraint___call __pyx_mstate_global->__pyx_n_s_InSetConstraint___call -#define __pyx_n_s_InSetConstraint___init __pyx_mstate_global->__pyx_n_s_InSetConstraint___init -#define __pyx_n_s_InSetConstraint_preProcess __pyx_mstate_global->__pyx_n_s_InSetConstraint_preProcess -#define __pyx_n_s_MaxProdConstraint __pyx_mstate_global->__pyx_n_s_MaxProdConstraint -#define __pyx_n_s_MaxProdConstraint___call __pyx_mstate_global->__pyx_n_s_MaxProdConstraint___call -#define __pyx_n_s_MaxProdConstraint___init __pyx_mstate_global->__pyx_n_s_MaxProdConstraint___init -#define __pyx_n_s_MaxProdConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MaxProdConstraint_preProcess -#define __pyx_n_s_MaxProdConstraint_preProcess_loc __pyx_mstate_global->__pyx_n_s_MaxProdConstraint_preProcess_loc -#define __pyx_n_s_MaxSumConstraint __pyx_mstate_global->__pyx_n_s_MaxSumConstraint -#define __pyx_n_s_MaxSumConstraint___call __pyx_mstate_global->__pyx_n_s_MaxSumConstraint___call -#define __pyx_n_s_MaxSumConstraint___init __pyx_mstate_global->__pyx_n_s_MaxSumConstraint___init -#define __pyx_n_s_MaxSumConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MaxSumConstraint_preProcess -#define __pyx_n_s_MaxSumConstraint_preProcess_loca __pyx_mstate_global->__pyx_n_s_MaxSumConstraint_preProcess_loca -#define __pyx_n_s_MinProdConstraint __pyx_mstate_global->__pyx_n_s_MinProdConstraint -#define __pyx_n_s_MinProdConstraint___call __pyx_mstate_global->__pyx_n_s_MinProdConstraint___call -#define __pyx_n_s_MinProdConstraint___init __pyx_mstate_global->__pyx_n_s_MinProdConstraint___init -#define __pyx_n_s_MinProdConstraint_preProcess __pyx_mstate_global->__pyx_n_s_MinProdConstraint_preProcess -#define __pyx_n_s_MinSumConstraint __pyx_mstate_global->__pyx_n_s_MinSumConstraint -#define __pyx_n_s_MinSumConstraint___call __pyx_mstate_global->__pyx_n_s_MinSumConstraint___call -#define __pyx_n_s_MinSumConstraint___init __pyx_mstate_global->__pyx_n_s_MinSumConstraint___init -#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError -#define __pyx_n_s_NotInSetConstraint __pyx_mstate_global->__pyx_n_s_NotInSetConstraint -#define __pyx_n_s_NotInSetConstraint___call __pyx_mstate_global->__pyx_n_s_NotInSetConstraint___call -#define __pyx_n_s_NotInSetConstraint___init __pyx_mstate_global->__pyx_n_s_NotInSetConstraint___init -#define __pyx_n_s_NotInSetConstraint_preProcess __pyx_mstate_global->__pyx_n_s_NotInSetConstraint_preProcess -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Sequence __pyx_mstate_global->__pyx_kp_s_Optional_Sequence -#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError -#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence -#define __pyx_n_s_SomeInSetConstraint __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint -#define __pyx_n_s_SomeInSetConstraint___call __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint___call -#define __pyx_n_s_SomeInSetConstraint___init __pyx_mstate_global->__pyx_n_s_SomeInSetConstraint___init -#define __pyx_n_s_SomeNotInSetConstraint __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint -#define __pyx_n_s_SomeNotInSetConstraint___call __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint___call -#define __pyx_n_s_SomeNotInSetConstraint___init __pyx_mstate_global->__pyx_n_s_SomeNotInSetConstraint___init -#define __pyx_n_s_Unassigned __pyx_mstate_global->__pyx_n_s_Unassigned -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_kp_s_Union_int_float __pyx_mstate_global->__pyx_kp_s_Union_int_float -#define __pyx_kp_s_Wrapper_function_for_picklable_s __pyx_mstate_global->__pyx_kp_s_Wrapper_function_for_picklable_s -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_n_s__68 __pyx_mstate_global->__pyx_n_s__68 -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_assigned __pyx_mstate_global->__pyx_n_s_assigned -#define __pyx_n_s_assigned_2 __pyx_mstate_global->__pyx_n_s_assigned_2 -#define __pyx_n_s_assignments __pyx_mstate_global->__pyx_n_s_assignments -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_call __pyx_mstate_global->__pyx_n_s_call -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_kp_s_constraint_constraints_py __pyx_mstate_global->__pyx_kp_s_constraint_constraints_py -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_contains_lt1 __pyx_mstate_global->__pyx_n_s_contains_lt1 -#define __pyx_n_s_contains_negative __pyx_mstate_global->__pyx_n_s_contains_negative -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_exact __pyx_mstate_global->__pyx_n_s_exact -#define __pyx_n_s_exact_2 __pyx_mstate_global->__pyx_n_s_exact_2 -#define __pyx_n_s_exactsum __pyx_mstate_global->__pyx_n_s_exactsum -#define __pyx_n_s_exactsum_2 __pyx_mstate_global->__pyx_n_s_exactsum_2 -#define __pyx_n_s_forwardCheck __pyx_mstate_global->__pyx_n_s_forwardCheck -#define __pyx_n_s_forwardcheck __pyx_mstate_global->__pyx_n_s_forwardcheck -#define __pyx_n_s_found __pyx_mstate_global->__pyx_n_s_found -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_n_s_func_2 __pyx_mstate_global->__pyx_n_s_func_2 -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_maxprod __pyx_mstate_global->__pyx_n_s_maxprod -#define __pyx_n_s_maxprod_2 __pyx_mstate_global->__pyx_n_s_maxprod_2 -#define __pyx_n_s_maxsum __pyx_mstate_global->__pyx_n_s_maxsum -#define __pyx_n_s_maxsum_2 __pyx_mstate_global->__pyx_n_s_maxsum_2 -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_minprod __pyx_mstate_global->__pyx_n_s_minprod -#define __pyx_n_s_minprod_2 __pyx_mstate_global->__pyx_n_s_minprod_2 -#define __pyx_n_s_minsum __pyx_mstate_global->__pyx_n_s_minsum -#define __pyx_n_s_minsum_2 __pyx_mstate_global->__pyx_n_s_minsum_2 -#define __pyx_n_s_missing __pyx_mstate_global->__pyx_n_s_missing -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_multiplier __pyx_mstate_global->__pyx_n_s_multiplier -#define __pyx_n_s_multipliers __pyx_mstate_global->__pyx_n_s_multipliers -#define __pyx_n_s_multipliers_2 __pyx_mstate_global->__pyx_n_s_multipliers_2 -#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n -#define __pyx_n_s_n_2 __pyx_mstate_global->__pyx_n_s_n_2 -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_parms __pyx_mstate_global->__pyx_n_s_parms -#define __pyx_n_s_preProcess __pyx_mstate_global->__pyx_n_s_preProcess -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_prod __pyx_mstate_global->__pyx_n_s_prod -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove -#define __pyx_n_s_round __pyx_mstate_global->__pyx_n_s_round -#define __pyx_n_s_seen __pyx_mstate_global->__pyx_n_s_seen -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set -#define __pyx_n_s_set_2 __pyx_mstate_global->__pyx_n_s_set_2 -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_singlevalue __pyx_mstate_global->__pyx_n_s_singlevalue -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_n_s_sum __pyx_mstate_global->__pyx_n_s_sum -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_unassigned __pyx_mstate_global->__pyx_n_s_unassigned -#define __pyx_n_s_unassignedvariable __pyx_mstate_global->__pyx_n_s_unassignedvariable -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variable_contains_lt1 __pyx_mstate_global->__pyx_n_s_variable_contains_lt1 -#define __pyx_n_s_variable_contains_negative __pyx_mstate_global->__pyx_n_s_variable_contains_negative -#define __pyx_n_s_variable_with_lt1 __pyx_mstate_global->__pyx_n_s_variable_with_lt1 -#define __pyx_n_s_variable_with_negative __pyx_mstate_global->__pyx_n_s_variable_with_negative -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 -#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33 -#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 -#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 -#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 -#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 -#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 -#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 -#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 -#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 -#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 -#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 -#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 -#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 -#define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 -#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 -#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 -#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 -#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 -#define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 -#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 -#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 -#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 -#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 -#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 -#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 -#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 /* #### Code section: module_code ### */ /* "constraint/constraints.py":10 @@ -3780,7 +2838,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_1__call__(PyObject *__pyx_self, @@ -3816,7 +2874,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3824,20 +2882,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3845,7 +2909,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3853,7 +2917,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -3863,7 +2927,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -3873,7 +2937,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -3884,8 +2948,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error) } } @@ -3895,9 +2962,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -3927,8 +2997,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 10, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 10, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 10, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 10, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -3949,7 +3019,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_variables, CYTHON_UNUSED PyObject *__pyx_v_domains, CYTHON_UNUSED PyObject *__pyx_v_assignments, CYTHON_UNUSED PyObject *__pyx_v_forwardcheck) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":33 * broken or not @@ -3957,7 +3027,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * return True # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -3969,7 +3039,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ /* function exit code */ __pyx_L0:; @@ -3984,7 +3054,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint___call__(CYTHO * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_10Constraint_3preProcess(PyObject *__pyx_self, @@ -4020,7 +3090,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4028,19 +3098,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4048,7 +3123,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4056,7 +3131,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -4066,7 +3141,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -4076,7 +3151,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -4086,7 +3161,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -4130,9 +3205,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 35, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 35, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -4169,7 +3244,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":54 * of constraints affecting the given variables. @@ -4177,7 +3252,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if len(variables) == 1: # <<<<<<<<<<<<<< * variable = variables[0] * domain = domains[variable] - */ +*/ __pyx_t_1 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 54, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { @@ -4188,8 +3263,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * variable = variables[0] # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_variables, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_variable = __pyx_t_3; __pyx_t_3 = 0; @@ -4200,7 +3275,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if not self(variables, domains, {variable: value}): - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_domain = __pyx_t_3; @@ -4212,8 +3287,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * for value in domain[:]: # <<<<<<<<<<<<<< * if not self(variables, domains, {variable: value}): * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); @@ -4222,7 +3297,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY } else { __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -4230,13 +3305,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4244,13 +3322,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 57, __pyx_L1_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); + if (unlikely((0 < 0))) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4277,7 +3358,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< * domain.remove(value) * constraints.remove((self, variables)) - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_v_variable, __pyx_v_value) < 0) __PYX_ERR(0, 58, __pyx_L1_error) @@ -4287,13 +3368,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; } #endif { @@ -4316,21 +3396,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * domain.remove(value) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * vconstraints[variable].remove((self, variables)) - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; } #endif { @@ -4349,7 +3428,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if not self(variables, domains, {variable: value}): # <<<<<<<<<<<<<< * domain.remove(value) * constraints.remove((self, variables)) - */ +*/ } /* "constraint/constraints.py":57 @@ -4358,7 +3437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * for value in domain[:]: # <<<<<<<<<<<<<< * if not self(variables, domains, {variable: value}): * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -4368,16 +3447,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * - */ +*/ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 60, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables)) __PYX_ERR(0, 60, __pyx_L1_error); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 60, __pyx_L1_error); + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4388,32 +3467,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self)) __PYX_ERR(0, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables)) __PYX_ERR(0, 61, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 61, __pyx_L1_error); __pyx_t_6 = NULL; __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_9 = 1; - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_9 = 1; } #endif { @@ -4433,7 +3511,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * if len(variables) == 1: # <<<<<<<<<<<<<< * variable = variables[0] * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":35 @@ -4442,7 +3520,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4470,7 +3548,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_2preProcess(CY * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -4480,20 +3558,20 @@ static PyObject *__pyx_pf_10constraint_11constraints___defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 63, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 63, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 63, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -4545,7 +3623,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("forwardCheck (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4553,21 +3631,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_unassigned,0}; - __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->arg0); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4575,7 +3659,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4583,7 +3667,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -4593,7 +3677,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -4603,7 +3687,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -4614,8 +3698,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L3_error) } } @@ -4625,9 +3712,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -4657,8 +3747,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 63, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 63, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 63, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v__unassigned); /* function exit code */ @@ -4695,7 +3785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("forwardCheck", 1); + __Pyx_RefNannySetupContext("forwardCheck", 0); /* "constraint/constraints.py":81 * broken or not @@ -4703,7 +3793,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * unassignedvariable = _unassigned # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_unassignedvariable = __pyx_v__unassigned; @@ -4713,7 +3803,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * if unassignedvariable is _unassigned: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -4721,20 +3811,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 82, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -4742,13 +3835,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 82, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 82, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -4775,7 +3871,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if variable not in assignments: # <<<<<<<<<<<<<< * if unassignedvariable is _unassigned: * unassignedvariable = variable - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) if (__pyx_t_5) { @@ -4785,7 +3881,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< * unassignedvariable = variable * else: - */ +*/ __pyx_t_5 = (__pyx_v_unassignedvariable == __pyx_v__unassigned); if (__pyx_t_5) { @@ -4795,7 +3891,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * unassignedvariable = variable # <<<<<<<<<<<<<< * else: * break - */ +*/ __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_unassignedvariable, __pyx_v_variable); @@ -4805,7 +3901,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is _unassigned: # <<<<<<<<<<<<<< * unassignedvariable = variable * else: - */ +*/ goto __pyx_L6; } @@ -4815,7 +3911,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * break # <<<<<<<<<<<<<< * else: * if unassignedvariable is not _unassigned: - */ +*/ /*else*/ { goto __pyx_L4_break; } @@ -4827,7 +3923,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if variable not in assignments: # <<<<<<<<<<<<<< * if unassignedvariable is _unassigned: * unassignedvariable = variable - */ +*/ } /* "constraint/constraints.py":82 @@ -4836,7 +3932,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * if unassignedvariable is _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L7_for_else; @@ -4852,7 +3948,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< * # Remove from the unassigned variable domain's all * # values which break our variable's constraints. - */ +*/ __pyx_t_5 = (__pyx_v_unassignedvariable != __pyx_v__unassigned); if (__pyx_t_5) { @@ -4862,7 +3958,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * domain = domains[unassignedvariable] # <<<<<<<<<<<<<< * if domain: * for value in domain[:]: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_unassignedvariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_domain = __pyx_t_1; @@ -4874,7 +3970,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if domain: # <<<<<<<<<<<<<< * for value in domain[:]: * assignments[unassignedvariable] = value - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 93, __pyx_L1_error) if (__pyx_t_5) { @@ -4884,8 +3980,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -4894,7 +3990,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -4902,13 +3998,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4916,13 +4015,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 94, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -4949,7 +4051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * assignments[unassignedvariable] = value # <<<<<<<<<<<<<< * if not self(variables, domains, assignments): * domain.hideValue(value) - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_unassignedvariable, __pyx_v_value) < 0))) __PYX_ERR(0, 95, __pyx_L1_error) /* "constraint/constraints.py":96 @@ -4958,20 +4060,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< * domain.hideValue(value) * del assignments[unassignedvariable] - */ +*/ __Pyx_INCREF(__pyx_v_self); __pyx_t_6 = __pyx_v_self; __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } + assert(__pyx_t_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; } #endif { @@ -4993,21 +4094,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * domain.hideValue(value) # <<<<<<<<<<<<<< * del assignments[unassignedvariable] * if not domain: - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } + assert(__pyx_t_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; } #endif { @@ -5026,7 +4126,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not self(variables, domains, assignments): # <<<<<<<<<<<<<< * domain.hideValue(value) * del assignments[unassignedvariable] - */ +*/ } /* "constraint/constraints.py":94 @@ -5035,7 +4135,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[unassignedvariable] = value * if not self(variables, domains, assignments): - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5045,7 +4145,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * del assignments[unassignedvariable] # <<<<<<<<<<<<<< * if not domain: * return False - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_unassignedvariable) < 0))) __PYX_ERR(0, 98, __pyx_L1_error) /* "constraint/constraints.py":93 @@ -5054,7 +4154,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if domain: # <<<<<<<<<<<<<< * for value in domain[:]: * assignments[unassignedvariable] = value - */ +*/ } /* "constraint/constraints.py":99 @@ -5063,7 +4163,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_9); if (__pyx_t_5) { @@ -5074,7 +4174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5086,7 +4186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":89 @@ -5095,7 +4195,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * if unassignedvariable is not _unassigned: # <<<<<<<<<<<<<< * # Remove from the unassigned variable domain's all * # values which break our variable's constraints. - */ +*/ } } __pyx_L8_for_end:; @@ -5106,7 +4206,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -5118,7 +4218,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5144,7 +4244,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_10Constraint_4forwardCheck( * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18FunctionConstraint_1__init__(PyObject *__pyx_self, @@ -5178,7 +4278,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5186,16 +4286,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,&__pyx_n_s_assigned,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_func,&__pyx_mstate_global->__pyx_n_u_assigned,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5203,7 +4307,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5211,7 +4315,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_func)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -5222,8 +4326,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assigned); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) } } @@ -5233,9 +4340,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -5280,7 +4390,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":134 * variables or not @@ -5288,8 +4398,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 134, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 134, __pyx_L1_error) /* "constraint/constraints.py":135 * """ @@ -5297,8 +4407,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__( # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 135, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 135, __pyx_L1_error) /* "constraint/constraints.py":125 * """ @@ -5306,7 +4416,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5326,7 +4436,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint___init * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -5336,7 +4446,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":142 @@ -5345,15 +4455,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False))) __PYX_ERR(0, 137, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False)) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); /* "constraint/constraints.py":137 * self._assigned = assigned @@ -5361,14 +4471,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_2__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 137, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 137, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -5420,7 +4530,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5428,24 +4538,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->arg0); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5453,7 +4571,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5461,7 +4579,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -5471,7 +4589,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -5481,7 +4599,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -5492,15 +4610,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L3_error) } } @@ -5510,11 +4634,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -5545,8 +4674,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 140, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 140, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18FunctionConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -5583,7 +4712,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":174 * @@ -5591,7 +4720,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * parms = list() # <<<<<<<<<<<<<< * missing = 0 * for x in variables: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_parms = ((PyObject*)__pyx_t_1); @@ -5603,9 +4732,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * missing = 0 # <<<<<<<<<<<<<< * for x in variables: * if x in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":176 * parms = list() @@ -5613,7 +4742,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * for x in variables: # <<<<<<<<<<<<<< * if x in assignments: * parms.append(assignments[x]) - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -5621,20 +4750,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 176, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 176, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5642,13 +4774,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 176, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 176, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 176, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5675,7 +4810,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if x in assignments: # <<<<<<<<<<<<<< * parms.append(assignments[x]) * else: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_x, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) if (__pyx_t_5) { @@ -5685,7 +4820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * parms.append(assignments[x]) # <<<<<<<<<<<<<< * else: * parms.append(_unassigned) - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error) @@ -5697,7 +4832,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if x in assignments: # <<<<<<<<<<<<<< * parms.append(assignments[x]) * else: - */ +*/ goto __pyx_L5; } @@ -5707,7 +4842,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * parms.append(_unassigned) # <<<<<<<<<<<<<< * missing += 1 * - */ +*/ /*else*/ { __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parms, __pyx_v__unassigned); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error) @@ -5717,8 +4852,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * missing += 1 # <<<<<<<<<<<<<< * * # if there are unassigned variables, do a forward check before executing the restriction function - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_4); __pyx_t_4 = 0; @@ -5731,7 +4866,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * for x in variables: # <<<<<<<<<<<<<< * if x in assignments: * parms.append(assignments[x]) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -5741,8 +4876,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if missing > 0: # <<<<<<<<<<<<<< * return (self._assigned or self._func(*parms)) and ( * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_missing, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) +*/ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_missing, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { @@ -5753,9 +4888,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * return (self._assigned or self._func(*parms)) and ( # <<<<<<<<<<<<<< * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) * ) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5763,7 +4898,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal } else { goto __pyx_L9_next_and; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); @@ -5788,7 +4923,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) # <<<<<<<<<<<<<< * ) * return self._func(*parms) - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_5); if (!__pyx_t_9) { @@ -5799,7 +4934,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __pyx_t_8 = 0; goto __pyx_L8_bool_binop_done; } - __pyx_t_8 = __Pyx_PyInt_NeObjC(__pyx_v_missing, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_NeObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) if (!__pyx_t_9) { @@ -5810,20 +4945,19 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardCheck); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardCheck); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; } #endif { @@ -5848,7 +4982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * if missing > 0: # <<<<<<<<<<<<<< * return (self._assigned or self._func(*parms)) and ( * not forwardcheck or missing != 1 or self.forwardCheck(variables, domains, assignments) - */ +*/ } /* "constraint/constraints.py":188 @@ -5857,9 +4991,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * return self._func(*parms) # <<<<<<<<<<<<<< * * class CompilableFunctionConstraint(Constraint): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySequence_Tuple(__pyx_v_parms); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -5877,7 +5011,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5902,7 +5036,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18FunctionConstraint_2__cal * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_28CompilableFunctionConstraint_1__init__(PyObject *__pyx_self, @@ -5935,7 +5069,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5943,16 +5077,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_func,&__pyx_n_s_assigned,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_func,&__pyx_mstate_global->__pyx_n_u_assigned,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5960,7 +5098,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5968,7 +5106,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_func)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_func)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -5979,8 +5117,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assigned); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) } } @@ -5990,9 +5131,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -6018,7 +5162,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 1))) __PYX_ERR(0, 193, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_func), (&PyUnicode_Type), 0, "func", 2))) __PYX_ERR(0, 193, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_28CompilableFunctionConstraint___init__(__pyx_self, __pyx_v_self, __pyx_v_func, __pyx_v_assigned); /* function exit code */ @@ -6042,7 +5186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":194 * @@ -6050,8 +5194,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * self._func = func # <<<<<<<<<<<<<< * self._assigned = assigned * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 194, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_func_2, __pyx_v_func) < 0) __PYX_ERR(0, 194, __pyx_L1_error) /* "constraint/constraints.py":195 * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 @@ -6059,8 +5203,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * self._assigned = assigned # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 195, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_assigned_2, __pyx_v_assigned) < 0) __PYX_ERR(0, 195, __pyx_L1_error) /* "constraint/constraints.py":193 * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" @@ -6068,7 +5212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -6088,7 +5232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") * - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -6098,23 +5242,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_4__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False))) __PYX_ERR(0, 197, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False)) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 197, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 197, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6166,7 +5310,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6174,24 +5318,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults2 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->arg0); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6199,7 +5351,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6207,7 +5359,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -6217,7 +5369,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -6227,7 +5379,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -6238,15 +5390,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) } } @@ -6256,11 +5414,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -6311,7 +5474,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":198 * @@ -6319,8 +5482,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< * * - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6332,7 +5495,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6350,7 +5513,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_28CompilableFunctionConstra * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -6360,7 +5523,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":217 @@ -6369,15 +5532,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False))) __PYX_ERR(0, 212, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False)) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); /* "constraint/constraints.py":212 * """ @@ -6385,14 +5548,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_6__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 212, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -6444,7 +5607,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6452,24 +5615,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults3 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->arg0); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6477,7 +5648,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6485,7 +5656,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -6495,7 +5666,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -6505,7 +5676,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -6516,15 +5687,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) } } @@ -6534,11 +5711,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -6569,8 +5751,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 215, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 215, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_22AllDifferentConstraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -6612,7 +5794,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":220 * _unassigned=Unassigned, @@ -6620,7 +5802,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * seen = {} # <<<<<<<<<<<<<< * for variable in variables: * value = assignments.get(variable, _unassigned) - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); @@ -6632,7 +5814,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if value is not _unassigned: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6640,20 +5822,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 221, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6661,13 +5846,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 221, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 221, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6694,7 +5882,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * value = assignments.get(variable, _unassigned) # <<<<<<<<<<<<<< * if value is not _unassigned: * if value in seen: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); @@ -6706,7 +5894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value is not _unassigned: # <<<<<<<<<<<<<< * if value in seen: * return False - */ +*/ __pyx_t_5 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_5) { @@ -6716,7 +5904,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in seen: # <<<<<<<<<<<<<< * return False * seen[value] = True - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_value, __pyx_v_seen, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) if (__pyx_t_5) { @@ -6726,7 +5914,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return False # <<<<<<<<<<<<<< * seen[value] = True * if forwardcheck: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6739,7 +5927,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in seen: # <<<<<<<<<<<<<< * return False * seen[value] = True - */ +*/ } /* "constraint/constraints.py":226 @@ -6748,7 +5936,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * seen[value] = True # <<<<<<<<<<<<<< * if forwardcheck: * for variable in variables: - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_seen, __pyx_v_value, Py_True) < 0))) __PYX_ERR(0, 226, __pyx_L1_error) /* "constraint/constraints.py":223 @@ -6757,7 +5945,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value is not _unassigned: # <<<<<<<<<<<<<< * if value in seen: * return False - */ +*/ } /* "constraint/constraints.py":221 @@ -6766,7 +5954,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if value is not _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6776,7 +5964,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) if (__pyx_t_5) { @@ -6786,7 +5974,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -6794,20 +5982,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 228, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6815,13 +6006,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 228, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 228, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -6848,7 +6042,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in seen: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) if (__pyx_t_5) { @@ -6858,7 +6052,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * domain = domains[variable] # <<<<<<<<<<<<<< * for value in seen: * if value in domain: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -6870,7 +6064,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for value in seen: # <<<<<<<<<<<<<< * if value in domain: * domain.hideValue(value) - */ +*/ __pyx_t_6 = 0; __pyx_t_9 = __Pyx_dict_iterator(__pyx_v_seen, 1, ((PyObject *)NULL), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -6891,7 +6085,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in domain: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_domain, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 232, __pyx_L1_error) if (__pyx_t_5) { @@ -6901,21 +6095,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) +*/ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_13 = 1; - } + assert(__pyx_t_12); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_13 = 1; } #endif { @@ -6934,7 +6127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_t_14 = (!__pyx_t_5); if (__pyx_t_14) { @@ -6945,7 +6138,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -6959,7 +6152,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":232 @@ -6968,7 +6161,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if value in domain: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -6979,7 +6172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in seen: - */ +*/ } /* "constraint/constraints.py":228 @@ -6988,7 +6181,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -6998,7 +6191,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":236 @@ -7007,7 +6200,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -7019,7 +6212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7046,7 +6239,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22AllDifferentConstraint___ * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; @@ -7056,7 +6249,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__defaults__", 1); + __Pyx_RefNannySetupContext("__defaults__", 0); __Pyx_XDECREF(__pyx_r); /* "constraint/constraints.py":255 @@ -7065,15 +6258,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED * forwardcheck=False, # <<<<<<<<<<<<<< * _unassigned=Unassigned, * ): - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False))) __PYX_ERR(0, 250, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg__unassigned)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_False)) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); /* "constraint/constraints.py":250 * """ @@ -7081,14 +6274,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_8__defaults__(CYTHON_UNUSED * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 250, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None) != (0)) __PYX_ERR(0, 250, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -7140,7 +6333,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -7148,24 +6341,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,&__pyx_n_s_unassigned,0}; - __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,&__pyx_mstate_global->__pyx_n_u_unassigned,0}; + struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self); values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg__unassigned); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->arg0); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -7173,7 +6374,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -7181,7 +6382,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -7191,7 +6392,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -7201,7 +6402,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -7212,15 +6413,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L3_error) } } @@ -7230,11 +6437,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + __Pyx_Arg_XDECREF_FASTCALL(values[5]); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -7265,8 +6477,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 253, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 254, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18AllEqualConstraint___call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck, __pyx_v__unassigned); /* function exit code */ @@ -7306,7 +6518,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":258 * _unassigned=Unassigned, @@ -7314,7 +6526,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * singlevalue = _unassigned # <<<<<<<<<<<<<< * for variable in variables: * value = assignments.get(variable, _unassigned) - */ +*/ __Pyx_INCREF(__pyx_v__unassigned); __pyx_v_singlevalue = __pyx_v__unassigned; @@ -7324,7 +6536,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -7332,20 +6544,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 259, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7353,13 +6568,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 259, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 259, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7386,7 +6604,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * value = assignments.get(variable, _unassigned) # <<<<<<<<<<<<<< * if singlevalue is _unassigned: * singlevalue = value - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_assignments, __pyx_v_variable, __pyx_v__unassigned); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_4); @@ -7398,7 +6616,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue is _unassigned: # <<<<<<<<<<<<<< * singlevalue = value * elif value is not _unassigned and value != singlevalue: - */ +*/ __pyx_t_5 = (__pyx_v_singlevalue == __pyx_v__unassigned); if (__pyx_t_5) { @@ -7408,7 +6626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * singlevalue = value # <<<<<<<<<<<<<< * elif value is not _unassigned and value != singlevalue: * return False - */ +*/ __Pyx_INCREF(__pyx_v_value); __Pyx_DECREF_SET(__pyx_v_singlevalue, __pyx_v_value); @@ -7418,7 +6636,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue is _unassigned: # <<<<<<<<<<<<<< * singlevalue = value * elif value is not _unassigned and value != singlevalue: - */ +*/ goto __pyx_L5; } @@ -7428,7 +6646,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< * return False * if forwardcheck and singlevalue is not _unassigned: - */ +*/ __pyx_t_6 = (__pyx_v_value != __pyx_v__unassigned); if (__pyx_t_6) { } else { @@ -7448,7 +6666,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return False # <<<<<<<<<<<<<< * if forwardcheck and singlevalue is not _unassigned: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -7461,7 +6679,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * elif value is not _unassigned and value != singlevalue: # <<<<<<<<<<<<<< * return False * if forwardcheck and singlevalue is not _unassigned: - */ +*/ } __pyx_L5:; @@ -7471,7 +6689,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * value = assignments.get(variable, _unassigned) * if singlevalue is _unassigned: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7481,7 +6699,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 265, __pyx_L1_error) if (__pyx_t_6) { } else { @@ -7499,7 +6717,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -7507,20 +6725,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 266, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7528,13 +6749,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 266, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 266, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7561,7 +6785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * if singlevalue not in domain: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 267, __pyx_L1_error) if (__pyx_t_5) { @@ -7571,7 +6795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * domain = domains[variable] # <<<<<<<<<<<<<< * if singlevalue not in domain: * return False - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -7583,7 +6807,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue not in domain: # <<<<<<<<<<<<<< * return False * for value in domain[:]: - */ +*/ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_singlevalue, __pyx_v_domain, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) if (__pyx_t_5) { @@ -7593,7 +6817,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return False # <<<<<<<<<<<<<< * for value in domain[:]: * if value != singlevalue: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -7606,7 +6830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if singlevalue not in domain: # <<<<<<<<<<<<<< * return False * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":271 @@ -7615,8 +6839,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for value in domain[:]: # <<<<<<<<<<<<<< * if value != singlevalue: * domain.hideValue(value) - */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); @@ -7625,7 +6849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -7633,13 +6857,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call if (likely(PyList_CheckExact(__pyx_t_7))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7647,13 +6874,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); + if (unlikely((0 < 0))) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_8++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -7680,7 +6910,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if value != singlevalue: # <<<<<<<<<<<<<< * domain.hideValue(value) * return True - */ +*/ __pyx_t_4 = PyObject_RichCompare(__pyx_v_value, __pyx_v_singlevalue, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -7692,21 +6922,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * domain.hideValue(value) # <<<<<<<<<<<<<< * return True * - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 273, __pyx_L1_error) +*/ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_12 = 1; } #endif { @@ -7725,7 +6954,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if value != singlevalue: # <<<<<<<<<<<<<< * domain.hideValue(value) * return True - */ +*/ } /* "constraint/constraints.py":271 @@ -7734,7 +6963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for value in domain[:]: # <<<<<<<<<<<<<< * if value != singlevalue: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7744,7 +6973,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * if singlevalue not in domain: - */ +*/ } /* "constraint/constraints.py":266 @@ -7753,7 +6982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7763,7 +6992,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * if forwardcheck and singlevalue is not _unassigned: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":274 @@ -7772,7 +7001,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -7784,7 +7013,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7811,7 +7040,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18AllEqualConstraint___call * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_1__init__(PyObject *__pyx_self, @@ -7845,7 +7074,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -7853,16 +7082,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_maxsum,&__pyx_n_s_multipliers,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_maxsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -7870,7 +7103,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -7878,7 +7111,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxsum)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_maxsum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -7889,8 +7122,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_multipliers); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 288, __pyx_L3_error) } } @@ -7900,9 +7136,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -7947,7 +7186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":297 * summed to be checked @@ -7955,8 +7194,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * self._maxsum = maxsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 297, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2, __pyx_v_maxsum) < 0) __PYX_ERR(0, 297, __pyx_L1_error) /* "constraint/constraints.py":298 * """ @@ -7964,8 +7203,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 298, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 298, __pyx_L1_error) /* "constraint/constraints.py":288 * """ @@ -7973,7 +7212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -7993,7 +7232,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint___init__ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_3preProcess(PyObject *__pyx_self, @@ -8028,7 +7267,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -8036,19 +7275,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -8056,7 +7300,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -8064,7 +7308,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -8074,7 +7318,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -8084,7 +7328,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -8094,7 +7338,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -8138,9 +7382,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 300, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -8165,7 +7409,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_negative.append(contains_negative) * if contains_negative: - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_cur_scope; @@ -8175,7 +7419,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -8187,7 +7431,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_10prePro __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MaxSumConstraint_preProcess_loca, __pyx_n_s_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_16MaxSumConstraint_10preProcess_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint_preProcess_loca, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8233,20 +7477,23 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 307, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -8254,13 +7501,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 307, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -8282,7 +7532,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { @@ -8305,10 +7555,12 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -8326,7 +7578,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_16MaxSumConstraint_10prePro * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { PyObject *__pyx_v_variable_contains_negative = 0; @@ -8358,7 +7610,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":301 * @@ -8366,10 +7618,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * # check if there are any negative values in the associated variables - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -8377,13 +7629,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -8402,7 +7653,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_contains_negative: list[bool] = list() # <<<<<<<<<<<<<< * variable_with_negative = None * for variable in variables: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_contains_negative = ((PyObject*)__pyx_t_1); @@ -8414,7 +7665,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_with_negative = None # <<<<<<<<<<<<<< * for variable in variables: * contains_negative = any(value < 0 for value in domains[variable]) - */ +*/ __Pyx_INCREF(Py_None); __pyx_v_variable_with_negative = Py_None; @@ -8424,7 +7675,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * contains_negative = any(value < 0 for value in domains[variable]) * variable_contains_negative.append(contains_negative) - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -8432,20 +7683,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8453,13 +7707,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 306, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8486,13 +7743,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * contains_negative = any(value < 0 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_negative.append(contains_negative) * if contains_negative: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_10preProcess_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_contains_negative, __pyx_t_3); @@ -8504,7 +7761,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_contains_negative.append(contains_negative) # <<<<<<<<<<<<<< * if contains_negative: * if variable_with_negative is not None: - */ +*/ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_variable_contains_negative, __pyx_v_contains_negative); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 308, __pyx_L1_error) /* "constraint/constraints.py":309 @@ -8513,7 +7770,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if contains_negative: # <<<<<<<<<<<<<< * if variable_with_negative is not None: * # if more than one associated variables contain negative, we can't prune - */ +*/ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_contains_negative); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 309, __pyx_L1_error) if (__pyx_t_8) { @@ -8523,7 +7780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain negative, we can't prune * return - */ +*/ __pyx_t_8 = (__pyx_v_variable_with_negative != Py_None); if (__pyx_t_8) { @@ -8533,7 +7790,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * return # <<<<<<<<<<<<<< * variable_with_negative = variable * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8545,7 +7802,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain negative, we can't prune * return - */ +*/ } /* "constraint/constraints.py":313 @@ -8554,7 +7811,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * variable_with_negative = variable # <<<<<<<<<<<<<< * * # prune the associated variables of values > maxsum - */ +*/ __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_negative, __pyx_v_variable); @@ -8564,7 +7821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if contains_negative: # <<<<<<<<<<<<<< * if variable_with_negative is not None: * # if more than one associated variables contain negative, we can't prune - */ +*/ } /* "constraint/constraints.py":306 @@ -8573,7 +7830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * contains_negative = any(value < 0 for value in domains[variable]) * variable_contains_negative.append(contains_negative) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8583,8 +7840,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * multipliers = self._multipliers # <<<<<<<<<<<<<< * maxsum = self._maxsum * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -8595,8 +7852,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * maxsum = self._maxsum # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; @@ -8607,7 +7864,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable_with_negative is not None and variable_with_negative != variable: - */ +*/ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 318, __pyx_L1_error) if (__pyx_t_8) { @@ -8617,15 +7874,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 319, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 319, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 319, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8636,7 +7893,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -8644,13 +7901,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 319, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8658,13 +7918,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 319, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8692,18 +7955,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_9); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -8712,7 +7979,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed; @@ -8739,7 +8006,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ __pyx_t_12 = (__pyx_v_variable_with_negative != Py_None); if (__pyx_t_12) { } else { @@ -8759,7 +8026,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ goto __pyx_L9_continue; /* "constraint/constraints.py":320 @@ -8768,7 +8035,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":322 @@ -8777,7 +8044,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value * multiplier > maxsum: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -8789,8 +8056,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > maxsum: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); @@ -8799,7 +8066,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 323, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -8807,13 +8074,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (likely(PyList_CheckExact(__pyx_t_9))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_13); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8821,13 +8091,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); + if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_13++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8854,7 +8127,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) @@ -8869,21 +8142,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain.remove(value) # <<<<<<<<<<<<<< * else: * for variable in variables: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -8902,7 +8174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ } /* "constraint/constraints.py":323 @@ -8911,7 +8183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > maxsum: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -8921,7 +8193,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ __pyx_L9_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8932,7 +8204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable_with_negative is not None and variable_with_negative != variable: - */ +*/ goto __pyx_L8; } @@ -8942,7 +8214,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); @@ -8951,20 +8223,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 327, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -8972,13 +8247,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 327, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_9); + __pyx_t_5++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -9005,7 +8283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ __pyx_t_12 = (__pyx_v_variable_with_negative != Py_None); if (__pyx_t_12) { } else { @@ -9025,7 +8303,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ goto __pyx_L21_continue; /* "constraint/constraints.py":328 @@ -9034,7 +8312,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if variable_with_negative is not None and variable_with_negative != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":330 @@ -9043,7 +8321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > maxsum: - */ +*/ __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_9); @@ -9055,8 +8333,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxsum: * domain.remove(value) - */ - __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) +*/ + __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) { __pyx_t_2 = __pyx_t_9; __Pyx_INCREF(__pyx_t_2); @@ -9065,7 +8343,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 331, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -9073,13 +8351,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 331, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -9087,13 +8368,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 331, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); + if (unlikely((0 < 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_9); + __pyx_t_13++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -9120,7 +8404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ __pyx_t_9 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -9132,21 +8416,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -9165,7 +8448,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * if value > maxsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } /* "constraint/constraints.py":331 @@ -9174,7 +8457,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxsum: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9184,7 +8467,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_negative is not None and variable_with_negative != variable: * continue - */ +*/ __pyx_L21_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9197,7 +8480,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -9232,7 +8515,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_2preProc * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MaxSumConstraint_5__call__(PyObject *__pyx_self, @@ -9267,7 +8550,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -9275,20 +8558,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -9296,7 +8585,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -9304,7 +8593,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -9314,7 +8603,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -9324,7 +8613,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -9335,8 +8624,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 335, __pyx_L3_error) } } @@ -9346,9 +8638,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -9378,8 +8673,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 335, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 335, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -9423,7 +8718,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":336 * @@ -9431,8 +8726,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * multipliers = self._multipliers # <<<<<<<<<<<<<< * maxsum = self._maxsum * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -9443,8 +8738,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * maxsum = self._maxsum # <<<<<<<<<<<<<< * sum = 0 * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxsum = __pyx_t_1; __pyx_t_1 = 0; @@ -9455,9 +8750,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = 0 # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":339 * maxsum = self._maxsum @@ -9465,7 +8760,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 339, __pyx_L1_error) if (__pyx_t_2) { @@ -9475,15 +8770,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9494,7 +8789,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -9502,13 +8797,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 340, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9516,13 +8814,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 340, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9550,18 +8851,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9570,7 +8875,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; @@ -9597,7 +8902,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * if isinstance(sum, float): - */ +*/ __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 341, __pyx_L1_error) if (__pyx_t_2) { @@ -9607,7 +8912,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) @@ -9625,7 +8930,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * if isinstance(sum, float): - */ +*/ } /* "constraint/constraints.py":340 @@ -9634,7 +8939,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9644,7 +8949,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { @@ -9654,15 +8959,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > maxsum: * return False - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 344, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 344, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum) != (0)) __PYX_ERR(0, 344, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 344, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9675,7 +8980,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ } /* "constraint/constraints.py":345 @@ -9684,7 +8989,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9696,7 +9001,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * if forwardcheck: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -9708,7 +9013,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ } /* "constraint/constraints.py":347 @@ -9717,7 +9022,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) if (__pyx_t_2) { @@ -9727,15 +9032,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables)) __PYX_ERR(0, 348, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 348, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers)) __PYX_ERR(0, 348, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 348, __pyx_L1_error); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -9746,7 +9051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -9754,13 +9059,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 348, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9768,13 +9076,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 348, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9802,18 +9113,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9822,7 +9137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L15_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L15_unpacking_failed; @@ -9849,7 +9164,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 349, __pyx_L1_error) if (__pyx_t_2) { @@ -9859,7 +9174,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > maxsum: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -9871,8 +9186,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); @@ -9881,7 +9196,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 351, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -9889,13 +9204,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 351, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_10); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9903,13 +9221,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 351, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); + if (unlikely((0 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_10++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -9936,7 +9257,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error) @@ -9954,21 +9275,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_12 = 1; } #endif { @@ -9987,7 +9307,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value * multiplier > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":351 @@ -9996,7 +9316,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > maxsum: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10006,7 +9326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 354, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_2); if (__pyx_t_13) { @@ -10017,7 +9337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * else: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -10030,7 +9350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":349 @@ -10039,7 +9359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":348 @@ -10048,7 +9368,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10058,7 +9378,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":339 @@ -10067,7 +9387,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ goto __pyx_L3; } @@ -10077,7 +9397,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); @@ -10086,20 +9406,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 357, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -10107,13 +9430,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 357, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -10140,7 +9466,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) if (__pyx_t_13) { @@ -10150,7 +9476,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum += assignments[variable] # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) @@ -10165,7 +9491,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ } /* "constraint/constraints.py":357 @@ -10174,7 +9500,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10184,7 +9510,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ __pyx_t_13 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_13) { @@ -10194,15 +9520,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > maxsum: * return False - */ +*/ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum)) __PYX_ERR(0, 361, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_10)) __PYX_ERR(0, 361, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 361, __pyx_L1_error); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10215,7 +9541,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > maxsum: - */ +*/ } /* "constraint/constraints.py":362 @@ -10224,7 +9550,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10236,7 +9562,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * if forwardcheck: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -10248,7 +9574,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum > maxsum: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ } /* "constraint/constraints.py":364 @@ -10257,7 +9583,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) if (__pyx_t_13) { @@ -10267,7 +9593,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -10275,20 +9601,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10296,13 +9625,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 365, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10329,7 +9661,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_13 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 366, __pyx_L1_error) if (__pyx_t_13) { @@ -10339,7 +9671,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > maxsum: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -10351,8 +9683,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > maxsum: * domain.hideValue(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); @@ -10361,7 +9693,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 368, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -10369,13 +9701,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 368, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_10); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10383,13 +9718,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 368, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); + if (unlikely((0 < 0))) __PYX_ERR(0, 368, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_10++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -10416,7 +9754,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_maxsum, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) @@ -10431,21 +9769,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_12 = 1; } #endif { @@ -10464,7 +9801,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if sum + value > maxsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":368 @@ -10473,7 +9810,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > maxsum: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -10483,7 +9820,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 371, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_13); if (__pyx_t_2) { @@ -10494,7 +9831,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -10507,7 +9844,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":366 @@ -10516,7 +9853,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":365 @@ -10525,7 +9862,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10535,7 +9872,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } } __pyx_L3:; @@ -10546,7 +9883,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -10558,7 +9895,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -10588,7 +9925,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MaxSumConstraint_4__call_ * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_1__init__(PyObject *__pyx_self, @@ -10622,7 +9959,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -10630,16 +9967,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exactsum,&__pyx_n_s_multipliers,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_exactsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -10647,7 +9988,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -10655,7 +9996,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exactsum)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_exactsum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -10666,8 +10007,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_multipliers); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error) } } @@ -10677,9 +10021,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -10724,7 +10071,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":396 * summed to be checked @@ -10732,8 +10079,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * self._exactsum = exactsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 396, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2, __pyx_v_exactsum) < 0) __PYX_ERR(0, 396, __pyx_L1_error) /* "constraint/constraints.py":397 * """ @@ -10741,8 +10088,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 397, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 397, __pyx_L1_error) /* "constraint/constraints.py":387 * """ @@ -10750,7 +10097,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -10770,7 +10117,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint___init * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_3preProcess(PyObject *__pyx_self, @@ -10805,7 +10152,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -10813,19 +10160,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -10833,7 +10185,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -10841,7 +10193,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -10851,7 +10203,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -10861,7 +10213,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -10871,7 +10223,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -10915,9 +10267,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 399, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 399, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -10959,7 +10311,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":400 * @@ -10967,10 +10319,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10978,13 +10330,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -11003,8 +10354,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -11015,8 +10366,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * exactsum = self._exactsum # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; @@ -11027,7 +10378,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 403, __pyx_L1_error) if (__pyx_t_5) { @@ -11037,15 +10388,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 404, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 404, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 404, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 404, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11056,7 +10407,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11064,13 +10415,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11078,13 +10432,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 404, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_6++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11112,18 +10469,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11132,7 +10493,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed; @@ -11159,7 +10520,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value * multiplier > exactsum: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -11171,8 +10532,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > exactsum: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); @@ -11181,7 +10542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { __pyx_t_11 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 406, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11189,13 +10550,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (likely(PyList_CheckExact(__pyx_t_8))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 406, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_11); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11203,13 +10567,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 406, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_11++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11236,7 +10603,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ __pyx_t_3 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) @@ -11251,21 +10618,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain.remove(value) # <<<<<<<<<<<<<< * else: * for variable in variables: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -11284,7 +10650,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * else: - */ +*/ } /* "constraint/constraints.py":406 @@ -11293,7 +10659,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value * multiplier > exactsum: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -11303,7 +10669,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11313,7 +10679,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * domain = domains[variable] - */ +*/ goto __pyx_L3; } @@ -11323,7 +10689,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); @@ -11332,20 +10698,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6++; #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -11353,13 +10722,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 410, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 410, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_8); + __pyx_t_6++; #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -11386,7 +10758,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > exactsum: - */ +*/ __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); @@ -11398,8 +10770,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value > exactsum: * domain.remove(value) - */ - __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) +*/ + __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); @@ -11408,7 +10780,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 412, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -11416,13 +10788,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 412, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_11++; #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -11430,13 +10805,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 412, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 412, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_8); + __pyx_t_11++; #else __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -11463,7 +10841,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ __pyx_t_8 = PyObject_RichCompare(__pyx_v_value, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -11475,21 +10853,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -11508,7 +10885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * if value > exactsum: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } /* "constraint/constraints.py":412 @@ -11517,7 +10894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value > exactsum: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11527,7 +10904,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -11539,7 +10916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -11570,7 +10947,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_2prePr * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18ExactSumConstraint_5__call__(PyObject *__pyx_self, @@ -11605,7 +10982,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -11613,20 +10990,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -11634,7 +11017,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -11642,7 +11025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -11652,7 +11035,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -11662,7 +11045,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -11673,8 +11056,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error) } } @@ -11684,9 +11070,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -11716,8 +11105,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 416, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 416, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 416, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -11762,7 +11151,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":417 * @@ -11770,8 +11159,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * multipliers = self._multipliers # <<<<<<<<<<<<<< * exactsum = self._exactsum * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -11782,8 +11171,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * exactsum = self._exactsum # <<<<<<<<<<<<<< * sum = 0 * missing = False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exactsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exactsum = __pyx_t_1; __pyx_t_1 = 0; @@ -11794,9 +11183,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = 0 # <<<<<<<<<<<<<< * missing = False * if multipliers: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":420 * exactsum = self._exactsum @@ -11804,7 +11193,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = False # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __pyx_v_missing = 0; /* "constraint/constraints.py":421 @@ -11813,7 +11202,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 421, __pyx_L1_error) if (__pyx_t_2) { @@ -11823,15 +11212,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 422, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 422, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 422, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 422, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11842,7 +11231,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11850,13 +11239,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 422, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11864,13 +11256,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 422, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -11898,18 +11293,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11918,7 +11317,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed; @@ -11945,7 +11344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: - */ +*/ __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 423, __pyx_L1_error) if (__pyx_t_2) { @@ -11955,7 +11354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * else: * missing = True - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) @@ -11973,7 +11372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: - */ +*/ goto __pyx_L8; } @@ -11983,7 +11382,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ /*else*/ { __pyx_v_missing = 1; } @@ -11995,7 +11394,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] * multiplier - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12005,7 +11404,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ __pyx_t_2 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_2) { @@ -12015,15 +11414,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > exactsum: * return False - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 428, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 428, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum) != (0)) __PYX_ERR(0, 428, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 428, __pyx_L1_error); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12036,7 +11435,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ } /* "constraint/constraints.py":429 @@ -12045,7 +11444,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ __pyx_t_3 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12057,7 +11456,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if forwardcheck and missing: * for variable, multiplier in zip(variables, multipliers): - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12069,7 +11468,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ } /* "constraint/constraints.py":431 @@ -12078,7 +11477,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 431, __pyx_L1_error) if (__pyx_t_10) { } else { @@ -12095,15 +11494,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables)) __PYX_ERR(0, 432, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 432, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers)) __PYX_ERR(0, 432, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 432, __pyx_L1_error); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12114,7 +11513,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12122,13 +11521,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12136,13 +11538,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12170,18 +11575,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12190,7 +11599,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L17_unpacking_failed; @@ -12217,7 +11626,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 433, __pyx_L1_error) if (__pyx_t_2) { @@ -12227,7 +11636,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value * multiplier > exactsum: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -12239,8 +11648,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > exactsum: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); @@ -12249,7 +11658,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 435, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12257,13 +11666,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_11); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12271,13 +11683,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 435, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 435, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_11++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -12304,7 +11719,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_1 = PyNumber_Multiply(__pyx_v_value, __pyx_v_multiplier); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyNumber_Add(__pyx_v_sum, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L1_error) @@ -12322,21 +11737,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_13 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_13 = 1; } #endif { @@ -12355,7 +11769,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value * multiplier > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":435 @@ -12364,7 +11778,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value * multiplier > exactsum: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -12374,7 +11788,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_10 = (!__pyx_t_2); if (__pyx_t_10) { @@ -12385,7 +11799,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * else: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12398,7 +11812,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":433 @@ -12407,7 +11821,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":432 @@ -12416,7 +11830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12426,7 +11840,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":421 @@ -12435,7 +11849,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * if variable in assignments: - */ +*/ goto __pyx_L3; } @@ -12445,7 +11859,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_3 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_3); @@ -12454,20 +11868,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 441, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_4); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -12475,13 +11892,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 441, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 441, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -12508,7 +11928,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * else: - */ +*/ __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) if (__pyx_t_10) { @@ -12518,7 +11938,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum += assignments[variable] # <<<<<<<<<<<<<< * else: * missing = True - */ +*/ __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) @@ -12533,7 +11953,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable in assignments: # <<<<<<<<<<<<<< * sum += assignments[variable] * else: - */ +*/ goto __pyx_L28; } @@ -12543,7 +11963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * missing = True # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ /*else*/ { __pyx_v_missing = 1; } @@ -12555,7 +11975,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * sum += assignments[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12565,7 +11985,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ __pyx_t_10 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_10) { @@ -12575,15 +11995,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * sum = round(sum, 10) # <<<<<<<<<<<<<< * if sum > exactsum: * return False - */ +*/ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum)) __PYX_ERR(0, 447, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_10)) __PYX_ERR(0, 447, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sum) != (0)) __PYX_ERR(0, 447, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 447, __pyx_L1_error); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12596,7 +12016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * if sum > exactsum: - */ +*/ } /* "constraint/constraints.py":448 @@ -12605,7 +12025,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12617,7 +12037,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if forwardcheck and missing: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12629,7 +12049,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum > exactsum: # <<<<<<<<<<<<<< * return False * if forwardcheck and missing: - */ +*/ } /* "constraint/constraints.py":450 @@ -12638,7 +12058,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 450, __pyx_L1_error) if (__pyx_t_2) { } else { @@ -12655,7 +12075,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -12663,20 +12083,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12684,13 +12107,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 451, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 451, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12717,7 +12143,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 452, __pyx_L1_error) if (__pyx_t_10) { @@ -12727,7 +12153,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if sum + value > exactsum: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -12739,8 +12165,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > exactsum: * domain.hideValue(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); @@ -12749,7 +12175,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 454, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -12757,13 +12183,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_11); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12771,13 +12200,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_11++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -12804,7 +12236,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_3 = PyNumber_Add(__pyx_v_sum, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_v_exactsum, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 455, __pyx_L1_error) @@ -12819,21 +12251,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_13 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_13 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_13 = 1; } #endif { @@ -12852,7 +12283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if sum + value > exactsum: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":454 @@ -12861,7 +12292,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for value in domain[:]: # <<<<<<<<<<<<<< * if sum + value > exactsum: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -12871,7 +12302,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * if missing: - */ +*/ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 457, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_10); if (__pyx_t_2) { @@ -12882,7 +12313,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return False # <<<<<<<<<<<<<< * if missing: * return sum <= exactsum - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -12895,7 +12326,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if not domain: # <<<<<<<<<<<<<< * return False * if missing: - */ +*/ } /* "constraint/constraints.py":452 @@ -12904,7 +12335,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":451 @@ -12913,7 +12344,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -12923,7 +12354,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if forwardcheck and missing: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } } __pyx_L3:; @@ -12934,7 +12365,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if missing: # <<<<<<<<<<<<<< * return sum <= exactsum * else: - */ +*/ if (__pyx_v_missing) { /* "constraint/constraints.py":460 @@ -12943,7 +12374,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return sum <= exactsum # <<<<<<<<<<<<<< * else: * return sum == exactsum - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_r = __pyx_t_1; @@ -12956,7 +12387,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * if missing: # <<<<<<<<<<<<<< * return sum <= exactsum * else: - */ +*/ } /* "constraint/constraints.py":462 @@ -12965,7 +12396,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * return sum == exactsum # <<<<<<<<<<<<<< * * - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_exactsum, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) @@ -12980,7 +12411,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -13010,7 +12441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18ExactSumConstraint_4__cal * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_1__init__(PyObject *__pyx_self, @@ -13044,7 +12475,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -13052,16 +12483,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_minsum,&__pyx_n_s_multipliers,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_minsum,&__pyx_mstate_global->__pyx_n_u_multipliers,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -13069,7 +12504,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -13077,7 +12512,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minsum)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_minsum)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -13088,8 +12523,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_multipliers); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_multipliers); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L3_error) } } @@ -13099,9 +12537,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -13146,7 +12587,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":485 * summed to be checked @@ -13154,8 +12595,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ * self._minsum = minsum # <<<<<<<<<<<<<< * self._multipliers = multipliers * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 485, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2, __pyx_v_minsum) < 0) __PYX_ERR(0, 485, __pyx_L1_error) /* "constraint/constraints.py":486 * """ @@ -13163,8 +12604,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ * self._multipliers = multipliers # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 486, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2, __pyx_v_multipliers) < 0) __PYX_ERR(0, 486, __pyx_L1_error) /* "constraint/constraints.py":476 * """ @@ -13172,7 +12613,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -13192,7 +12633,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint___init__ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_16MinSumConstraint_3__call__(PyObject *__pyx_self, @@ -13227,7 +12668,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -13235,20 +12676,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -13256,7 +12703,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -13264,7 +12711,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -13274,7 +12721,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -13284,7 +12731,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -13295,8 +12742,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error) } } @@ -13306,9 +12756,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -13338,8 +12791,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 488, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 488, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 488, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 488, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -13377,7 +12830,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":490 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 @@ -13385,7 +12838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * return True - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -13393,20 +12846,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 490, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13414,13 +12870,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 490, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 490, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13447,7 +12906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * return True * - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 491, __pyx_L1_error) if (__pyx_t_5) { @@ -13457,7 +12916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * return True # <<<<<<<<<<<<<< * * # with each variable assigned, sum the values - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -13470,7 +12929,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if variable not in assignments: # <<<<<<<<<<<<<< * return True * - */ +*/ } /* "constraint/constraints.py":490 @@ -13479,7 +12938,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * return True - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13489,8 +12948,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * multipliers = self._multipliers # <<<<<<<<<<<<<< * minsum = self._minsum * sum = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_multipliers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_multipliers = __pyx_t_1; __pyx_t_1 = 0; @@ -13501,8 +12960,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * minsum = self._minsum # <<<<<<<<<<<<<< * sum = 0 * if multipliers: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minsum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minsum = __pyx_t_1; __pyx_t_1 = 0; @@ -13513,9 +12972,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * sum = 0 # <<<<<<<<<<<<<< * if multipliers: * for variable, multiplier in zip(variables, multipliers): - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_sum = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_sum = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":498 * minsum = self._minsum @@ -13523,7 +12982,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * sum += assignments[variable] * multiplier - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_multipliers); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) if (__pyx_t_5) { @@ -13533,15 +12992,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables)) __PYX_ERR(0, 499, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_variables) != (0)) __PYX_ERR(0, 499, __pyx_L1_error); __Pyx_INCREF(__pyx_v_multipliers); __Pyx_GIVEREF(__pyx_v_multipliers); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers)) __PYX_ERR(0, 499, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_multipliers) != (0)) __PYX_ERR(0, 499, __pyx_L1_error); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13552,7 +13011,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -13560,13 +13019,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 499, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13574,13 +13036,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 499, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13608,18 +13073,22 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_6 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -13628,7 +13097,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L10_unpacking_failed; @@ -13655,7 +13124,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * sum += assignments[variable] * multiplier # <<<<<<<<<<<<<< * else: * for variable in variables: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_multiplier); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error) @@ -13673,7 +13142,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable, multiplier in zip(variables, multipliers): # <<<<<<<<<<<<<< * sum += assignments[variable] * multiplier * else: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13683,7 +13152,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if multipliers: # <<<<<<<<<<<<<< * for variable, multiplier in zip(variables, multipliers): * sum += assignments[variable] * multiplier - */ +*/ goto __pyx_L7; } @@ -13693,7 +13162,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable in variables: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); @@ -13702,20 +13171,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 502, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13723,13 +13195,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 502, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -13756,7 +13231,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * sum += assignments[variable] # <<<<<<<<<<<<<< * if isinstance(sum, float): * sum = round(sum, 10) - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_sum, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error) @@ -13771,7 +13246,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * for variable in variables: # <<<<<<<<<<<<<< * sum += assignments[variable] * if isinstance(sum, float): - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -13783,7 +13258,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * return sum >= minsum - */ +*/ __pyx_t_5 = PyFloat_Check(__pyx_v_sum); if (__pyx_t_5) { @@ -13793,15 +13268,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * sum = round(sum, 10) # <<<<<<<<<<<<<< * return sum >= minsum * - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_sum); __Pyx_GIVEREF(__pyx_v_sum); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum)) __PYX_ERR(0, 505, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 505, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sum) != (0)) __PYX_ERR(0, 505, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 505, __pyx_L1_error); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13814,7 +13289,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * if isinstance(sum, float): # <<<<<<<<<<<<<< * sum = round(sum, 10) * return sum >= minsum - */ +*/ } /* "constraint/constraints.py":506 @@ -13823,7 +13298,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * return sum >= minsum # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = PyObject_RichCompare(__pyx_v_sum, __pyx_v_minsum, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) __pyx_r = __pyx_t_7; @@ -13836,7 +13311,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -13864,7 +13339,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_16MinSumConstraint_2__call_ * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_1__init__(PyObject *__pyx_self, @@ -13897,7 +13372,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -13905,13 +13380,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_maxprod,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_maxprod,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -13919,7 +13396,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -13927,7 +13404,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxprod)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_maxprod)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -13984,7 +13461,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":518 * maxprod: Value to be considered as the maximum product @@ -13992,8 +13469,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ * self._maxprod = maxprod # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 518, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2, __pyx_v_maxprod) < 0) __PYX_ERR(0, 518, __pyx_L1_error) /* "constraint/constraints.py":512 * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" @@ -14001,7 +13478,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -14021,7 +13498,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint___init_ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_3preProcess(PyObject *__pyx_self, @@ -14056,7 +13533,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -14064,19 +13541,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -14084,7 +13566,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -14092,7 +13574,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -14102,7 +13584,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -14112,7 +13594,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -14122,7 +13604,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -14166,9 +13648,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 520, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 520, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 520, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 520, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -14193,7 +13675,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_lt1.append(contains_lt1) * if contains_lt1 is True: - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_cur_scope; @@ -14203,7 +13685,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -14215,7 +13697,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_10prePr __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_MaxProdConstraint_preProcess_loc, __pyx_n_s_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_11constraints_17MaxProdConstraint_10preProcess_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess_loc, __pyx_mstate_global->__pyx_n_u_constraint_constraints); if (unlikely(!gen)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -14261,20 +13743,23 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 527, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 527, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -14282,13 +13767,16 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 527, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 527, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -14310,7 +13798,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_value, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_value, __pyx_mstate_global->__pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { @@ -14333,10 +13821,12 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -14354,7 +13844,7 @@ static PyObject *__pyx_gb_10constraint_11constraints_17MaxProdConstraint_10prePr * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2preProcess(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_variables, PyObject *__pyx_v_domains, PyObject *__pyx_v_constraints, PyObject *__pyx_v_vconstraints) { PyObject *__pyx_v_variable_contains_lt1 = 0; @@ -14383,7 +13873,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":521 * @@ -14391,10 +13881,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * # check if there are any values less than 1 in the associated variables - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -14402,13 +13892,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -14427,7 +13916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * variable_contains_lt1: list[bool] = list() # <<<<<<<<<<<<<< * variable_with_lt1 = None * for variable in variables: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_variable_contains_lt1 = ((PyObject*)__pyx_t_1); @@ -14439,7 +13928,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * variable_with_lt1 = None # <<<<<<<<<<<<<< * for variable in variables: * contains_lt1 = any(value < 1 for value in domains[variable]) - */ +*/ __Pyx_INCREF(Py_None); __pyx_v_variable_with_lt1 = Py_None; @@ -14449,7 +13938,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * contains_lt1 = any(value < 1 for value in domains[variable]) * variable_contains_lt1.append(contains_lt1) - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -14457,20 +13946,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 526, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14478,13 +13970,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 526, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 526, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14511,13 +14006,13 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * contains_lt1 = any(value < 1 for value in domains[variable]) # <<<<<<<<<<<<<< * variable_contains_lt1.append(contains_lt1) * if contains_lt1 is True: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_10preProcess_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_3 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_contains_lt1, __pyx_t_3); @@ -14529,7 +14024,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * variable_contains_lt1.append(contains_lt1) # <<<<<<<<<<<<<< * if contains_lt1 is True: * if variable_with_lt1 is not None: - */ +*/ __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_variable_contains_lt1, __pyx_v_contains_lt1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 528, __pyx_L1_error) /* "constraint/constraints.py":529 @@ -14538,7 +14033,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if contains_lt1 is True: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune - */ +*/ __pyx_t_8 = (__pyx_v_contains_lt1 == Py_True); if (__pyx_t_8) { @@ -14548,7 +14043,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain less than 1, we can't prune * return - */ +*/ __pyx_t_8 = (__pyx_v_variable_with_lt1 != Py_None); if (__pyx_t_8) { @@ -14558,7 +14053,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * return # <<<<<<<<<<<<<< * variable_with_lt1 = variable * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14570,7 +14065,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None: # <<<<<<<<<<<<<< * # if more than one associated variables contain less than 1, we can't prune * return - */ +*/ } /* "constraint/constraints.py":533 @@ -14579,7 +14074,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * variable_with_lt1 = variable # <<<<<<<<<<<<<< * * # prune the associated variables of values > maxprod - */ +*/ __Pyx_INCREF(__pyx_v_variable); __Pyx_DECREF_SET(__pyx_v_variable_with_lt1, __pyx_v_variable); @@ -14589,7 +14084,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if contains_lt1 is True: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None: * # if more than one associated variables contain less than 1, we can't prune - */ +*/ } /* "constraint/constraints.py":526 @@ -14598,7 +14093,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * contains_lt1 = any(value < 1 for value in domains[variable]) * variable_contains_lt1.append(contains_lt1) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14608,8 +14103,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * maxprod = self._maxprod # <<<<<<<<<<<<<< * for variable in variables: * if variable_with_lt1 is not None and variable_with_lt1 != variable: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; @@ -14620,7 +14115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -14628,20 +14123,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 537, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 537, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14649,13 +14147,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 537, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 537, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14682,7 +14183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ __pyx_t_9 = (__pyx_v_variable_with_lt1 != Py_None); if (__pyx_t_9) { } else { @@ -14702,7 +14203,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * continue # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ goto __pyx_L8_continue; /* "constraint/constraints.py":538 @@ -14711,7 +14212,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if variable_with_lt1 is not None and variable_with_lt1 != variable: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/constraints.py":540 @@ -14720,7 +14221,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value > maxprod: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -14732,8 +14233,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxprod: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -14742,7 +14243,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -14750,13 +14251,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_10); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14764,13 +14268,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); + if (unlikely((0 < 0))) __PYX_ERR(0, 541, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_10++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14797,7 +14304,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and maxprod < 0: - */ +*/ __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -14809,21 +14316,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * domain.remove(value) # <<<<<<<<<<<<<< * elif value == 0 and maxprod < 0: * domain.remove(value) - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L1_error) +*/ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_13); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_4 = 1; } #endif { @@ -14842,7 +14348,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * if value > maxprod: # <<<<<<<<<<<<<< * domain.remove(value) * elif value == 0 and maxprod < 0: - */ +*/ goto __pyx_L15; } @@ -14852,14 +14358,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< * domain.remove(value) * - */ - __pyx_t_9 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_value, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) +*/ + __pyx_t_9 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) if (__pyx_t_9) { } else { __pyx_t_8 = __pyx_t_9; goto __pyx_L16_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_maxprod, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __pyx_t_9; @@ -14872,21 +14378,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) +*/ + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_13); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_4 = 1; } #endif { @@ -14905,7 +14410,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * elif value == 0 and maxprod < 0: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } __pyx_L15:; @@ -14915,7 +14420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for value in domain[:]: # <<<<<<<<<<<<<< * if value > maxprod: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14925,7 +14430,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * if variable_with_lt1 is not None and variable_with_lt1 != variable: * continue - */ +*/ __pyx_L8_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -14936,7 +14441,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -14969,7 +14474,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_2prePro * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MaxProdConstraint_5__call__(PyObject *__pyx_self, @@ -15004,7 +14509,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -15012,20 +14517,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -15033,7 +14544,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -15041,7 +14552,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -15051,7 +14562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -15061,7 +14572,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -15072,8 +14583,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error) } } @@ -15083,9 +14597,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -15115,8 +14632,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 547, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 547, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 547, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 547, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -15157,7 +14674,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":548 * @@ -15165,8 +14682,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * maxprod = self._maxprod # <<<<<<<<<<<<<< * prod = 1 * for variable in variables: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_maxprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_maxprod = __pyx_t_1; __pyx_t_1 = 0; @@ -15177,9 +14694,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * prod = 1 # <<<<<<<<<<<<<< * for variable in variables: * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_prod = __pyx_int_1; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; /* "constraint/constraints.py":550 * maxprod = self._maxprod @@ -15187,7 +14704,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -15195,20 +14712,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 550, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 550, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15216,13 +14736,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 550, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 550, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15249,7 +14772,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * if isinstance(prod, float): - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 551, __pyx_L1_error) if (__pyx_t_5) { @@ -15259,7 +14782,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * prod *= assignments[variable] # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error) @@ -15274,7 +14797,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if variable in assignments: # <<<<<<<<<<<<<< * prod *= assignments[variable] * if isinstance(prod, float): - */ +*/ } /* "constraint/constraints.py":550 @@ -15283,7 +14806,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * prod *= assignments[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15293,7 +14816,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * if prod > maxprod: - */ +*/ __pyx_t_5 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_5) { @@ -15303,15 +14826,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * prod = round(prod, 10) # <<<<<<<<<<<<<< * if prod > maxprod: * return False - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_prod); __Pyx_GIVEREF(__pyx_v_prod); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod)) __PYX_ERR(0, 554, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 554, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod) != (0)) __PYX_ERR(0, 554, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 554, __pyx_L1_error); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15324,7 +14847,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * if prod > maxprod: - */ +*/ } /* "constraint/constraints.py":555 @@ -15333,7 +14856,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if prod > maxprod: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -15345,7 +14868,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * return False # <<<<<<<<<<<<<< * if forwardcheck: * for variable in variables: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -15357,7 +14880,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if prod > maxprod: # <<<<<<<<<<<<<< * return False * if forwardcheck: - */ +*/ } /* "constraint/constraints.py":557 @@ -15366,7 +14889,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 557, __pyx_L1_error) if (__pyx_t_5) { @@ -15376,7 +14899,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_6 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0; @@ -15384,20 +14907,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 558, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -15405,13 +14931,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 558, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -15438,7 +14967,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 559, __pyx_L1_error) if (__pyx_t_5) { @@ -15448,7 +14977,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if prod * value > maxprod: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -15460,8 +14989,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for value in domain[:]: # <<<<<<<<<<<<<< * if prod * value > maxprod: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); @@ -15470,7 +14999,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -15478,13 +15007,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_7); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -15492,13 +15024,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 561, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); + if (unlikely((0 < 0))) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_7++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -15525,7 +15060,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if prod * value > maxprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_1 = PyNumber_Multiply(__pyx_v_prod, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_RichCompare(__pyx_t_1, __pyx_v_maxprod, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error) @@ -15540,21 +15075,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_11 = 1; } #endif { @@ -15573,7 +15107,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if prod * value > maxprod: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":561 @@ -15582,7 +15116,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for value in domain[:]: # <<<<<<<<<<<<<< * if prod * value > maxprod: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -15592,7 +15126,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 564, __pyx_L1_error) __pyx_t_12 = (!__pyx_t_5); if (__pyx_t_12) { @@ -15603,7 +15137,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -15616,7 +15150,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/constraints.py":559 @@ -15625,7 +15159,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":558 @@ -15634,7 +15168,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -15644,7 +15178,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * if forwardcheck: # <<<<<<<<<<<<<< * for variable in variables: * if variable not in assignments: - */ +*/ } /* "constraint/constraints.py":566 @@ -15653,7 +15187,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -15665,7 +15199,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -15693,7 +15227,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MaxProdConstraint_4__call * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_1__init__(PyObject *__pyx_self, @@ -15726,7 +15260,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -15734,13 +15268,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_minprod,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_minprod,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -15748,7 +15284,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -15756,7 +15292,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minprod)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_minprod)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -15813,7 +15349,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":578 * minprod: Value to be considered as the maximum product @@ -15821,8 +15357,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ * self._minprod = minprod # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minprod_2, __pyx_v_minprod) < 0) __PYX_ERR(0, 578, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2, __pyx_v_minprod) < 0) __PYX_ERR(0, 578, __pyx_L1_error) /* "constraint/constraints.py":572 * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" @@ -15830,7 +15366,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -15850,7 +15386,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint___init_ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_3preProcess(PyObject *__pyx_self, @@ -15885,7 +15421,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -15893,19 +15429,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -15913,7 +15454,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -15921,7 +15462,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -15931,7 +15472,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -15941,7 +15482,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -15951,7 +15492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -15995,9 +15536,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 580, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 580, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 580, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint_2preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -16037,7 +15578,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":581 * @@ -16045,10 +15586,10 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * Constraint.preProcess(self, variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * # prune the associated variables of values > maxprod - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -16056,13 +15597,12 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; } #endif { @@ -16081,8 +15621,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * minprod = self._minprod # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; @@ -16093,7 +15633,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -16101,20 +15641,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 585, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16122,13 +15665,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16155,7 +15701,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value == 0 and minprod > 0: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); @@ -16167,8 +15713,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * for value in domain[:]: # <<<<<<<<<<<<<< * if value == 0 and minprod > 0: * domain.remove(value) - */ - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); @@ -16177,7 +15723,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } else { __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 587, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -16185,13 +15731,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_7); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16199,13 +15748,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); + if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_7++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -16232,14 +15784,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * domain.remove(value) * - */ - __pyx_t_10 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_value, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) +*/ + __pyx_t_10 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L8_bool_binop_done; } - __pyx_t_3 = PyObject_RichCompare(__pyx_v_minprod, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_minprod, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __pyx_t_10; @@ -16252,21 +15804,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * domain.remove(value) # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 589, __pyx_L1_error) +*/ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_12); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_4 = 1; } #endif { @@ -16285,7 +15836,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * if value == 0 and minprod > 0: # <<<<<<<<<<<<<< * domain.remove(value) * - */ +*/ } /* "constraint/constraints.py":587 @@ -16294,7 +15845,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * for value in domain[:]: # <<<<<<<<<<<<<< * if value == 0 and minprod > 0: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16304,7 +15855,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16314,7 +15865,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -16343,7 +15894,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_2prePro * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_17MinProdConstraint_5__call__(PyObject *__pyx_self, @@ -16378,7 +15929,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -16386,20 +15937,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -16407,7 +15964,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -16415,7 +15972,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -16425,7 +15982,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -16435,7 +15992,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -16446,8 +16003,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 591, __pyx_L3_error) } } @@ -16457,9 +16017,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -16489,8 +16052,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 591, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 591, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 591, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -16523,7 +16086,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":593 * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 @@ -16531,7 +16094,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * return True - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -16539,20 +16102,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 593, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16560,13 +16126,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 593, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 593, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16593,7 +16162,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * if variable not in assignments: # <<<<<<<<<<<<<< * return True * - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 594, __pyx_L1_error) if (__pyx_t_5) { @@ -16603,7 +16172,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * return True # <<<<<<<<<<<<<< * * # with each variable assigned, sum the values - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -16616,7 +16185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * if variable not in assignments: # <<<<<<<<<<<<<< * return True * - */ +*/ } /* "constraint/constraints.py":593 @@ -16625,7 +16194,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * return True - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16635,8 +16204,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * minprod = self._minprod # <<<<<<<<<<<<<< * prod = 1 * for variable in variables: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_minprod_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_minprod = __pyx_t_1; __pyx_t_1 = 0; @@ -16647,9 +16216,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * prod = 1 # <<<<<<<<<<<<<< * for variable in variables: * prod *= assignments[variable] - */ - __Pyx_INCREF(__pyx_int_1); - __pyx_v_prod = __pyx_int_1; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1); + __pyx_v_prod = __pyx_mstate_global->__pyx_int_1; /* "constraint/constraints.py":600 * minprod = self._minprod @@ -16657,7 +16226,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * prod *= assignments[variable] * if isinstance(prod, float): - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -16665,20 +16234,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 600, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16686,13 +16258,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 600, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 600, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16719,7 +16294,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * prod *= assignments[variable] # <<<<<<<<<<<<<< * if isinstance(prod, float): * prod = round(prod, 10) - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_prod, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 601, __pyx_L1_error) @@ -16734,7 +16309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * for variable in variables: # <<<<<<<<<<<<<< * prod *= assignments[variable] * if isinstance(prod, float): - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16744,7 +16319,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * return prod >= minprod - */ +*/ __pyx_t_5 = PyFloat_Check(__pyx_v_prod); if (__pyx_t_5) { @@ -16754,15 +16329,15 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * prod = round(prod, 10) # <<<<<<<<<<<<<< * return prod >= minprod * - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_prod); __Pyx_GIVEREF(__pyx_v_prod); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod)) __PYX_ERR(0, 603, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_10); - __Pyx_GIVEREF(__pyx_int_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_10)) __PYX_ERR(0, 603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prod) != (0)) __PYX_ERR(0, 603, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_10) != (0)) __PYX_ERR(0, 603, __pyx_L1_error); __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -16775,7 +16350,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * if isinstance(prod, float): # <<<<<<<<<<<<<< * prod = round(prod, 10) * return prod >= minprod - */ +*/ } /* "constraint/constraints.py":604 @@ -16784,7 +16359,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * return prod >= minprod # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyObject_RichCompare(__pyx_v_prod, __pyx_v_minprod, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) __pyx_r = __pyx_t_6; @@ -16797,7 +16372,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -16821,7 +16396,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_17MinProdConstraint_4__call * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_1__init__(PyObject *__pyx_self, @@ -16854,7 +16429,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -16862,13 +16437,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -16876,7 +16453,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -16884,7 +16461,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -16941,7 +16518,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":624 * set (set): Set of allowed values @@ -16949,8 +16526,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( * self._set = set # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 624, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 624, __pyx_L1_error) /* "constraint/constraints.py":618 * """ @@ -16958,7 +16535,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -16978,7 +16555,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint___init__( * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_3__call__(PyObject *__pyx_self, @@ -17013,7 +16590,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17021,20 +16598,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17042,7 +16625,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17050,7 +16633,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17060,7 +16643,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -17070,7 +16653,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -17081,8 +16664,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) } } @@ -17092,9 +16678,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -17144,7 +16733,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":628 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 @@ -17152,8 +16741,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17165,7 +16754,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -17183,7 +16772,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_2__call__ * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_15InSetConstraint_5preProcess(PyObject *__pyx_self, @@ -17218,7 +16807,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17226,19 +16815,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17246,7 +16840,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17254,7 +16848,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17264,7 +16858,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -17274,7 +16868,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -17284,7 +16878,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -17328,9 +16922,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 630, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 630, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 630, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_15InSetConstraint_4preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -17369,7 +16963,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":631 * @@ -17377,8 +16971,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * set = self._set # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; @@ -17389,7 +16983,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -17397,20 +16991,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 632, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17418,13 +17015,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 632, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 632, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 632, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17451,7 +17051,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value not in set: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -17463,8 +17063,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.remove(value) - */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); @@ -17473,7 +17073,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -17481,13 +17081,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17495,13 +17098,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 634, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 634, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17528,7 +17134,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * if value not in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) - */ +*/ __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 635, __pyx_L1_error) if (__pyx_t_8) { @@ -17538,21 +17144,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * domain.remove(value) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * constraints.remove((self, variables)) - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error) +*/ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -17571,7 +17176,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * if value not in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) - */ +*/ } /* "constraint/constraints.py":634 @@ -17580,7 +17185,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -17590,32 +17195,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self)) __PYX_ERR(0, 637, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 637, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables)) __PYX_ERR(0, 637, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 637, __pyx_L1_error); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -17635,7 +17239,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17645,16 +17249,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * * - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 638, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 638, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables)) __PYX_ERR(0, 638, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 638, __pyx_L1_error); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -17665,7 +17269,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -17694,7 +17298,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_15InSetConstraint_4preProce * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_1__init__(PyObject *__pyx_self, @@ -17727,7 +17331,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17735,13 +17339,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17749,7 +17355,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17757,7 +17363,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17814,7 +17420,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":658 * set (set): Set of disallowed values @@ -17822,8 +17428,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init * self._set = set # <<<<<<<<<<<<<< * * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 658, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 658, __pyx_L1_error) /* "constraint/constraints.py":652 * """ @@ -17831,7 +17437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -17851,7 +17457,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint___init * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_3__call__(PyObject *__pyx_self, @@ -17886,7 +17492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17894,20 +17500,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17915,7 +17527,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17923,7 +17535,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17933,7 +17545,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -17943,7 +17555,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -17954,8 +17566,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L3_error) } } @@ -17965,9 +17580,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -18017,7 +17635,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":662 * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 @@ -18025,8 +17643,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18038,7 +17656,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -18056,7 +17674,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_2__cal * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_18NotInSetConstraint_5preProcess(PyObject *__pyx_self, @@ -18091,7 +17709,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("preProcess (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18099,19 +17717,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18119,7 +17742,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18127,7 +17750,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -18137,7 +17760,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -18147,7 +17770,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -18157,7 +17780,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -18201,9 +17824,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 664, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 664, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 664, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 664, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_18NotInSetConstraint_4preProcess(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -18242,7 +17865,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("preProcess", 1); + __Pyx_RefNannySetupContext("preProcess", 0); /* "constraint/constraints.py":665 * @@ -18250,8 +17873,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * set = self._set # <<<<<<<<<<<<<< * for variable in variables: * domain = domains[variable] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; @@ -18262,7 +17885,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -18270,20 +17893,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 666, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 666, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18291,13 +17917,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 666, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 666, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 666, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18324,7 +17953,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value in set: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_4); @@ -18336,8 +17965,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.remove(value) - */ - __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); @@ -18346,7 +17975,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -18354,13 +17983,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 668, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_6); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18368,13 +18000,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 668, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_6++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18401,7 +18036,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * if value in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) - */ +*/ __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) if (__pyx_t_8) { @@ -18411,21 +18046,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * domain.remove(value) # <<<<<<<<<<<<<< * vconstraints[variable].remove((self, variables)) * constraints.remove((self, variables)) - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error) +*/ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -18444,7 +18078,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * if value in set: # <<<<<<<<<<<<<< * domain.remove(value) * vconstraints[variable].remove((self, variables)) - */ +*/ } /* "constraint/constraints.py":668 @@ -18453,7 +18087,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.remove(value) - */ +*/ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18463,32 +18097,31 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * vconstraints[variable].remove((self, variables)) # <<<<<<<<<<<<<< * constraints.remove((self, variables)) * - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self)) __PYX_ERR(0, 671, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 671, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables)) __PYX_ERR(0, 671, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 671, __pyx_L1_error); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -18508,7 +18141,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * for variable in variables: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18518,16 +18151,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * constraints.remove((self, variables)) # <<<<<<<<<<<<<< * * - */ +*/ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 672, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self) != (0)) __PYX_ERR(0, 672, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables)) __PYX_ERR(0, 672, __pyx_L1_error); - __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 672, __pyx_L1_error); + __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__remove, __pyx_v_constraints, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -18538,7 +18171,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -18567,7 +18200,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_18NotInSetConstraint_4prePr * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_1__init__(PyObject *__pyx_self, @@ -18602,7 +18235,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18610,19 +18243,25 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,&__pyx_n_s_n,&__pyx_n_s_exact,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_mstate_global->__pyx_int_1))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18630,7 +18269,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18638,7 +18277,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -18649,15 +18288,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_n); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exact); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_exact); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error) } } @@ -18667,11 +18312,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -18717,7 +18367,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":696 * are present in set must be exactly `n` @@ -18725,8 +18375,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini * self._set = set # <<<<<<<<<<<<<< * self._n = n * self._exact = exact - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 696, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 696, __pyx_L1_error) /* "constraint/constraints.py":697 * """ @@ -18734,8 +18384,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini * self._n = n # <<<<<<<<<<<<<< * self._exact = exact * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 697, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 697, __pyx_L1_error) /* "constraint/constraints.py":698 * self._set = set @@ -18743,8 +18393,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini * self._exact = exact # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 698, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 698, __pyx_L1_error) /* "constraint/constraints.py":686 * """ @@ -18752,7 +18402,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -18772,7 +18422,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint___ini * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_19SomeInSetConstraint_3__call__(PyObject *__pyx_self, @@ -18807,7 +18457,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18815,20 +18465,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18836,7 +18492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18844,7 +18500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -18854,7 +18510,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -18864,7 +18520,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -18875,8 +18531,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L3_error) } } @@ -18886,9 +18545,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -18918,8 +18580,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 700, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 700, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 700, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 700, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -18961,7 +18623,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":701 * @@ -18969,8 +18631,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * set = self._set # <<<<<<<<<<<<<< * missing = 0 * found = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; @@ -18981,9 +18643,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * missing = 0 # <<<<<<<<<<<<<< * found = 0 * for variable in variables: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":703 * set = self._set @@ -18991,9 +18653,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * found = 0 # <<<<<<<<<<<<<< * for variable in variables: * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_found = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":704 * missing = 0 @@ -19001,7 +18663,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * found += assignments[variable] in set - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -19009,20 +18671,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 704, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -19030,13 +18695,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 704, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 704, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -19063,7 +18731,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] in set * else: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 705, __pyx_L1_error) if (__pyx_t_5) { @@ -19073,7 +18741,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * found += assignments[variable] in set # <<<<<<<<<<<<<< * else: * missing += 1 - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 706, __pyx_L1_error) @@ -19092,7 +18760,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] in set * else: - */ +*/ goto __pyx_L5; } @@ -19102,9 +18770,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * missing += 1 # <<<<<<<<<<<<<< * if missing: * if self._exact: - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); __pyx_t_6 = 0; @@ -19117,7 +18785,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * found += assignments[variable] in set - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19127,7 +18795,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 709, __pyx_L1_error) if (__pyx_t_5) { @@ -19137,8 +18805,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19150,8 +18818,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 711, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_6)) { @@ -19173,7 +18841,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False # <<<<<<<<<<<<<< * else: * if self._n > missing + found: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -19185,7 +18853,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":710 @@ -19194,7 +18862,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False - */ +*/ goto __pyx_L8; } @@ -19204,9 +18872,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._n > missing + found: # <<<<<<<<<<<<<< * return False * if forwardcheck and self._n - found == missing: - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19223,7 +18891,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False # <<<<<<<<<<<<<< * if forwardcheck and self._n - found == missing: * # All unassigned variables must be assigned to - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -19235,7 +18903,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._n > missing + found: # <<<<<<<<<<<<<< * return False * if forwardcheck and self._n - found == missing: - */ +*/ } } __pyx_L8:; @@ -19246,14 +18914,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values in the set. - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 716, __pyx_L1_error) if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19272,7 +18940,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; @@ -19280,20 +18948,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19301,13 +18972,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 719, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 719, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19334,7 +19008,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 720, __pyx_L1_error) if (__pyx_t_7) { @@ -19344,7 +19018,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value not in set: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -19356,8 +19030,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); @@ -19366,7 +19040,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 722, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19374,13 +19048,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19388,13 +19065,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 722, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); + if (unlikely((0 < 0))) __PYX_ERR(0, 722, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19421,7 +19101,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if value not in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 723, __pyx_L1_error) if (__pyx_t_7) { @@ -19431,21 +19111,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) +*/ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_12 = 1; } #endif { @@ -19464,7 +19143,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if value not in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":722 @@ -19473,7 +19152,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for value in domain[:]: # <<<<<<<<<<<<<< * if value not in set: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -19483,7 +19162,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 725, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { @@ -19494,7 +19173,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False # <<<<<<<<<<<<<< * else: * if self._exact: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -19507,7 +19186,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":720 @@ -19516,7 +19195,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":719 @@ -19525,7 +19204,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19535,7 +19214,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values in the set. - */ +*/ } /* "constraint/constraints.py":709 @@ -19544,7 +19223,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): - */ +*/ goto __pyx_L7; } @@ -19554,9 +19233,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._exact: # <<<<<<<<<<<<<< * if found != self._n: * return False - */ +*/ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19568,8 +19247,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if found != self._n: # <<<<<<<<<<<<<< * return False * else: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -19583,7 +19262,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False # <<<<<<<<<<<<<< * else: * if found < self._n: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -19595,7 +19274,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if found != self._n: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":728 @@ -19604,7 +19283,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if self._exact: # <<<<<<<<<<<<<< * if found != self._n: * return False - */ +*/ goto __pyx_L23; } @@ -19614,9 +19293,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if found < self._n: # <<<<<<<<<<<<<< * return False * return True - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -19630,7 +19309,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -19642,7 +19321,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * if found < self._n: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } } __pyx_L23:; @@ -19655,7 +19334,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -19667,7 +19346,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -19696,7 +19375,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_19SomeInSetConstraint_2__ca * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_1__init__(PyObject *__pyx_self, @@ -19731,7 +19410,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -19739,19 +19418,25 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,&__pyx_n_s_n,&__pyx_n_s_exact,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1))); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_exact,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_mstate_global->__pyx_int_1))); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -19759,7 +19444,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -19767,7 +19452,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -19778,15 +19463,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_n); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exact); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_exact); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 748, __pyx_L3_error) } } @@ -19796,11 +19487,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + __Pyx_Arg_XDECREF_FASTCALL(values[3]); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -19846,7 +19542,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/constraints.py":758 * are not present in set must be exactly `n` @@ -19854,8 +19550,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ * self._set = set # <<<<<<<<<<<<<< * self._n = n * self._exact = exact - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 758, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2, __pyx_v_set) < 0) __PYX_ERR(0, 758, __pyx_L1_error) /* "constraint/constraints.py":759 * """ @@ -19863,8 +19559,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ * self._n = n # <<<<<<<<<<<<<< * self._exact = exact * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 759, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2, __pyx_v_n) < 0) __PYX_ERR(0, 759, __pyx_L1_error) /* "constraint/constraints.py":760 * self._set = set @@ -19872,8 +19568,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ * self._exact = exact # <<<<<<<<<<<<<< * * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 760, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2, __pyx_v_exact) < 0) __PYX_ERR(0, 760, __pyx_L1_error) /* "constraint/constraints.py":748 * """ @@ -19881,7 +19577,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -19901,7 +19597,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint___ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_11constraints_22SomeNotInSetConstraint_3__call__(PyObject *__pyx_self, @@ -19936,7 +19632,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -19944,20 +19640,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables,&__pyx_n_s_domains,&__pyx_n_s_assignments,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -19965,7 +19667,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -19973,7 +19675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -19983,7 +19685,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -19993,7 +19695,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -20004,8 +19706,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 762, __pyx_L3_error) } } @@ -20015,9 +19720,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + __Pyx_Arg_XDECREF_FASTCALL(values[4]); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -20047,8 +19755,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 762, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 762, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 762, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 762, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2__call__(__pyx_self, __pyx_v_self, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_forwardcheck); /* function exit code */ @@ -20090,7 +19798,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__call__", 1); + __Pyx_RefNannySetupContext("__call__", 0); /* "constraint/constraints.py":763 * @@ -20098,8 +19806,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * set = self._set # <<<<<<<<<<<<<< * missing = 0 * found = 0 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_set_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_set = __pyx_t_1; __pyx_t_1 = 0; @@ -20110,9 +19818,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * missing = 0 # <<<<<<<<<<<<<< * found = 0 * for variable in variables: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_missing = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_missing = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":765 * set = self._set @@ -20120,9 +19828,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * found = 0 # <<<<<<<<<<<<<< * for variable in variables: * if variable in assignments: - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_found = __pyx_int_0; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_v_found = __pyx_mstate_global->__pyx_int_0; /* "constraint/constraints.py":766 * missing = 0 @@ -20130,7 +19838,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * found += assignments[variable] not in set - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; @@ -20138,20 +19846,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 766, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 766, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -20159,13 +19870,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 766, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 766, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 766, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -20192,7 +19906,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] not in set * else: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 767, __pyx_L1_error) if (__pyx_t_5) { @@ -20202,7 +19916,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * found += assignments[variable] not in set # <<<<<<<<<<<<<< * else: * missing += 1 - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_set, Py_NE)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 768, __pyx_L1_error) @@ -20221,7 +19935,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if variable in assignments: # <<<<<<<<<<<<<< * found += assignments[variable] not in set * else: - */ +*/ goto __pyx_L5; } @@ -20231,9 +19945,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * missing += 1 # <<<<<<<<<<<<<< * if missing: * if self._exact: - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_missing, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_v_missing, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_missing, __pyx_t_6); __pyx_t_6 = 0; @@ -20246,7 +19960,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for variable in variables: # <<<<<<<<<<<<<< * if variable in assignments: * found += assignments[variable] not in set - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20256,7 +19970,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_missing); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 771, __pyx_L1_error) if (__pyx_t_5) { @@ -20266,8 +19980,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -20279,8 +19993,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_6)) { @@ -20302,7 +20016,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return False # <<<<<<<<<<<<<< * else: * if self._n > missing + found: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -20314,7 +20028,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if not (found <= self._n <= missing + found): # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":772 @@ -20323,7 +20037,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._exact: # <<<<<<<<<<<<<< * if not (found <= self._n <= missing + found): * return False - */ +*/ goto __pyx_L8; } @@ -20333,9 +20047,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._n > missing + found: # <<<<<<<<<<<<<< * return False * if forwardcheck and self._n - found == missing: - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_v_missing, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20352,7 +20066,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return False # <<<<<<<<<<<<<< * if forwardcheck and self._n - found == missing: * # All unassigned variables must be assigned to - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -20364,7 +20078,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._n > missing + found: # <<<<<<<<<<<<<< * return False * if forwardcheck and self._n - found == missing: - */ +*/ } } __pyx_L8:; @@ -20375,14 +20089,14 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values not in the set. - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 778, __pyx_L1_error) if (__pyx_t_5) { } else { __pyx_t_7 = __pyx_t_5; goto __pyx_L12_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_v_found); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20401,7 +20115,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_4 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0; @@ -20409,20 +20123,23 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 781, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 781, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20430,13 +20147,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 781, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 781, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20463,7 +20183,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 782, __pyx_L1_error) if (__pyx_t_7) { @@ -20473,7 +20193,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * domain = domains[variable] # <<<<<<<<<<<<<< * for value in domain[:]: * if value in set: - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); @@ -20485,8 +20205,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.hideValue(value) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); @@ -20495,7 +20215,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 784, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -20503,13 +20223,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_8); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20517,13 +20240,16 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 784, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); + if (unlikely((0 < 0))) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_8++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -20550,7 +20276,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if value in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_value, __pyx_v_set, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 785, __pyx_L1_error) if (__pyx_t_7) { @@ -20560,21 +20286,20 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * domain.hideValue(value) # <<<<<<<<<<<<<< * if not domain: * return False - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 786, __pyx_L1_error) +*/ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_12 = 1; } #endif { @@ -20593,7 +20318,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if value in set: # <<<<<<<<<<<<<< * domain.hideValue(value) * if not domain: - */ +*/ } /* "constraint/constraints.py":784 @@ -20602,7 +20327,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for value in domain[:]: # <<<<<<<<<<<<<< * if value in set: * domain.hideValue(value) - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20612,7 +20337,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 787, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_7); if (__pyx_t_5) { @@ -20623,7 +20348,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return False # <<<<<<<<<<<<<< * else: * if self._exact: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -20636,7 +20361,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if not domain: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":782 @@ -20645,7 +20370,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if variable not in assignments: # <<<<<<<<<<<<<< * domain = domains[variable] * for value in domain[:]: - */ +*/ } /* "constraint/constraints.py":781 @@ -20654,7 +20379,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * for variable in variables: # <<<<<<<<<<<<<< * if variable not in assignments: * domain = domains[variable] - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -20664,7 +20389,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if forwardcheck and self._n - found == missing: # <<<<<<<<<<<<<< * # All unassigned variables must be assigned to * # values not in the set. - */ +*/ } /* "constraint/constraints.py":771 @@ -20673,7 +20398,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if missing: # <<<<<<<<<<<<<< * if self._exact: * if not (found <= self._n <= missing + found): - */ +*/ goto __pyx_L7; } @@ -20683,9 +20408,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._exact: # <<<<<<<<<<<<<< * if found != self._n: * return False - */ +*/ /*else*/ { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exact_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -20697,8 +20422,8 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found != self._n: # <<<<<<<<<<<<<< * return False * else: - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyObject_RichCompare(__pyx_v_found, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -20712,7 +20437,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * return False # <<<<<<<<<<<<<< * else: * if found < self._n: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -20724,7 +20449,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found != self._n: # <<<<<<<<<<<<<< * return False * else: - */ +*/ } /* "constraint/constraints.py":790 @@ -20733,7 +20458,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if self._exact: # <<<<<<<<<<<<<< * if found != self._n: * return False - */ +*/ goto __pyx_L23; } @@ -20743,9 +20468,9 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found < self._n: # <<<<<<<<<<<<<< * return False * return True - */ +*/ /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_n_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyObject_RichCompare(__pyx_v_found, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -20758,7 +20483,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found < self._n: * return False # <<<<<<<<<<<<<< * return True - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -20770,7 +20495,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found < self._n: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } } __pyx_L23:; @@ -20781,7 +20506,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * if found < self._n: * return False * return True # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -20793,7 +20518,7 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -20815,10 +20540,155 @@ static PyObject *__pyx_pf_10constraint_11constraints_22SomeNotInSetConstraint_2_ __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr = 0; +static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + #endif + return o; +} + +static void __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults(PyObject *o) { + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->arg0); + #if CYTHON_USE_TYPE_SLOTS + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif +} + +static int __pyx_tp_traverse_10constraint_11constraints___pyx_defaults(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } + if (p->arg0) { + e = (*v)(p->arg0, a); if (e) return e; + } + return 0; +} + +static int __pyx_tp_clear_10constraint_11constraints___pyx_defaults(PyObject *o) { + PyObject* tmp; + struct __pyx_defaults *p = (struct __pyx_defaults *)o; + tmp = ((PyObject*)p->arg0); + p->arg0 = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10constraint_11constraints___pyx_defaults_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10constraint_11constraints___pyx_defaults}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10constraint_11constraints___pyx_defaults}, + {Py_tp_clear, (void *)__pyx_tp_clear_10constraint_11constraints___pyx_defaults}, + {Py_tp_new, (void *)__pyx_tp_new_10constraint_11constraints___pyx_defaults}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10constraint_11constraints___pyx_defaults_spec = { + "constraint.constraints.__pyx_defaults", + sizeof(struct __pyx_defaults), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_10constraint_11constraints___pyx_defaults_slots, +}; +#else + +static PyTypeObject __pyx_type_10constraint_11constraints___pyx_defaults = { + PyVarObject_HEAD_INIT(0, 0) + "constraint.constraints.""__pyx_defaults", /*tp_name*/ + sizeof(struct __pyx_defaults), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10constraint_11constraints___pyx_defaults, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_as_async*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10constraint_11constraints___pyx_defaults, /*tp_traverse*/ + __pyx_tp_clear_10constraint_11constraints___pyx_defaults, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + 0, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10constraint_11constraints___pyx_defaults, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; #endif static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { @@ -20828,8 +20698,8 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct__gen o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20856,12 +20726,12 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { - __pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20875,6 +20745,10 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct__gene static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct__genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -20913,12 +20787,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20959,13 +20828,11 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20984,11 +20851,6 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct__ge }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[8]; -static int __pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -20996,8 +20858,8 @@ static PyObject *__pyx_tp_new_10constraint_11constraints___pyx_scope_struct_1_ge o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[--__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21024,12 +20886,12 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_gen Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_value); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { - __pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_11constraints___pyx_scope_struct_1_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_11constraints___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21043,6 +20905,10 @@ static void __pyx_tp_dealloc_10constraint_11constraints___pyx_scope_struct_1_gen static int __pyx_tp_traverse_10constraint_11constraints___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_10constraint_11constraints___pyx_scope_struct_1_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -21081,12 +20947,7 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21127,13 +20988,11 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21155,730 +21014,111 @@ static PyTypeObject __pyx_type_10constraint_11constraints___pyx_scope_struct_1_g static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Abstract_base_class_for_constrai, __pyx_k_Abstract_base_class_for_constrai, sizeof(__pyx_k_Abstract_base_class_for_constrai), 0, 0, 1, 0}, - {&__pyx_n_s_AllDifferentConstraint, __pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllDifferentConstraint___call, __pyx_k_AllDifferentConstraint___call, sizeof(__pyx_k_AllDifferentConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint, __pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint___call, __pyx_k_AllEqualConstraint___call, sizeof(__pyx_k_AllEqualConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, - {&__pyx_kp_u_Can_t_happen, __pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint___c, __pyx_k_CompilableFunctionConstraint___c, sizeof(__pyx_k_CompilableFunctionConstraint___c), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint___i, __pyx_k_CompilableFunctionConstraint___i, sizeof(__pyx_k_CompilableFunctionConstraint___i), 0, 0, 1, 1}, - {&__pyx_kp_u_CompilableFunctionConstraint_can, __pyx_k_CompilableFunctionConstraint_can, sizeof(__pyx_k_CompilableFunctionConstraint_can), 0, 1, 0, 0}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint___call, __pyx_k_Constraint___call, sizeof(__pyx_k_Constraint___call), 0, 0, 1, 1}, - {&__pyx_kp_s_Constraint_enforcing_that_at_lea, __pyx_k_Constraint_enforcing_that_at_lea, sizeof(__pyx_k_Constraint_enforcing_that_at_lea), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_at_lea_2, __pyx_k_Constraint_enforcing_that_at_lea_2, sizeof(__pyx_k_Constraint_enforcing_that_at_lea_2), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values, __pyx_k_Constraint_enforcing_that_values, sizeof(__pyx_k_Constraint_enforcing_that_values), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_2, __pyx_k_Constraint_enforcing_that_values_2, sizeof(__pyx_k_Constraint_enforcing_that_values_2), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_3, __pyx_k_Constraint_enforcing_that_values_3, sizeof(__pyx_k_Constraint_enforcing_that_values_3), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_4, __pyx_k_Constraint_enforcing_that_values_4, sizeof(__pyx_k_Constraint_enforcing_that_values_4), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_5, __pyx_k_Constraint_enforcing_that_values_5, sizeof(__pyx_k_Constraint_enforcing_that_values_5), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_6, __pyx_k_Constraint_enforcing_that_values_6, sizeof(__pyx_k_Constraint_enforcing_that_values_6), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_7, __pyx_k_Constraint_enforcing_that_values_7, sizeof(__pyx_k_Constraint_enforcing_that_values_7), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_8, __pyx_k_Constraint_enforcing_that_values_8, sizeof(__pyx_k_Constraint_enforcing_that_values_8), 0, 0, 1, 0}, - {&__pyx_kp_s_Constraint_enforcing_that_values_9, __pyx_k_Constraint_enforcing_that_values_9, sizeof(__pyx_k_Constraint_enforcing_that_values_9), 0, 0, 1, 0}, - {&__pyx_n_s_Constraint_forwardCheck, __pyx_k_Constraint_forwardCheck, sizeof(__pyx_k_Constraint_forwardCheck), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint_preProcess, __pyx_k_Constraint_preProcess, sizeof(__pyx_k_Constraint_preProcess), 0, 0, 1, 1}, - {&__pyx_kp_s_Constraint_which_wraps_a_functio, __pyx_k_Constraint_which_wraps_a_functio, sizeof(__pyx_k_Constraint_which_wraps_a_functio), 0, 0, 1, 0}, - {&__pyx_n_s_ExactSumConstraint, __pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint___call, __pyx_k_ExactSumConstraint___call, sizeof(__pyx_k_ExactSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint___init, __pyx_k_ExactSumConstraint___init, sizeof(__pyx_k_ExactSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint_preProcess, __pyx_k_ExactSumConstraint_preProcess, sizeof(__pyx_k_ExactSumConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint___call, __pyx_k_FunctionConstraint___call, sizeof(__pyx_k_FunctionConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint___init, __pyx_k_FunctionConstraint___init, sizeof(__pyx_k_FunctionConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint, __pyx_k_InSetConstraint, sizeof(__pyx_k_InSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint___call, __pyx_k_InSetConstraint___call, sizeof(__pyx_k_InSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint___init, __pyx_k_InSetConstraint___init, sizeof(__pyx_k_InSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_InSetConstraint_preProcess, __pyx_k_InSetConstraint_preProcess, sizeof(__pyx_k_InSetConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint, __pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint___call, __pyx_k_MaxProdConstraint___call, sizeof(__pyx_k_MaxProdConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint___init, __pyx_k_MaxProdConstraint___init, sizeof(__pyx_k_MaxProdConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint_preProcess, __pyx_k_MaxProdConstraint_preProcess, sizeof(__pyx_k_MaxProdConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxProdConstraint_preProcess_loc, __pyx_k_MaxProdConstraint_preProcess_loc, sizeof(__pyx_k_MaxProdConstraint_preProcess_loc), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint, __pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint___call, __pyx_k_MaxSumConstraint___call, sizeof(__pyx_k_MaxSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint___init, __pyx_k_MaxSumConstraint___init, sizeof(__pyx_k_MaxSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint_preProcess, __pyx_k_MaxSumConstraint_preProcess, sizeof(__pyx_k_MaxSumConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint_preProcess_loca, __pyx_k_MaxSumConstraint_preProcess_loca, sizeof(__pyx_k_MaxSumConstraint_preProcess_loca), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint, __pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint___call, __pyx_k_MinProdConstraint___call, sizeof(__pyx_k_MinProdConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint___init, __pyx_k_MinProdConstraint___init, sizeof(__pyx_k_MinProdConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint_preProcess, __pyx_k_MinProdConstraint_preProcess, sizeof(__pyx_k_MinProdConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint, __pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint___call, __pyx_k_MinSumConstraint___call, sizeof(__pyx_k_MinSumConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint___init, __pyx_k_MinSumConstraint___init, sizeof(__pyx_k_MinSumConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint, __pyx_k_NotInSetConstraint, sizeof(__pyx_k_NotInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint___call, __pyx_k_NotInSetConstraint___call, sizeof(__pyx_k_NotInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint___init, __pyx_k_NotInSetConstraint___init, sizeof(__pyx_k_NotInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_NotInSetConstraint_preProcess, __pyx_k_NotInSetConstraint_preProcess, sizeof(__pyx_k_NotInSetConstraint_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Sequence, __pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint, __pyx_k_SomeInSetConstraint, sizeof(__pyx_k_SomeInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint___call, __pyx_k_SomeInSetConstraint___call, sizeof(__pyx_k_SomeInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_SomeInSetConstraint___init, __pyx_k_SomeInSetConstraint___init, sizeof(__pyx_k_SomeInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint, __pyx_k_SomeNotInSetConstraint, sizeof(__pyx_k_SomeNotInSetConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint___call, __pyx_k_SomeNotInSetConstraint___call, sizeof(__pyx_k_SomeNotInSetConstraint___call), 0, 0, 1, 1}, - {&__pyx_n_s_SomeNotInSetConstraint___init, __pyx_k_SomeNotInSetConstraint___init, sizeof(__pyx_k_SomeNotInSetConstraint___init), 0, 0, 1, 1}, - {&__pyx_n_s_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 0, 1, 1}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_int_float, __pyx_k_Union_int_float, sizeof(__pyx_k_Union_int_float), 0, 0, 1, 0}, - {&__pyx_kp_s_Wrapper_function_for_picklable_s, __pyx_k_Wrapper_function_for_picklable_s, sizeof(__pyx_k_Wrapper_function_for_picklable_s), 0, 0, 1, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_n_s__68, __pyx_k__68, sizeof(__pyx_k__68), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_assigned, __pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 0, 1, 1}, - {&__pyx_n_s_assigned_2, __pyx_k_assigned_2, sizeof(__pyx_k_assigned_2), 0, 0, 1, 1}, - {&__pyx_n_s_assignments, __pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_constraints_py, __pyx_k_constraint_constraints_py, sizeof(__pyx_k_constraint_constraints_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_contains_lt1, __pyx_k_contains_lt1, sizeof(__pyx_k_contains_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_contains_negative, __pyx_k_contains_negative, sizeof(__pyx_k_contains_negative), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_exact, __pyx_k_exact, sizeof(__pyx_k_exact), 0, 0, 1, 1}, - {&__pyx_n_s_exact_2, __pyx_k_exact_2, sizeof(__pyx_k_exact_2), 0, 0, 1, 1}, - {&__pyx_n_s_exactsum, __pyx_k_exactsum, sizeof(__pyx_k_exactsum), 0, 0, 1, 1}, - {&__pyx_n_s_exactsum_2, __pyx_k_exactsum_2, sizeof(__pyx_k_exactsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_forwardCheck, __pyx_k_forwardCheck, sizeof(__pyx_k_forwardCheck), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck, __pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 0, 1, 1}, - {&__pyx_n_s_found, __pyx_k_found, sizeof(__pyx_k_found), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_maxprod, __pyx_k_maxprod, sizeof(__pyx_k_maxprod), 0, 0, 1, 1}, - {&__pyx_n_s_maxprod_2, __pyx_k_maxprod_2, sizeof(__pyx_k_maxprod_2), 0, 0, 1, 1}, - {&__pyx_n_s_maxsum, __pyx_k_maxsum, sizeof(__pyx_k_maxsum), 0, 0, 1, 1}, - {&__pyx_n_s_maxsum_2, __pyx_k_maxsum_2, sizeof(__pyx_k_maxsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_minprod, __pyx_k_minprod, sizeof(__pyx_k_minprod), 0, 0, 1, 1}, - {&__pyx_n_s_minprod_2, __pyx_k_minprod_2, sizeof(__pyx_k_minprod_2), 0, 0, 1, 1}, - {&__pyx_n_s_minsum, __pyx_k_minsum, sizeof(__pyx_k_minsum), 0, 0, 1, 1}, - {&__pyx_n_s_minsum_2, __pyx_k_minsum_2, sizeof(__pyx_k_minsum_2), 0, 0, 1, 1}, - {&__pyx_n_s_missing, __pyx_k_missing, sizeof(__pyx_k_missing), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_multiplier, __pyx_k_multiplier, sizeof(__pyx_k_multiplier), 0, 0, 1, 1}, - {&__pyx_n_s_multipliers, __pyx_k_multipliers, sizeof(__pyx_k_multipliers), 0, 0, 1, 1}, - {&__pyx_n_s_multipliers_2, __pyx_k_multipliers_2, sizeof(__pyx_k_multipliers_2), 0, 0, 1, 1}, - {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, - {&__pyx_n_s_n_2, __pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_parms, __pyx_k_parms, sizeof(__pyx_k_parms), 0, 0, 1, 1}, - {&__pyx_n_s_preProcess, __pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, - {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, - {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, - {&__pyx_n_s_set_2, __pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_singlevalue, __pyx_k_singlevalue, sizeof(__pyx_k_singlevalue), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_unassigned, __pyx_k_unassigned, sizeof(__pyx_k_unassigned), 0, 0, 1, 1}, - {&__pyx_n_s_unassignedvariable, __pyx_k_unassignedvariable, sizeof(__pyx_k_unassignedvariable), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variable_contains_lt1, __pyx_k_variable_contains_lt1, sizeof(__pyx_k_variable_contains_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_variable_contains_negative, __pyx_k_variable_contains_negative, sizeof(__pyx_k_variable_contains_negative), 0, 0, 1, 1}, - {&__pyx_n_s_variable_with_lt1, __pyx_k_variable_with_lt1, sizeof(__pyx_k_variable_with_lt1), 0, 0, 1, 1}, - {&__pyx_n_s_variable_with_negative, __pyx_k_variable_with_negative, sizeof(__pyx_k_variable_with_negative), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 198, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 319, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 628, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/constraints.py":57 - * variable = variables[0] - * domain = domains[variable] - * for value in domain[:]: # <<<<<<<<<<<<<< - * if not self(variables, domains, {variable: value}): - * domain.remove(value) - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 57, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/constraints.py":198 - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_CompilableFunctionConstraint_can); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 198, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "constraint/constraints.py":628 - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 628, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "constraint/constraints.py":10 - * """Abstract base class for constraints.""" - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< - * """Perform the constraint checking. - * - */ - __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 10, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 10, __pyx_L1_error) - __pyx_tuple__7 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "constraint/constraints.py":35 - * return True - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Preprocess variable domains. - * - */ - __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 35, __pyx_L1_error) - - /* "constraint/constraints.py":63 - * vconstraints[variable].remove((self, variables)) - * - * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< - * """Helper method for generic forward checking. - * - */ - __pyx_tuple__10 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_unassigned, __pyx_n_s_unassignedvariable, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_forwardCheck, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 63, __pyx_L1_error) - - /* "constraint/constraints.py":125 - * """ - * - * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_assigned); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 125, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - - /* "constraint/constraints.py":137 - * self._assigned = assigned - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__15 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_parms, __pyx_n_s_missing, __pyx_n_s_x); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 137, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 137, __pyx_L1_error) - - /* "constraint/constraints.py":193 - * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" - * - * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< - * self._func = func - * self._assigned = assigned - */ - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 193, __pyx_L1_error) - - /* "constraint/constraints.py":197 - * self._assigned = assigned - * - * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< - * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") - * - */ - __pyx_tuple__18 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__18); - __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 197, __pyx_L1_error) - - /* "constraint/constraints.py":212 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__20 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_seen, __pyx_n_s_variable, __pyx_n_s_value, __pyx_n_s_domain); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 212, __pyx_L1_error) - - /* "constraint/constraints.py":250 - * """ - * - * def __call__( # noqa: D102 # <<<<<<<<<<<<<< - * self, - * variables: Sequence, - */ - __pyx_tuple__22 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_unassigned, __pyx_n_s_singlevalue, __pyx_n_s_variable, __pyx_n_s_value, __pyx_n_s_domain); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 250, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 250, __pyx_L1_error) - - /* "constraint/constraints.py":288 - * """ - * - * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_maxsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 288, __pyx_L1_error) - __pyx_tuple__26 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - - /* "constraint/constraints.py":300 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - __pyx_tuple__27 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable_contains_negative, __pyx_n_s_variable_with_negative, __pyx_n_s_variable, __pyx_n_s_contains_negative, __pyx_n_s_multipliers, __pyx_n_s_maxsum, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 300, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 300, __pyx_L1_error) - - /* "constraint/constraints.py":335 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * maxsum = self._maxsum - */ - __pyx_tuple__29 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_multipliers, __pyx_n_s_maxsum, __pyx_n_s_sum, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 335, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 335, __pyx_L1_error) - - /* "constraint/constraints.py":387 - * """ - * - * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__31 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_exactsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 387, __pyx_L1_error) - - /* "constraint/constraints.py":399 - * self._multipliers = multipliers - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * multipliers = self._multipliers - */ - __pyx_tuple__33 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_multipliers, __pyx_n_s_exactsum, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 399, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__33); - __Pyx_GIVEREF(__pyx_tuple__33); - __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 399, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 399, __pyx_L1_error) - - /* "constraint/constraints.py":416 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * multipliers = self._multipliers - * exactsum = self._exactsum - */ - __pyx_tuple__35 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_multipliers, __pyx_n_s_exactsum, __pyx_n_s_sum, __pyx_n_s_missing, __pyx_n_s_variable, __pyx_n_s_multiplier, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__35); - __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 416, __pyx_L1_error) - - /* "constraint/constraints.py":476 - * """ - * - * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_minsum, __pyx_n_s_multipliers); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 476, __pyx_L1_error) - - /* "constraint/constraints.py":488 - * self._multipliers = multipliers - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: - */ - __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_variable, __pyx_n_s_multipliers, __pyx_n_s_minsum, __pyx_n_s_sum, __pyx_n_s_multiplier); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 488, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 488, __pyx_L1_error) - - /* "constraint/constraints.py":512 - * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" - * - * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MaxProdConstraint. - * - */ - __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_maxprod); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 512, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 512, __pyx_L1_error) - - /* "constraint/constraints.py":520 - * self._maxprod = maxprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - __pyx_tuple__43 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_variable_contains_lt1, __pyx_n_s_variable_with_lt1, __pyx_n_s_variable, __pyx_n_s_contains_lt1, __pyx_n_s_maxprod, __pyx_n_s_domain, __pyx_n_s_value, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 520, __pyx_L1_error) - - /* "constraint/constraints.py":547 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * maxprod = self._maxprod - * prod = 1 - */ - __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_maxprod, __pyx_n_s_prod, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 547, __pyx_L1_error) - - /* "constraint/constraints.py":572 - * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" - * - * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< - * """Instantiate a MinProdConstraint. - * - */ - __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_minprod); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 572, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 572, __pyx_L1_error) - - /* "constraint/constraints.py":580 - * self._minprod = minprod - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * Constraint.preProcess(self, variables, domains, constraints, vconstraints) - * - */ - __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_minprod, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 580, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_preProcess, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 580, __pyx_L1_error) - - /* "constraint/constraints.py":591 - * domain.remove(value) - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # check if each variable is in the assignments - * for variable in variables: - */ - __pyx_tuple__51 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_variable, __pyx_n_s_minprod, __pyx_n_s_prod); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 591, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 591, __pyx_L1_error) - - /* "constraint/constraints.py":618 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_set); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 618, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 618, __pyx_L1_error) - - /* "constraint/constraints.py":626 - * self._set = set - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 626, __pyx_L1_error) - - /* "constraint/constraints.py":630 - * raise RuntimeError("Can't happen") - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: - */ - __pyx_tuple__56 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_set, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 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_constraint_constraints_py, __pyx_n_s_preProcess, 630, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 630, __pyx_L1_error) - - /* "constraint/constraints.py":652 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 652, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 652, __pyx_L1_error) - - /* "constraint/constraints.py":660 - * self._set = set - * - * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * # preProcess() will remove it. - * raise RuntimeError("Can't happen") - */ - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_call, 660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 660, __pyx_L1_error) - - /* "constraint/constraints.py":664 - * raise RuntimeError("Can't happen") - * - * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * for variable in variables: - */ - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 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_constraint_constraints_py, __pyx_n_s_preProcess, 664, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 664, __pyx_L1_error) - - /* "constraint/constraints.py":686 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_set, __pyx_n_s_n, __pyx_n_s_exact); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 686, __pyx_L1_error) - __pyx_tuple__63 = PyTuple_Pack(2, ((PyObject *)__pyx_int_1), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 686, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__63); - __Pyx_GIVEREF(__pyx_tuple__63); - - /* "constraint/constraints.py":700 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ - __pyx_tuple__64 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_variables, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_forwardcheck, __pyx_n_s_set, __pyx_n_s_missing, __pyx_n_s_found, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_value); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__64); - __Pyx_GIVEREF(__pyx_tuple__64); - __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 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_constraint_constraints_py, __pyx_n_s_call, 700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 700, __pyx_L1_error) - - /* "constraint/constraints.py":748 - * """ - * - * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_constraints_py, __pyx_n_s_init, 748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 748, __pyx_L1_error) - - /* "constraint/constraints.py":762 - * self._exact = exact - * - * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< - * set = self._set - * missing = 0 - */ - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 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_constraint_constraints_py, __pyx_n_s_call, 762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 762, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; - __pyx_umethod_PyList_Type_remove.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_remove.method_name = &__pyx_n_s_remove; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr)) __PYX_ERR(0, 307, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 63, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #else - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults = &__pyx_type_10constraint_11constraints___pyx_defaults; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults) < 0) __PYX_ERR(0, 63, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_defaults->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 527, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr)) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) #else - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 307, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 527, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + #else + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr = &__pyx_type_10constraint_11constraints___pyx_scope_struct_1_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_11constraints___pyx_scope_struct_1_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -21888,38 +21128,42 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_constraints(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_constraints}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + #endif {0, NULL} }; #endif @@ -21937,7 +21181,7 @@ namespace { #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + sizeof(__pyx_mstatetype), /* m_size */ #else -1, /* m_size */ #endif @@ -21960,50 +21204,37 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initconstraints(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initconstraints(void) -#else __Pyx_PyMODINIT_FUNC PyInit_constraints(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_constraints(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { + if (__Pyx_VersionSanityCheck() < 0) return NULL; return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif { PyErr_SetString( PyExc_ImportError, @@ -22067,12 +21298,15 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit_module) #endif -#endif { + #if !CYTHON_PEP489_MULTI_PHASE_INIT + if (__Pyx_VersionSanityCheck() < 0) return NULL; + #endif int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -22090,7 +21324,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit PyErr_SetString(PyExc_RuntimeError, "Module 'constraints' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ @@ -22098,10 +21332,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("constraints", __pyx_methods, __pyx_k_Module_containing_the_code_for_c, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE + #if CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); @@ -22113,13 +21344,18 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_constraints(PyObject *__pyx_pyinit __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); #endif + #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -22129,14 +21365,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_constraints(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_constraints", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -22152,48 +21389,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__constraints) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.constraints")) { if (unlikely((PyDict_SetItemString(modules, "constraint.constraints", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/constraints.py":3 * """Module containing the code for constraint definitions.""" @@ -22201,18 +21424,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Unassigned # <<<<<<<<<<<<<< * from typing import Callable, Union, Optional * from collections.abc import Sequence - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Unassigned); - __Pyx_GIVEREF(__pyx_n_s_Unassigned); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Unassigned)) __PYX_ERR(0, 3, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Unassigned, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Unassigned, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22222,32 +21442,23 @@ if (!__Pyx_RefNanny) { * from typing import Callable, Union, Optional # <<<<<<<<<<<<<< * from collections.abc import Sequence * - */ - __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_mstate_global->__pyx_n_u_Union, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Callable); - __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Callable)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Union)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Optional)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Callable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22257,18 +21468,15 @@ if (!__Pyx_RefNanny) { * from collections.abc import Sequence # <<<<<<<<<<<<<< * * class Constraint: - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Sequence); - __Pyx_GIVEREF(__pyx_n_s_Sequence); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Sequence)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sequence, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_t_2) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22278,8 +21486,8 @@ if (!__Pyx_RefNanny) { * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Constraint, __pyx_n_s_Constraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Abstract_base_class_for_constrai); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_Constraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_constrai); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "constraint/constraints.py":10 @@ -22288,18 +21496,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< * """Perform the constraint checking. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_1__call__, 0, __pyx_n_s_Constraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_Constraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":35 @@ -22308,18 +21516,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Preprocess variable domains. * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_3preProcess, 0, __pyx_n_s_Constraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_Constraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":63 @@ -22328,24 +21536,24 @@ if (!__Pyx_RefNanny) { * def forwardCheck(self, variables: Sequence, domains: dict, assignments: dict, _unassigned=Unassigned): # <<<<<<<<<<<<<< * """Helper method for generic forward checking. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck, 0, __pyx_n_s_Constraint_forwardCheck, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_10Constraint_5forwardCheck, 0, __pyx_mstate_global->__pyx_n_u_Constraint_forwardCheck, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 63, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 63, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg__unassigned = __pyx_t_5; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_5; __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints___defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_forwardCheck, __pyx_t_4) < 0) __PYX_ERR(0, 63, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":7 @@ -22354,10 +21562,10 @@ if (!__Pyx_RefNanny) { * class Constraint: # <<<<<<<<<<<<<< * """Abstract base class for constraints.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Constraint, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_4) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22367,19 +21575,17 @@ if (!__Pyx_RefNanny) { * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_FunctionConstraint, __pyx_n_s_FunctionConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_which_wraps_a_functio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_which_wraps_a_functio); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 104, __pyx_L1_error) @@ -22392,17 +21598,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_func, __pyx_n_s_Callable) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assigned, __pyx_n_s_bool) < 0) __PYX_ERR(0, 125, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__, 0, __pyx_n_s_FunctionConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_Callable) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__14); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":137 @@ -22411,15 +21617,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__, 0, __pyx_n_s_FunctionConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18FunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_FunctionConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 137, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 137, __pyx_L1_error) /* "constraint/constraints.py":143 * assignments: dict, @@ -22427,16 +21633,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * # # initial code: 0.94621 seconds, Cythonized: 0.92805 seconds - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_4)->__pyx_arg__unassigned = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_4)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_4, __pyx_pf_10constraint_11constraints_2__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":104 @@ -22445,10 +21651,10 @@ if (!__Pyx_RefNanny) { * class FunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint which wraps a function defining the constraint logic. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22460,19 +21666,17 @@ if (!__Pyx_RefNanny) { * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_CompilableFunctionConstraint, __pyx_n_s_CompilableFunctionConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Wrapper_function_for_picklable_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Wrapper_function_for_picklable_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 190, __pyx_L1_error) @@ -22485,17 +21689,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, func: str, assigned: bool = True): # noqa: D102, D107 # <<<<<<<<<<<<<< * self._func = func * self._assigned = assigned - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_func, __pyx_n_s_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assigned, __pyx_n_s_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, 0, __pyx_n_s_CompilableFunctionConstraint___i, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assigned, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___i, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__14); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":197 @@ -22504,17 +21708,17 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 # <<<<<<<<<<<<<< * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") * - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, 0, __pyx_n_s_CompilableFunctionConstraint___c, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_28CompilableFunctionConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint___c, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 197, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 197, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_6)->__pyx_arg__unassigned = __pyx_t_2; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_6)->arg0 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_10constraint_11constraints_4__defaults__); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_6) < 0) __PYX_ERR(0, 197, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":190 @@ -22523,10 +21727,10 @@ if (!__Pyx_RefNanny) { * class CompilableFunctionConstraint(Constraint): # <<<<<<<<<<<<<< * """Wrapper function for picklable string constraints that must be compiled into a FunctionConstraint later on.""" * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -22538,19 +21742,17 @@ if (!__Pyx_RefNanny) { * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_AllDifferentConstraint, __pyx_n_s_AllDifferentConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) @@ -22563,15 +21765,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__, 0, __pyx_n_s_AllDifferentConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22AllDifferentConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 212, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 212, __pyx_L1_error) /* "constraint/constraints.py":218 * assignments: dict, @@ -22579,16 +21781,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * seen = {} - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_2)->__pyx_arg__unassigned = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_10constraint_11constraints_6__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":201 @@ -22597,10 +21799,10 @@ if (!__Pyx_RefNanny) { * class AllDifferentConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are different. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -22612,19 +21814,17 @@ if (!__Pyx_RefNanny) { * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_AllEqualConstraint, __pyx_n_s_AllEqualConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 239, __pyx_L1_error) @@ -22637,15 +21837,15 @@ if (!__Pyx_RefNanny) { * def __call__( # noqa: D102 # <<<<<<<<<<<<<< * self, * variables: Sequence, - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__, 0, __pyx_n_s_AllEqualConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18AllEqualConstraint_1__call__, 0, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 250, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_10constraint_11constraints___pyx_defaults)) __PYX_ERR(0, 250, __pyx_L1_error) /* "constraint/constraints.py":256 * assignments: dict, @@ -22653,16 +21853,16 @@ if (!__Pyx_RefNanny) { * _unassigned=Unassigned, # <<<<<<<<<<<<<< * ): * singlevalue = _unassigned - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Unassigned); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_5)->__pyx_arg__unassigned = __pyx_t_7; + __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_5)->arg0 = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_10constraint_11constraints_8__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":239 @@ -22671,10 +21871,10 @@ if (!__Pyx_RefNanny) { * class AllEqualConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of all given variables are equal. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllEqualConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -22686,19 +21886,17 @@ if (!__Pyx_RefNanny) { * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_MaxSumConstraint, __pyx_n_s_MaxSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_6) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 277, __pyx_L1_error) @@ -22711,17 +21909,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_maxsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 288, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 288, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__, 0, __pyx_n_s_MaxSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_maxsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":300 @@ -22730,18 +21928,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess, 0, __pyx_n_s_MaxSumConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":335 @@ -22750,18 +21948,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * maxsum = self._maxsum - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__, 0, __pyx_n_s_MaxSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 335, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MaxSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 335, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":277 @@ -22770,10 +21968,10 @@ if (!__Pyx_RefNanny) { * class MaxSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum up to a given amount. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MaxSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22785,19 +21983,17 @@ if (!__Pyx_RefNanny) { * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_ExactSumConstraint, __pyx_n_s_ExactSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 376, __pyx_L1_error) @@ -22810,17 +22006,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, exactsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_exactsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__, 0, __pyx_n_s_ExactSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exactsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[4]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":399 @@ -22829,18 +22025,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * multipliers = self._multipliers - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess, 0, __pyx_n_s_ExactSumConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_2) < 0) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":416 @@ -22849,18 +22045,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * multipliers = self._multipliers * exactsum = self._exactsum - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__, 0, __pyx_n_s_ExactSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18ExactSumConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_6) < 0) __PYX_ERR(0, 416, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_6) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":376 @@ -22869,10 +22065,10 @@ if (!__Pyx_RefNanny) { * class ExactSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum exactly to a given amount. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_ExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -22884,19 +22080,17 @@ if (!__Pyx_RefNanny) { * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least to a given amount. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_MinSumConstraint, __pyx_n_s_MinSumConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 465, __pyx_L1_error) @@ -22909,17 +22103,17 @@ if (!__Pyx_RefNanny) { * def __init__(self, minsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_minsum, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_multipliers, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__, 0, __pyx_n_s_MinSumConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_minsum, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_multipliers, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__26); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[4]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":488 @@ -22928,18 +22122,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_3__call__, 0, __pyx_n_s_MinSumConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_16MinSumConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_MinSumConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 488, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":465 @@ -22948,10 +22142,10 @@ if (!__Pyx_RefNanny) { * class MinSumConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables sum at least to a given amount. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_MinSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 465, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -22963,19 +22157,17 @@ if (!__Pyx_RefNanny) { * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_MaxProdConstraint, __pyx_n_s_MaxProdConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 509, __pyx_L1_error) @@ -22988,15 +22180,15 @@ if (!__Pyx_RefNanny) { * def __init__(self, maxprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MaxProdConstraint. * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_maxprod, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__, 0, __pyx_n_s_MaxProdConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":520 @@ -23005,18 +22197,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess, 0, __pyx_n_s_MaxProdConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 520, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_4) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":547 @@ -23025,18 +22217,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * maxprod = self._maxprod * prod = 1 - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__, 0, __pyx_n_s_MaxProdConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MaxProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 547, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":509 @@ -23045,10 +22237,10 @@ if (!__Pyx_RefNanny) { * class MaxProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at most a given amount.""" * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -23060,19 +22252,17 @@ if (!__Pyx_RefNanny) { * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_MinProdConstraint, __pyx_n_s_MinProdConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_6) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 569, __pyx_L1_error) @@ -23085,15 +22275,15 @@ if (!__Pyx_RefNanny) { * def __init__(self, minprod: Union[int, float]): # <<<<<<<<<<<<<< * """Instantiate a MinProdConstraint. * - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_minprod, __pyx_kp_s_Union_int_float) < 0) __PYX_ERR(0, 572, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__, 0, __pyx_n_s_MinProdConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_minprod, __pyx_mstate_global->__pyx_kp_u_Union_int_float) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":580 @@ -23102,18 +22292,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * Constraint.preProcess(self, variables, domains, constraints, vconstraints) * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess, 0, __pyx_n_s_MinProdConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_3preProcess, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":591 @@ -23122,18 +22312,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # check if each variable is in the assignments * for variable in variables: - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__, 0, __pyx_n_s_MinProdConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_17MinProdConstraint_5__call__, 0, __pyx_mstate_global->__pyx_n_u_MinProdConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 591, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":569 @@ -23142,10 +22332,10 @@ if (!__Pyx_RefNanny) { * class MinProdConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables create a product up to at least a given amount.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 569, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23157,19 +22347,17 @@ if (!__Pyx_RefNanny) { * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_InSetConstraint, __pyx_n_s_InSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_mstate_global->__pyx_n_u_InSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 607, __pyx_L1_error) @@ -23182,10 +22370,10 @@ if (!__Pyx_RefNanny) { * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__, 0, __pyx_n_s_InSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 618, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":626 @@ -23194,11 +22382,11 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__, 0, __pyx_n_s_InSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__7); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_5) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":630 @@ -23207,18 +22395,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess, 0, __pyx_n_s_InSetConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_15InSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_InSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 630, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_6) < 0) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":607 @@ -23227,10 +22415,10 @@ if (!__Pyx_RefNanny) { * class InSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are present in the given set. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InSetConstraint, __pyx_t_6) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23242,19 +22430,17 @@ if (!__Pyx_RefNanny) { * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_NotInSetConstraint, __pyx_n_s_NotInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_values_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_values_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 641, __pyx_L1_error) @@ -23267,10 +22453,10 @@ if (!__Pyx_RefNanny) { * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__, 0, __pyx_n_s_NotInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":660 @@ -23279,11 +22465,11 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * # preProcess() will remove it. * raise RuntimeError("Can't happen") - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__, 0, __pyx_n_s_NotInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 660, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":664 @@ -23292,18 +22478,18 @@ if (!__Pyx_RefNanny) { * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * for variable in variables: - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_5preProcess, 0, __pyx_n_s_NotInSetConstraint_preProcess, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_18NotInSetConstraint_5preProcess, 0, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint_preProcess, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 664, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_preProcess, __pyx_t_5) < 0) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/constraints.py":641 @@ -23312,10 +22498,10 @@ if (!__Pyx_RefNanny) { * class NotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that values of given variables are not present in the given set. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NotInSetConstraint, __pyx_t_5) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -23327,19 +22513,17 @@ if (!__Pyx_RefNanny) { * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_SomeInSetConstraint, __pyx_n_s_SomeInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_at_lea); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 675, __pyx_L1_error) @@ -23352,11 +22536,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__, 0, __pyx_n_s_SomeInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__63); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[5]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":700 @@ -23365,18 +22549,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_3__call__, 0, __pyx_n_s_SomeInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_19SomeInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_call, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_2) < 0) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/constraints.py":675 @@ -23385,10 +22569,10 @@ if (!__Pyx_RefNanny) { * class SomeInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must be present in a given set. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeInSetConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -23400,19 +22584,17 @@ if (!__Pyx_RefNanny) { * class SomeNotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must not be present in a given set. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_SomeNotInSetConstraint, __pyx_n_s_SomeNotInSetConstraint, (PyObject *) NULL, __pyx_n_s_constraint_constraints, __pyx_kp_s_Constraint_enforcing_that_at_lea_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_kp_u_Constraint_enforcing_that_at_lea_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_6) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 737, __pyx_L1_error) @@ -23425,11 +22607,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, 0, __pyx_n_s_SomeNotInSetConstraint___init, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_1__init__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__63); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 748, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[5]); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/constraints.py":762 @@ -23438,18 +22620,18 @@ if (!__Pyx_RefNanny) { * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # noqa: D102 # <<<<<<<<<<<<<< * set = self._set * missing = 0 - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_variables, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, 0, __pyx_n_s_SomeNotInSetConstraint___call, NULL, __pyx_n_s_constraint_constraints, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_variables, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_11constraints_22SomeNotInSetConstraint_3__call__, 0, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint___call, NULL, __pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_call, __pyx_t_4) < 0) __PYX_ERR(0, 762, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_call, __pyx_t_4) < 0) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/constraints.py":737 @@ -23458,10 +22640,10 @@ if (!__Pyx_RefNanny) { * class SomeNotInSetConstraint(Constraint): # <<<<<<<<<<<<<< * """Constraint enforcing that at least some of the values of given variables must not be present in a given set. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 737, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SomeNotInSetConstraint, __pyx_t_4) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23471,10 +22653,10 @@ if (!__Pyx_RefNanny) { * """Module containing the code for constraint definitions.""" # <<<<<<<<<<<<<< * * from constraint.domain import Unassigned - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ @@ -23488,7 +22670,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.constraints", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -23505,15 +22687,555 @@ if (!__Pyx_RefNanny) { } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init constraint.constraints"); } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if CYTHON_PEP489_MULTI_PHASE_INIT - return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; - #else - return; - #endif + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #else + return __pyx_m; + #endif +} +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 645 <= 65535 + const unsigned short n; +#elif 645 / 2 < INT_MAX + const unsigned int n; +#elif 645 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_Abstract_base_class_for_constrai, sizeof(__pyx_k_Abstract_base_class_for_constrai), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Abstract_base_class_for_constrai */ + {__pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint */ + {__pyx_k_AllDifferentConstraint___call, sizeof(__pyx_k_AllDifferentConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint___call */ + {__pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint */ + {__pyx_k_AllEqualConstraint___call, sizeof(__pyx_k_AllEqualConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint___call */ + {__pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Callable */ + {__pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_happen */ + {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ + {__pyx_k_CompilableFunctionConstraint___c, sizeof(__pyx_k_CompilableFunctionConstraint___c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint___c */ + {__pyx_k_CompilableFunctionConstraint___i, sizeof(__pyx_k_CompilableFunctionConstraint___i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint___i */ + {__pyx_k_CompilableFunctionConstraint_can, sizeof(__pyx_k_CompilableFunctionConstraint_can), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_CompilableFunctionConstraint_can */ + {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ + {__pyx_k_Constraint___call, sizeof(__pyx_k_Constraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint___call */ + {__pyx_k_Constraint_enforcing_that_at_lea, sizeof(__pyx_k_Constraint_enforcing_that_at_lea), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_at_lea */ + {__pyx_k_Constraint_enforcing_that_at_lea_2, sizeof(__pyx_k_Constraint_enforcing_that_at_lea_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_at_lea_2 */ + {__pyx_k_Constraint_enforcing_that_values, sizeof(__pyx_k_Constraint_enforcing_that_values), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values */ + {__pyx_k_Constraint_enforcing_that_values_2, sizeof(__pyx_k_Constraint_enforcing_that_values_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_2 */ + {__pyx_k_Constraint_enforcing_that_values_3, sizeof(__pyx_k_Constraint_enforcing_that_values_3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_3 */ + {__pyx_k_Constraint_enforcing_that_values_4, sizeof(__pyx_k_Constraint_enforcing_that_values_4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_4 */ + {__pyx_k_Constraint_enforcing_that_values_5, sizeof(__pyx_k_Constraint_enforcing_that_values_5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_5 */ + {__pyx_k_Constraint_enforcing_that_values_6, sizeof(__pyx_k_Constraint_enforcing_that_values_6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_6 */ + {__pyx_k_Constraint_enforcing_that_values_7, sizeof(__pyx_k_Constraint_enforcing_that_values_7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_7 */ + {__pyx_k_Constraint_enforcing_that_values_8, sizeof(__pyx_k_Constraint_enforcing_that_values_8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_8 */ + {__pyx_k_Constraint_enforcing_that_values_9, sizeof(__pyx_k_Constraint_enforcing_that_values_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_enforcing_that_values_9 */ + {__pyx_k_Constraint_forwardCheck, sizeof(__pyx_k_Constraint_forwardCheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint_forwardCheck */ + {__pyx_k_Constraint_preProcess, sizeof(__pyx_k_Constraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint_preProcess */ + {__pyx_k_Constraint_which_wraps_a_functio, sizeof(__pyx_k_Constraint_which_wraps_a_functio), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraint_which_wraps_a_functio */ + {__pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint */ + {__pyx_k_ExactSumConstraint___call, sizeof(__pyx_k_ExactSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint___call */ + {__pyx_k_ExactSumConstraint___init, sizeof(__pyx_k_ExactSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint___init */ + {__pyx_k_ExactSumConstraint_preProcess, sizeof(__pyx_k_ExactSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint_preProcess */ + {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ + {__pyx_k_FunctionConstraint___call, sizeof(__pyx_k_FunctionConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint___call */ + {__pyx_k_FunctionConstraint___init, sizeof(__pyx_k_FunctionConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint___init */ + {__pyx_k_InSetConstraint, sizeof(__pyx_k_InSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint */ + {__pyx_k_InSetConstraint___call, sizeof(__pyx_k_InSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint___call */ + {__pyx_k_InSetConstraint___init, sizeof(__pyx_k_InSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint___init */ + {__pyx_k_InSetConstraint_preProcess, sizeof(__pyx_k_InSetConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InSetConstraint_preProcess */ + {__pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint */ + {__pyx_k_MaxProdConstraint___call, sizeof(__pyx_k_MaxProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___call */ + {__pyx_k_MaxProdConstraint___init, sizeof(__pyx_k_MaxProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint___init */ + {__pyx_k_MaxProdConstraint_preProcess, sizeof(__pyx_k_MaxProdConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint_preProcess */ + {__pyx_k_MaxProdConstraint_preProcess_loc, sizeof(__pyx_k_MaxProdConstraint_preProcess_loc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint_preProcess_loc */ + {__pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint */ + {__pyx_k_MaxSumConstraint___call, sizeof(__pyx_k_MaxSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint___call */ + {__pyx_k_MaxSumConstraint___init, sizeof(__pyx_k_MaxSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint___init */ + {__pyx_k_MaxSumConstraint_preProcess, sizeof(__pyx_k_MaxSumConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint_preProcess */ + {__pyx_k_MaxSumConstraint_preProcess_loca, sizeof(__pyx_k_MaxSumConstraint_preProcess_loca), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint_preProcess_loca */ + {__pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint */ + {__pyx_k_MinProdConstraint___call, sizeof(__pyx_k_MinProdConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint___call */ + {__pyx_k_MinProdConstraint___init, sizeof(__pyx_k_MinProdConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint___init */ + {__pyx_k_MinProdConstraint_preProcess, sizeof(__pyx_k_MinProdConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint_preProcess */ + {__pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint */ + {__pyx_k_MinSumConstraint___call, sizeof(__pyx_k_MinSumConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint___call */ + {__pyx_k_MinSumConstraint___init, sizeof(__pyx_k_MinSumConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint___init */ + {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */ + {__pyx_k_NotInSetConstraint, sizeof(__pyx_k_NotInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint */ + {__pyx_k_NotInSetConstraint___call, sizeof(__pyx_k_NotInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint___call */ + {__pyx_k_NotInSetConstraint___init, sizeof(__pyx_k_NotInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint___init */ + {__pyx_k_NotInSetConstraint_preProcess, sizeof(__pyx_k_NotInSetConstraint_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotInSetConstraint_preProcess */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ + {__pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Sequence */ + {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */ + {__pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sequence */ + {__pyx_k_SomeInSetConstraint, sizeof(__pyx_k_SomeInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint */ + {__pyx_k_SomeInSetConstraint___call, sizeof(__pyx_k_SomeInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint___call */ + {__pyx_k_SomeInSetConstraint___init, sizeof(__pyx_k_SomeInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeInSetConstraint___init */ + {__pyx_k_SomeNotInSetConstraint, sizeof(__pyx_k_SomeNotInSetConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint */ + {__pyx_k_SomeNotInSetConstraint___call, sizeof(__pyx_k_SomeNotInSetConstraint___call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint___call */ + {__pyx_k_SomeNotInSetConstraint___init, sizeof(__pyx_k_SomeNotInSetConstraint___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SomeNotInSetConstraint___init */ + {__pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Unassigned */ + {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ + {__pyx_k_Union_int_float, sizeof(__pyx_k_Union_int_float), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Union_int_float */ + {__pyx_k_Wrapper_function_for_picklable_s, sizeof(__pyx_k_Wrapper_function_for_picklable_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Wrapper_function_for_picklable_s */ + {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_assigned, sizeof(__pyx_k_assigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned */ + {__pyx_k_assigned_2, sizeof(__pyx_k_assigned_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assigned_2 */ + {__pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ + {__pyx_k_call, sizeof(__pyx_k_call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_call */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ + {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ + {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ + {__pyx_k_constraint_constraints_py, sizeof(__pyx_k_constraint_constraints_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_constraints_py */ + {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ + {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ + {__pyx_k_contains_lt1, sizeof(__pyx_k_contains_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contains_lt1 */ + {__pyx_k_contains_negative, sizeof(__pyx_k_contains_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_contains_negative */ + {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ + {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ + {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ + {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ + {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ + {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ + {__pyx_k_exact, sizeof(__pyx_k_exact), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exact */ + {__pyx_k_exact_2, sizeof(__pyx_k_exact_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exact_2 */ + {__pyx_k_exactsum, sizeof(__pyx_k_exactsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactsum */ + {__pyx_k_exactsum_2, sizeof(__pyx_k_exactsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exactsum_2 */ + {__pyx_k_forwardCheck, sizeof(__pyx_k_forwardCheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardCheck */ + {__pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck */ + {__pyx_k_found, sizeof(__pyx_k_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_found */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ + {__pyx_k_func_3, sizeof(__pyx_k_func_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_3 */ + {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ + {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ + {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ + {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ + {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ + {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_maxprod, sizeof(__pyx_k_maxprod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxprod */ + {__pyx_k_maxprod_2, sizeof(__pyx_k_maxprod_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxprod_2 */ + {__pyx_k_maxsum, sizeof(__pyx_k_maxsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxsum */ + {__pyx_k_maxsum_2, sizeof(__pyx_k_maxsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_maxsum_2 */ + {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ + {__pyx_k_minprod, sizeof(__pyx_k_minprod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minprod */ + {__pyx_k_minprod_2, sizeof(__pyx_k_minprod_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minprod_2 */ + {__pyx_k_minsum, sizeof(__pyx_k_minsum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minsum */ + {__pyx_k_minsum_2, sizeof(__pyx_k_minsum_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minsum_2 */ + {__pyx_k_missing, sizeof(__pyx_k_missing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ + {__pyx_k_multiplier, sizeof(__pyx_k_multiplier), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multiplier */ + {__pyx_k_multipliers, sizeof(__pyx_k_multipliers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multipliers */ + {__pyx_k_multipliers_2, sizeof(__pyx_k_multipliers_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_multipliers_2 */ + {__pyx_k_n, sizeof(__pyx_k_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n */ + {__pyx_k_n_2, sizeof(__pyx_k_n_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n_2 */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ + {__pyx_k_parms, sizeof(__pyx_k_parms), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parms */ + {__pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_preProcess */ + {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ + {__pyx_k_prod, sizeof(__pyx_k_prod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prod */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove */ + {__pyx_k_round, sizeof(__pyx_k_round), 0, 1, 1}, /* PyObject cname: __pyx_n_u_round */ + {__pyx_k_seen, sizeof(__pyx_k_seen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seen */ + {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ + {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ + {__pyx_k_set, sizeof(__pyx_k_set), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set */ + {__pyx_k_set_2, sizeof(__pyx_k_set_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_2 */ + {__pyx_k_singlevalue, sizeof(__pyx_k_singlevalue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_singlevalue */ + {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */ + {__pyx_k_sum, sizeof(__pyx_k_sum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sum */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ + {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ + {__pyx_k_unassigned, sizeof(__pyx_k_unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned */ + {__pyx_k_unassignedvariable, sizeof(__pyx_k_unassignedvariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassignedvariable */ + {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ + {__pyx_k_variable_contains_lt1, sizeof(__pyx_k_variable_contains_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_contains_lt1 */ + {__pyx_k_variable_contains_negative, sizeof(__pyx_k_variable_contains_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_contains_negative */ + {__pyx_k_variable_with_lt1, sizeof(__pyx_k_variable_with_lt1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_with_lt1 */ + {__pyx_k_variable_with_negative, sizeof(__pyx_k_variable_with_negative), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable_with_negative */ + {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ + {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ + {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ + {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_round); if (!__pyx_builtin_round) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 628, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/constraints.py":57 + * variable = variables[0] + * domain = domains[variable] + * for value in domain[:]: # <<<<<<<<<<<<<< + * if not self(variables, domains, {variable: value}): + * domain.remove(value) +*/ + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/constraints.py":198 + * + * def __call__(self, variables, domains, assignments, forwardcheck=False, _unassigned=Unassigned): # noqa: D102 + * raise NotImplementedError("CompilableFunctionConstraint can not be called directly") # <<<<<<<<<<<<<< + * + * +*/ + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_CompilableFunctionConstraint_can); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/constraints.py":628 + * def __call__(self, variables, domains, assignments, forwardcheck=False): # noqa: D102 + * # preProcess() will remove it. + * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + * + * def preProcess(self, variables: Sequence, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 628, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/constraints.py":10 + * """Abstract base class for constraints.""" + * + * def __call__(self, variables: Sequence, domains: dict, assignments: dict, forwardcheck=False): # <<<<<<<<<<<<<< + * """Perform the constraint checking. + * +*/ + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 10, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + + /* "constraint/constraints.py":125 + * """ + * + * def __init__(self, func: Callable, assigned: bool = True): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + + /* "constraint/constraints.py":288 + * """ + * + * def __init__(self, maxsum: Union[int, float], multipliers: Optional[Sequence] = None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); + + /* "constraint/constraints.py":686 + * """ + * + * def __init__(self, set, n=1, exact=False): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_int_1), ((PyObject *)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; + __pyx_mstate->__pyx_umethod_PyList_Type__remove.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__remove.method_name = &__pyx_mstate->__pyx_n_u_remove; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_10 = PyLong_FromLong(10); if (unlikely(!__pyx_mstate->__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +typedef struct { + unsigned int argcount : 3; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 10; + unsigned int line_table_length : 13; +} __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + PyObject* tuple_dedup_map = PyDict_New(); + if (unlikely(!tuple_dedup_map)) return -1; + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 307, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 527, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10, 20}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35, 109}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_3a_Q_y_WAQ_q_4t1Kz_1_wb, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63, 151}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_unassignedvariable, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_forwardCheck, __pyx_k_99LL___Q_L_y_q_c_1_q_1_4t1Ky_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 125, 25}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_assigned}; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_Zz_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137, 142}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_parms, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_x}; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_A_E_r_A_WA_WAQ_1_82Q_D_3d_M_HC, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193, 23}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_assigned}; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_U_A_IQ_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 19}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned}; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_88XXY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212, 146}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_seen, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain}; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_q_L_Kt1Ja_vWA_6_A_1_AYa_1_A_9G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 250, 160}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_unassigned, __pyx_mstate->__pyx_n_u_singlevalue, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain}; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_A_a_L_Kt1Ja_3a_a_wl_fCq_q_L_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288, 27}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_multipliers}; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 300, 257}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable_contains_negative, __pyx_mstate->__pyx_n_u_variable_with_negative, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_negative, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_6Q_L_7_gQa_q_d_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 335, 334}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_maxsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_Q_a_1_1Kq_9Cq_az_1_z_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 387, 27}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_multipliers}; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_4M_M_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 399, 149}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_d_4q_1_1Kq_IV1_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 416, 375}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_exactsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multiplier, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_4q_a_1_1Kq_9Cq_az_1_a_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 476, 27}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minsum, __pyx_mstate->__pyx_n_u_multipliers}; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_2_q_Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 488, 135}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_multipliers, __pyx_mstate->__pyx_n_u_minsum, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_n_u_multiplier}; + __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_L_y_q_q_d_Q_a_1_1Kq_Rq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 512, 14}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxprod}; + __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 520, 192}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable_contains_lt1, __pyx_mstate->__pyx_n_u_variable_with_lt1, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_contains_lt1, __pyx_mstate->__pyx_n_u_maxprod, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_1_A_L_gQ_Cq_WA_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 547, 164}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_maxprod, __pyx_mstate->__pyx_n_u_prod, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_a_q_L_y_1_1A_QfA_5_q_5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 572, 14}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minprod}; + __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 580, 92}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_minprod, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_QfKy_Q_a_L_WAQ_q_6_Bd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 591, 95}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_minprod, __pyx_mstate->__pyx_n_u_prod}; + __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_L_y_q_q_a_q_L_Kq_QfA_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618, 11}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; + __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 626, 14}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 630, 91}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 652, 11}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; + __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 660, 14}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_8_l_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 664, 91}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_preProcess, __pyx_k_77JJeef_d_L_WAQ_q_6_A_6_7_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 686, 30}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_exact}; + __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 700, 249}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_found, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_L_y_1_AZs_1_1_t1_5_c_WH, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 748, 30}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_exact}; + __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_E_HA_F_Ja, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 762, 249}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_n_u_missing, __pyx_mstate->__pyx_n_u_found, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_constraints_py, __pyx_mstate->__pyx_n_u_call, __pyx_k_55H_a_d_L_y_1_AZwa_1_1_t1_5_c_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; } /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ @@ -23555,11 +23277,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif @@ -23681,7 +23397,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -23697,20 +23413,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -23724,8 +23456,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -23748,7 +23479,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -23795,55 +23527,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -23861,9 +23577,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -23873,9 +23586,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -23883,14 +23593,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -23899,14 +23603,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -23966,12 +23681,7 @@ static void __Pyx_RaiseDoubleKeywordsError( PyObject* kw_name) { PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } /* ParseKeywords */ @@ -23994,7 +23704,7 @@ static int __Pyx_ParseOptionalKeywords( Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); @@ -24037,38 +23747,11 @@ static int __Pyx_ParseOptionalKeywords( #endif Py_INCREF(value); name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**name) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); @@ -24087,8 +23770,8 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**argname) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -24115,15 +23798,9 @@ static int __Pyx_ParseOptionalKeywords( "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif bad: Py_XDECREF(key); Py_XDECREF(value); @@ -24135,23 +23812,44 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; @@ -24168,7 +23866,7 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); @@ -24178,7 +23876,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -24186,7 +23884,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); @@ -24196,7 +23894,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -24204,13 +23902,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, n); } } else if (PyTuple_CheckExact(o)) { @@ -24224,7 +23920,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); + PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); @@ -24249,11 +23945,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } /* DictGetItem */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); @@ -24283,50 +23979,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -24340,7 +23995,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -24349,7 +24004,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -24415,9 +24070,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -24425,19 +24078,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -24474,9 +24119,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -24485,17 +24128,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -24510,13 +24146,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -24535,13 +24166,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -24563,7 +24189,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -24592,12 +24218,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -24605,7 +24229,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else @@ -24619,10 +24243,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, (size_t)nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -24631,6 +24257,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -24653,11 +24285,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; @@ -24700,13 +24328,9 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + } else if (flag == METH_FASTCALL) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } @@ -24714,34 +24338,24 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } @@ -24751,32 +24365,16 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif -/* PyIntBinop */ +/* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; @@ -24876,36 +24474,23 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); double result; - PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif -/* PyIntCompare */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { +/* PyLongCompare */ +static CYTHON_INLINE PyObject* __Pyx_PyLong_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { Py_RETURN_FALSE; } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE; - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; @@ -24953,11 +24538,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE; } return ( @@ -24965,58 +24546,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, } /* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -25101,9 +24630,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -25123,35 +24652,28 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif } - #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); @@ -25160,31 +24682,20 @@ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObje result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(3); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 1, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 2, arg2); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); + return result; } -#else - args = PyTuple_Pack(3, self, arg1, arg2); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif -bad: - Py_XDECREF(args); - return result; + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) @@ -25194,7 +24705,7 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec Py_INCREF(value); if ((1)); #else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; @@ -25204,9 +24715,9 @@ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObjec #endif else { if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); else - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } @@ -25261,18 +24772,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -25312,13 +24817,8 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -25387,20 +24887,45 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { + if (likely(is_tuple || PyTuple_Check(tuple))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -25411,7 +24936,7 @@ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -25447,7 +24972,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -25459,7 +24984,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -25515,8 +25040,20 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( } Py_INCREF(key); Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; + } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif *pitem = tuple; } else { if (pkey) { @@ -25531,15 +25068,33 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #endif + if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyList_GET_ITEM(iter_obj, pos); + #else + next_item = PyList_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else #endif @@ -25605,12 +25160,10 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -25664,32 +25217,32 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* PyDictVersioning */ @@ -25726,16 +25279,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } @@ -25743,16 +25287,23 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) +#elif !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif !CYTHON_AVOID_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = PyObject_GetItem(__pyx_mstate_global->__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -25761,20 +25312,13 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) return __Pyx_GetBuiltinName(name); } -/* PyIntCompare */ -static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { +/* PyLongCompare */ +static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_UNUSED_VAR(inplace); if (op1 == op2) { return 1; } - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - return (a == b); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { int unequal; @@ -25822,17 +25366,105 @@ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, lo #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); return ((double)a == (double)b); } return __Pyx_PyObject_IsTrueAndDecref( PyObject_RichCompare(op1, op2, Py_EQ)); } +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyVersionSanityCheck */ +static int __Pyx_VersionSanityCheck(void) { + #if CYTHON_COMPILING_IN_CPYTHON + #if PY_VERSION_HEX < 0x03080000 + if (PySys_GetObject("gettotalrefcount")) { + #ifndef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a non-debug version of Python but imported into a debug version." + ); + return -1; + #endif + } else { + #ifdef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a debug version of Python but imported into a non-debug version." + ); + return -1; + #endif + } + #endif // Py_VERSION_HEX < 0x03080000 + #if PY_VERSION_HEX >= 0x030d0000 + if (PyRun_SimpleStringFlags( + "if " + #ifdef Py_GIL_DISABLED + "not " + #endif + "__import__('sysconfig').get_config_var('Py_GIL_DISABLED'): raise ImportError", + NULL + ) == -1) { + PyErr_SetString( + PyExc_ImportError, + #ifdef Py_GIL_DISABLED + "Module was compiled with a freethreading build of Python but imported into a non-freethreading build." + #else + "Module was compiled with a non-freethreading build of Python but imported into a freethreading build." + #endif + ); + return -1; + } + #endif // version hex 3.13+ + if (PySys_GetObject("getobjects")) { + #ifndef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled without Py_TRACE_REFS but imported into a build of Python with." + ); + return -1; + #endif + } else { + #ifdef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with Py_TRACE_REFS but imported into a build of Python without." + ); + return -1; + #endif + } + const char code[] = "if __import__('sys').getsizeof(object()) != %u: raise ImportError"; + char formattedCode[sizeof(code)+50]; + PyOS_snprintf(formattedCode, sizeof(formattedCode), code, (unsigned int)sizeof(PyObject)); + if (PyRun_SimpleStringFlags(formattedCode, NULL) == -1) { + PyErr_SetString( + PyExc_ImportError, + "Runtime and compile-time PyObject size do not match." + ); + return -1; + } + #endif + return 0; +} + /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { @@ -25910,14 +25542,15 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -25926,18 +25559,6 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) @@ -25954,7 +25575,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -25974,7 +25595,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -26004,7 +25625,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -26013,12 +25634,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -26026,7 +25648,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -26045,7 +25667,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -26054,7 +25676,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -26073,103 +25695,52 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } @@ -26186,11 +25757,12 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__4); + module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -26206,19 +25778,14 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -26322,8 +25889,34 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec } #endif +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -26334,7 +25927,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -26350,10 +25948,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif Py_INCREF(key); Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -26371,16 +25978,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -26388,8 +26008,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func_3); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -26414,11 +26051,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -26448,10 +26081,8 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -26463,12 +26094,7 @@ static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -26488,12 +26114,7 @@ static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -26673,9 +26294,8 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -26688,7 +26308,7 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); @@ -26699,10 +26319,39 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { ignore: PyErr_Clear(); } -#endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { @@ -26716,24 +26365,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif @@ -26741,23 +26390,21 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -26766,18 +26413,14 @@ static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -26819,8 +26462,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -26882,14 +26523,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -26906,6 +26540,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -26913,40 +26551,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __Pyx_VISIT_CONST(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -26968,7 +26595,7 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -26976,24 +26603,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -27012,18 +26630,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -27031,16 +26640,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -27057,10 +26658,10 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -27072,11 +26673,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -27084,14 +26685,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -27101,21 +26697,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -27123,13 +26719,18 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27137,29 +26738,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27167,29 +26777,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27197,17 +26816,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -27215,6 +26838,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27222,12 +26851,17 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS @@ -27250,9 +26884,13 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif +#endif // CYTHON_METH_FASTCALL Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -27272,11 +26910,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #endif 0, 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else 0, -#endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, @@ -27298,11 +26932,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else offsetof(PyCFunctionObject, m_weakreflist), -#endif 0, 0, __pyx_CyFunction_methods, @@ -27325,9 +26955,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -#if PY_VERSION_HEX >= 0x030400a1 0, -#endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif @@ -27346,25 +26974,22 @@ static PyTypeObject __pyx_CyFunctionType_type = { }; #endif static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -27387,7 +27012,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -27399,7 +27024,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -27414,10 +27039,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -27436,31 +27057,17 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } -/* PyObjectCall2Args */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args[3] = {NULL, arg1, arg2}; - return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* PyObjectLookupSpecial */ #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -27481,7 +27088,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -27496,148 +27103,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -27645,7 +27118,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -27661,25 +27134,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } @@ -27688,10 +27144,26 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -27700,7 +27172,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -27728,12 +27200,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -27745,14 +27230,20 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -27760,20 +27251,20 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -27784,7 +27275,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; @@ -27795,7 +27286,6 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -27817,8 +27307,8 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; @@ -27831,7 +27321,8 @@ static PyCodeObject *__pyx_find_code_object(int code_line) { Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { @@ -27851,7 +27342,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; @@ -27874,7 +27365,6 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } -#endif /* AddTraceback */ #include "compile.h" @@ -27894,8 +27384,7 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } @@ -27935,20 +27424,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -27974,58 +27469,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -28056,7 +27510,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -28068,8 +27522,40 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28081,7 +27567,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG @@ -28091,7 +27577,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -28112,25 +27598,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -28145,11 +27631,11 @@ static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); + __pyx_mstate_global->__pyx_n_u_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__68); + name = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2); } return name; } @@ -28178,7 +27664,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28188,24 +27674,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -28445,7 +27918,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28455,24 +27928,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -28752,29 +28212,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -28782,21 +28219,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif +} + /* PyObjectCallMethod1 */ #if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2) static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { @@ -28991,7 +28445,53 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif } +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async) { + if (value == Py_None) { + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if (PY_VERSION_HEX >= 0x030C00A6 + || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -28999,7 +28499,14 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -29017,20 +28524,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -29058,27 +28580,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -29115,26 +28645,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -29145,26 +28656,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -29174,7 +28681,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -29220,10 +28727,14 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -29250,17 +28761,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif + PyObject *exc = + #ifdef __Pyx_AsyncGen_USED + __Pyx_AsyncGen_CheckExact(gen) ? PyExc_StopAsyncIteration : + #endif + PyExc_StopIteration; __Pyx_PyErr_SetNone(exc); } } return retval; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async); + Py_XDECREF(retval); + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -29297,25 +28823,57 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult result; + gen->is_running = 1; + result = gen_am_send(gen->yieldfrom, value, &ret); + gen->is_running = 0; + if (result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + return __Pyx_Coroutine_SendEx(gen, ret, retval, 0); +} +#endif +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -29331,66 +28889,65 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } gen->is_running = 0; if (likely(ret)) { - return ret; + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; + result = PYGEN_RETURN; gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -29398,20 +28955,29 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(gen->is_running)) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED @@ -29419,36 +28985,47 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); gen->is_running = 0; if (likely(ret)) { return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; + __Pyx_PySendResult result; PyObject *yf = gen->yieldfrom; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -29457,10 +29034,23 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -29468,25 +29058,14 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; + return PYGEN_ERROR; } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; - } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { @@ -29495,6 +29074,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -29502,7 +29082,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } gen->is_running = 1; @@ -29520,7 +29100,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { @@ -29541,20 +29121,25 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(self, ret); + if (ret) + return ret; + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -29569,6 +29154,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -29578,7 +29167,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -29599,10 +29188,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -29621,6 +29213,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if !(CYTHON_USE_TYPE_SPECS && !CYTHON_USE_TP_FINALIZE) static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -29657,42 +29250,18 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); @@ -29702,9 +29271,13 @@ static void __Pyx_Coroutine_del(PyObject *self) { return; } { +#if !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); +#else + #error __Pyx_Coroutine_del with Limited API and without CYTHON_USE_TP_FINALIZE should never be compiled +#endif } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && @@ -29717,6 +29290,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif #endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -29730,12 +29304,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -29757,12 +29326,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -29774,6 +29338,7 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { @@ -29783,7 +29348,7 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) @@ -29792,6 +29357,11 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) } Py_INCREF(frame); return frame; +#else + CYTHON_UNUSED_VAR(self); + CYTHON_UNUSED_VAR(context); + Py_RETURN_NONE; +#endif } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -29811,7 +29381,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -29835,131 +29406,34 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( return gen; } -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, + {"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + PyDoc_STR("object being iterated by 'yield from', or None")}, + {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS @@ -29971,9 +29445,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -29985,6 +29462,12 @@ static PyType_Spec __pyx_GeneratorType_spec = { __pyx_GeneratorType_slots }; #else +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async = { + 0, + 0, + 0, + __Pyx_Coroutine_AmSend, +}; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", @@ -29994,6 +29477,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, + __Pyx_SlotTpAsAsync(__pyx_Generator_as_async), 0, 0, 0, @@ -30004,8 +29488,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, @@ -30039,7 +29522,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 +#else 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) @@ -30060,45 +29543,60 @@ static PyTypeObject __pyx_GeneratorType_type = { }; #endif static int __pyx_Generator_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif - if (unlikely(!__pyx_GeneratorType)) { + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -30121,45 +29619,164 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject* filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000)) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -30187,31 +29804,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -30223,16 +29839,12 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif @@ -30264,9 +29876,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -30280,74 +29891,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -30393,23 +29974,19 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } @@ -30417,8 +29994,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } diff --git a/constraint/domain.c b/constraint/domain.c index db4c6ba..53a36cf 100644 --- a/constraint/domain.c +++ b/constraint/domain.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.0a1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" -#else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_0a1" +#define CYTHON_HEX_VERSION 0x030100A1 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,8 +178,13 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,7 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -248,11 +246,17 @@ END: Cython Metadata */ #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -262,80 +266,20 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 - #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +288,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +309,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +342,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +519,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +536,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,62 +551,12 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif @@ -673,31 +578,6 @@ END: Cython Metadata */ #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) @@ -757,7 +637,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +675,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -836,8 +716,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +730,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +742,40 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +799,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +815,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +844,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +857,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +867,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,26 +884,69 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && PY_VERSION_HEX >= 0x030d00b1 +#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS +#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +#endif +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItem(dict, key); + if (*result == NULL) { + return 0; + } + Py_INCREF(*result); + return 1; +} +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (PyErr_Occurred()) { + return -1; + } else if (*result == NULL) { + return 0; + } + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) @@ -1132,64 +957,48 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#define PyBoolObject PyLongObject +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_pyiter_sendfunc sendfunc #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND && __PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_SlotTpAsAsync(s) (&(s)) +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)&(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1209,8 +1018,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1060,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1104,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1127,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1211,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,26 +1228,38 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/domain.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ @@ -1514,7 +1285,6 @@ static const char *__pyx_f[] = { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1528,11 +1298,6 @@ static const char *__pyx_f[] = { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1644,6 +1409,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1677,10 +1444,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) @@ -1699,9 +1466,12 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1742,12 +1512,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1830,7 +1594,7 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) @@ -1849,19 +1613,18 @@ typedef struct { } __Pyx_CachedCFunction; /* CallUnboundCMethod0.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ - (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ - (PY_VERSION_HEX >= 0x030700A0 ?\ - (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ - (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ - (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ - ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + (likely((cfunc)->flag == METH_FASTCALL) ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_mstate_global->__pyx_empty_tuple, 0) :\ + ((cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_mstate_global->__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_mstate_global->__pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_mstate_global->__pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else @@ -1874,8 +1637,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* IncludeStructmemberH.proto */ -#include +/* PyVersionSanityCheck.proto */ +static int __Pyx_VersionSanityCheck(void); /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS @@ -1884,43 +1647,26 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); - -/* FetchCommonType.proto */ -#if !CYTHON_USE_TYPE_SPECS -static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); -#else -static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); -#endif - -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -1954,10 +1700,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -1970,9 +1717,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -1981,9 +1726,9 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) @@ -1993,9 +1738,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2008,7 +1752,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2023,7 +1767,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2083,7 +1827,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2103,16 +1847,20 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { @@ -2122,9 +1870,8 @@ struct __Pyx_CodeObjectCache { }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2148,14 +1895,32 @@ typedef const char *__Pyx_TypeName; #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) PyDict_New() +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2169,19 +1934,48 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #define __PYX_LIMITED_ABI_SUFFIX "limited" +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.domain" */ /* #### Code section: typeinfo ### */ @@ -2193,21 +1987,23 @@ int __pyx_module_is_main_constraint__domain = 0; /* Implementation of "constraint.domain" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_ModuleNotFoundError; /* #### Code section: string_decls ### */ -static const char __pyx_k__16[] = "?"; +static const char __pyx_k_[] = "?"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_set[] = "set"; +static const char __pyx_k_A_HA[] = "\200A\360\016\000\t\r\210H\220A"; +static const char __pyx_k_A_t1[] = "\200A\340\010\017\210t\2201"; static const char __pyx_k_bool[] = "bool"; -static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_diff[] = "diff"; +static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "name"; static const char __pyx_k_repr[] = "__repr__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_super[] = "super"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_Domain[] = "Domain"; static const char __pyx_k_append[] = "append"; @@ -2218,21 +2014,24 @@ static const char __pyx_k_name_2[] = "__name__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_return[] = "return"; static const char __pyx_k_states[] = "_states"; +static const char __pyx_k_1_q_s_q[] = "\320\000\033\2301\360\014\000\005\006\360\006\000\t\020\210q\330\013\027\220s\230!\330\010\017\210q"; +static const char __pyx_k_A_HG1Cq[] = "\200A\360\n\000\t\r\210H\220G\2301\230C\230q\240\001"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_Variable[] = "Variable"; static const char __pyx_k_popState[] = "popState"; static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; +static const char __pyx_k_A_G1D_D_D[] = "\200A\340\010\014\210G\2201\220D\230\001\330\010\014\210D\220\010\230\001\330\010\014\210D\220\010\230\001"; static const char __pyx_k_hideValue[] = "hideValue"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_pushState[] = "pushState"; +static const char __pyx_k_A_G1F_HG1A[] = "\200A\360\022\000\t\r\210G\2201\220F\230!\330\010\014\210H\220G\2301\230A"; static const char __pyx_k_Unassigned[] = "Unassigned"; static const char __pyx_k_resetState[] = "resetState"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_mro_entries[] = "__mro_entries__"; +static const char __pyx_k_A_IQfA_Kq_Kq[] = "\200A\360\014\000\t\r\210I\220Q\220f\230A\330\010\014\210K\220q\330\010\014\210K\220q"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_Domain___init[] = "Domain.__init__"; -static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_Domain_popState[] = "Domain.popState"; static const char __pyx_k_Variable___init[] = "Variable.__init__"; static const char __pyx_k_Variable___repr[] = "Variable.__repr__"; @@ -2243,7 +2042,9 @@ static const char __pyx_k_check_if_compiled[] = "check_if_compiled"; static const char __pyx_k_constraint_domain[] = "constraint.domain"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_ModuleNotFoundError[] = "ModuleNotFoundError"; static const char __pyx_k_constraint_domain_py[] = "constraint/domain.py"; +static const char __pyx_k_A_t84s_Cq_1_q_HAQa_HAQa[] = "\200A\360\n\000\t\020\210t\2208\2304\230s\240\"\240C\240q\250\001\330\010\013\2101\330\014\020\220\007\220q\230\004\230H\240A\240Q\240a\330\014\020\220\004\220H\230A\230Q\230a"; static const char __pyx_k_Class_used_to_control_possible_v[] = "Class used to control possible values for variables.\n\n When list or tuples are used as domains, they are automatically\n converted to an instance of that class.\n "; static const char __pyx_k_Helper_class_for_variable_defini[] = "Helper class for variable definition.\n\n Using this class is optional, since any hashable object,\n including plain strings and integers, may be used as variables.\n "; static const char __pyx_k_Module_containing_the_code_for_t[] = "Module containing the code for the Variable and Domain classes."; @@ -2256,9 +2057,19 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2284,105 +2095,95 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_s_Class_used_to_control_possible_v; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_n_s_Domain___init; - PyObject *__pyx_n_s_Domain_hideValue; - PyObject *__pyx_n_s_Domain_popState; - PyObject *__pyx_n_s_Domain_pushState; - PyObject *__pyx_n_s_Domain_resetState; - PyObject *__pyx_kp_s_Helper_class_for_variable_defini; - PyObject *__pyx_n_s_ImportError; - PyObject *__pyx_n_s_Unassigned; - PyObject *__pyx_n_u_Unassigned; - PyObject *__pyx_n_s_Variable; - PyObject *__pyx_n_s_Variable___init; - PyObject *__pyx_n_s_Variable___repr; - PyObject *__pyx_n_s__16; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_check_if_compiled; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_kp_s_constraint_domain_py; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_diff; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_extend; - PyObject *__pyx_n_s_hidden; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_name_2; - PyObject *__pyx_n_s_pop; - PyObject *__pyx_n_s_popState; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_pushState; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_remove; - PyObject *__pyx_n_s_repr; - PyObject *__pyx_n_s_resetState; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_set; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_states; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_value; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__14; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__15; -} __pyx_mstate; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; + PyObject *__pyx_slice[1]; + PyObject *__pyx_codeobj_tab[8]; + PyObject *__pyx_string_tab[50]; +/* #### Code section: module_state_contents ### */ +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_Class_used_to_control_possible_v __pyx_string_tab[1] +#define __pyx_n_u_Domain __pyx_string_tab[2] +#define __pyx_n_u_Domain___init __pyx_string_tab[3] +#define __pyx_n_u_Domain_hideValue __pyx_string_tab[4] +#define __pyx_n_u_Domain_popState __pyx_string_tab[5] +#define __pyx_n_u_Domain_pushState __pyx_string_tab[6] +#define __pyx_n_u_Domain_resetState __pyx_string_tab[7] +#define __pyx_kp_u_Helper_class_for_variable_defini __pyx_string_tab[8] +#define __pyx_n_u_ImportError __pyx_string_tab[9] +#define __pyx_n_u_ModuleNotFoundError __pyx_string_tab[10] +#define __pyx_n_u_Unassigned __pyx_string_tab[11] +#define __pyx_n_u_Variable __pyx_string_tab[12] +#define __pyx_n_u_Variable___init __pyx_string_tab[13] +#define __pyx_n_u_Variable___repr __pyx_string_tab[14] +#define __pyx_n_u_append __pyx_string_tab[15] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[16] +#define __pyx_n_u_bool __pyx_string_tab[17] +#define __pyx_n_u_check_if_compiled __pyx_string_tab[18] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[19] +#define __pyx_n_u_constraint_domain __pyx_string_tab[20] +#define __pyx_kp_u_constraint_domain_py __pyx_string_tab[21] +#define __pyx_n_u_diff __pyx_string_tab[22] +#define __pyx_n_u_doc __pyx_string_tab[23] +#define __pyx_n_u_extend __pyx_string_tab[24] +#define __pyx_n_u_func __pyx_string_tab[25] +#define __pyx_n_u_hidden __pyx_string_tab[26] +#define __pyx_n_u_hideValue __pyx_string_tab[27] +#define __pyx_n_u_init __pyx_string_tab[28] +#define __pyx_n_u_is_coroutine __pyx_string_tab[29] +#define __pyx_n_u_main __pyx_string_tab[30] +#define __pyx_n_u_metaclass __pyx_string_tab[31] +#define __pyx_n_u_module __pyx_string_tab[32] +#define __pyx_n_u_mro_entries __pyx_string_tab[33] +#define __pyx_n_u_name __pyx_string_tab[34] +#define __pyx_n_u_name_2 __pyx_string_tab[35] +#define __pyx_n_u_pop __pyx_string_tab[36] +#define __pyx_n_u_popState __pyx_string_tab[37] +#define __pyx_n_u_prepare __pyx_string_tab[38] +#define __pyx_n_u_pushState __pyx_string_tab[39] +#define __pyx_n_u_qualname __pyx_string_tab[40] +#define __pyx_n_u_remove __pyx_string_tab[41] +#define __pyx_n_u_repr __pyx_string_tab[42] +#define __pyx_n_u_resetState __pyx_string_tab[43] +#define __pyx_n_u_return __pyx_string_tab[44] +#define __pyx_n_u_self __pyx_string_tab[45] +#define __pyx_n_u_set __pyx_string_tab[46] +#define __pyx_n_u_states __pyx_string_tab[47] +#define __pyx_n_u_test __pyx_string_tab[48] +#define __pyx_n_u_value __pyx_string_tab[49] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -2396,260 +2197,35 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_kp_s_Class_used_to_control_possible_v); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain_resetState); - Py_CLEAR(clear_module_state->__pyx_kp_s_Helper_class_for_variable_defini); - Py_CLEAR(clear_module_state->__pyx_n_s_ImportError); - Py_CLEAR(clear_module_state->__pyx_n_s_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_u_Unassigned); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Variable___repr); - Py_CLEAR(clear_module_state->__pyx_n_s__16); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_check_if_compiled); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_domain_py); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_diff); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_extend); - Py_CLEAR(clear_module_state->__pyx_n_s_hidden); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_name_2); - Py_CLEAR(clear_module_state->__pyx_n_s_pop); - Py_CLEAR(clear_module_state->__pyx_n_s_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_remove); - Py_CLEAR(clear_module_state->__pyx_n_s_repr); - Py_CLEAR(clear_module_state->__pyx_n_s_resetState); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_set); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_states); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<50; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - Py_VISIT(traverse_module_state->__pyx_kp_s_Class_used_to_control_possible_v); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain_resetState); - Py_VISIT(traverse_module_state->__pyx_kp_s_Helper_class_for_variable_defini); - Py_VISIT(traverse_module_state->__pyx_n_s_ImportError); - Py_VISIT(traverse_module_state->__pyx_n_s_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_u_Unassigned); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Variable___repr); - Py_VISIT(traverse_module_state->__pyx_n_s__16); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_check_if_compiled); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_domain_py); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_diff); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_extend); - Py_VISIT(traverse_module_state->__pyx_n_s_hidden); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_name_2); - Py_VISIT(traverse_module_state->__pyx_n_s_pop); - Py_VISIT(traverse_module_state->__pyx_n_s_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_remove); - Py_VISIT(traverse_module_state->__pyx_n_s_repr); - Py_VISIT(traverse_module_state->__pyx_n_s_resetState); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_set); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_states); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<50; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_s_Class_used_to_control_possible_v __pyx_mstate_global->__pyx_kp_s_Class_used_to_control_possible_v -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_n_s_Domain___init __pyx_mstate_global->__pyx_n_s_Domain___init -#define __pyx_n_s_Domain_hideValue __pyx_mstate_global->__pyx_n_s_Domain_hideValue -#define __pyx_n_s_Domain_popState __pyx_mstate_global->__pyx_n_s_Domain_popState -#define __pyx_n_s_Domain_pushState __pyx_mstate_global->__pyx_n_s_Domain_pushState -#define __pyx_n_s_Domain_resetState __pyx_mstate_global->__pyx_n_s_Domain_resetState -#define __pyx_kp_s_Helper_class_for_variable_defini __pyx_mstate_global->__pyx_kp_s_Helper_class_for_variable_defini -#define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError -#define __pyx_n_s_Unassigned __pyx_mstate_global->__pyx_n_s_Unassigned -#define __pyx_n_u_Unassigned __pyx_mstate_global->__pyx_n_u_Unassigned -#define __pyx_n_s_Variable __pyx_mstate_global->__pyx_n_s_Variable -#define __pyx_n_s_Variable___init __pyx_mstate_global->__pyx_n_s_Variable___init -#define __pyx_n_s_Variable___repr __pyx_mstate_global->__pyx_n_s_Variable___repr -#define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16 -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_check_if_compiled __pyx_mstate_global->__pyx_n_s_check_if_compiled -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_kp_s_constraint_domain_py __pyx_mstate_global->__pyx_kp_s_constraint_domain_py -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_diff __pyx_mstate_global->__pyx_n_s_diff -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend -#define __pyx_n_s_hidden __pyx_mstate_global->__pyx_n_s_hidden -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 -#define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop -#define __pyx_n_s_popState __pyx_mstate_global->__pyx_n_s_popState -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_pushState __pyx_mstate_global->__pyx_n_s_pushState -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove -#define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr -#define __pyx_n_s_resetState __pyx_mstate_global->__pyx_n_s_resetState -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_set __pyx_mstate_global->__pyx_n_s_set -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_states __pyx_mstate_global->__pyx_n_s_states -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 /* #### Code section: module_code ### */ /* "constraint/domain.py":4 @@ -2658,7 +2234,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_1check_if_compiled(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ @@ -2683,7 +2259,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("check_if_compiled", 1); + __Pyx_RefNannySetupContext("check_if_compiled", 0); /* "constraint/domain.py":10 * bool: whether the code has been compiled. @@ -2691,7 +2267,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * try: # <<<<<<<<<<<<<< * from cython import compiled * - */ +*/ { (void)__pyx_t_1; (void)__pyx_t_2; (void)__pyx_t_3; /* mark used */ /*try:*/ { @@ -2702,7 +2278,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * return compiled # <<<<<<<<<<<<<< * except ImportError or ModuleNotFoundError: * return False - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -2714,7 +2290,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * try: # <<<<<<<<<<<<<< * from cython import compiled * - */ +*/ } __pyx_L7_try_return:; goto __pyx_L0; @@ -2726,7 +2302,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ /* function exit code */ __pyx_L0:; @@ -2741,7 +2317,7 @@ static PyObject *__pyx_pf_10constraint_6domain_check_if_compiled(CYTHON_UNUSED P * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_8Variable_1__init__(PyObject *__pyx_self, @@ -2774,7 +2350,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -2782,13 +2358,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_name,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -2796,7 +2374,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -2804,7 +2382,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_name)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -2861,7 +2439,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/domain.py":37 * purposes @@ -2869,8 +2447,8 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * self.name = name # <<<<<<<<<<<<<< * * def __repr__(self): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 37, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_name, __pyx_v_name) < 0) __PYX_ERR(0, 37, __pyx_L1_error) /* "constraint/domain.py":30 * """ @@ -2878,7 +2456,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -2898,7 +2476,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable___init__(CYTHON_UNUSED * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_8Variable_3__repr__(PyObject *__pyx_self, @@ -2930,7 +2508,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -2938,11 +2516,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -2950,7 +2529,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3004,7 +2583,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 1); + __Pyx_RefNannySetupContext("__repr__", 0); /* "constraint/domain.py":41 * def __repr__(self): @@ -3012,9 +2591,9 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * return self.name # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3026,7 +2605,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3045,7 +2624,7 @@ static PyObject *__pyx_pf_10constraint_6domain_8Variable_2__repr__(CYTHON_UNUSED * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_1__init__(PyObject *__pyx_self, @@ -3078,7 +2657,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3086,13 +2665,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_set,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_set,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3100,7 +2681,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3108,7 +2689,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_set)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_set)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -3169,7 +2750,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/domain.py":65 * set: Set of values, comparable by equality, that the given variables may assume. @@ -3177,21 +2758,20 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * list.__init__(self, set) # <<<<<<<<<<<<<< * self._hidden = [] * self._states = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -3210,10 +2790,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * self._hidden = [] # <<<<<<<<<<<<<< * self._states = [] * - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hidden, __pyx_t_1) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden, __pyx_t_1) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":67 @@ -3222,10 +2802,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * self._states = [] # <<<<<<<<<<<<<< * * def resetState(self): - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_states, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":59 @@ -3234,7 +2814,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3257,7 +2837,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain___init__(CYTHON_UNUSED Py * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_3resetState(PyObject *__pyx_self, @@ -3289,7 +2869,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("resetState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3297,11 +2877,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3309,7 +2890,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3367,7 +2948,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("resetState", 1); + __Pyx_RefNannySetupContext("resetState", 0); /* "constraint/domain.py":71 * def resetState(self): @@ -3375,23 +2956,22 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * self.extend(self._hidden) # <<<<<<<<<<<<<< * del self._hidden[:] * del self._states[:] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_extend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } #endif { @@ -3411,10 +2991,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * del self._hidden[:] # <<<<<<<<<<<<<< * del self._states[:] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":73 @@ -3423,10 +3003,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * del self._states[:] # <<<<<<<<<<<<<< * * def pushState(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/domain.py":69 @@ -3435,7 +3015,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3459,7 +3039,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_2resetState(CYTHON_UNUSED * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_5pushState(PyObject *__pyx_self, @@ -3491,7 +3071,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pushState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3499,11 +3079,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3511,7 +3092,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3568,7 +3149,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("pushState", 1); + __Pyx_RefNannySetupContext("pushState", 0); /* "constraint/domain.py":80 * Variables hidden after that call are restored when that state is popped from the stack. @@ -3576,11 +3157,11 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * self._states.append(len(self)) # <<<<<<<<<<<<<< * * def popState(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 80, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -3592,7 +3173,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3614,7 +3195,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_4pushState(CYTHON_UNUSED * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_7popState(PyObject *__pyx_self, @@ -3646,7 +3227,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("popState (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3654,11 +3235,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3666,7 +3248,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3728,7 +3310,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("popState", 1); + __Pyx_RefNannySetupContext("popState", 0); /* "constraint/domain.py":87 * Variables hidden since the last popped state are then available again. @@ -3736,14 +3318,14 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * diff = self._states.pop() - len(self) # <<<<<<<<<<<<<< * if diff: * self.extend(self._hidden[-diff:]) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -3758,7 +3340,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * if diff: # <<<<<<<<<<<<<< * self.extend(self._hidden[-diff:]) * del self._hidden[-diff:] - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_diff); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 88, __pyx_L1_error) if (__pyx_t_5) { @@ -3768,10 +3350,10 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * self.extend(self._hidden[-diff:]) # <<<<<<<<<<<<<< * del self._hidden[-diff:] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyNumber_Negative(__pyx_v_diff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -3784,13 +3366,12 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; } #endif { @@ -3810,8 +3391,8 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * del self._hidden[-diff:] # <<<<<<<<<<<<<< * * def hideValue(self, value): - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyNumber_Negative(__pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -3825,7 +3406,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * if diff: # <<<<<<<<<<<<<< * self.extend(self._hidden[-diff:]) * del self._hidden[-diff:] - */ +*/ } /* "constraint/domain.py":82 @@ -3834,7 +3415,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3860,7 +3441,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_6popState(CYTHON_UNUSED P * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6domain_6Domain_9hideValue(PyObject *__pyx_self, @@ -3893,7 +3474,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("hideValue (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3901,13 +3482,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3915,7 +3498,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3923,7 +3506,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -3985,28 +3568,27 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("hideValue", 1); + __Pyx_RefNannySetupContext("hideValue", 0); /* "constraint/domain.py":101 * value: Object currently available in the domain * """ * list.remove(self, value) # <<<<<<<<<<<<<< * self._hidden.append(value) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyList_Type)), __pyx_mstate_global->__pyx_n_u_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -4023,8 +3605,8 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED * """ * list.remove(self, value) * self._hidden.append(value) # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_hidden); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_value); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4035,7 +3617,7 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4051,296 +3633,98 @@ static PyObject *__pyx_pf_10constraint_6domain_6Domain_8hideValue(CYTHON_UNUSED __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Class_used_to_control_possible_v, __pyx_k_Class_used_to_control_possible_v, sizeof(__pyx_k_Class_used_to_control_possible_v), 0, 0, 1, 0}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_n_s_Domain___init, __pyx_k_Domain___init, sizeof(__pyx_k_Domain___init), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_hideValue, __pyx_k_Domain_hideValue, sizeof(__pyx_k_Domain_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_popState, __pyx_k_Domain_popState, sizeof(__pyx_k_Domain_popState), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_pushState, __pyx_k_Domain_pushState, sizeof(__pyx_k_Domain_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_Domain_resetState, __pyx_k_Domain_resetState, sizeof(__pyx_k_Domain_resetState), 0, 0, 1, 1}, - {&__pyx_kp_s_Helper_class_for_variable_defini, __pyx_k_Helper_class_for_variable_defini, sizeof(__pyx_k_Helper_class_for_variable_defini), 0, 0, 1, 0}, - {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, - {&__pyx_n_s_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 0, 1, 1}, - {&__pyx_n_u_Unassigned, __pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 0, 1}, - {&__pyx_n_s_Variable, __pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 0, 1, 1}, - {&__pyx_n_s_Variable___init, __pyx_k_Variable___init, sizeof(__pyx_k_Variable___init), 0, 0, 1, 1}, - {&__pyx_n_s_Variable___repr, __pyx_k_Variable___repr, sizeof(__pyx_k_Variable___repr), 0, 0, 1, 1}, - {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_check_if_compiled, __pyx_k_check_if_compiled, sizeof(__pyx_k_check_if_compiled), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_domain_py, __pyx_k_constraint_domain_py, sizeof(__pyx_k_constraint_domain_py), 0, 0, 1, 0}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, - {&__pyx_n_s_hidden, __pyx_k_hidden, sizeof(__pyx_k_hidden), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, - {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, - {&__pyx_n_s_popState, __pyx_k_popState, sizeof(__pyx_k_popState), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_pushState, __pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, - {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1}, - {&__pyx_n_s_resetState, __pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_states, __pyx_k_states, sizeof(__pyx_k_states), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 14, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/domain.py":72 - * """Reset to the original domain state, including all possible values.""" - * self.extend(self._hidden) - * del self._hidden[:] # <<<<<<<<<<<<<< - * del self._states[:] - * - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 72, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/domain.py":4 - * - * - * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< - * """Check if this code has been compiled with Cython. - * - */ - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_check_if_compiled, 4, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 4, __pyx_L1_error) - - /* "constraint/domain.py":30 - * """ - * - * def __init__(self, name): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 30, __pyx_L1_error) - - /* "constraint/domain.py":39 - * self.name = name - * - * def __repr__(self): # <<<<<<<<<<<<<< - * """Represents itself with the name attribute.""" - * return self.name - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_repr, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 39, __pyx_L1_error) - - /* "constraint/domain.py":44 - * - * - * Unassigned = Variable("Unassigned") #: Helper object instance representing unassigned values # <<<<<<<<<<<<<< - * - * - */ - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_u_Unassigned); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - - /* "constraint/domain.py":59 - * """ - * - * def __init__(self, set): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_set); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_init, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 59, __pyx_L1_error) - - /* "constraint/domain.py":69 - * self._states = [] - * - * def resetState(self): # <<<<<<<<<<<<<< - * """Reset to the original domain state, including all possible values.""" - * self.extend(self._hidden) - */ - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_resetState, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 69, __pyx_L1_error) - - /* "constraint/domain.py":75 - * del self._states[:] - * - * def pushState(self): # <<<<<<<<<<<<<< - * """Save current domain state. - * - */ - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_pushState, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 75, __pyx_L1_error) - - /* "constraint/domain.py":82 - * self._states.append(len(self)) - * - * def popState(self): # <<<<<<<<<<<<<< - * """Restore domain state from the top of the stack. - * - */ - __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_popState, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 82, __pyx_L1_error) - - /* "constraint/domain.py":92 - * del self._hidden[-diff:] - * - * def hideValue(self, value): # <<<<<<<<<<<<<< - * """Hide the given value from the domain. - * - */ - __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__14); - __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_domain_py, __pyx_n_s_hideValue, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_domain(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_domain}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + #endif {0, NULL} }; #endif @@ -4358,7 +3742,7 @@ namespace { #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + sizeof(__pyx_mstatetype), /* m_size */ #else -1, /* m_size */ #endif @@ -4379,52 +3763,39 @@ namespace { #endif }; #ifdef __cplusplus -} /* anonymous namespace */ -#endif -#endif - -#ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif +} /* anonymous namespace */ #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initdomain(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initdomain(void) +/* PyModInitFuncType */ +#ifndef CYTHON_NO_PYINIT_EXPORT + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif +#endif + __Pyx_PyMODINIT_FUNC PyInit_domain(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_domain(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { + if (__Pyx_VersionSanityCheck() < 0) return NULL; return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif { PyErr_SetString( PyExc_ImportError, @@ -4488,17 +3859,21 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_module) #endif -#endif { + #if !CYTHON_PEP489_MULTI_PHASE_INIT + if (__Pyx_VersionSanityCheck() < 0) return NULL; + #endif int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + unsigned int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -4509,7 +3884,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_modu PyErr_SetString(PyExc_RuntimeError, "Module 'domain' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ @@ -4517,10 +3892,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_modu __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("domain", __pyx_methods, __pyx_k_Module_containing_the_code_for_t, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE + #if CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); @@ -4532,13 +3904,18 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_domain(PyObject *__pyx_pyinit_modu __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); + #endif #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -4548,14 +3925,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_domain(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_domain", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -4571,48 +3949,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__domain) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.domain")) { if (unlikely((PyDict_SetItemString(modules, "constraint.domain", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/domain.py":4 * @@ -4620,15 +3984,15 @@ if (!__Pyx_RefNanny) { * def check_if_compiled() -> bool: # <<<<<<<<<<<<<< * """Check if this code has been compiled with Cython. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 4, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_1check_if_compiled, 0, __pyx_n_s_check_if_compiled, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_1check_if_compiled, 0, __pyx_mstate_global->__pyx_n_u_check_if_compiled, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_if_compiled, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_check_if_compiled, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":23 @@ -4637,8 +4001,8 @@ if (!__Pyx_RefNanny) { * class Variable: # <<<<<<<<<<<<<< * """Helper class for variable definition. * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Variable, __pyx_n_s_Variable, (PyObject *) NULL, __pyx_n_s_constraint_domain, __pyx_kp_s_Helper_class_for_variable_defini); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Variable, __pyx_mstate_global->__pyx_n_u_Variable, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_kp_u_Helper_class_for_variable_defini); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "constraint/domain.py":30 @@ -4647,10 +4011,10 @@ if (!__Pyx_RefNanny) { * def __init__(self, name): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_1__init__, 0, __pyx_n_s_Variable___init, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Variable___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":39 @@ -4659,10 +4023,10 @@ if (!__Pyx_RefNanny) { * def __repr__(self): # <<<<<<<<<<<<<< * """Represents itself with the name attribute.""" * return self.name - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_3__repr__, 0, __pyx_n_s_Variable___repr, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_8Variable_3__repr__, 0, __pyx_mstate_global->__pyx_n_u_Variable___repr, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":23 @@ -4671,10 +4035,10 @@ if (!__Pyx_RefNanny) { * class Variable: # <<<<<<<<<<<<<< * """Helper class for variable definition. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Variable, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Variable, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Variable, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Variable, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4684,14 +4048,21 @@ if (!__Pyx_RefNanny) { * Unassigned = Variable("Unassigned") #: Helper object instance representing unassigned values # <<<<<<<<<<<<<< * * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Unassigned}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Unassigned, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Unassigned, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":52 * @@ -4699,22 +4070,19 @@ if (!__Pyx_RefNanny) { * class Domain(list): # <<<<<<<<<<<<<< * """Class used to control possible values for variables. * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF((PyObject *)(&PyList_Type)); - __Pyx_GIVEREF((PyObject *)(&PyList_Type)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyList_Type)))) __PYX_ERR(0, 52, __pyx_L1_error); - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) +*/ + __pyx_t_3 = PyTuple_Pack(1, ((PyObject *)(&PyList_Type))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_Domain, __pyx_n_s_Domain, (PyObject *) NULL, __pyx_n_s_constraint_domain, __pyx_kp_s_Class_used_to_control_possible_v); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_mstate_global->__pyx_n_u_Domain, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_kp_u_Class_used_to_control_possible_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (__pyx_t_2 != __pyx_t_3) { + if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":59 * """ @@ -4722,11 +4090,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, set): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_1__init__, 0, __pyx_n_s_Domain___init, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 59, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Domain___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_3) < 0) __PYX_ERR(0, 59, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":69 * self._states = [] @@ -4734,11 +4102,11 @@ if (!__Pyx_RefNanny) { * def resetState(self): # <<<<<<<<<<<<<< * """Reset to the original domain state, including all possible values.""" * self.extend(self._hidden) - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_3resetState, 0, __pyx_n_s_Domain_resetState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_resetState, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_3resetState, 0, __pyx_mstate_global->__pyx_n_u_Domain_resetState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_resetState, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":75 * del self._states[:] @@ -4746,11 +4114,11 @@ if (!__Pyx_RefNanny) { * def pushState(self): # <<<<<<<<<<<<<< * """Save current domain state. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_5pushState, 0, __pyx_n_s_Domain_pushState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_pushState, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_5pushState, 0, __pyx_mstate_global->__pyx_n_u_Domain_pushState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pushState, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":82 * self._states.append(len(self)) @@ -4758,11 +4126,11 @@ if (!__Pyx_RefNanny) { * def popState(self): # <<<<<<<<<<<<<< * """Restore domain state from the top of the stack. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_7popState, 0, __pyx_n_s_Domain_popState, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_popState, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_7popState, 0, __pyx_mstate_global->__pyx_n_u_Domain_popState, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_popState, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":92 * del self._hidden[-diff:] @@ -4770,11 +4138,11 @@ if (!__Pyx_RefNanny) { * def hideValue(self, value): # <<<<<<<<<<<<<< * """Hide the given value from the domain. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_9hideValue, 0, __pyx_n_s_Domain_hideValue, NULL, __pyx_n_s_constraint_domain, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_hideValue, __pyx_t_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6domain_6Domain_9hideValue, 0, __pyx_mstate_global->__pyx_n_u_Domain_hideValue, NULL, __pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_hideValue, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/domain.py":52 * @@ -4782,24 +4150,24 @@ if (!__Pyx_RefNanny) { * class Domain(list): # <<<<<<<<<<<<<< * """Class used to control possible values for variables. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_Domain, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Domain, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/domain.py":1 * """Module containing the code for the Variable and Domain classes.""" # <<<<<<<<<<<<<< * * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ @@ -4808,9 +4176,9 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.domain", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -4831,12 +4199,227 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 176 <= 65535 + const unsigned short n; +#elif 176 / 2 < INT_MAX + const unsigned int n; +#elif 176 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_Class_used_to_control_possible_v, sizeof(__pyx_k_Class_used_to_control_possible_v), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Class_used_to_control_possible_v */ + {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ + {__pyx_k_Domain___init, sizeof(__pyx_k_Domain___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain___init */ + {__pyx_k_Domain_hideValue, sizeof(__pyx_k_Domain_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_hideValue */ + {__pyx_k_Domain_popState, sizeof(__pyx_k_Domain_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_popState */ + {__pyx_k_Domain_pushState, sizeof(__pyx_k_Domain_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_pushState */ + {__pyx_k_Domain_resetState, sizeof(__pyx_k_Domain_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain_resetState */ + {__pyx_k_Helper_class_for_variable_defini, sizeof(__pyx_k_Helper_class_for_variable_defini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Helper_class_for_variable_defini */ + {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */ + {__pyx_k_ModuleNotFoundError, sizeof(__pyx_k_ModuleNotFoundError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ModuleNotFoundError */ + {__pyx_k_Unassigned, sizeof(__pyx_k_Unassigned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Unassigned */ + {__pyx_k_Variable, sizeof(__pyx_k_Variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable */ + {__pyx_k_Variable___init, sizeof(__pyx_k_Variable___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable___init */ + {__pyx_k_Variable___repr, sizeof(__pyx_k_Variable___repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Variable___repr */ + {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ + {__pyx_k_check_if_compiled, sizeof(__pyx_k_check_if_compiled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check_if_compiled */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ + {__pyx_k_constraint_domain_py, sizeof(__pyx_k_constraint_domain_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_domain_py */ + {__pyx_k_diff, sizeof(__pyx_k_diff), 0, 1, 1}, /* PyObject cname: __pyx_n_u_diff */ + {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ + {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_hidden, sizeof(__pyx_k_hidden), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hidden */ + {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ + {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_popState, sizeof(__pyx_k_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popState */ + {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ + {__pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushState */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_remove, sizeof(__pyx_k_remove), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove */ + {__pyx_k_repr, sizeof(__pyx_k_repr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repr */ + {__pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_resetState */ + {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ + {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ + {__pyx_k_set, sizeof(__pyx_k_set), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set */ + {__pyx_k_states, sizeof(__pyx_k_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_states */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 14, __pyx_L1_error) + __pyx_builtin_ModuleNotFoundError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ModuleNotFoundError); if (!__pyx_builtin_ModuleNotFoundError) __PYX_ERR(0, 14, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/domain.py":72 + * """Reset to the original domain state, including all possible values.""" + * self.extend(self._hidden) + * del self._hidden[:] # <<<<<<<<<<<<<< + * del self._states[:] + * +*/ + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 2; + unsigned int flags : 10; + unsigned int first_line : 7; + unsigned int line_table_length : 11; +} __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + PyObject* tuple_dedup_map = PyDict_New(); + if (unlikely(!tuple_dedup_map)) return -1; + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4, 29}; + PyObject* varnames[] = {0}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_check_if_compiled, __pyx_k_1_q_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 30, 11}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39, 9}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_repr, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59, 29}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_set}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_A_IQfA_Kq_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 69, 31}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_resetState, __pyx_k_A_G1D_D_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75, 19}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_pushState, __pyx_k_A_HG1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82, 58}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_diff}; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_popState, __pyx_k_A_t84s_Cq_1_q_HAQa_HAQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92, 26}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_domain_py, __pyx_mstate->__pyx_n_u_hideValue, __pyx_k_A_G1F_HG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -4877,11 +4460,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif @@ -5003,7 +4580,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -5019,20 +4596,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -5046,8 +4639,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -5070,7 +4662,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -5117,55 +4710,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -5183,9 +4760,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -5195,9 +4769,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -5205,14 +4776,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -5221,14 +4786,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -5288,12 +4864,7 @@ static void __Pyx_RaiseDoubleKeywordsError( PyObject* kw_name) { PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } /* ParseKeywords */ @@ -5316,7 +4887,7 @@ static int __Pyx_ParseOptionalKeywords( Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); @@ -5359,38 +4930,11 @@ static int __Pyx_ParseOptionalKeywords( #endif Py_INCREF(value); name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**name) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); @@ -5409,8 +4953,8 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**argname) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -5437,15 +4981,9 @@ static int __Pyx_ParseOptionalKeywords( "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif bad: Py_XDECREF(key); Py_XDECREF(value); @@ -5458,10 +4996,6 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif @@ -5501,9 +5035,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -5511,19 +5043,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -5560,9 +5084,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -5571,17 +5093,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -5596,13 +5111,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5621,13 +5131,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5649,7 +5154,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -5678,12 +5183,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -5691,7 +5194,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else @@ -5705,10 +5208,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, (size_t)nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -5724,50 +5229,9 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { int result; @@ -5781,7 +5245,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -5790,7 +5254,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -5857,18 +5321,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -5908,13 +5366,8 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -5968,7 +5421,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); @@ -6020,11 +5473,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; @@ -6062,20 +5511,9 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *args, *result = NULL; + PyObject *result; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_ASSUME_SAFE_MACROS - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); -#else - args = PyTuple_Pack(1, self); - if (unlikely(!args)) goto bad; -#endif - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - Py_DECREF(args); -bad: + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); return result; } @@ -6084,15 +5522,15 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { return PySet_Pop(L); } - return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); + return __Pyx_PyObject_CallMethod0(L, __pyx_mstate_global->__pyx_n_u_pop); } -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type_pop, L); } #endif @@ -6103,50 +5541,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -6160,7 +5557,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -6169,7 +5566,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -6200,6 +5597,79 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, return NULL; } +/* PyVersionSanityCheck */ +static int __Pyx_VersionSanityCheck(void) { + #if CYTHON_COMPILING_IN_CPYTHON + #if PY_VERSION_HEX < 0x03080000 + if (PySys_GetObject("gettotalrefcount")) { + #ifndef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a non-debug version of Python but imported into a debug version." + ); + return -1; + #endif + } else { + #ifdef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a debug version of Python but imported into a non-debug version." + ); + return -1; + #endif + } + #endif // Py_VERSION_HEX < 0x03080000 + #if PY_VERSION_HEX >= 0x030d0000 + if (PyRun_SimpleStringFlags( + "if " + #ifdef Py_GIL_DISABLED + "not " + #endif + "__import__('sysconfig').get_config_var('Py_GIL_DISABLED'): raise ImportError", + NULL + ) == -1) { + PyErr_SetString( + PyExc_ImportError, + #ifdef Py_GIL_DISABLED + "Module was compiled with a freethreading build of Python but imported into a non-freethreading build." + #else + "Module was compiled with a non-freethreading build of Python but imported into a freethreading build." + #endif + ); + return -1; + } + #endif // version hex 3.13+ + if (PySys_GetObject("getobjects")) { + #ifndef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled without Py_TRACE_REFS but imported into a build of Python with." + ); + return -1; + #endif + } else { + #ifdef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with Py_TRACE_REFS but imported into a build of Python without." + ); + return -1; + #endif + } + const char code[] = "if __import__('sys').getsizeof(object()) != %u: raise ImportError"; + char formattedCode[sizeof(code)+50]; + PyOS_snprintf(formattedCode, sizeof(formattedCode), code, (unsigned int)sizeof(PyObject)); + if (PyRun_SimpleStringFlags(formattedCode, NULL) == -1) { + PyErr_SetString( + PyExc_ImportError, + "Runtime and compile-time PyObject size do not match." + ); + return -1; + } + #endif + return 0; +} + /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { @@ -6275,7 +5745,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -6379,8 +5849,53 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec } #endif +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -6391,7 +5906,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -6407,10 +5927,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif Py_INCREF(key); Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -6428,16 +5957,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -6445,8 +5987,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -6471,11 +6030,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -6505,10 +6060,8 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -6520,12 +6073,7 @@ static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -6545,12 +6093,7 @@ static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -6730,9 +6273,8 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -6745,7 +6287,7 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); @@ -6756,10 +6298,39 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { ignore: PyErr_Clear(); } -#endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { @@ -6773,24 +6344,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif @@ -6798,23 +6369,21 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -6823,18 +6392,14 @@ static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -6876,8 +6441,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -6939,14 +6502,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -6963,6 +6519,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -6970,40 +6530,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __Pyx_VISIT_CONST(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -7025,7 +6574,7 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -7033,24 +6582,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -7069,18 +6609,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -7088,16 +6619,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -7114,10 +6637,10 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -7129,11 +6652,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -7141,14 +6664,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -7158,21 +6676,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -7180,13 +6698,18 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -7194,29 +6717,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -7224,29 +6756,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -7254,17 +6795,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -7272,6 +6817,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -7279,12 +6830,17 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS @@ -7307,9 +6863,13 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif +#endif // CYTHON_METH_FASTCALL Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -7329,11 +6889,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #endif 0, 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else 0, -#endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, @@ -7355,11 +6911,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else offsetof(PyCFunctionObject, m_weakreflist), -#endif 0, 0, __pyx_CyFunction_methods, @@ -7382,9 +6934,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -#if PY_VERSION_HEX >= 0x030400a1 0, -#endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif @@ -7403,25 +6953,22 @@ static PyTypeObject __pyx_CyFunctionType_type = { }; #endif static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -7444,7 +6991,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -7456,7 +7003,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -7471,10 +7018,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -7493,11 +7036,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; @@ -7508,10 +7047,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -7523,172 +7058,38 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb } else if (with_error) { PyErr_SetObject(PyExc_AttributeError, attr_name); } - return res; -} -#endif - -/* Py3ClassCreate */ -static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, - PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { - PyObject *ns; - if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); - if (prep) { - PyObject *pargs[3] = {NULL, name, bases}; - ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); - Py_DECREF(prep); - } else { - if (unlikely(PyErr_Occurred())) - return NULL; - ns = PyDict_New(); - } - } else { - ns = PyDict_New(); - } - if (unlikely(!ns)) - return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; - return ns; -bad: - Py_DECREF(ns); - return NULL; -} -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; + return res; +} +#endif + +/* Py3ClassCreate */ +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, + PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { + PyObject *ns; + if (metaclass) { + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); + if (prep) { + PyObject *pargs[3] = {NULL, name, bases}; + ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); + Py_DECREF(prep); + } else { + if (unlikely(PyErr_Occurred())) + return NULL; + ns = PyDict_New(); } + } else { + ns = PyDict_New(); } -done: - Py_XDECREF(mro); - return type_obj; + if (unlikely(!ns)) + return NULL; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; + return ns; bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); + Py_DECREF(ns); return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif } -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -7696,7 +7097,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -7712,25 +7113,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } @@ -7768,16 +7152,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } @@ -7785,16 +7160,23 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) +#elif !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif !CYTHON_AVOID_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = PyObject_GetItem(__pyx_mstate_global->__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -7808,10 +7190,26 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -7820,7 +7218,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -7848,12 +7246,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -7865,14 +7276,20 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -7880,20 +7297,20 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -7904,7 +7321,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; @@ -7915,7 +7332,6 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -7937,8 +7353,8 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; @@ -7951,7 +7367,8 @@ static PyCodeObject *__pyx_find_code_object(int code_line) { Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { @@ -7971,7 +7388,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; @@ -7994,7 +7411,6 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } -#endif /* AddTraceback */ #include "compile.h" @@ -8014,8 +7430,7 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } @@ -8055,20 +7470,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -8094,58 +7515,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -8176,7 +7556,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -8194,18 +7574,50 @@ static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name_2); + __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__16); + name = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_); } return name; } #endif +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8217,7 +7629,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG @@ -8227,7 +7639,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -8248,25 +7660,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -8298,7 +7710,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8308,24 +7720,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -8565,7 +7964,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8575,24 +7974,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -8872,29 +8258,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -8902,21 +8265,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -8994,45 +8357,164 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject* filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000)) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -9060,31 +8542,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -9096,16 +8577,12 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif @@ -9137,9 +8614,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -9153,74 +8629,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -9266,23 +8712,19 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } @@ -9290,8 +8732,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } diff --git a/constraint/parser.c b/constraint/parser.c index 30e398e..3169999 100644 --- a/constraint/parser.c +++ b/constraint/parser.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.0a1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_0a1" +#define CYTHON_HEX_VERSION 0x030100A1 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,8 +178,13 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,7 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -248,11 +246,17 @@ END: Cython Metadata */ #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -262,80 +266,20 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 - #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +288,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +309,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +342,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +519,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +536,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,62 +551,12 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif @@ -673,31 +578,6 @@ END: Cython Metadata */ #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) @@ -757,7 +637,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +675,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -836,8 +716,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +730,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +742,40 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +799,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +815,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +844,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +857,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +867,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,26 +884,69 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && PY_VERSION_HEX >= 0x030d00b1 +#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS +#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +#endif +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItem(dict, key); + if (*result == NULL) { + return 0; + } + Py_INCREF(*result); + return 1; +} +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (PyErr_Occurred()) { + return -1; + } else if (*result == NULL) { + return 0; + } + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) @@ -1132,64 +957,48 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject +#define PyBoolObject PyLongObject +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 +#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND && __PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif + #define __Pyx_SlotTpAsAsync(s) (&(s)) #else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)&(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1209,8 +1018,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1060,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1104,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1127,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1211,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,26 +1228,38 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/parser.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ @@ -1510,7 +1281,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr; * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { PyObject_HEAD PyObject *__pyx_v_params_used; @@ -1524,7 +1295,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions { * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint { PyObject_HEAD PyObject *__pyx_v_operator; @@ -1538,7 +1309,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1555,7 +1326,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr { * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; @@ -1570,7 +1341,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr { * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_outer_scope; @@ -1585,7 +1356,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr { * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_outer_scope; @@ -1599,7 +1370,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constrain * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_outer_scope; @@ -1614,7 +1385,7 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr { * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - */ +*/ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1640,7 +1411,6 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1654,11 +1424,6 @@ struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1770,6 +1535,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1803,10 +1570,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) @@ -1825,9 +1592,12 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1865,12 +1635,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1911,13 +1675,26 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, } /* PyObject_Unicode.proto */ -#if PY_MAJOR_VERSION >= 3 #define __Pyx_PyObject_Unicode(obj)\ (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj)) + +/* UnicodeConcatInPlace.proto */ +# if CYTHON_COMPILING_IN_CPYTHON + #if CYTHON_REFNANNY + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) + #else + #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right) + #endif + static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ); #else -#define __Pyx_PyObject_Unicode(obj)\ - (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Unicode(obj)) +#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat #endif +#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\ + PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { @@ -1977,7 +1754,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2017,19 +1794,19 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2)) #endif @@ -2068,11 +1845,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + /* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (1) -#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) +#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) static int __pyx_assertions_enabled_flag; #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) static int __Pyx_init_assertions_enabled(void) { @@ -2138,9 +1915,6 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); -/* IncludeStructmemberH.proto */ -#include - /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); @@ -2156,35 +1930,18 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2218,10 +1975,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2234,9 +1992,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2245,9 +2001,9 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) @@ -2257,9 +2013,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2272,7 +2027,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2297,11 +2052,6 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -2314,6 +2064,9 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); PyObject_Format(s, f)) #endif +/* PyObjectCall2Args.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); + /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; @@ -2324,6 +2077,7 @@ typedef struct { } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); @@ -2332,7 +2086,7 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* #endif /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* IterFinish.proto */ @@ -2347,8 +2101,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +/* PyVersionSanityCheck.proto */ +static int __Pyx_VersionSanityCheck(void); /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); @@ -2364,36 +2118,34 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { @@ -2403,9 +2155,8 @@ struct __Pyx_CodeObjectCache { }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2416,8 +2167,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) PyDict_New() +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API @@ -2433,10 +2202,10 @@ typedef const char *__Pyx_TypeName; #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2450,10 +2219,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2463,12 +2239,18 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif -/* PyObjectCall2Args.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); +/* IterNextPlain.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); +#endif /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2489,11 +2271,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2505,8 +2292,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2531,28 +2319,45 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #define __PYX_LIMITED_ABI_SUFFIX "limited" +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.parser" */ /* #### Code section: typeinfo ### */ @@ -2570,8 +2375,11 @@ static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ static const char __pyx_k_[] = "']]"; +static const char __pyx_k_1[] = "\2401"; +static const char __pyx_k_Q[] = "\220Q"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_m[] = "m"; +static const char __pyx_k_o[] = "o"; static const char __pyx_k_r[] = "r"; static const char __pyx_k_s[] = "s"; static const char __pyx_k__2[] = "<="; @@ -2580,38 +2388,39 @@ static const char __pyx_k__4[] = ">"; static const char __pyx_k__5[] = "<"; static const char __pyx_k__6[] = "|"; static const char __pyx_k__7[] = "=="; +static const char __pyx_k__8[] = "\\*\\*"; +static const char __pyx_k__9[] = "\\*"; static const char __pyx_k_gc[] = "gc"; static const char __pyx_k_or[] = " or "; static const char __pyx_k_re[] = "re"; -static const char __pyx_k__10[] = "\\*\\*"; -static const char __pyx_k__11[] = "\\*"; -static const char __pyx_k__12[] = "\\+"; -static const char __pyx_k__13[] = "**"; -static const char __pyx_k__14[] = "*"; -static const char __pyx_k__15[] = "+"; -static const char __pyx_k__16[] = "!="; -static const char __pyx_k__26[] = " "; -static const char __pyx_k__27[] = ""; -static const char __pyx_k__29[] = "("; -static const char __pyx_k__30[] = ")"; -static const char __pyx_k__34[] = ", "; -static const char __pyx_k__35[] = " \n"; -static const char __pyx_k__36[] = "."; -static const char __pyx_k__42[] = "?"; +static const char __pyx_k__10[] = "\\+"; +static const char __pyx_k__11[] = "**"; +static const char __pyx_k__12[] = "*"; +static const char __pyx_k__13[] = "+"; +static const char __pyx_k__14[] = "!="; +static const char __pyx_k__15[] = " "; +static const char __pyx_k__16[] = ""; +static const char __pyx_k__17[] = "("; +static const char __pyx_k__18[] = ")"; +static const char __pyx_k__19[] = ", "; +static const char __pyx_k__20[] = " \n"; +static const char __pyx_k__21[] = "."; +static const char __pyx_k__22[] = "?"; +static const char __pyx_k__23[] = "\270!"; static const char __pyx_k_and[] = " and "; static const char __pyx_k_end[] = "end"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_res[] = "res"; static const char __pyx_k_str[] = "str"; static const char __pyx_k_sub[] = "sub"; -static const char __pyx_k_args[] = "args"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_eval[] = "eval"; static const char __pyx_k_exec[] = "exec"; -static const char __pyx_k_func[] = "func"; +static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_spec[] = "__spec__"; static const char __pyx_k_test[] = "__test__"; @@ -2628,8 +2437,9 @@ static const char __pyx_k_start[] = "start"; static const char __pyx_k_strip[] = "strip"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_types[] = "types"; +static const char __pyx_k_value[] = "value"; static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_func_2[] = "func"; static const char __pyx_k_number[] = "number"; static const char __pyx_k_params[] = "params"; static const char __pyx_k_return[] = "return"; @@ -2642,6 +2452,7 @@ static const char __pyx_k_findall[] = "findall"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_Optional[] = "Optional"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_finditer[] = "finditer"; static const char __pyx_k_fromkeys[] = "fromkeys"; static const char __pyx_k_left_num[] = "left_num"; @@ -2674,16 +2485,19 @@ static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_match_object[] = "match_object"; static const char __pyx_k_restrictions[] = "restrictions"; +static const char __pyx_k_XQ_Qa_z_5_q_q[] = "\320\010%\240X\250Q\330\014\r\340\020\031\230\024\230Q\230a\330\020\027\220z\240\021\240)\2505\260\001\330\020\027\220q\330\023\024\340\020\027\220q"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; static const char __pyx_k_number_is_int[] = "number_is_int"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_replace_params[] = "replace_params"; static const char __pyx_k_operators_found[] = "operators_found"; +static const char __pyx_k_A_l_4s_Cq_2V2Q_1[] = "\200A\330\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\023\320\023+\2502\250V\2602\260Q\340\014\023\2201"; static const char __pyx_k_Invalid_operator[] = "Invalid operator "; static const char __pyx_k_MaxSumConstraint[] = "MaxSumConstraint"; static const char __pyx_k_MinSumConstraint[] = "MinSumConstraint"; static const char __pyx_k_equalities_found[] = "equalities_found"; static const char __pyx_k_params_used_list[] = "params_used_list"; +static const char __pyx_k_A_l_4s_Cq_t1A_1_1[] = "\200A\340\010\016\210l\230&\240\001\240\021\330\010\013\2104\210s\220!\330\014\024\220C\220q\230\001\330\014\027\220t\2301\230A\330\014\023\2201\340\014\023\2201"; static const char __pyx_k_MaxProdConstraint[] = "MaxProdConstraint"; static const char __pyx_k_MinProdConstraint[] = "MinProdConstraint"; static const char __pyx_k_comparators_found[] = "comparators_found"; @@ -2720,11 +2534,17 @@ static const char __pyx_k_to_multiple_restrictions[] = "to_multiple_restrictions static const char __pyx_k_restrictions_cleaned_unique[] = "restrictions_cleaned_unique"; static const char __pyx_k_restrictions_unique_indices[] = "restrictions_unique_indices"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; +static const char __pyx_k_FBVVW_A_UUV__A_Qm1_q_9_gQm_q_1K[] = "\320\000(\320(<\270F\320BV\320VW\360\026\000\005\033\320\032,\250A\250]\270!\330\004U\320UV\330\004\010\210\r\220_\240A\330\010\013\210:\220Q\220m\2401\340\014\017\210q\330\020\035\320\0359\270\021\270!\340\020\036\230g\240Q\240m\260<\270q\330\020\027\220|\2401\240K\250z\270\021\270$\270g\300Q\330\020\035\320\035/\250q\260\001\330\014 \240\007\240r\250\034\260]\300!\330\r\027\220q\230\r\240Q\340\014 \240\007\240r\250\035\260m\3001\340\014\022\220*\230A\230R\320\037/\320/_\320_c\320cd\320de\360\006\000\005\014\2101"; static const char __pyx_k_Optional_Union_MinSumConstraint[] = "Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]"; +static const char __pyx_k_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR[] = "\320\004/\250~\270Q\340\010!\240\021\330\010\014\210G\2201\340\014\017\210x\220s\230$\230c\240\027\250\003\2501\330\020\"\240'\250\021\250!\330\020\021\340\014\032\230!\2306\240\026\240u\250A\330\014\"\240\"\240A\240V\2501\250D\260\001\260\024\260Q\260d\270$\270e\3002\300Y\310a\310s\320RW\320WX\320Xf\320fg\330\014\017\210s\220!\320\023(\250\003\2501\340\020\"\240'\250\021\250!\330\020\021\340\014\020\220\t\230\025\230a\230s\240!\2401\330\020\034\230A\330\020\034\320\034/\250q\260\006\260b\270\002\270!\2703\270b\300\005\300V\3102\310W\320TU\330\020\021\330\024'\240q\250\006\250b\260\002\260!\2606\270\026\270r\300\023\300A\320EZ\320Z\\\320\\c\320cf\320fg\320gh\340\020\"\240'\250\021\250)\2601\260J\270j\310\006\310a\330\010\017\210q"; +static const char __pyx_k_Ya_1_Q2_U_F_U_6_Q_q_t4uA_d_4y_a[] = "\320\000%\320%=\270Y\300a\360\006\000\005\034\2301\340\004\005\360\020\000\005\006\360\024\000\005\"\240\036\250~\270Q\3602\000\005\006\330\010\025\220U\230(\240!\330\t\n\360F\003\000\005\006\330\010\025\220U\230(\240!\330\t\n\3606\000\005\026\220Q\340\010\037\230q\240\001\240\030\250\021\250%\250t\2604\260u\270A\330\010&\240d\250!\2504\250y\270\001\270\021\340\010&\240a\320';\2706\300\021\300#\300T\310\025\310a\330\010\027\220q\230\014\240A\240S\250\004\250E\260\021\360\006\000\005\024\320\023+\2501\250A\340\004\036\230a\330\004\010\210\007\210q\330\010#\2401\330\010\035\230R\230t\2401\320$:\320:P\320PT\320TZ\320Z[\330\010\033\2304\230q\240\001\330\010\037\230q\330\010\013\2107\220'\230\024\230T\240\030\250\027\260\001\340\014\r\330\020\"\240!\2403\240c\250\021\330\020\024\320\024&\240b\250\003\2503\250a\330\020\024\220D\230\007\320\0371\260\021\260!\330\020\024\220D\230\007\320\0371\260\022\2601\340\020%\320%7\260q\270\003\2701\340\014#\320#8\270\001\3209M\310Q\330\014\017\320\017$\240C\240q\340\020'\320'=\270Q\320>R\320RS\330\010\013\320\013 \240\003\2401\340\014#\2402\240Z\250t\2605\270\001\3209V\320VW\330\010\033\2307\240\"\320$:\270!\340\004\013\2101"; static const char __pyx_k_is_neither_a_string_or_Constrai[] = " is neither a string or Constraint "; static const char __pyx_k_list_tuple_Union_Constraint_str[] = "list[tuple[Union[Constraint, str], list[str]]]"; +static const char __pyx_k_A_3axs_Qa_1_2XQfA_Rxq_a_5_1_b_Cq[] = "\200A\330\025\"\240!\330\t\n\360\006\000\t\014\2103\210a\210x\220s\230#\230Q\230a\330\014\023\2201\360\006\000\t\034\2302\230X\240Q\240f\250A\330\010\035\230R\230x\240q\250\006\250a\340\010\013\2105\220\003\2201\320\024&\240b\250\002\250\"\250C\250q\3200F\300a\330\014\023\2201\330\010\025\320\025%\240Q\240f\250C\250q\3200B\300\"\300G\320K]\320]^\320^_\360\006\000\t\024\220;\230f\240A\240Q\340\010\013\2103\210a\210z\230\023\230C\230q\240\010\320(:\270!\340\014\017\210{\230#\230Q\330\020\027\320\027)\250\021\330\021\034\230C\230q\330\020\027\320\027-\250Q\330\014\023\220:\230Q\230b\320 X\320XY\330\010\017\210q"; +static const char __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81[] = "\200A\330\025\"\240!\330\t\n\340\010\026\220a\220v\230V\2406\250\025\250a\330\010\034\230B\230h\240a\240s\250%\250q\260\016\270a\340\010\013\2103\210a\320\017\"\240#\240Q\330\014\023\2201\330\010\025\320\025&\240a\240q\360\006\000\t\017\210h\220e\2308\2401\360\006\000\t#\240#\240X\250Q\360\026\000\t\024\320\023(\250\001\250\021\330\010\024\320\024)\250\021\250!\330\010\014\210I\220S\230\005\230T\240\032\2503\250f\260D\270\t\300\027\310\005\310T\320Q[\320[b\320bc\340\014\023\2201\330\010\020\220\013\2301\330\014\r\210Z\220u\230F\240$\240j\260\t\270\027\300\013\310;\320VZ\320Z`\320`d\320de\360\010\000\t\031\230\n\240!\2408\2501\330\010\013\2101\330\014\017\210{\230#\230Q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\330\021\034\230C\230q\330\020\023\2201\340\024\036\230a\360\006\000\025\037\230a\360\006\000\t\025\220A\220Y\230g\240Q\330\010\032\230\"\230H\240A\240S\250\001\250\023\250E\260\021\260-\270q\330\010\013\2103\210a\320\017 \240\003\2401\340\014\017\210s\220!\2208\2303\230b\240\003\240:\250W\260A\340\020\027\220q\360\006\000\022\035\230C\230q\330\020\027\320\027)\250\021\250!\330\021\034\230C\230u\240D\250\013\2603\260d\270$\270a\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\021\034\230C\230u\240D\250\013\2603\260d\270$\270a\330\020\027\320\027'\240q\250\013\3203J\320JZ\320Z[\320[\\\330\014\022\220*\230A\230R\320\0376\260a\360\006\000\t\024\220?\240!\2401\330\010\013\210:\220Q\340\014\023\2201\360\006\000\t\024\2209\230F\240!\2401\340\010\013\2103\210a\210z\230\023\230C\230q\240\010\320(:\270!\340\014\017\210y\230\003\2301\340\020\027\220q\330\021\032\230#\230Q\330\020\023\220;\230c\240\025\240d\250+\260S\270\004\270D\300\001\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\330\024\033\320\033,\250A\250[\3208O\320O`\320`a\320ab\330\021\032\230#\230Q\330\020\023\220;\230c\240\021\330\024\033\320\033-\250Q\250a\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\330""\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\330\025 \240\003\2405\250\004\250K\260s\270$\270d\300!\330\024\033\320\033+\2501\250K\3207N\320N^\320^_\320_`\340\020\026\220j\240\001\240\022\320#8\270\001\330\010\017\210q"; static const char __pyx_k_Module_containing_the_code_for_p[] = "Module containing the code for parsing string constraints."; static const char __pyx_k_Not_possible_comparator_should_b[] = "Not possible: comparator should be '==' or '!=', is "; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; static const char __pyx_k_Optional_Union_AllEqualConstrain[] = "Optional[Union[AllEqualConstraint, AllDifferentConstraint]]"; static const char __pyx_k_list_tuple_Constraint_list_str_U[] = "list[tuple[Constraint, list[str], Union[str, None]]]"; static const char __pyx_k_parse_restrictions_locals_genexp[] = "parse_restrictions..genexpr"; @@ -2758,9 +2578,19 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr( static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_index = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2786,7 +2616,6 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; @@ -2795,7 +2624,6 @@ typedef struct { PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; PyObject *__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; - #endif PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr; @@ -2804,225 +2632,264 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr; PyTypeObject *__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr; - PyObject *__pyx_kp_u_; - PyObject *__pyx_n_s_AllDifferentConstraint; - PyObject *__pyx_n_s_AllEqualConstraint; - PyObject *__pyx_n_s_AssertionError; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_ExactSumConstraint; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionType; - PyObject *__pyx_kp_u_Invalid_comparator; - PyObject *__pyx_kp_u_Invalid_operator; - PyObject *__pyx_n_s_MaxProdConstraint; - PyObject *__pyx_n_s_MaxSumConstraint; - PyObject *__pyx_n_s_MinProdConstraint; - PyObject *__pyx_n_s_MinSumConstraint; - PyObject *__pyx_kp_u_Not_possible_comparator_should_b; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Union_AllEqualConstrain; - PyObject *__pyx_kp_s_Optional_Union_MinSumConstraint; - PyObject *__pyx_kp_s_Optional_Union_int_float; - PyObject *__pyx_kp_u_Restriction; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u__10; - PyObject *__pyx_kp_u__11; - PyObject *__pyx_kp_u__12; - PyObject *__pyx_kp_u__13; - PyObject *__pyx_n_s__14; - PyObject *__pyx_kp_u__14; - PyObject *__pyx_kp_u__15; - PyObject *__pyx_kp_u__16; - PyObject *__pyx_kp_u__2; - PyObject *__pyx_kp_u__26; - PyObject *__pyx_kp_u__27; - PyObject *__pyx_kp_u__29; - PyObject *__pyx_kp_u__3; - PyObject *__pyx_kp_u__30; - PyObject *__pyx_kp_u__34; - PyObject *__pyx_kp_u__35; - PyObject *__pyx_kp_u__36; - PyObject *__pyx_kp_u__4; - PyObject *__pyx_n_s__42; - PyObject *__pyx_kp_u__5; - PyObject *__pyx_kp_u__6; - PyObject *__pyx_kp_u__7; - PyObject *__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; - PyObject *__pyx_kp_u_and; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_co_consts; - PyObject *__pyx_n_s_code_object; - PyObject *__pyx_n_s_comparator; - PyObject *__pyx_n_s_comparators; - PyObject *__pyx_n_s_comparators_found; - PyObject *__pyx_n_s_comparators_indices; - PyObject *__pyx_n_s_compile; - PyObject *__pyx_n_s_compile_to_constraints; - PyObject *__pyx_n_s_compiled_constraints; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_parser; - PyObject *__pyx_kp_s_constraint_parser_py; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_kp_u_def_r; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_end; - PyObject *__pyx_n_s_equalities_found; - PyObject *__pyx_n_s_eval; - PyObject *__pyx_n_u_exec; - PyObject *__pyx_n_s_finalized_constraint; - PyObject *__pyx_n_s_findall; - PyObject *__pyx_n_s_finditer; - PyObject *__pyx_n_s_fromkeys; - PyObject *__pyx_n_s_func; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_group; - PyObject *__pyx_n_s_i; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_index; - PyObject *__pyx_n_s_inequalities_found; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_kp_u_is_neither_a_string_or_Constrai; - PyObject *__pyx_n_s_is_or_evals_to_number; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_key; - PyObject *__pyx_n_s_left; - PyObject *__pyx_n_s_left_num; - PyObject *__pyx_kp_s_list_str; - PyObject *__pyx_kp_s_list_tuple_Constraint_list_str_U; - PyObject *__pyx_kp_s_list_tuple_Union_Constraint_str; - PyObject *__pyx_n_s_m; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_match_object; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_next_stop; - PyObject *__pyx_n_s_number; - PyObject *__pyx_n_s_number_is_int; - PyObject *__pyx_n_s_operator; - PyObject *__pyx_n_s_operators; - PyObject *__pyx_n_s_operators_found; - PyObject *__pyx_kp_u_or; - PyObject *__pyx_n_s_param; - PyObject *__pyx_n_s_params; - PyObject *__pyx_kp_u_params_params_index; - PyObject *__pyx_n_s_params_used; - PyObject *__pyx_n_s_params_used_list; - PyObject *__pyx_n_s_parse_restrictions; - PyObject *__pyx_n_s_parse_restrictions_locals_genexp; - PyObject *__pyx_n_s_parse_restrictions_locals_replac; - PyObject *__pyx_n_s_parse_restrictions_locals_replac_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_equ; - PyObject *__pyx_n_s_parse_restrictions_locals_to_equ_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_mul; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num_2; - PyObject *__pyx_n_s_parse_restrictions_locals_to_num_3; - PyObject *__pyx_n_s_parsed_restriction; - PyObject *__pyx_n_s_parsed_restrictions; - PyObject *__pyx_n_s_picklable; - PyObject *__pyx_n_s_prev_stop; - PyObject *__pyx_n_s_r; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_re; - PyObject *__pyx_n_s_regex_match_variable; - PyObject *__pyx_n_s_replace; - PyObject *__pyx_n_s_replace_params; - PyObject *__pyx_n_s_replace_params_split; - PyObject *__pyx_n_s_res; - PyObject *__pyx_n_s_restriction; - PyObject *__pyx_n_s_restrictions; - PyObject *__pyx_n_s_restrictions_cleaned; - PyObject *__pyx_n_s_restrictions_cleaned_unique; - PyObject *__pyx_n_s_restrictions_unique_indices; - PyObject *__pyx_n_s_return; - PyObject *__pyx_kp_u_return_2; - PyObject *__pyx_n_s_right; - PyObject *__pyx_n_s_right_num; - PyObject *__pyx_n_s_s; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_split; - PyObject *__pyx_n_s_split_restrictions; - PyObject *__pyx_n_s_splitted; - PyObject *__pyx_n_s_start; - PyObject *__pyx_n_s_str; - PyObject *__pyx_kp_u_string; - PyObject *__pyx_n_s_strip; - PyObject *__pyx_n_s_sub; - PyObject *__pyx_n_s_temp_copy; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_n_s_to_equality_constraint; - PyObject *__pyx_n_s_to_multiple_restrictions; - PyObject *__pyx_n_s_to_numeric_constraint; - PyObject *__pyx_n_s_tune_params; - PyObject *__pyx_n_s_types; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_variables_on_left; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type__index; + PyObject *__pyx_slice[3]; + PyObject *__pyx_tuple[2]; + PyObject *__pyx_codeobj_tab[13]; + PyObject *__pyx_string_tab[170]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; - PyObject *__pyx_tuple__8; - PyObject *__pyx_slice__31; - PyObject *__pyx_slice__32; - PyObject *__pyx_slice__33; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__22; - PyObject *__pyx_tuple__24; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__37; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__19; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__23; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[8]; +int __pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr; +#endif +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_n_u_AllDifferentConstraint __pyx_string_tab[1] +#define __pyx_n_u_AllEqualConstraint __pyx_string_tab[2] +#define __pyx_n_u_AssertionError __pyx_string_tab[3] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[4] +#define __pyx_n_u_Constraint __pyx_string_tab[5] +#define __pyx_n_u_ExactSumConstraint __pyx_string_tab[6] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[7] +#define __pyx_n_u_FunctionType __pyx_string_tab[8] +#define __pyx_kp_u_Invalid_comparator __pyx_string_tab[9] +#define __pyx_kp_u_Invalid_operator __pyx_string_tab[10] +#define __pyx_n_u_MaxProdConstraint __pyx_string_tab[11] +#define __pyx_n_u_MaxSumConstraint __pyx_string_tab[12] +#define __pyx_n_u_MinProdConstraint __pyx_string_tab[13] +#define __pyx_n_u_MinSumConstraint __pyx_string_tab[14] +#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_string_tab[15] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[16] +#define __pyx_n_u_Optional __pyx_string_tab[17] +#define __pyx_kp_u_Optional_Union_AllEqualConstrain __pyx_string_tab[18] +#define __pyx_kp_u_Optional_Union_MinSumConstraint __pyx_string_tab[19] +#define __pyx_kp_u_Optional_Union_int_float __pyx_string_tab[20] +#define __pyx_kp_u_Restriction __pyx_string_tab[21] +#define __pyx_n_u_Union __pyx_string_tab[22] +#define __pyx_n_u_ValueError __pyx_string_tab[23] +#define __pyx_kp_u__10 __pyx_string_tab[24] +#define __pyx_kp_u__11 __pyx_string_tab[25] +#define __pyx_kp_u__12 __pyx_string_tab[26] +#define __pyx_kp_u__13 __pyx_string_tab[27] +#define __pyx_kp_u__14 __pyx_string_tab[28] +#define __pyx_kp_u__15 __pyx_string_tab[29] +#define __pyx_kp_u__16 __pyx_string_tab[30] +#define __pyx_kp_u__17 __pyx_string_tab[31] +#define __pyx_kp_u__18 __pyx_string_tab[32] +#define __pyx_kp_u__19 __pyx_string_tab[33] +#define __pyx_kp_u__2 __pyx_string_tab[34] +#define __pyx_kp_u__20 __pyx_string_tab[35] +#define __pyx_kp_u__21 __pyx_string_tab[36] +#define __pyx_kp_u__22 __pyx_string_tab[37] +#define __pyx_kp_u__3 __pyx_string_tab[38] +#define __pyx_kp_u__4 __pyx_string_tab[39] +#define __pyx_kp_u__5 __pyx_string_tab[40] +#define __pyx_kp_u__6 __pyx_string_tab[41] +#define __pyx_kp_u__7 __pyx_string_tab[42] +#define __pyx_kp_u__8 __pyx_string_tab[43] +#define __pyx_kp_u__9 __pyx_string_tab[44] +#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_string_tab[45] +#define __pyx_kp_u_add_note __pyx_string_tab[46] +#define __pyx_kp_u_and __pyx_string_tab[47] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[48] +#define __pyx_n_u_class_getitem __pyx_string_tab[49] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[50] +#define __pyx_n_u_close __pyx_string_tab[51] +#define __pyx_n_u_co_consts __pyx_string_tab[52] +#define __pyx_n_u_code_object __pyx_string_tab[53] +#define __pyx_n_u_comparator __pyx_string_tab[54] +#define __pyx_n_u_comparators __pyx_string_tab[55] +#define __pyx_n_u_comparators_found __pyx_string_tab[56] +#define __pyx_n_u_comparators_indices __pyx_string_tab[57] +#define __pyx_n_u_compile __pyx_string_tab[58] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[59] +#define __pyx_n_u_compiled_constraints __pyx_string_tab[60] +#define __pyx_n_u_constraint __pyx_string_tab[61] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[62] +#define __pyx_n_u_constraint_parser __pyx_string_tab[63] +#define __pyx_kp_u_constraint_parser_py __pyx_string_tab[64] +#define __pyx_n_u_constraints __pyx_string_tab[65] +#define __pyx_kp_u_def_r __pyx_string_tab[66] +#define __pyx_n_u_dict __pyx_string_tab[67] +#define __pyx_kp_u_disable __pyx_string_tab[68] +#define __pyx_n_u_domains __pyx_string_tab[69] +#define __pyx_kp_u_enable __pyx_string_tab[70] +#define __pyx_n_u_end __pyx_string_tab[71] +#define __pyx_n_u_equalities_found __pyx_string_tab[72] +#define __pyx_n_u_eval __pyx_string_tab[73] +#define __pyx_n_u_exec __pyx_string_tab[74] +#define __pyx_n_u_finalized_constraint __pyx_string_tab[75] +#define __pyx_n_u_findall __pyx_string_tab[76] +#define __pyx_n_u_finditer __pyx_string_tab[77] +#define __pyx_n_u_fromkeys __pyx_string_tab[78] +#define __pyx_n_u_func __pyx_string_tab[79] +#define __pyx_n_u_func_2 __pyx_string_tab[80] +#define __pyx_kp_u_gc __pyx_string_tab[81] +#define __pyx_n_u_genexpr __pyx_string_tab[82] +#define __pyx_n_u_group __pyx_string_tab[83] +#define __pyx_n_u_i __pyx_string_tab[84] +#define __pyx_n_u_index __pyx_string_tab[85] +#define __pyx_n_u_inequalities_found __pyx_string_tab[86] +#define __pyx_n_u_initializing __pyx_string_tab[87] +#define __pyx_n_u_is_coroutine __pyx_string_tab[88] +#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_string_tab[89] +#define __pyx_n_u_is_or_evals_to_number __pyx_string_tab[90] +#define __pyx_kp_u_isenabled __pyx_string_tab[91] +#define __pyx_n_u_key __pyx_string_tab[92] +#define __pyx_n_u_left __pyx_string_tab[93] +#define __pyx_n_u_left_num __pyx_string_tab[94] +#define __pyx_kp_u_list_str __pyx_string_tab[95] +#define __pyx_kp_u_list_tuple_Constraint_list_str_U __pyx_string_tab[96] +#define __pyx_kp_u_list_tuple_Union_Constraint_str __pyx_string_tab[97] +#define __pyx_n_u_m __pyx_string_tab[98] +#define __pyx_n_u_main __pyx_string_tab[99] +#define __pyx_n_u_match_object __pyx_string_tab[100] +#define __pyx_n_u_name __pyx_string_tab[101] +#define __pyx_n_u_next __pyx_string_tab[102] +#define __pyx_n_u_next_stop __pyx_string_tab[103] +#define __pyx_n_u_number __pyx_string_tab[104] +#define __pyx_n_u_number_is_int __pyx_string_tab[105] +#define __pyx_n_u_o __pyx_string_tab[106] +#define __pyx_n_u_operator __pyx_string_tab[107] +#define __pyx_n_u_operators __pyx_string_tab[108] +#define __pyx_n_u_operators_found __pyx_string_tab[109] +#define __pyx_kp_u_or __pyx_string_tab[110] +#define __pyx_n_u_param __pyx_string_tab[111] +#define __pyx_n_u_params __pyx_string_tab[112] +#define __pyx_kp_u_params_params_index __pyx_string_tab[113] +#define __pyx_n_u_params_used __pyx_string_tab[114] +#define __pyx_n_u_params_used_list __pyx_string_tab[115] +#define __pyx_n_u_parse_restrictions __pyx_string_tab[116] +#define __pyx_n_u_parse_restrictions_locals_genexp __pyx_string_tab[117] +#define __pyx_n_u_parse_restrictions_locals_replac __pyx_string_tab[118] +#define __pyx_n_u_parse_restrictions_locals_replac_2 __pyx_string_tab[119] +#define __pyx_n_u_parse_restrictions_locals_to_equ __pyx_string_tab[120] +#define __pyx_n_u_parse_restrictions_locals_to_equ_2 __pyx_string_tab[121] +#define __pyx_n_u_parse_restrictions_locals_to_mul __pyx_string_tab[122] +#define __pyx_n_u_parse_restrictions_locals_to_num __pyx_string_tab[123] +#define __pyx_n_u_parse_restrictions_locals_to_num_2 __pyx_string_tab[124] +#define __pyx_n_u_parse_restrictions_locals_to_num_3 __pyx_string_tab[125] +#define __pyx_n_u_parsed_restriction __pyx_string_tab[126] +#define __pyx_n_u_parsed_restrictions __pyx_string_tab[127] +#define __pyx_n_u_picklable __pyx_string_tab[128] +#define __pyx_n_u_prev_stop __pyx_string_tab[129] +#define __pyx_n_u_r __pyx_string_tab[130] +#define __pyx_n_u_range __pyx_string_tab[131] +#define __pyx_n_u_re __pyx_string_tab[132] +#define __pyx_n_u_regex_match_variable __pyx_string_tab[133] +#define __pyx_n_u_replace __pyx_string_tab[134] +#define __pyx_n_u_replace_params __pyx_string_tab[135] +#define __pyx_n_u_replace_params_split __pyx_string_tab[136] +#define __pyx_n_u_res __pyx_string_tab[137] +#define __pyx_n_u_restriction __pyx_string_tab[138] +#define __pyx_n_u_restrictions __pyx_string_tab[139] +#define __pyx_n_u_restrictions_cleaned __pyx_string_tab[140] +#define __pyx_n_u_restrictions_cleaned_unique __pyx_string_tab[141] +#define __pyx_n_u_restrictions_unique_indices __pyx_string_tab[142] +#define __pyx_n_u_return __pyx_string_tab[143] +#define __pyx_kp_u_return_2 __pyx_string_tab[144] +#define __pyx_n_u_right __pyx_string_tab[145] +#define __pyx_n_u_right_num __pyx_string_tab[146] +#define __pyx_n_u_s __pyx_string_tab[147] +#define __pyx_n_u_send __pyx_string_tab[148] +#define __pyx_n_u_spec __pyx_string_tab[149] +#define __pyx_n_u_split __pyx_string_tab[150] +#define __pyx_n_u_split_restrictions __pyx_string_tab[151] +#define __pyx_n_u_splitted __pyx_string_tab[152] +#define __pyx_n_u_start __pyx_string_tab[153] +#define __pyx_n_u_str __pyx_string_tab[154] +#define __pyx_kp_u_string __pyx_string_tab[155] +#define __pyx_n_u_strip __pyx_string_tab[156] +#define __pyx_n_u_sub __pyx_string_tab[157] +#define __pyx_n_u_temp_copy __pyx_string_tab[158] +#define __pyx_n_u_test __pyx_string_tab[159] +#define __pyx_n_u_throw __pyx_string_tab[160] +#define __pyx_n_u_to_equality_constraint __pyx_string_tab[161] +#define __pyx_n_u_to_multiple_restrictions __pyx_string_tab[162] +#define __pyx_n_u_to_numeric_constraint __pyx_string_tab[163] +#define __pyx_n_u_tune_params __pyx_string_tab[164] +#define __pyx_n_u_types __pyx_string_tab[165] +#define __pyx_n_u_typing __pyx_string_tab[166] +#define __pyx_n_u_value __pyx_string_tab[167] +#define __pyx_n_u_variables __pyx_string_tab[168] +#define __pyx_n_u_variables_on_left __pyx_string_tab[169] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3052,210 +2919,27 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_u_); - Py_CLEAR(clear_module_state->__pyx_n_s_AllDifferentConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AllEqualConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_ExactSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionType); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_comparator); - Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MaxSumConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinProdConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Not_possible_comparator_should_b); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_AllEqualConstrain); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_MinSumConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Union_int_float); - Py_CLEAR(clear_module_state->__pyx_kp_u_Restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u__10); - Py_CLEAR(clear_module_state->__pyx_kp_u__11); - Py_CLEAR(clear_module_state->__pyx_kp_u__12); - Py_CLEAR(clear_module_state->__pyx_kp_u__13); - Py_CLEAR(clear_module_state->__pyx_n_s__14); - Py_CLEAR(clear_module_state->__pyx_kp_u__14); - Py_CLEAR(clear_module_state->__pyx_kp_u__15); - Py_CLEAR(clear_module_state->__pyx_kp_u__16); - Py_CLEAR(clear_module_state->__pyx_kp_u__2); - Py_CLEAR(clear_module_state->__pyx_kp_u__26); - Py_CLEAR(clear_module_state->__pyx_kp_u__27); - Py_CLEAR(clear_module_state->__pyx_kp_u__29); - Py_CLEAR(clear_module_state->__pyx_kp_u__3); - Py_CLEAR(clear_module_state->__pyx_kp_u__30); - Py_CLEAR(clear_module_state->__pyx_kp_u__34); - Py_CLEAR(clear_module_state->__pyx_kp_u__35); - Py_CLEAR(clear_module_state->__pyx_kp_u__36); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); - Py_CLEAR(clear_module_state->__pyx_n_s__42); - Py_CLEAR(clear_module_state->__pyx_kp_u__5); - Py_CLEAR(clear_module_state->__pyx_kp_u__6); - Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - Py_CLEAR(clear_module_state->__pyx_kp_u_and); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_co_consts); - Py_CLEAR(clear_module_state->__pyx_n_s_code_object); - Py_CLEAR(clear_module_state->__pyx_n_s_comparator); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators_found); - Py_CLEAR(clear_module_state->__pyx_n_s_comparators_indices); - Py_CLEAR(clear_module_state->__pyx_n_s_compile); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_compiled_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_parser); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_parser_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_kp_u_def_r); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_end); - Py_CLEAR(clear_module_state->__pyx_n_s_equalities_found); - Py_CLEAR(clear_module_state->__pyx_n_s_eval); - Py_CLEAR(clear_module_state->__pyx_n_u_exec); - Py_CLEAR(clear_module_state->__pyx_n_s_finalized_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_findall); - Py_CLEAR(clear_module_state->__pyx_n_s_finditer); - Py_CLEAR(clear_module_state->__pyx_n_s_fromkeys); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_group); - Py_CLEAR(clear_module_state->__pyx_n_s_i); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_index); - Py_CLEAR(clear_module_state->__pyx_n_s_inequalities_found); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_kp_u_is_neither_a_string_or_Constrai); - Py_CLEAR(clear_module_state->__pyx_n_s_is_or_evals_to_number); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_key); - Py_CLEAR(clear_module_state->__pyx_n_s_left); - Py_CLEAR(clear_module_state->__pyx_n_s_left_num); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Constraint_list_str_U); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Union_Constraint_str); - Py_CLEAR(clear_module_state->__pyx_n_s_m); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_match_object); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_next_stop); - Py_CLEAR(clear_module_state->__pyx_n_s_number); - Py_CLEAR(clear_module_state->__pyx_n_s_number_is_int); - Py_CLEAR(clear_module_state->__pyx_n_s_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_operators); - Py_CLEAR(clear_module_state->__pyx_n_s_operators_found); - Py_CLEAR(clear_module_state->__pyx_kp_u_or); - Py_CLEAR(clear_module_state->__pyx_n_s_param); - Py_CLEAR(clear_module_state->__pyx_n_s_params); - Py_CLEAR(clear_module_state->__pyx_kp_u_params_params_index); - Py_CLEAR(clear_module_state->__pyx_n_s_params_used); - Py_CLEAR(clear_module_state->__pyx_n_s_params_used_list); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_genexp); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_replac); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_replac_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_equ); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_equ_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_mul); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num_2); - Py_CLEAR(clear_module_state->__pyx_n_s_parse_restrictions_locals_to_num_3); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed_restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_picklable); - Py_CLEAR(clear_module_state->__pyx_n_s_prev_stop); - Py_CLEAR(clear_module_state->__pyx_n_s_r); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_re); - Py_CLEAR(clear_module_state->__pyx_n_s_regex_match_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_replace); - Py_CLEAR(clear_module_state->__pyx_n_s_replace_params); - Py_CLEAR(clear_module_state->__pyx_n_s_replace_params_split); - Py_CLEAR(clear_module_state->__pyx_n_s_res); - Py_CLEAR(clear_module_state->__pyx_n_s_restriction); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_cleaned); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_cleaned_unique); - Py_CLEAR(clear_module_state->__pyx_n_s_restrictions_unique_indices); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_kp_u_return_2); - Py_CLEAR(clear_module_state->__pyx_n_s_right); - Py_CLEAR(clear_module_state->__pyx_n_s_right_num); - Py_CLEAR(clear_module_state->__pyx_n_s_s); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_split); - Py_CLEAR(clear_module_state->__pyx_n_s_split_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_splitted); - Py_CLEAR(clear_module_state->__pyx_n_s_start); - Py_CLEAR(clear_module_state->__pyx_n_s_str); - Py_CLEAR(clear_module_state->__pyx_kp_u_string); - Py_CLEAR(clear_module_state->__pyx_n_s_strip); - Py_CLEAR(clear_module_state->__pyx_n_s_sub); - Py_CLEAR(clear_module_state->__pyx_n_s_temp_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_n_s_to_equality_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_to_multiple_restrictions); - Py_CLEAR(clear_module_state->__pyx_n_s_to_numeric_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_tune_params); - Py_CLEAR(clear_module_state->__pyx_n_s_types); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_variables_on_left); + for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<13; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<170; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_neg_1); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_slice__31); - Py_CLEAR(clear_module_state->__pyx_slice__32); - Py_CLEAR(clear_module_state->__pyx_slice__33); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__22); - Py_CLEAR(clear_module_state->__pyx_tuple__24); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__37); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__23); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif @@ -3278,432 +2962,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_u_); - Py_VISIT(traverse_module_state->__pyx_n_s_AllDifferentConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AllEqualConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_ExactSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionType); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_comparator); - Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MaxSumConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinProdConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Not_possible_comparator_should_b); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_AllEqualConstrain); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_MinSumConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Union_int_float); - Py_VISIT(traverse_module_state->__pyx_kp_u_Restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u__10); - Py_VISIT(traverse_module_state->__pyx_kp_u__11); - Py_VISIT(traverse_module_state->__pyx_kp_u__12); - Py_VISIT(traverse_module_state->__pyx_kp_u__13); - Py_VISIT(traverse_module_state->__pyx_n_s__14); - Py_VISIT(traverse_module_state->__pyx_kp_u__14); - Py_VISIT(traverse_module_state->__pyx_kp_u__15); - Py_VISIT(traverse_module_state->__pyx_kp_u__16); - Py_VISIT(traverse_module_state->__pyx_kp_u__2); - Py_VISIT(traverse_module_state->__pyx_kp_u__26); - Py_VISIT(traverse_module_state->__pyx_kp_u__27); - Py_VISIT(traverse_module_state->__pyx_kp_u__29); - Py_VISIT(traverse_module_state->__pyx_kp_u__3); - Py_VISIT(traverse_module_state->__pyx_kp_u__30); - Py_VISIT(traverse_module_state->__pyx_kp_u__34); - Py_VISIT(traverse_module_state->__pyx_kp_u__35); - Py_VISIT(traverse_module_state->__pyx_kp_u__36); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); - Py_VISIT(traverse_module_state->__pyx_n_s__42); - Py_VISIT(traverse_module_state->__pyx_kp_u__5); - Py_VISIT(traverse_module_state->__pyx_kp_u__6); - Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - Py_VISIT(traverse_module_state->__pyx_kp_u_and); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_co_consts); - Py_VISIT(traverse_module_state->__pyx_n_s_code_object); - Py_VISIT(traverse_module_state->__pyx_n_s_comparator); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators_found); - Py_VISIT(traverse_module_state->__pyx_n_s_comparators_indices); - Py_VISIT(traverse_module_state->__pyx_n_s_compile); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_compiled_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_parser); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_parser_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_kp_u_def_r); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_end); - Py_VISIT(traverse_module_state->__pyx_n_s_equalities_found); - Py_VISIT(traverse_module_state->__pyx_n_s_eval); - Py_VISIT(traverse_module_state->__pyx_n_u_exec); - Py_VISIT(traverse_module_state->__pyx_n_s_finalized_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_findall); - Py_VISIT(traverse_module_state->__pyx_n_s_finditer); - Py_VISIT(traverse_module_state->__pyx_n_s_fromkeys); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_group); - Py_VISIT(traverse_module_state->__pyx_n_s_i); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_index); - Py_VISIT(traverse_module_state->__pyx_n_s_inequalities_found); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_kp_u_is_neither_a_string_or_Constrai); - Py_VISIT(traverse_module_state->__pyx_n_s_is_or_evals_to_number); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_key); - Py_VISIT(traverse_module_state->__pyx_n_s_left); - Py_VISIT(traverse_module_state->__pyx_n_s_left_num); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Constraint_list_str_U); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Union_Constraint_str); - Py_VISIT(traverse_module_state->__pyx_n_s_m); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_match_object); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_next_stop); - Py_VISIT(traverse_module_state->__pyx_n_s_number); - Py_VISIT(traverse_module_state->__pyx_n_s_number_is_int); - Py_VISIT(traverse_module_state->__pyx_n_s_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_operators); - Py_VISIT(traverse_module_state->__pyx_n_s_operators_found); - Py_VISIT(traverse_module_state->__pyx_kp_u_or); - Py_VISIT(traverse_module_state->__pyx_n_s_param); - Py_VISIT(traverse_module_state->__pyx_n_s_params); - Py_VISIT(traverse_module_state->__pyx_kp_u_params_params_index); - Py_VISIT(traverse_module_state->__pyx_n_s_params_used); - Py_VISIT(traverse_module_state->__pyx_n_s_params_used_list); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_genexp); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_replac); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_replac_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_equ); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_equ_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_mul); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num_2); - Py_VISIT(traverse_module_state->__pyx_n_s_parse_restrictions_locals_to_num_3); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed_restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_picklable); - Py_VISIT(traverse_module_state->__pyx_n_s_prev_stop); - Py_VISIT(traverse_module_state->__pyx_n_s_r); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_re); - Py_VISIT(traverse_module_state->__pyx_n_s_regex_match_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_replace); - Py_VISIT(traverse_module_state->__pyx_n_s_replace_params); - Py_VISIT(traverse_module_state->__pyx_n_s_replace_params_split); - Py_VISIT(traverse_module_state->__pyx_n_s_res); - Py_VISIT(traverse_module_state->__pyx_n_s_restriction); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_cleaned); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_cleaned_unique); - Py_VISIT(traverse_module_state->__pyx_n_s_restrictions_unique_indices); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_kp_u_return_2); - Py_VISIT(traverse_module_state->__pyx_n_s_right); - Py_VISIT(traverse_module_state->__pyx_n_s_right_num); - Py_VISIT(traverse_module_state->__pyx_n_s_s); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_split); - Py_VISIT(traverse_module_state->__pyx_n_s_split_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_splitted); - Py_VISIT(traverse_module_state->__pyx_n_s_start); - Py_VISIT(traverse_module_state->__pyx_n_s_str); - Py_VISIT(traverse_module_state->__pyx_kp_u_string); - Py_VISIT(traverse_module_state->__pyx_n_s_strip); - Py_VISIT(traverse_module_state->__pyx_n_s_sub); - Py_VISIT(traverse_module_state->__pyx_n_s_temp_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_n_s_to_equality_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_to_multiple_restrictions); - Py_VISIT(traverse_module_state->__pyx_n_s_to_numeric_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_tune_params); - Py_VISIT(traverse_module_state->__pyx_n_s_types); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_variables_on_left); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_neg_1); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_slice__31); - Py_VISIT(traverse_module_state->__pyx_slice__32); - Py_VISIT(traverse_module_state->__pyx_slice__33); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__22); - Py_VISIT(traverse_module_state->__pyx_tuple__24); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__37); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__23); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); + for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<13; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<170; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions -#define __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint -#define __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint -#define __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr -#define __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr -#endif -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr -#define __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr -#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_ -#define __pyx_n_s_AllDifferentConstraint __pyx_mstate_global->__pyx_n_s_AllDifferentConstraint -#define __pyx_n_s_AllEqualConstraint __pyx_mstate_global->__pyx_n_s_AllEqualConstraint -#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_ExactSumConstraint __pyx_mstate_global->__pyx_n_s_ExactSumConstraint -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionType __pyx_mstate_global->__pyx_n_s_FunctionType -#define __pyx_kp_u_Invalid_comparator __pyx_mstate_global->__pyx_kp_u_Invalid_comparator -#define __pyx_kp_u_Invalid_operator __pyx_mstate_global->__pyx_kp_u_Invalid_operator -#define __pyx_n_s_MaxProdConstraint __pyx_mstate_global->__pyx_n_s_MaxProdConstraint -#define __pyx_n_s_MaxSumConstraint __pyx_mstate_global->__pyx_n_s_MaxSumConstraint -#define __pyx_n_s_MinProdConstraint __pyx_mstate_global->__pyx_n_s_MinProdConstraint -#define __pyx_n_s_MinSumConstraint __pyx_mstate_global->__pyx_n_s_MinSumConstraint -#define __pyx_kp_u_Not_possible_comparator_should_b __pyx_mstate_global->__pyx_kp_u_Not_possible_comparator_should_b -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Union_AllEqualConstrain __pyx_mstate_global->__pyx_kp_s_Optional_Union_AllEqualConstrain -#define __pyx_kp_s_Optional_Union_MinSumConstraint __pyx_mstate_global->__pyx_kp_s_Optional_Union_MinSumConstraint -#define __pyx_kp_s_Optional_Union_int_float __pyx_mstate_global->__pyx_kp_s_Optional_Union_int_float -#define __pyx_kp_u_Restriction __pyx_mstate_global->__pyx_kp_u_Restriction -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10 -#define __pyx_kp_u__11 __pyx_mstate_global->__pyx_kp_u__11 -#define __pyx_kp_u__12 __pyx_mstate_global->__pyx_kp_u__12 -#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13 -#define __pyx_n_s__14 __pyx_mstate_global->__pyx_n_s__14 -#define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14 -#define __pyx_kp_u__15 __pyx_mstate_global->__pyx_kp_u__15 -#define __pyx_kp_u__16 __pyx_mstate_global->__pyx_kp_u__16 -#define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2 -#define __pyx_kp_u__26 __pyx_mstate_global->__pyx_kp_u__26 -#define __pyx_kp_u__27 __pyx_mstate_global->__pyx_kp_u__27 -#define __pyx_kp_u__29 __pyx_mstate_global->__pyx_kp_u__29 -#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 -#define __pyx_kp_u__30 __pyx_mstate_global->__pyx_kp_u__30 -#define __pyx_kp_u__34 __pyx_mstate_global->__pyx_kp_u__34 -#define __pyx_kp_u__35 __pyx_mstate_global->__pyx_kp_u__35 -#define __pyx_kp_u__36 __pyx_mstate_global->__pyx_kp_u__36 -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 -#define __pyx_n_s__42 __pyx_mstate_global->__pyx_n_s__42 -#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 -#define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 -#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9 -#define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_co_consts __pyx_mstate_global->__pyx_n_s_co_consts -#define __pyx_n_s_code_object __pyx_mstate_global->__pyx_n_s_code_object -#define __pyx_n_s_comparator __pyx_mstate_global->__pyx_n_s_comparator -#define __pyx_n_s_comparators __pyx_mstate_global->__pyx_n_s_comparators -#define __pyx_n_s_comparators_found __pyx_mstate_global->__pyx_n_s_comparators_found -#define __pyx_n_s_comparators_indices __pyx_mstate_global->__pyx_n_s_comparators_indices -#define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile -#define __pyx_n_s_compile_to_constraints __pyx_mstate_global->__pyx_n_s_compile_to_constraints -#define __pyx_n_s_compiled_constraints __pyx_mstate_global->__pyx_n_s_compiled_constraints -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_parser __pyx_mstate_global->__pyx_n_s_constraint_parser -#define __pyx_kp_s_constraint_parser_py __pyx_mstate_global->__pyx_kp_s_constraint_parser_py -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_kp_u_def_r __pyx_mstate_global->__pyx_kp_u_def_r -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_end __pyx_mstate_global->__pyx_n_s_end -#define __pyx_n_s_equalities_found __pyx_mstate_global->__pyx_n_s_equalities_found -#define __pyx_n_s_eval __pyx_mstate_global->__pyx_n_s_eval -#define __pyx_n_u_exec __pyx_mstate_global->__pyx_n_u_exec -#define __pyx_n_s_finalized_constraint __pyx_mstate_global->__pyx_n_s_finalized_constraint -#define __pyx_n_s_findall __pyx_mstate_global->__pyx_n_s_findall -#define __pyx_n_s_finditer __pyx_mstate_global->__pyx_n_s_finditer -#define __pyx_n_s_fromkeys __pyx_mstate_global->__pyx_n_s_fromkeys -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_group __pyx_mstate_global->__pyx_n_s_group -#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index -#define __pyx_n_s_inequalities_found __pyx_mstate_global->__pyx_n_s_inequalities_found -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_kp_u_is_neither_a_string_or_Constrai __pyx_mstate_global->__pyx_kp_u_is_neither_a_string_or_Constrai -#define __pyx_n_s_is_or_evals_to_number __pyx_mstate_global->__pyx_n_s_is_or_evals_to_number -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key -#define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left -#define __pyx_n_s_left_num __pyx_mstate_global->__pyx_n_s_left_num -#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str -#define __pyx_kp_s_list_tuple_Constraint_list_str_U __pyx_mstate_global->__pyx_kp_s_list_tuple_Constraint_list_str_U -#define __pyx_kp_s_list_tuple_Union_Constraint_str __pyx_mstate_global->__pyx_kp_s_list_tuple_Union_Constraint_str -#define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_match_object __pyx_mstate_global->__pyx_n_s_match_object -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_next_stop __pyx_mstate_global->__pyx_n_s_next_stop -#define __pyx_n_s_number __pyx_mstate_global->__pyx_n_s_number -#define __pyx_n_s_number_is_int __pyx_mstate_global->__pyx_n_s_number_is_int -#define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator -#define __pyx_n_s_operators __pyx_mstate_global->__pyx_n_s_operators -#define __pyx_n_s_operators_found __pyx_mstate_global->__pyx_n_s_operators_found -#define __pyx_kp_u_or __pyx_mstate_global->__pyx_kp_u_or -#define __pyx_n_s_param __pyx_mstate_global->__pyx_n_s_param -#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params -#define __pyx_kp_u_params_params_index __pyx_mstate_global->__pyx_kp_u_params_params_index -#define __pyx_n_s_params_used __pyx_mstate_global->__pyx_n_s_params_used -#define __pyx_n_s_params_used_list __pyx_mstate_global->__pyx_n_s_params_used_list -#define __pyx_n_s_parse_restrictions __pyx_mstate_global->__pyx_n_s_parse_restrictions -#define __pyx_n_s_parse_restrictions_locals_genexp __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_genexp -#define __pyx_n_s_parse_restrictions_locals_replac __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_replac -#define __pyx_n_s_parse_restrictions_locals_replac_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_replac_2 -#define __pyx_n_s_parse_restrictions_locals_to_equ __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_equ -#define __pyx_n_s_parse_restrictions_locals_to_equ_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_equ_2 -#define __pyx_n_s_parse_restrictions_locals_to_mul __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_mul -#define __pyx_n_s_parse_restrictions_locals_to_num __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num -#define __pyx_n_s_parse_restrictions_locals_to_num_2 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num_2 -#define __pyx_n_s_parse_restrictions_locals_to_num_3 __pyx_mstate_global->__pyx_n_s_parse_restrictions_locals_to_num_3 -#define __pyx_n_s_parsed_restriction __pyx_mstate_global->__pyx_n_s_parsed_restriction -#define __pyx_n_s_parsed_restrictions __pyx_mstate_global->__pyx_n_s_parsed_restrictions -#define __pyx_n_s_picklable __pyx_mstate_global->__pyx_n_s_picklable -#define __pyx_n_s_prev_stop __pyx_mstate_global->__pyx_n_s_prev_stop -#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re -#define __pyx_n_s_regex_match_variable __pyx_mstate_global->__pyx_n_s_regex_match_variable -#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace -#define __pyx_n_s_replace_params __pyx_mstate_global->__pyx_n_s_replace_params -#define __pyx_n_s_replace_params_split __pyx_mstate_global->__pyx_n_s_replace_params_split -#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res -#define __pyx_n_s_restriction __pyx_mstate_global->__pyx_n_s_restriction -#define __pyx_n_s_restrictions __pyx_mstate_global->__pyx_n_s_restrictions -#define __pyx_n_s_restrictions_cleaned __pyx_mstate_global->__pyx_n_s_restrictions_cleaned -#define __pyx_n_s_restrictions_cleaned_unique __pyx_mstate_global->__pyx_n_s_restrictions_cleaned_unique -#define __pyx_n_s_restrictions_unique_indices __pyx_mstate_global->__pyx_n_s_restrictions_unique_indices -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_kp_u_return_2 __pyx_mstate_global->__pyx_kp_u_return_2 -#define __pyx_n_s_right __pyx_mstate_global->__pyx_n_s_right -#define __pyx_n_s_right_num __pyx_mstate_global->__pyx_n_s_right_num -#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split -#define __pyx_n_s_split_restrictions __pyx_mstate_global->__pyx_n_s_split_restrictions -#define __pyx_n_s_splitted __pyx_mstate_global->__pyx_n_s_splitted -#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start -#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str -#define __pyx_kp_u_string __pyx_mstate_global->__pyx_kp_u_string -#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip -#define __pyx_n_s_sub __pyx_mstate_global->__pyx_n_s_sub -#define __pyx_n_s_temp_copy __pyx_mstate_global->__pyx_n_s_temp_copy -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_n_s_to_equality_constraint __pyx_mstate_global->__pyx_n_s_to_equality_constraint -#define __pyx_n_s_to_multiple_restrictions __pyx_mstate_global->__pyx_n_s_to_multiple_restrictions -#define __pyx_n_s_to_numeric_constraint __pyx_mstate_global->__pyx_n_s_to_numeric_constraint -#define __pyx_n_s_tune_params __pyx_mstate_global->__pyx_n_s_tune_params -#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_variables_on_left __pyx_mstate_global->__pyx_n_s_variables_on_left -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_slice__31 __pyx_mstate_global->__pyx_slice__31 -#define __pyx_slice__32 __pyx_mstate_global->__pyx_slice__32 -#define __pyx_slice__33 __pyx_mstate_global->__pyx_slice__33 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 -#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 /* #### Code section: module_code ### */ /* "constraint/parser.py":23 @@ -3712,7 +2980,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_1parse_restrictions(PyObject *__pyx_self, @@ -3745,7 +3013,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parse_restrictions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3753,13 +3021,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restrictions,&__pyx_n_s_tune_params,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restrictions,&__pyx_mstate_global->__pyx_n_u_tune_params,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3767,7 +3037,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictions)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_restrictions)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3775,7 +3045,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tune_params)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_tune_params)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -3813,8 +3083,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 1))) __PYX_ERR(0, 23, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 1))) __PYX_ERR(0, 23, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 23, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_tune_params), (&PyDict_Type), 0, "tune_params", 2))) __PYX_ERR(0, 23, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_parse_restrictions(__pyx_self, __pyx_v_restrictions, __pyx_v_tune_params); /* function exit code */ @@ -3838,7 +3108,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_1replace_params(PyObject *__pyx_self, @@ -3869,7 +3139,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replace_params (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3877,11 +3147,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_object,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_match_object,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3889,7 +3160,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_match_object)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_match_object)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -3951,7 +3222,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("replace_params", 1); + __Pyx_RefNannySetupContext("replace_params", 0); __pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; @@ -3961,25 +3232,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * key = match_object.group(1) # <<<<<<<<<<<<<< * if key in tune_params: * param = str(key) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) @@ -3995,7 +3265,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * return "params[params_index['" + param + "']]" - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 30, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_tune_params == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); @@ -4010,10 +3280,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * param = str(key) # <<<<<<<<<<<<<< * return "params[params_index['" + param + "']]" * else: - */ +*/ __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_param = __pyx_t_1; + __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "constraint/parser.py":32 @@ -4022,11 +3292,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * return "params[params_index['" + param + "']]" # <<<<<<<<<<<<<< * else: * return key - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Add(__pyx_kp_u_params_params_index, __pyx_v_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_params_params_index, __pyx_v_param); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -4039,7 +3309,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * return "params[params_index['" + param + "']]" - */ +*/ } /* "constraint/parser.py":34 @@ -4048,7 +3318,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * return key # <<<<<<<<<<<<<< * * def replace_params_split(match_object): - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_key); @@ -4062,7 +3332,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4085,7 +3355,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_replace_para * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_3replace_params_split(PyObject *__pyx_self, @@ -4116,7 +3386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("replace_params_split (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4124,11 +3394,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_match_object,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_match_object,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4136,7 +3407,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_match_object)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_match_object)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4199,7 +3470,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("replace_params_split", 1); + __Pyx_RefNannySetupContext("replace_params_split", 0); __pyx_outer_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; @@ -4209,25 +3480,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * key = match_object.group(1) # <<<<<<<<<<<<<< * if key in tune_params: * param = str(key) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_object, __pyx_mstate_global->__pyx_n_u_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_1}; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) @@ -4243,7 +3513,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * params_used.add(param) - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_v_tune_params)) { __Pyx_RaiseClosureNameError("tune_params"); __PYX_ERR(0, 39, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_tune_params == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); @@ -4258,10 +3528,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * param = str(key) # <<<<<<<<<<<<<< * params_used.add(param) * return param - */ +*/ __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_param = __pyx_t_1; + __pyx_v_param = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "constraint/parser.py":41 @@ -4270,7 +3540,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * params_used.add(param) # <<<<<<<<<<<<<< * return param * else: - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_v_params_used)) { __Pyx_RaiseClosureNameError("params_used"); __PYX_ERR(0, 41, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_v_params_used == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add"); @@ -4284,7 +3554,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * return param # <<<<<<<<<<<<<< * else: * return key - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_param); __pyx_r = __pyx_v_param; @@ -4296,7 +3566,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * if key in tune_params: # <<<<<<<<<<<<<< * param = str(key) * params_used.add(param) - */ +*/ } /* "constraint/parser.py":44 @@ -4305,7 +3575,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * return key # <<<<<<<<<<<<<< * * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_key); @@ -4319,7 +3589,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4342,7 +3612,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_2replace_par * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions(PyObject *__pyx_self, @@ -4374,7 +3644,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_multiple_restrictions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4382,11 +3652,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restrictions,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restrictions,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4394,7 +3665,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restrictions)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_restrictions)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4428,7 +3699,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 1))) __PYX_ERR(0, 46, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restrictions), (&PyList_Type), 0, "restrictions", 2))) __PYX_ERR(0, 46, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_self, __pyx_v_restrictions); /* function exit code */ @@ -4476,7 +3747,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("to_multiple_restrictions", 1); + __Pyx_RefNannySetupContext("to_multiple_restrictions", 0); /* "constraint/parser.py":48 * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: @@ -4484,7 +3755,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * split_restrictions = list() # <<<<<<<<<<<<<< * for res in restrictions: * # if there are logic chains in the restriction, skip splitting further - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_split_restrictions = ((PyObject*)__pyx_t_1); @@ -4496,19 +3767,22 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * for res in restrictions: # <<<<<<<<<<<<<< * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: - */ +*/ __pyx_t_1 = __pyx_v_restrictions; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 49, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 49, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4522,14 +3796,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * if " and " in res or " or " in res: # <<<<<<<<<<<<<< * split_restrictions.append(res) * continue - */ - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_and, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) +*/ + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_or, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_4 = __pyx_t_5; __pyx_L6_bool_binop_done:; if (__pyx_t_4) { @@ -4540,7 +3814,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * split_restrictions.append(res) # <<<<<<<<<<<<<< * continue * # find the indices of splittable comparators - */ +*/ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 52, __pyx_L1_error) /* "constraint/parser.py":53 @@ -4549,7 +3823,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * continue # <<<<<<<<<<<<<< * # find the indices of splittable comparators * comparators = ["<=", ">=", ">", "<"] - */ +*/ goto __pyx_L3_continue; /* "constraint/parser.py":51 @@ -4558,7 +3832,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * if " and " in res or " or " in res: # <<<<<<<<<<<<<< * split_restrictions.append(res) * continue - */ +*/ } /* "constraint/parser.py":55 @@ -4567,21 +3841,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * comparators = ["<=", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] * if len(comparators_indices) <= 1: - */ +*/ __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_GIVEREF(__pyx_kp_u__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__2)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__3); - __Pyx_GIVEREF(__pyx_kp_u__3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_kp_u__3)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__4); - __Pyx_GIVEREF(__pyx_kp_u__4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__4)) __PYX_ERR(0, 55, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__5); - __Pyx_GIVEREF(__pyx_kp_u__5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_kp_u__5)) __PYX_ERR(0, 55, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 55, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__3); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 55, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__4); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 55, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__5); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 55, __pyx_L1_error); __Pyx_XDECREF_SET(__pyx_v_comparators, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; @@ -4591,29 +3865,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * comparators_indices = [(m.start(0), m.end(0)) for m in re.finditer("|".join(comparators), res)] # <<<<<<<<<<<<<< * if len(comparators_indices) <= 1: * # this can't be split further - */ +*/ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_finditer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_finditer); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_8 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -4632,7 +3905,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } else { __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 56, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -4640,13 +3913,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple if (likely(PyList_CheckExact(__pyx_t_9))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 56, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_7 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_12); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12++; #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); @@ -4654,13 +3930,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 56, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); + if (unlikely((0 < 0))) __PYX_ERR(0, 56, __pyx_L10_error) + __Pyx_INCREF(__pyx_t_7); + __pyx_t_12++; #else __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); @@ -4680,48 +3959,46 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_m, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_8))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_11 = 1; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_int_0}; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_mstate_global->__pyx_int_0}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_n_s_end); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L10_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_m, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_14 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_10))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_14); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_11 = 1; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_int_0}; + PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_mstate_global->__pyx_int_0}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error) @@ -4731,9 +4008,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 56, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7)) __PYX_ERR(0, 56, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(0, 56, __pyx_L10_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8)) __PYX_ERR(0, 56, __pyx_L10_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 56, __pyx_L10_error); __pyx_t_7 = 0; __pyx_t_8 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 56, __pyx_L10_error) @@ -4756,7 +4033,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< * # this can't be split further * split_restrictions.append(res) - */ +*/ __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 57, __pyx_L1_error) __pyx_t_4 = (__pyx_t_12 <= 1); if (__pyx_t_4) { @@ -4767,7 +4044,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * split_restrictions.append(res) # <<<<<<<<<<<<<< * continue * # split the restrictions from the previous to the next comparator - */ +*/ __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_v_res); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 59, __pyx_L1_error) /* "constraint/parser.py":60 @@ -4776,7 +4053,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * continue # <<<<<<<<<<<<<< * # split the restrictions from the previous to the next comparator * for index in range(len(comparators_indices)): - */ +*/ goto __pyx_L3_continue; /* "constraint/parser.py":57 @@ -4785,7 +4062,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * if len(comparators_indices) <= 1: # <<<<<<<<<<<<<< * # this can't be split further * split_restrictions.append(res) - */ +*/ } /* "constraint/parser.py":62 @@ -4794,9 +4071,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< * temp_copy = res * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 - */ +*/ __pyx_t_12 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -4808,7 +4085,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } else { __pyx_t_12 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { @@ -4816,13 +4093,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 62, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_12); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -4830,13 +4110,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 62, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); __Pyx_INCREF(__pyx_t_9); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_12); + if (unlikely((0 < 0))) __PYX_ERR(0, 62, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_9); + __pyx_t_12++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -4863,7 +4146,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * temp_copy = res # <<<<<<<<<<<<<< * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 * next_stop = ( - */ +*/ __Pyx_INCREF(__pyx_v_res); __Pyx_XDECREF_SET(__pyx_v_temp_copy, __pyx_v_res); @@ -4873,27 +4156,27 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 # <<<<<<<<<<<<<< * next_stop = ( * comparators_indices[index + 1][0] if index < len(comparators_indices) - 1 else len(temp_copy) - */ - __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) +*/ + __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - __pyx_t_10 = __Pyx_PyInt_SubtractObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_SubtractObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyLong_AddObjC(__pyx_t_10, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_9 = __pyx_t_8; __pyx_t_8 = 0; } else { - __Pyx_INCREF(__pyx_int_0); - __pyx_t_9 = __pyx_int_0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __pyx_t_9 = __pyx_mstate_global->__pyx_int_0; } __Pyx_XDECREF_SET(__pyx_v_prev_stop, __pyx_t_9); __pyx_t_9 = 0; @@ -4904,28 +4187,28 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * comparators_indices[index + 1][0] if index < len(comparators_indices) - 1 else len(temp_copy) # <<<<<<<<<<<<<< * ) * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) - */ +*/ __pyx_t_15 = __Pyx_PyList_GET_SIZE(__pyx_v_comparators_indices); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_t_8 = PyInt_FromSsize_t((__pyx_t_15 - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_8 = PyLong_FromSsize_t((__pyx_t_15 - 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = PyObject_RichCompare(__pyx_v_index, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { - __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_v_index, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_comparators_indices, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_9 = __pyx_t_10; __pyx_t_10 = 0; } else { __pyx_t_15 = PyObject_Length(__pyx_v_temp_copy); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 66, __pyx_L1_error) - __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) + __pyx_t_10 = PyLong_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __pyx_t_10; __pyx_t_10 = 0; @@ -4939,34 +4222,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * split_restrictions.append(temp_copy[prev_stop:next_stop].strip()) # <<<<<<<<<<<<<< * return split_restrictions * - */ - __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_temp_copy, 0, 0, &__pyx_v_prev_stop, &__pyx_v_next_stop, NULL, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 68, __pyx_L1_error) +*/ + __pyx_t_9 = __Pyx_PyObject_GetSlice(__pyx_v_temp_copy, 0, 0, &__pyx_v_prev_stop, &__pyx_v_next_stop, NULL, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_split_restrictions, __pyx_t_9); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 68, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -4976,7 +4240,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * for index in range(len(comparators_indices)): # <<<<<<<<<<<<<< * temp_copy = res * prev_stop = comparators_indices[index - 1][1] + 1 if index > 0 else 0 - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4986,7 +4250,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * for res in restrictions: # <<<<<<<<<<<<<< * # if there are logic chains in the restriction, skip splitting further * if " and " in res or " or " in res: - */ +*/ __pyx_L3_continue:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4997,7 +4261,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * return split_restrictions # <<<<<<<<<<<<<< * * def to_numeric_constraint( - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_split_restrictions); __pyx_r = __pyx_v_split_restrictions; @@ -5009,7 +4273,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5043,7 +4307,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_7to_numeric_constraint(PyObject *__pyx_self, @@ -5076,7 +4340,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_numeric_constraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5084,13 +4348,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restriction,&__pyx_n_s_params,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restriction,&__pyx_mstate_global->__pyx_n_u_params,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5098,7 +4364,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restriction)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_restriction)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5106,7 +4372,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_params)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -5144,8 +4410,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 1))) __PYX_ERR(0, 72, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 1))) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 72, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 72, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -5169,7 +4435,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< * try: * # check if it's a number or solvable to a number (e.g. '32*2') - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number(PyObject *__pyx_self, @@ -5200,7 +4466,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_or_evals_to_number (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5208,11 +4474,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5220,7 +4487,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_s)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5254,7 +4521,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 1))) __PYX_ERR(0, 86, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), (&PyUnicode_Type), 0, "s", 2))) __PYX_ERR(0, 86, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_self, __pyx_v_s); /* function exit code */ @@ -5288,7 +4555,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("is_or_evals_to_number", 1); + __Pyx_RefNannySetupContext("is_or_evals_to_number", 0); /* "constraint/parser.py":87 * # find out which side is the constant number @@ -5296,7 +4563,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * try: # <<<<<<<<<<<<<< * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -5312,26 +4579,26 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * number = eval(s) # <<<<<<<<<<<<<< * assert isinstance(number, (int, float)) * return number - */ +*/ __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_v_number) { - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_v_number) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_number, __pyx_v_number) < 0) __PYX_ERR(0, 89, __pyx_L3_error) } if (__pyx_v_s) { - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_s, __pyx_v_s) < 0) __PYX_ERR(0, 89, __pyx_L3_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_s, __pyx_v_s) < 0) __PYX_ERR(0, 89, __pyx_L3_error) } __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_s); __Pyx_GIVEREF(__pyx_v_s); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_s)) __PYX_ERR(0, 89, __pyx_L3_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_s) != (0)) __PYX_ERR(0, 89, __pyx_L3_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 89, __pyx_L3_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 89, __pyx_L3_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 89, __pyx_L3_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(0, 89, __pyx_L3_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L3_error) @@ -5346,10 +4613,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * assert isinstance(number, (int, float)) # <<<<<<<<<<<<<< * return number * except Exception: - */ +*/ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_8 = PyInt_Check(__pyx_v_number); + __pyx_t_8 = PyLong_Check(__pyx_v_number); if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; @@ -5373,7 +4640,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * return number # <<<<<<<<<<<<<< * except Exception: * # it's not a solvable subexpression, return None - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_number); __pyx_r = __pyx_v_number; @@ -5385,7 +4652,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * try: # <<<<<<<<<<<<<< * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) - */ +*/ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5398,8 +4665,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * except Exception: # <<<<<<<<<<<<<< * # it's not a solvable subexpression, return None * return None - */ - __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); +*/ + __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (__pyx_t_9) { __Pyx_AddTraceback("constraint.parser.parse_restrictions.to_numeric_constraint.is_or_evals_to_number", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 92, __pyx_L5_except_error) @@ -5413,7 +4680,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * return None # <<<<<<<<<<<<<< * * # either the left or right side of the equation must evaluate to a constant number - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5429,7 +4696,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * try: # <<<<<<<<<<<<<< * # check if it's a number or solvable to a number (e.g. '32*2') * number = eval(s) - */ +*/ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_1); __Pyx_XGIVEREF(__pyx_t_2); @@ -5456,7 +4723,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< * try: * # check if it's a number or solvable to a number (e.g. '32*2') - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5479,7 +4746,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0, PyObject *__pyx_genexpr_arg_1) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_cur_scope; @@ -5489,7 +4756,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -5504,7 +4771,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_1); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_1); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_4generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5528,8 +4795,6 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5543,7 +4808,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(__pyx_sent_value != Py_None)) { + if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); + __PYX_ERR(0, 83, __pyx_L1_error) + } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 83, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_1)) { __Pyx_RaiseUnboundLocalError(".1"); __PYX_ERR(0, 83, __pyx_L1_error) } __pyx_t_1 = PyUnicode_Split(__pyx_cur_scope->__pyx_genexpr_arg_0, __Pyx_NoneAsNull(__pyx_cur_scope->__pyx_genexpr_arg_1), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) @@ -5554,13 +4822,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 83, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5569,32 +4840,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_t_0 = __pyx_t_2; __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; @@ -5615,17 +4867,18 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -5642,7 +4895,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -5652,7 +4905,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -5667,7 +4920,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_7generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5714,20 +4967,23 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 144, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5735,13 +4991,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 144, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5788,10 +5047,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -5810,7 +5071,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_cur_scope; @@ -5820,7 +5081,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -5835,7 +5096,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_num, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_10generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5860,10 +5121,8 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + int __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -5885,20 +5144,23 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5906,13 +5168,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 151, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -5934,35 +5199,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 151, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = (!__pyx_t_8); - if (__pyx_t_9) { + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 151, __pyx_L1_error) } + __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -5982,12 +5228,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -6005,7 +5252,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_21to_numeric * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_cur_scope; @@ -6042,7 +5289,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_numeric_constraint", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)Py_None); __Pyx_INCREF(Py_None); @@ -6060,24 +5307,24 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * comparators = ["<=", "==", ">=", ">", "<"] # <<<<<<<<<<<<<< * comparators_found = re.findall("|".join(comparators), restriction) * # check if there is exactly one comparator, if not, return None - */ +*/ __pyx_t_1 = PyList_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_kp_u__2); - __Pyx_GIVEREF(__pyx_kp_u__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__2)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__7); - __Pyx_GIVEREF(__pyx_kp_u__7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u__7)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__3); - __Pyx_GIVEREF(__pyx_kp_u__3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__3)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__4); - __Pyx_GIVEREF(__pyx_kp_u__4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u__4)) __PYX_ERR(0, 75, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__5); - __Pyx_GIVEREF(__pyx_kp_u__5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__5)) __PYX_ERR(0, 75, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__2); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_kp_u__2) != (0)) __PYX_ERR(0, 75, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u__7) != (0)) __PYX_ERR(0, 75, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__3); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_kp_u__3) != (0)) __PYX_ERR(0, 75, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__4); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_mstate_global->__pyx_kp_u__4) != (0)) __PYX_ERR(0, 75, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__5); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__5); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_mstate_global->__pyx_kp_u__5) != (0)) __PYX_ERR(0, 75, __pyx_L1_error); __pyx_v_comparators = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; @@ -6087,26 +5334,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * comparators_found = re.findall("|".join(comparators), restriction) # <<<<<<<<<<<<<< * # check if there is exactly one comparator, if not, return None * if len(comparators_found) != 1: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) + __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_comparators); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; } #endif { @@ -6127,7 +5373,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] - */ +*/ __pyx_t_6 = PyObject_Length(__pyx_v_comparators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 78, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 1); if (__pyx_t_7) { @@ -6138,7 +5384,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * comparator = comparators_found[0] * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -6149,7 +5395,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(comparators_found) != 1: # <<<<<<<<<<<<<< * return None * comparator = comparators_found[0] - */ +*/ } /* "constraint/parser.py":80 @@ -6158,8 +5404,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * comparator = comparators_found[0] # <<<<<<<<<<<<<< * * # split the string on the comparison and remove leading and trailing whitespace - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_comparators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_comparator = __pyx_t_1; __pyx_t_1 = 0; @@ -6170,7 +5416,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * left, right = tuple(s.strip() for s in restriction.split(comparator)) # <<<<<<<<<<<<<< * * # find out which side is the constant number - */ +*/ __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_2genexpr(NULL, __pyx_v_restriction, __pyx_v_comparator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) @@ -6178,21 +5424,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (1) { PyObject* sequence = __pyx_t_3; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 83, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6208,12 +5454,12 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< * try: * # check if it's a number or solvable to a number (e.g. '32*2') - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_s, __pyx_n_s_str) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Optional_Union_int_float) < 0) __PYX_ERR(0, 86, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, 0, __pyx_n_s_parse_restrictions_locals_to_num_2, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_s, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_int_float) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_1is_or_evals_to_number, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -6226,8 +5472,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * left_num = is_or_evals_to_number(left) # <<<<<<<<<<<<<< * right_num = is_or_evals_to_number(right) * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): - */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_left))||((__pyx_v_left) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_left))) __PYX_ERR(0, 97, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_left))||((__pyx_v_left) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_left))) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_v_left)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_left_num = __pyx_t_2; @@ -6239,8 +5485,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * right_num = is_or_evals_to_number(right) # <<<<<<<<<<<<<< * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): * # left_num and right_num can't be both None or both a constant - */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_right))) __PYX_ERR(0, 98, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_right))||((__pyx_v_right) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_right))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_is_or_evals_to_number(__pyx_v_is_or_evals_to_number, ((PyObject*)__pyx_v_right)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_right_num = __pyx_t_2; @@ -6252,7 +5498,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): # <<<<<<<<<<<<<< * # left_num and right_num can't be both None or both a constant * return None - */ +*/ __pyx_t_8 = (__pyx_v_left_num == Py_None); if (!__pyx_t_8) { goto __pyx_L6_next_or; @@ -6282,7 +5528,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * number, variables, variables_on_left = ( * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -6293,7 +5539,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if (left_num is None and right_num is None) or (left_num is not None and right_num is not None): # <<<<<<<<<<<<<< * # left_num and right_num can't be both None or both a constant * return None - */ +*/ } /* "constraint/parser.py":103 @@ -6302,106 +5548,68 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) # <<<<<<<<<<<<<< * ) * - */ +*/ __pyx_t_7 = (__pyx_v_left_num != Py_None); if (__pyx_t_7) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_right, __pyx_n_s_strip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_right, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_left_num); __Pyx_GIVEREF(__pyx_v_left_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_left_num)) __PYX_ERR(0, 103, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_left_num) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 103, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = __pyx_t_1; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); __pyx_t_1 = 0; + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; } else { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_left, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_left, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_right_num); __Pyx_GIVEREF(__pyx_v_right_num); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_right_num)) __PYX_ERR(0, 103, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_right_num) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_True)) __PYX_ERR(0, 103, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_True) != (0)) __PYX_ERR(0, 103, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; } if (likely(__pyx_t_2 != Py_None)) { PyObject* sequence = __pyx_t_2; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 102, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6415,7 +5623,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number, variables, variables_on_left = ( # <<<<<<<<<<<<<< * (left_num, right.strip(), False) if left_num is not None else (right_num, left.strip(), True) * ) - */ +*/ __pyx_v_number = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_variables = __pyx_t_1; @@ -6429,8 +5637,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number_is_int = isinstance(number, int) # <<<<<<<<<<<<<< * if number_is_int: * if comparator == "<": - */ - __pyx_t_7 = PyInt_Check(__pyx_v_number); +*/ + __pyx_t_7 = PyLong_Check(__pyx_v_number); __pyx_v_number_is_int = __pyx_t_7; /* "constraint/parser.py":108 @@ -6439,7 +5647,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": * if variables_on_left: - */ +*/ if (__pyx_v_number_is_int) { /* "constraint/parser.py":109 @@ -6448,8 +5656,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 109, __pyx_L1_error) if (__pyx_t_7) { /* "constraint/parser.py":110 @@ -6458,7 +5666,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 110, __pyx_L1_error) if (__pyx_t_7) { @@ -6468,8 +5676,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number -= 1 # <<<<<<<<<<<<<< * else: * # (2 < x) == (2+1 <= x) - */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); __pyx_t_2 = 0; @@ -6480,7 +5688,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: # <<<<<<<<<<<<<< * # (x < 2) == (x <= 2-1) * number -= 1 - */ +*/ goto __pyx_L11; } @@ -6490,9 +5698,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number += 1 # <<<<<<<<<<<<<< * elif comparator == ">": * if variables_on_left: - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); __pyx_t_2 = 0; @@ -6505,7 +5713,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "<": # <<<<<<<<<<<<<< * if variables_on_left: * # (x < 2) == (x <= 2-1) - */ +*/ goto __pyx_L10; } @@ -6515,8 +5723,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 116, __pyx_L1_error) if (__pyx_t_7) { /* "constraint/parser.py":117 @@ -6525,7 +5733,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) if (__pyx_t_7) { @@ -6535,8 +5743,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number += 1 # <<<<<<<<<<<<<< * else: * # (2 > x) == (2-1 >= x) - */ - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyLong_AddObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); __pyx_t_2 = 0; @@ -6547,7 +5755,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if variables_on_left: # <<<<<<<<<<<<<< * # (x > 2) == (x >= 2+1) * number += 1 - */ +*/ goto __pyx_L12; } @@ -6557,9 +5765,9 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * number -= 1 # <<<<<<<<<<<<<< * * # check if an operator is applied on the variables, if not return - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_number, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_SubtractObjC(__pyx_v_number, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_number, __pyx_t_2); __pyx_t_2 = 0; @@ -6572,7 +5780,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">": # <<<<<<<<<<<<<< * if variables_on_left: * # (x > 2) == (x >= 2+1) - */ +*/ } __pyx_L10:; @@ -6582,7 +5790,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if number_is_int: # <<<<<<<<<<<<<< * if comparator == "<": * if variables_on_left: - */ +*/ } /* "constraint/parser.py":125 @@ -6591,18 +5799,18 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * operators = [r"\*\*", r"\*", r"\+"] # <<<<<<<<<<<<<< * operators_found = re.findall(str("|".join(operators)), variables) * if len(operators_found) == 0: - */ +*/ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_kp_u__10); - __Pyx_GIVEREF(__pyx_kp_u__10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__10)) __PYX_ERR(0, 125, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__11); - __Pyx_GIVEREF(__pyx_kp_u__11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u__11)) __PYX_ERR(0, 125, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u__12); - __Pyx_GIVEREF(__pyx_kp_u__12); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__12)) __PYX_ERR(0, 125, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__8); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__8); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_u__8) != (0)) __PYX_ERR(0, 125, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__9); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__9); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_kp_u__9) != (0)) __PYX_ERR(0, 125, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__10); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u__10); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_kp_u__10) != (0)) __PYX_ERR(0, 125, __pyx_L1_error); __pyx_v_operators = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; @@ -6612,26 +5820,25 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * operators_found = re.findall(str("|".join(operators)), variables) # <<<<<<<<<<<<<< * if len(operators_found) == 0: * # no operators found, return only based on comparator - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_findall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_4 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__6, __pyx_v_operators); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } #endif { @@ -6652,7 +5859,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(operators_found) == 0: # <<<<<<<<<<<<<< * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: - */ +*/ __pyx_t_6 = PyObject_Length(__pyx_v_operators_found); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 == 0); if (__pyx_t_7) { @@ -6663,7 +5870,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< * # there were more than one variable but no operator * return None - */ +*/ __pyx_t_2 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error) @@ -6685,7 +5892,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * # map to a Constraint * # if there are restrictions with a single variable, it will be used to prune the domain at the start - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -6696,7 +5903,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(params) != 1 or variables not in params: # <<<<<<<<<<<<<< * # there were more than one variable but no operator * return None - */ +*/ } /* "constraint/parser.py":134 @@ -6705,8 +5912,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 134, __pyx_L1_error) if (__pyx_t_7) { /* "constraint/parser.py":135 @@ -6715,22 +5922,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return ExactSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } #endif { @@ -6751,7 +5957,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ +*/ } /* "constraint/parser.py":136 @@ -6760,14 +5966,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L17_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; @@ -6783,24 +5989,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 137, __pyx_L1_error) if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -6814,20 +6019,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -6851,7 +6055,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } /* "constraint/parser.py":138 @@ -6860,14 +6064,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) if (!__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; goto __pyx_L20_bool_binop_done; } - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 138, __pyx_L1_error) if (__pyx_t_8) { } else { __pyx_t_7 = __pyx_t_8; @@ -6883,24 +6087,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * raise ValueError(f"Invalid comparator {comparator}") * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -6914,20 +6117,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -6951,7 +6153,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * raise ValueError(f"Invalid comparator {comparator}") - */ +*/ } /* "constraint/parser.py":140 @@ -6960,10 +6162,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * raise ValueError(f"Invalid comparator {comparator}") # <<<<<<<<<<<<<< * * # check which operator is applied on the variables - */ - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_comparator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) @@ -6979,7 +6181,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(operators_found) == 0: # <<<<<<<<<<<<<< * # no operators found, return only based on comparator * if len(params) != 1 or variables not in params: - */ +*/ } /* "constraint/parser.py":143 @@ -6988,8 +6190,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * operator = operators_found[0] # <<<<<<<<<<<<<< * if not all(o == operator for o in operators_found): * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_operators_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_cur_scope->__pyx_v_operator = __pyx_t_2; @@ -7001,10 +6203,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ +*/ __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_5genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_operators_found); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 144, __pyx_L1_error) @@ -7018,7 +6220,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * * # split the string on the comparison - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -7029,7 +6231,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if not all(o == operator for o in operators_found): # <<<<<<<<<<<<<< * # if the operator is inconsistent (e.g. 'x + y * z == 3'), return None * return None - */ +*/ } /* "constraint/parser.py":149 @@ -7038,21 +6240,20 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * splitted = variables.split(operator) # <<<<<<<<<<<<<< * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_variables, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_variables, __pyx_mstate_global->__pyx_n_u_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } #endif { @@ -7072,7 +6273,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": - */ +*/ __pyx_t_6 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_1); @@ -7086,7 +6287,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ } __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_21to_numeric_constraint_8genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) @@ -7101,8 +6302,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if operator == "**": # <<<<<<<<<<<<<< * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__11, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 153, __pyx_L1_error) if (__pyx_t_8) { /* "constraint/parser.py":155 @@ -7111,7 +6312,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * elif operator == "*": * if comparator == "<=" or (comparator == "<" and number_is_int): - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -7122,7 +6323,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if operator == "**": # <<<<<<<<<<<<<< * # power operations are not (yet) supported, added to avoid matching the double asterisk * return None - */ +*/ } /* "constraint/parser.py":156 @@ -7131,8 +6332,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__12, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 156, __pyx_L1_error) if (__pyx_t_8) { /* "constraint/parser.py":157 @@ -7141,14 +6342,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L29_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 157, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; @@ -7164,24 +6365,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 158, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7195,20 +6395,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7232,7 +6431,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } /* "constraint/parser.py":159 @@ -7241,14 +6440,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L32_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 159, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; @@ -7264,24 +6463,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) # <<<<<<<<<<<<<< * elif operator == "+": * if comparator == "==": - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 160, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7295,20 +6493,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7332,7 +6529,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinProdConstraint(number) if variables_on_left else MaxProdConstraint(number) * elif operator == "+": - */ +*/ } /* "constraint/parser.py":156 @@ -7341,7 +6538,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif operator == "*": # <<<<<<<<<<<<<< * if comparator == "<=" or (comparator == "<" and number_is_int): * return MaxProdConstraint(number) if variables_on_left else MinProdConstraint(number) - */ +*/ goto __pyx_L27; } @@ -7351,8 +6548,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_kp_u__15, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 161, __pyx_L1_error) if (likely(__pyx_t_8)) { /* "constraint/parser.py":162 @@ -7361,8 +6558,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ - __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) +*/ + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) if (__pyx_t_8) { /* "constraint/parser.py":163 @@ -7371,22 +6568,21 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return ExactSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == "<=" or (comparator == "<" and number_is_int): * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } #endif { @@ -7407,7 +6603,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if comparator == "==": # <<<<<<<<<<<<<< * return ExactSumConstraint(number) * elif comparator == "<=" or (comparator == "<" and number_is_int): - */ +*/ } /* "constraint/parser.py":164 @@ -7416,14 +6612,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__2, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L36_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__5, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; @@ -7439,24 +6635,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) # <<<<<<<<<<<<<< * elif comparator == ">=" or (comparator == ">" and number_is_int): * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 165, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7470,20 +6665,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7507,7 +6701,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == "<=" or (comparator == "<" and number_is_int): # <<<<<<<<<<<<<< * return MaxSumConstraint(number) if variables_on_left else MinSumConstraint(number) * elif comparator == ">=" or (comparator == ">" and number_is_int): - */ +*/ } /* "constraint/parser.py":166 @@ -7516,14 +6710,14 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: - */ - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) +*/ + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__3, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) if (!__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; goto __pyx_L39_bool_binop_done; } - __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__4, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) if (__pyx_t_7) { } else { __pyx_t_8 = __pyx_t_7; @@ -7539,24 +6733,23 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) # <<<<<<<<<<<<<< * else: * raise ValueError(f"Invalid operator {operator}") - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_variables_on_left); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 167, __pyx_L1_error) if (__pyx_t_8) { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7570,20 +6763,19 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ __pyx_t_2 = __pyx_t_1; __pyx_t_1 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { @@ -7607,7 +6799,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif comparator == ">=" or (comparator == ">" and number_is_int): # <<<<<<<<<<<<<< * return MinSumConstraint(number) if variables_on_left else MaxSumConstraint(number) * else: - */ +*/ } /* "constraint/parser.py":161 @@ -7616,7 +6808,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * elif operator == "+": # <<<<<<<<<<<<<< * if comparator == "==": * return ExactSumConstraint(number) - */ +*/ goto __pyx_L27; } @@ -7626,11 +6818,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * raise ValueError(f"Invalid operator {operator}") # <<<<<<<<<<<<<< * return None * - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_operator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_operator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_operator, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) @@ -7648,7 +6840,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if operator == "**": - */ +*/ } /* "constraint/parser.py":170 @@ -7657,7 +6849,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * return None # <<<<<<<<<<<<<< * * def to_equality_constraint( - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -7668,7 +6860,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7708,7 +6900,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_ * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_18parse_restrictions_9to_equality_constraint(PyObject *__pyx_self, @@ -7741,7 +6933,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("to_equality_constraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -7749,13 +6941,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_restriction,&__pyx_n_s_params,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restriction,&__pyx_mstate_global->__pyx_n_u_params,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -7763,7 +6957,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_restriction)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_restriction)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -7771,7 +6965,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_params)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_params)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -7809,8 +7003,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 1))) __PYX_ERR(0, 173, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 1))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_restriction), (&PyUnicode_Type), 0, "restriction", 2))) __PYX_ERR(0, 173, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), (&PyList_Type), 0, "params", 2))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_self, __pyx_v_restriction, __pyx_v_params); /* function exit code */ @@ -7835,7 +7029,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_cur_scope; @@ -7845,7 +7039,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -7860,7 +7054,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_22to_equalit __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_to_equ, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_22to_equality_constraint_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7882,13 +7076,10 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; + int __pyx_t_5; + int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -7903,91 +7094,39 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 191, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 191, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) - } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 191, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 191, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 191, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 191, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_params)) { __Pyx_RaiseClosureNameError("params"); __PYX_ERR(0, 191, __pyx_L1_error) } - __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_params, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = (!__pyx_t_8); - if (__pyx_t_9) { + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; @@ -8007,12 +7146,13 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -8030,7 +7170,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_22to_equalit * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(PyObject *__pyx_self, PyObject *__pyx_v_restriction, PyObject *__pyx_v_params) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_cur_scope; @@ -8054,7 +7194,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("to_equality_constraint", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)Py_None); __Pyx_INCREF(Py_None); @@ -8075,7 +7215,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if len(params) != len(tune_params): # <<<<<<<<<<<<<< * return None * - */ +*/ __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 177, __pyx_L1_error) @@ -8098,7 +7238,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return None # <<<<<<<<<<<<<< * * # find whether (in)equalities appear in this restriction - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -8109,7 +7249,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if len(params) != len(tune_params): # <<<<<<<<<<<<<< * return None * - */ +*/ } /* "constraint/parser.py":181 @@ -8118,10 +7258,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * equalities_found = re.findall("==", restriction) # <<<<<<<<<<<<<< * inequalities_found = re.findall("!=", restriction) * # check if one of the two have been found, if none or both have been found, return None - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -8129,17 +7269,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_7 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_7 = 1; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_kp_u__7, __pyx_v_restriction}; + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u__7, __pyx_v_restriction}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) @@ -8155,10 +7294,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * inequalities_found = re.findall("!=", restriction) # <<<<<<<<<<<<<< * # check if one of the two have been found, if none or both have been found, return None * if not (len(equalities_found) > 0 ^ len(inequalities_found) > 0): - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_findall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -8166,17 +7305,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_kp_u__16, __pyx_v_restriction}; + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u__14, __pyx_v_restriction}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) @@ -8192,7 +7330,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if not (len(equalities_found) > 0 ^ len(inequalities_found) > 0): # <<<<<<<<<<<<<< * return None * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] - */ +*/ __pyx_t_3 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_t_2 = PyObject_Length(__pyx_v_inequalities_found); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 184, __pyx_L1_error) __pyx_t_8 = (0 ^ __pyx_t_2); @@ -8209,7 +7347,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return None # <<<<<<<<<<<<<< * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -8220,7 +7358,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if not (len(equalities_found) > 0 ^ len(inequalities_found) > 0): # <<<<<<<<<<<<<< * return None * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] - */ +*/ } /* "constraint/parser.py":186 @@ -8229,16 +7367,16 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * comparator = equalities_found[0] if len(equalities_found) > 0 else inequalities_found[0] # <<<<<<<<<<<<<< * * # split the string on the comparison - */ +*/ __pyx_t_8 = PyObject_Length(__pyx_v_equalities_found); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_9 = (__pyx_t_8 > 0); if (__pyx_t_9) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_equalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; } else { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_inequalities_found, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; __pyx_t_5 = 0; @@ -8252,10 +7390,10 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * splitted = restriction.split(comparator) # <<<<<<<<<<<<<< * # check if there are only pure, non-recurring variables (no operations or constants) in the restriction * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): - */ +*/ __pyx_t_1 = PyUnicode_Split(__pyx_v_restriction, __Pyx_NoneAsNull(__pyx_v_comparator), -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_splitted = __pyx_t_1; + __pyx_v_splitted = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "constraint/parser.py":191 @@ -8264,8 +7402,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": - */ - __pyx_t_8 = PyObject_Length(__pyx_v_splitted); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) +*/ + __pyx_t_8 = __Pyx_PyList_GET_SIZE(__pyx_v_splitted); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) __pyx_t_1 = __pyx_cur_scope->__pyx_v_params; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 191, __pyx_L1_error) @@ -8278,7 +7416,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality } __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_22to_equality_constraint_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_splitted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) @@ -8293,8 +7431,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if comparator == "==": # <<<<<<<<<<<<<< * return AllEqualConstraint() * elif comparator == "!=": - */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) +*/ + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__7, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) if (__pyx_t_9) { /* "constraint/parser.py":194 @@ -8303,34 +7441,15 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return AllEqualConstraint() # <<<<<<<<<<<<<< * elif comparator == "!=": * return AllDifferentConstraint() - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AllEqualConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/parser.py":193 @@ -8339,7 +7458,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if comparator == "==": # <<<<<<<<<<<<<< * return AllEqualConstraint() * elif comparator == "!=": - */ +*/ } /* "constraint/parser.py":195 @@ -8348,8 +7467,8 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * elif comparator == "!=": # <<<<<<<<<<<<<< * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") - */ - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_kp_u__16, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) +*/ + __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_v_comparator, __pyx_mstate_global->__pyx_kp_u__14, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 195, __pyx_L1_error) if (__pyx_t_9) { /* "constraint/parser.py":196 @@ -8358,32 +7477,13 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return AllDifferentConstraint() # <<<<<<<<<<<<<< * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") * return None - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AllDifferentConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; @@ -8394,7 +7494,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * elif comparator == "!=": # <<<<<<<<<<<<<< * return AllDifferentConstraint() * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") - */ +*/ } /* "constraint/parser.py":197 @@ -8403,11 +7503,11 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return ValueError(f"Not possible: comparator should be '==' or '!=', is {comparator}") # <<<<<<<<<<<<<< * return None * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_comparator, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Not_possible_comparator_should_b, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Not_possible_comparator_should_b, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) @@ -8423,7 +7523,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * if len(splitted) == len(params) and all(s.strip() in params for s in splitted): # <<<<<<<<<<<<<< * # map to a Constraint * if comparator == "==": - */ +*/ } /* "constraint/parser.py":198 @@ -8432,7 +7532,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * return None # <<<<<<<<<<<<<< * * # remove functionally duplicate restrictions (preserves order and whitespace) - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -8443,7 +7543,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -8471,7 +7571,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_cur_scope; @@ -8481,7 +7581,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -8493,7 +7593,7 @@ static PyObject *__pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(CY __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_12generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_parse_restrictions_locals_genexp, __pyx_n_s_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_6parser_18parse_restrictions_12generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_genexp, __pyx_mstate_global->__pyx_n_u_constraint_parser); if (unlikely(!gen)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -8537,13 +7637,16 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 201, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -8574,10 +7677,12 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -8595,7 +7700,7 @@ static PyObject *__pyx_gb_10constraint_6parser_18parse_restrictions_12generator4 * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out - */ +*/ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_restrictions, PyObject *__pyx_v_tune_params) { struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_cur_scope; @@ -8626,16 +7731,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - Py_UCS4 __pyx_t_11; - int __pyx_t_12; + int __pyx_t_8; + PyObject *__pyx_t_9[5]; + int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("parse_restrictions", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(__pyx_mstate_global->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)Py_None); __Pyx_INCREF(Py_None); @@ -8654,9 +7757,9 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" # <<<<<<<<<<<<<< * * def replace_params(match_object): - */ - __Pyx_INCREF(__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); - __pyx_v_regex_match_variable = __pyx_kp_u_a_zA_Z__a_zA_Z__0_9; +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9); + __pyx_v_regex_match_variable = __pyx_mstate_global->__pyx_kp_u_a_zA_Z__a_zA_Z__0_9; /* "constraint/parser.py":28 * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" @@ -8664,8 +7767,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def replace_params(match_object): # <<<<<<<<<<<<<< * key = match_object.group(1) * if key in tune_params: - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params, 0, __pyx_n_s_parse_restrictions_locals_replac, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_1replace_params, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params = __pyx_t_1; __pyx_t_1 = 0; @@ -8676,8 +7779,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def replace_params_split(match_object): # <<<<<<<<<<<<<< * # careful: has side-effect of adding to set `params_used` * key = match_object.group(1) - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split, 0, __pyx_n_s_parse_restrictions_locals_replac_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_3replace_params_split, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_replac_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_replace_params_split = __pyx_t_1; __pyx_t_1 = 0; @@ -8688,12 +7791,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 * split_restrictions = list() - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_restrictions, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, 0, __pyx_n_s_parse_restrictions_locals_to_mul, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_5to_multiple_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_mul, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8706,13 +7809,13 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def to_numeric_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_restriction, __pyx_n_s_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_params, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_Optional_Union_MinSumConstraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, 0, __pyx_n_s_parse_restrictions_locals_to_num_3, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_MinSumConstraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_7to_numeric_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_num_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_1, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8725,13 +7828,13 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def to_equality_constraint( # <<<<<<<<<<<<<< * restriction: str, params: list[str] * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_restriction, __pyx_n_s_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_params, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_return, __pyx_kp_s_Optional_Union_AllEqualConstrain) < 0) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint, 0, __pyx_n_s_parse_restrictions_locals_to_equ_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_restriction, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_params, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Optional_Union_AllEqualConstrain) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_18parse_restrictions_9to_equality_constraint, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions_locals_to_equ_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8744,10 +7847,10 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - */ +*/ __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_10genexpr(NULL, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) @@ -8760,7 +7863,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order * # get the indices of the unique restrictions, use these to build a new list of restrictions - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); @@ -8769,22 +7872,25 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 203, __pyx_L6_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4++; #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_r, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_r, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr6__pyx_v_r, __pyx_mstate_global->__pyx_n_u_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L6_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 203, __pyx_L6_error) @@ -8807,22 +7913,21 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order # <<<<<<<<<<<<<< * # get the indices of the unique restrictions, use these to build a new list of restrictions * restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_n_s_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_mstate_global->__pyx_n_u_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_restrictions_cleaned}; @@ -8844,7 +7949,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * restrictions_unique_indices = [restrictions_cleaned.index(r) for r in restrictions_cleaned_unique] # <<<<<<<<<<<<<< * restrictions = [restrictions[i] for i in restrictions_unique_indices] * - */ +*/ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_2); @@ -8853,20 +7958,23 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 206, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 206, __pyx_L13_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_r, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_restrictions_cleaned, __pyx_8genexpr7__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) + __pyx_t_6 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyList_Type__index, __pyx_v_restrictions_cleaned, __pyx_8genexpr7__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 206, __pyx_L13_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -8888,7 +7996,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * restrictions = [restrictions[i] for i in restrictions_unique_indices] # <<<<<<<<<<<<<< * * # create the parsed restrictions, split into multiple restrictions where possible - */ +*/ { /* enter inner scope */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_2); @@ -8897,13 +8005,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L20_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L20_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4++; #else __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L20_error) __Pyx_GOTREF(__pyx_t_6); @@ -8932,7 +8043,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if all(isinstance(r, str) for r in restrictions): # <<<<<<<<<<<<<< * # clean the restriction strings to functional equivalence * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] - */ +*/ } /* "constraint/parser.py":210 @@ -8941,7 +8052,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * restrictions = to_multiple_restrictions(restrictions) # <<<<<<<<<<<<<< * # split into functions that only take their relevant parameters * parsed_restrictions = list() - */ +*/ __pyx_t_2 = __pyx_pf_10constraint_6parser_18parse_restrictions_4to_multiple_restrictions(__pyx_v_to_multiple_restrictions, __pyx_v_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 210, __pyx_L1_error) @@ -8954,7 +8065,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * parsed_restrictions = list() # <<<<<<<<<<<<<< * for res in restrictions: * params_used: set[str] = set() - */ +*/ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_parsed_restrictions = ((PyObject*)__pyx_t_2); @@ -8966,7 +8077,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * for res in restrictions: # <<<<<<<<<<<<<< * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() - */ +*/ if (unlikely(__pyx_v_restrictions == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 213, __pyx_L1_error) @@ -8976,13 +8087,16 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 213, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8996,7 +8110,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * params_used: set[str] = set() # <<<<<<<<<<<<<< * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() * params_used_list = list(params_used) - */ +*/ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_params_used); @@ -9010,59 +8124,39 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() # <<<<<<<<<<<<<< * params_used_list = list(params_used) * finalized_constraint = None - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sub); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_regex_match_variable, __pyx_v_replace_params_split, __pyx_v_res}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_7 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_regex_match_variable, __pyx_v_replace_params_split, __pyx_v_res}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_strip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); __pyx_t_1 = 0; @@ -9072,7 +8166,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * params_used_list = list(params_used) # <<<<<<<<<<<<<< * finalized_constraint = None * if " or " not in res and " and " not in res: - */ +*/ __pyx_t_1 = PySequence_List(__pyx_cur_scope->__pyx_v_params_used); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_params_used_list, ((PyObject*)__pyx_t_1)); @@ -9084,7 +8178,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * finalized_constraint = None # <<<<<<<<<<<<<< * if " or " not in res and " and " not in res: * # if applicable, strip the outermost round brackets - */ +*/ __Pyx_INCREF(Py_None); __Pyx_XDECREF_SET(__pyx_v_finalized_constraint, Py_None); @@ -9094,15 +8188,15 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< * # if applicable, strip the outermost round brackets * while ( - */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_or, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) - if (__pyx_t_9) { +*/ + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_or, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + if (__pyx_t_8) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_8; goto __pyx_L28_bool_binop_done; } - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_and, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_t_3 = __pyx_t_9; + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u_and, __pyx_v_res, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_3 = __pyx_t_8; __pyx_L28_bool_binop_done:; if (__pyx_t_3) { @@ -9112,7 +8206,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * while ( # <<<<<<<<<<<<<< * parsed_restriction[0] == "(" * and parsed_restriction[-1] == ")" - */ +*/ while (1) { /* "constraint/parser.py":221 @@ -9121,14 +8215,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * parsed_restriction[0] == "(" # <<<<<<<<<<<<<< * and parsed_restriction[-1] == ")" * and "(" not in parsed_restriction[1:] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__29, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__17, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_8; goto __pyx_L32_bool_binop_done; } @@ -9138,14 +8232,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * and parsed_restriction[-1] == ")" # <<<<<<<<<<<<<< * and "(" not in parsed_restriction[1:] * and ")" not in parsed_restriction[:1] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parsed_restriction, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u__30, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__18, Py_EQ)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_8; goto __pyx_L32_bool_binop_done; } @@ -9155,14 +8249,14 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< * and ")" not in parsed_restriction[:1] * ): - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, 0, NULL, NULL, &__pyx_slice__31, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__17, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_9) { + if (__pyx_t_8) { } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_8; goto __pyx_L32_bool_binop_done; } @@ -9172,12 +8266,12 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< * ): * parsed_restriction = parsed_restriction[1:-1] - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 0, 1, NULL, NULL, &__pyx_slice__32, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 0, 1, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__18, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_t_9; + __pyx_t_3 = __pyx_t_8; __pyx_L32_bool_binop_done:; if (!__pyx_t_3) break; @@ -9187,8 +8281,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * parsed_restriction = parsed_restriction[1:-1] # <<<<<<<<<<<<<< * # check if we can turn this into the built-in numeric comparison constraint * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) - */ - __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, -1L, NULL, NULL, &__pyx_slice__33, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_parsed_restriction, 1, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[2], 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_parsed_restriction, __pyx_t_1); __pyx_t_1 = 0; @@ -9200,8 +8294,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) # <<<<<<<<<<<<<< * if finalized_constraint is None: * # check if we can turn this into the built-in equality comparison constraint - */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_parsed_restriction))) __PYX_ERR(0, 228, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 228, __pyx_L1_error) __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_6to_numeric_constraint(__pyx_v_to_numeric_constraint, ((PyObject*)__pyx_v_parsed_restriction), __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); @@ -9213,7 +8307,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if finalized_constraint is None: # <<<<<<<<<<<<<< * # check if we can turn this into the built-in equality comparison constraint * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) - */ +*/ __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { @@ -9223,8 +8317,8 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) # <<<<<<<<<<<<<< * if finalized_constraint is None: * # we must turn it into a general function - */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_parsed_restriction))) __PYX_ERR(0, 231, __pyx_L1_error) +*/ + if (!(likely(PyUnicode_CheckExact(__pyx_v_parsed_restriction))||((__pyx_v_parsed_restriction) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_v_parsed_restriction))) __PYX_ERR(0, 231, __pyx_L1_error) __pyx_t_1 = __pyx_pf_10constraint_6parser_18parse_restrictions_8to_equality_constraint(__pyx_v_to_equality_constraint, ((PyObject*)__pyx_v_parsed_restriction), __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_1); @@ -9236,7 +8330,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if finalized_constraint is None: # <<<<<<<<<<<<<< * # check if we can turn this into the built-in equality comparison constraint * finalized_constraint = to_equality_constraint(parsed_restriction, params_used_list) - */ +*/ } /* "constraint/parser.py":218 @@ -9245,7 +8339,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if " or " not in res and " and " not in res: # <<<<<<<<<<<<<< * # if applicable, strip the outermost round brackets * while ( - */ +*/ } /* "constraint/parser.py":232 @@ -9254,7 +8348,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if finalized_constraint is None: # <<<<<<<<<<<<<< * # we must turn it into a general function * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" - */ +*/ __pyx_t_3 = (__pyx_v_finalized_constraint == Py_None); if (__pyx_t_3) { @@ -9264,42 +8358,23 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" # <<<<<<<<<<<<<< * parsed_restrictions.append((finalized_constraint, params_used_list)) * - */ - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __pyx_t_1 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__19, __pyx_v_params_used_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = 0; - __pyx_t_11 = 127; - __Pyx_INCREF(__pyx_kp_u_def_r); - __pyx_t_10 += 6; - __Pyx_GIVEREF(__pyx_kp_u_def_r); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_def_r); - __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__34, __pyx_v_params_used_list); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; - __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u_return_2); - __pyx_t_10 += 10; - __Pyx_GIVEREF(__pyx_kp_u_return_2); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_return_2); - __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_11; - __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8); - __pyx_t_8 = 0; - __Pyx_INCREF(__pyx_kp_u__35); - __pyx_t_10 += 2; - __Pyx_GIVEREF(__pyx_kp_u__35); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__35); - __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_parsed_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_def_r; + __pyx_t_9[1] = __pyx_t_1; + __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_return_2; + __pyx_t_9[3] = __pyx_t_5; + __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u__20; + __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_9, 5, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5)); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF_SET(__pyx_v_finalized_constraint, __pyx_t_6); + __pyx_t_6 = 0; /* "constraint/parser.py":232 * # check if we can turn this into the built-in equality comparison constraint @@ -9307,7 +8382,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * if finalized_constraint is None: # <<<<<<<<<<<<<< * # we must turn it into a general function * finalized_constraint = f"def r({', '.join(params_used_list)}): return {parsed_restriction} \n" - */ +*/ } /* "constraint/parser.py":235 @@ -9316,17 +8391,17 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * parsed_restrictions.append((finalized_constraint, params_used_list)) # <<<<<<<<<<<<<< * * return parsed_restrictions - */ - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); +*/ + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_finalized_constraint); __Pyx_GIVEREF(__pyx_v_finalized_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_finalized_constraint)) __PYX_ERR(0, 235, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_finalized_constraint) != (0)) __PYX_ERR(0, 235, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used_list); __Pyx_GIVEREF(__pyx_v_params_used_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_params_used_list)) __PYX_ERR(0, 235, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_parsed_restrictions, __pyx_t_8); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_params_used_list) != (0)) __PYX_ERR(0, 235, __pyx_L1_error); + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_parsed_restrictions, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/parser.py":213 * # split into functions that only take their relevant parameters @@ -9334,7 +8409,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * for res in restrictions: # <<<<<<<<<<<<<< * params_used: set[str] = set() * parsed_restriction = re.sub(regex_match_variable, replace_params_split, res).strip() - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9344,7 +8419,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * return parsed_restrictions # <<<<<<<<<<<<<< * * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_parsed_restrictions); __pyx_r = __pyx_v_parsed_restrictions; @@ -9356,7 +8431,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -9364,7 +8439,6 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("constraint.parser.parse_restrictions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -9399,7 +8473,7 @@ static PyObject *__pyx_pf_10constraint_6parser_parse_restrictions(CYTHON_UNUSED * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_6parser_3compile_to_constraints(PyObject *__pyx_self, @@ -9433,7 +8507,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compile_to_constraints (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -9441,16 +8515,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraints,&__pyx_n_s_domains,&__pyx_n_s_picklable,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_picklable,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -9458,7 +8536,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -9466,7 +8544,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -9477,8 +8555,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_picklable); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_picklable); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L3_error) } } @@ -9488,9 +8569,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -9516,8 +8600,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 239, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 239, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 239, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_6parser_2compile_to_constraints(__pyx_self, __pyx_v_constraints, __pyx_v_domains, __pyx_v_picklable); /* function exit code */ @@ -9557,12 +8641,11 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN int __pyx_t_10; PyObject *__pyx_t_11 = NULL; int __pyx_t_12; - Py_ssize_t __pyx_t_13; - Py_UCS4 __pyx_t_14; + PyObject *__pyx_t_13[4]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compile_to_constraints", 1); + __Pyx_RefNannySetupContext("compile_to_constraints", 0); /* "constraint/parser.py":250 * list of tuples with restrictions, parameters used (list[str]), and source (str) if applicable. Returned restrictions are strings, functions, or Constraints depending on the options provided. @@ -9570,21 +8653,20 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * parsed_restrictions = parse_restrictions(constraints, domains) # <<<<<<<<<<<<<< * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() * for restriction, params_used in parsed_restrictions: - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_parse_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_parse_restrictions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -9604,7 +8686,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * compiled_constraints: list[tuple[Constraint, list[str], Union[str, None]]] = list() # <<<<<<<<<<<<<< * for restriction, params_used in parsed_restrictions: * if isinstance(restriction, str): - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_compiled_constraints = ((PyObject*)__pyx_t_1); @@ -9616,7 +8698,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint - */ +*/ if (likely(PyList_CheckExact(__pyx_v_parsed_restrictions)) || PyTuple_CheckExact(__pyx_v_parsed_restrictions)) { __pyx_t_1 = __pyx_v_parsed_restrictions; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -9624,20 +8706,23 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_parsed_restrictions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9645,13 +8730,16 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9679,18 +8767,22 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_7 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9699,7 +8791,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed; @@ -9726,7 +8818,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * if isinstance(restriction, str): # <<<<<<<<<<<<<< * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: - */ +*/ __pyx_t_10 = PyUnicode_Check(__pyx_v_restriction); if (__pyx_t_10) { @@ -9736,7 +8828,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * if picklable: # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(restriction) * else: - */ +*/ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) if (__pyx_t_10) { @@ -9746,21 +8838,20 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * constraint = CompilableFunctionConstraint(restriction) # <<<<<<<<<<<<<< * else: * code_object = compile(restriction, "", "exec") - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; } #endif { @@ -9780,7 +8871,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * if picklable: # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(restriction) * else: - */ +*/ goto __pyx_L8; } @@ -9790,19 +8881,19 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * code_object = compile(restriction, "", "exec") # <<<<<<<<<<<<<< * func = FunctionType(code_object.co_consts[0], globals()) * constraint = FunctionConstraint(func) - */ +*/ /*else*/ { __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_restriction)) __PYX_ERR(0, 258, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u_string); - __Pyx_GIVEREF(__pyx_kp_u_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_u_string)) __PYX_ERR(0, 258, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_exec); - __Pyx_GIVEREF(__pyx_n_u_exec); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_exec)) __PYX_ERR(0, 258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 258, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_string); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_string); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_kp_u_string) != (0)) __PYX_ERR(0, 258, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_exec); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_exec); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_mstate_global->__pyx_n_u_exec) != (0)) __PYX_ERR(0, 258, __pyx_L1_error); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9815,12 +8906,12 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< * constraint = FunctionConstraint(func) * compiled_constraints.append((constraint, params_used, restriction)) - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) @@ -9830,13 +8921,12 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -9858,21 +8948,20 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * constraint = FunctionConstraint(func) # <<<<<<<<<<<<<< * compiled_constraints.append((constraint, params_used, restriction)) * elif isinstance(restriction, Constraint): - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -9894,18 +8983,18 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * compiled_constraints.append((constraint, params_used, restriction)) # <<<<<<<<<<<<<< * elif isinstance(restriction, Constraint): * # otherwise it already is a Constraint, pass it directly - */ +*/ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_constraint)) __PYX_ERR(0, 261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used)) __PYX_ERR(0, 261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 261, __pyx_L1_error); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_restriction)) __PYX_ERR(0, 261, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_restriction) != (0)) __PYX_ERR(0, 261, __pyx_L1_error); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -9915,7 +9004,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * if isinstance(restriction, str): # <<<<<<<<<<<<<< * # if it's a string, wrap it in a (compilable or compiled) function constraint * if picklable: - */ +*/ goto __pyx_L7; } @@ -9925,8 +9014,8 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< * # otherwise it already is a Constraint, pass it directly * compiled_constraints.append((restriction, params_used, None)) - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = PyObject_IsInstance(__pyx_v_restriction, __pyx_t_7); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -9938,18 +9027,18 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * compiled_constraints.append((restriction, params_used, None)) # <<<<<<<<<<<<<< * else: * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") - */ +*/ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_restriction); __Pyx_GIVEREF(__pyx_v_restriction); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_restriction)) __PYX_ERR(0, 264, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_restriction) != (0)) __PYX_ERR(0, 264, __pyx_L1_error); __Pyx_INCREF(__pyx_v_params_used); __Pyx_GIVEREF(__pyx_v_params_used); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used)) __PYX_ERR(0, 264, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_params_used) != (0)) __PYX_ERR(0, 264, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None)) __PYX_ERR(0, 264, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, Py_None) != (0)) __PYX_ERR(0, 264, __pyx_L1_error); __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_compiled_constraints, __pyx_t_7); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -9959,7 +9048,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * elif isinstance(restriction, Constraint): # <<<<<<<<<<<<<< * # otherwise it already is a Constraint, pass it directly * compiled_constraints.append((restriction, params_used, None)) - */ +*/ goto __pyx_L7; } @@ -9969,42 +9058,26 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * raise ValueError(f"Restriction {restriction} is neither a string or Constraint {type(restriction)}") # <<<<<<<<<<<<<< * * # return the restrictions and used parameters - */ +*/ /*else*/ { - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = 0; - __pyx_t_14 = 127; - __Pyx_INCREF(__pyx_kp_u_Restriction); - __pyx_t_13 += 12; - __Pyx_GIVEREF(__pyx_kp_u_Restriction); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_Restriction); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_restriction, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_kp_u_is_neither_a_string_or_Constrai); - __pyx_t_13 += 35; - __Pyx_GIVEREF(__pyx_kp_u_is_neither_a_string_or_Constrai); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_is_neither_a_string_or_Constrai); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_14) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_14; - __pyx_t_13 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_restriction)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13[0] = __pyx_mstate_global->__pyx_kp_u_Restriction; + __pyx_t_13[1] = __pyx_t_7; + __pyx_t_13[2] = __pyx_mstate_global->__pyx_kp_u_is_neither_a_string_or_Constrai; + __pyx_t_13[3] = __pyx_t_2; + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_13, 4, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2)); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __PYX_ERR(0, 266, __pyx_L1_error) } __pyx_L7:; @@ -10015,7 +9088,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * for restriction, params_used in parsed_restrictions: # <<<<<<<<<<<<<< * if isinstance(restriction, str): * # if it's a string, wrap it in a (compilable or compiled) function constraint - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10023,7 +9096,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * * # return the restrictions and used parameters * return compiled_constraints # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_compiled_constraints); __pyx_r = __pyx_v_compiled_constraints; @@ -10035,7 +9108,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -10059,11 +9132,7 @@ static PyObject *__pyx_pf_10constraint_6parser_2compile_to_constraints(CYTHON_UN __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions = 0; -#endif +/* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -10072,8 +9141,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct__parse_res o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[--__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10100,12 +9169,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest Py_CLEAR(p->__pyx_v_params_used); Py_CLEAR(p->__pyx_v_tune_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct__parse_restrictions[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct__parse_restrictions++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10119,6 +9188,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct__parse_rest static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct__parse_restrictions(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct__parse_restrictions *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_params_used) { e = (*v)(p->__pyx_v_params_used, a); if (e) return e; } @@ -10170,12 +9243,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10216,13 +9284,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10241,11 +9307,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct__parse_re }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -10253,8 +9314,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_1_to_numer o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10281,12 +9342,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri Py_CLEAR(p->__pyx_v_operator); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10300,6 +9361,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_1_to_numeri static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_operator) { e = (*v)(p->__pyx_v_operator, a); if (e) return e; } @@ -10351,12 +9416,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10397,13 +9457,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10422,11 +9480,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_1_to_nume }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -10434,8 +9487,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_2_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10464,12 +9517,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10483,6 +9536,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_2_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_2_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_1) { e = (*v)(p->__pyx_genexpr_arg_1, a); if (e) return e; } @@ -10524,12 +9581,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10570,13 +9622,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10595,11 +9645,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -10607,8 +9652,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_3_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10636,12 +9681,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_o); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10655,6 +9700,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_3_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_3_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -10696,12 +9745,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10742,13 +9786,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10767,11 +9809,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -10779,8 +9816,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_4_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10808,12 +9845,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10827,6 +9864,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_4_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_4_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -10868,12 +9909,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10914,13 +9950,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10939,11 +9973,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -10951,8 +9980,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_5_to_equal o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -10979,12 +10008,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equali Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -10998,6 +10027,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_5_to_equali static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -11049,12 +10082,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11095,13 +10123,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11120,11 +10146,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equa }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -11132,8 +10153,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_6_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -11161,12 +10182,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -11180,6 +10201,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_6_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_6_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -11221,12 +10246,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11267,13 +10287,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11292,11 +10310,6 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[8]; -static int __pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -11304,8 +10317,8 @@ static PyObject *__pyx_tp_new_10constraint_6parser___pyx_scope_struct_7_genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[--__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -11332,12 +10345,12 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_r); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { - __pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_6parser___pyx_scope_struct_7_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_6parser___pyx_scope_struct_7_genexpr++] = ((struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -11351,6 +10364,10 @@ static void __pyx_tp_dealloc_10constraint_6parser___pyx_scope_struct_7_genexpr(P static int __pyx_tp_traverse_10constraint_6parser___pyx_scope_struct_7_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *p = (struct __pyx_obj_10constraint_6parser___pyx_scope_struct_7_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -11389,12 +10406,7 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -11435,13 +10447,11 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -11463,568 +10473,206 @@ static PyTypeObject __pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0}, - {&__pyx_n_s_AllDifferentConstraint, __pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AllEqualConstraint, __pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_ExactSumConstraint, __pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1}, - {&__pyx_kp_u_Invalid_comparator, __pyx_k_Invalid_comparator, sizeof(__pyx_k_Invalid_comparator), 0, 1, 0, 0}, - {&__pyx_kp_u_Invalid_operator, __pyx_k_Invalid_operator, sizeof(__pyx_k_Invalid_operator), 0, 1, 0, 0}, - {&__pyx_n_s_MaxProdConstraint, __pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MaxSumConstraint, __pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinProdConstraint, __pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_MinSumConstraint, __pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Not_possible_comparator_should_b, __pyx_k_Not_possible_comparator_should_b, sizeof(__pyx_k_Not_possible_comparator_should_b), 0, 1, 0, 0}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Union_AllEqualConstrain, __pyx_k_Optional_Union_AllEqualConstrain, sizeof(__pyx_k_Optional_Union_AllEqualConstrain), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_Union_MinSumConstraint, __pyx_k_Optional_Union_MinSumConstraint, sizeof(__pyx_k_Optional_Union_MinSumConstraint), 0, 0, 1, 0}, - {&__pyx_kp_s_Optional_Union_int_float, __pyx_k_Optional_Union_int_float, sizeof(__pyx_k_Optional_Union_int_float), 0, 0, 1, 0}, - {&__pyx_kp_u_Restriction, __pyx_k_Restriction, sizeof(__pyx_k_Restriction), 0, 1, 0, 0}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0}, - {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0}, - {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0}, - {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0}, - {&__pyx_n_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 1}, - {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0}, - {&__pyx_kp_u__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0, 0}, - {&__pyx_kp_u__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0, 0}, - {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0}, - {&__pyx_kp_u__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 1, 0, 0}, - {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0}, - {&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0}, - {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, - {&__pyx_kp_u__30, __pyx_k__30, sizeof(__pyx_k__30), 0, 1, 0, 0}, - {&__pyx_kp_u__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 1, 0, 0}, - {&__pyx_kp_u__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 1, 0, 0}, - {&__pyx_kp_u__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 1, 0, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, - {&__pyx_n_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 1}, - {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, - {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_kp_u_a_zA_Z__a_zA_Z__0_9, __pyx_k_a_zA_Z__a_zA_Z__0_9, sizeof(__pyx_k_a_zA_Z__a_zA_Z__0_9), 0, 1, 0, 0}, - {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_co_consts, __pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 0, 1, 1}, - {&__pyx_n_s_code_object, __pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 0, 1, 1}, - {&__pyx_n_s_comparator, __pyx_k_comparator, sizeof(__pyx_k_comparator), 0, 0, 1, 1}, - {&__pyx_n_s_comparators, __pyx_k_comparators, sizeof(__pyx_k_comparators), 0, 0, 1, 1}, - {&__pyx_n_s_comparators_found, __pyx_k_comparators_found, sizeof(__pyx_k_comparators_found), 0, 0, 1, 1}, - {&__pyx_n_s_comparators_indices, __pyx_k_comparators_indices, sizeof(__pyx_k_comparators_indices), 0, 0, 1, 1}, - {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_constraints, __pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_compiled_constraints, __pyx_k_compiled_constraints, sizeof(__pyx_k_compiled_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_parser, __pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_parser_py, __pyx_k_constraint_parser_py, sizeof(__pyx_k_constraint_parser_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_kp_u_def_r, __pyx_k_def_r, sizeof(__pyx_k_def_r), 0, 1, 0, 0}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, - {&__pyx_n_s_equalities_found, __pyx_k_equalities_found, sizeof(__pyx_k_equalities_found), 0, 0, 1, 1}, - {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 0, 0, 1, 1}, - {&__pyx_n_u_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 0, 1}, - {&__pyx_n_s_finalized_constraint, __pyx_k_finalized_constraint, sizeof(__pyx_k_finalized_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 0, 0, 1, 1}, - {&__pyx_n_s_finditer, __pyx_k_finditer, sizeof(__pyx_k_finditer), 0, 0, 1, 1}, - {&__pyx_n_s_fromkeys, __pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1}, - {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, - {&__pyx_n_s_inequalities_found, __pyx_k_inequalities_found, sizeof(__pyx_k_inequalities_found), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_kp_u_is_neither_a_string_or_Constrai, __pyx_k_is_neither_a_string_or_Constrai, sizeof(__pyx_k_is_neither_a_string_or_Constrai), 0, 1, 0, 0}, - {&__pyx_n_s_is_or_evals_to_number, __pyx_k_is_or_evals_to_number, sizeof(__pyx_k_is_or_evals_to_number), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, - {&__pyx_n_s_left_num, __pyx_k_left_num, sizeof(__pyx_k_left_num), 0, 0, 1, 1}, - {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Constraint_list_str_U, __pyx_k_list_tuple_Constraint_list_str_U, sizeof(__pyx_k_list_tuple_Constraint_list_str_U), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Union_Constraint_str, __pyx_k_list_tuple_Union_Constraint_str, sizeof(__pyx_k_list_tuple_Union_Constraint_str), 0, 0, 1, 0}, - {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_match_object, __pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_next_stop, __pyx_k_next_stop, sizeof(__pyx_k_next_stop), 0, 0, 1, 1}, - {&__pyx_n_s_number, __pyx_k_number, sizeof(__pyx_k_number), 0, 0, 1, 1}, - {&__pyx_n_s_number_is_int, __pyx_k_number_is_int, sizeof(__pyx_k_number_is_int), 0, 0, 1, 1}, - {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, - {&__pyx_n_s_operators, __pyx_k_operators, sizeof(__pyx_k_operators), 0, 0, 1, 1}, - {&__pyx_n_s_operators_found, __pyx_k_operators_found, sizeof(__pyx_k_operators_found), 0, 0, 1, 1}, - {&__pyx_kp_u_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 1, 0, 0}, - {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1}, - {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1}, - {&__pyx_kp_u_params_params_index, __pyx_k_params_params_index, sizeof(__pyx_k_params_params_index), 0, 1, 0, 0}, - {&__pyx_n_s_params_used, __pyx_k_params_used, sizeof(__pyx_k_params_used), 0, 0, 1, 1}, - {&__pyx_n_s_params_used_list, __pyx_k_params_used_list, sizeof(__pyx_k_params_used_list), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions, __pyx_k_parse_restrictions, sizeof(__pyx_k_parse_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_genexp, __pyx_k_parse_restrictions_locals_genexp, sizeof(__pyx_k_parse_restrictions_locals_genexp), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_replac, __pyx_k_parse_restrictions_locals_replac, sizeof(__pyx_k_parse_restrictions_locals_replac), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_replac_2, __pyx_k_parse_restrictions_locals_replac_2, sizeof(__pyx_k_parse_restrictions_locals_replac_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_equ, __pyx_k_parse_restrictions_locals_to_equ, sizeof(__pyx_k_parse_restrictions_locals_to_equ), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_equ_2, __pyx_k_parse_restrictions_locals_to_equ_2, sizeof(__pyx_k_parse_restrictions_locals_to_equ_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_mul, __pyx_k_parse_restrictions_locals_to_mul, sizeof(__pyx_k_parse_restrictions_locals_to_mul), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num, __pyx_k_parse_restrictions_locals_to_num, sizeof(__pyx_k_parse_restrictions_locals_to_num), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num_2, __pyx_k_parse_restrictions_locals_to_num_2, sizeof(__pyx_k_parse_restrictions_locals_to_num_2), 0, 0, 1, 1}, - {&__pyx_n_s_parse_restrictions_locals_to_num_3, __pyx_k_parse_restrictions_locals_to_num_3, sizeof(__pyx_k_parse_restrictions_locals_to_num_3), 0, 0, 1, 1}, - {&__pyx_n_s_parsed_restriction, __pyx_k_parsed_restriction, sizeof(__pyx_k_parsed_restriction), 0, 0, 1, 1}, - {&__pyx_n_s_parsed_restrictions, __pyx_k_parsed_restrictions, sizeof(__pyx_k_parsed_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_picklable, __pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 0, 1, 1}, - {&__pyx_n_s_prev_stop, __pyx_k_prev_stop, sizeof(__pyx_k_prev_stop), 0, 0, 1, 1}, - {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, - {&__pyx_n_s_regex_match_variable, __pyx_k_regex_match_variable, sizeof(__pyx_k_regex_match_variable), 0, 0, 1, 1}, - {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, - {&__pyx_n_s_replace_params, __pyx_k_replace_params, sizeof(__pyx_k_replace_params), 0, 0, 1, 1}, - {&__pyx_n_s_replace_params_split, __pyx_k_replace_params_split, sizeof(__pyx_k_replace_params_split), 0, 0, 1, 1}, - {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1}, - {&__pyx_n_s_restriction, __pyx_k_restriction, sizeof(__pyx_k_restriction), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions, __pyx_k_restrictions, sizeof(__pyx_k_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_cleaned, __pyx_k_restrictions_cleaned, sizeof(__pyx_k_restrictions_cleaned), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_cleaned_unique, __pyx_k_restrictions_cleaned_unique, sizeof(__pyx_k_restrictions_cleaned_unique), 0, 0, 1, 1}, - {&__pyx_n_s_restrictions_unique_indices, __pyx_k_restrictions_unique_indices, sizeof(__pyx_k_restrictions_unique_indices), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_kp_u_return_2, __pyx_k_return_2, sizeof(__pyx_k_return_2), 0, 1, 0, 0}, - {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, - {&__pyx_n_s_right_num, __pyx_k_right_num, sizeof(__pyx_k_right_num), 0, 0, 1, 1}, - {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, - {&__pyx_n_s_split_restrictions, __pyx_k_split_restrictions, sizeof(__pyx_k_split_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_splitted, __pyx_k_splitted, sizeof(__pyx_k_splitted), 0, 0, 1, 1}, - {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1}, - {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_kp_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 0}, - {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, - {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1}, - {&__pyx_n_s_temp_copy, __pyx_k_temp_copy, sizeof(__pyx_k_temp_copy), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_n_s_to_equality_constraint, __pyx_k_to_equality_constraint, sizeof(__pyx_k_to_equality_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_to_multiple_restrictions, __pyx_k_to_multiple_restrictions, sizeof(__pyx_k_to_multiple_restrictions), 0, 0, 1, 1}, - {&__pyx_n_s_to_numeric_constraint, __pyx_k_to_numeric_constraint, sizeof(__pyx_k_to_numeric_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_tune_params, __pyx_k_tune_params, sizeof(__pyx_k_tune_params), 0, 0, 1, 1}, - {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_variables_on_left, __pyx_k_variables_on_left, sizeof(__pyx_k_variables_on_left), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 62, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 140, __pyx_L1_error) - __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 89, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 90, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 258, __pyx_L1_error) +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); return 0; - __pyx_L1_error:; - return -1; } -/* #### Code section: cached_constants ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/parser.py":86 - * - * # find out which side is the constant number - * def is_or_evals_to_number(s: str) -> Optional[Union[int, float]]: # <<<<<<<<<<<<<< - * try: - * # check if it's a number or solvable to a number (e.g. '32*2') - */ - __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_s, __pyx_n_s_number); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_is_or_evals_to_number, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 86, __pyx_L1_error) + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/parser.py":28 - * regex_match_variable = r"([a-zA-Z_$][a-zA-Z_$0-9]*)" - * - * def replace_params(match_object): # <<<<<<<<<<<<<< - * key = match_object.group(1) - * if key in tune_params: - */ - __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_match_object, __pyx_n_s_key, __pyx_n_s_param); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_replace_params, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 28, __pyx_L1_error) +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} - /* "constraint/parser.py":36 - * return key - * - * def replace_params_split(match_object): # <<<<<<<<<<<<<< - * # careful: has side-effect of adding to set `params_used` - * key = match_object.group(1) - */ - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_replace_params_split, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 36, __pyx_L1_error) - - /* "constraint/parser.py":46 - * return key - * - * def to_multiple_restrictions(restrictions: list[str]) -> list[str]: # <<<<<<<<<<<<<< - * """Split the restrictions into multiple restriction where possible (e.g. 3 <= x * y < 9 <= z -> [(MinProd(3), [x, y]), (MaxProd(9-1), [x, y]), (MinProd(9), [z])]).""" # noqa: E501 - * split_restrictions = list() - */ - __pyx_tuple__20 = PyTuple_Pack(10, __pyx_n_s_restrictions, __pyx_n_s_split_restrictions, __pyx_n_s_res, __pyx_n_s_comparators, __pyx_n_s_comparators_indices, __pyx_n_s_index, __pyx_n_s_temp_copy, __pyx_n_s_prev_stop, __pyx_n_s_next_stop, __pyx_n_s_m); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_multiple_restrictions, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 46, __pyx_L1_error) - - /* "constraint/parser.py":71 - * return split_restrictions - * - * def to_numeric_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[MinSumConstraint, ExactSumConstraint, MaxSumConstraint, MaxProdConstraint]]: - */ - __pyx_tuple__22 = PyTuple_Pack(23, __pyx_n_s_restriction, __pyx_n_s_params, __pyx_n_s_comparators, __pyx_n_s_comparators_found, __pyx_n_s_comparator, __pyx_n_s_left, __pyx_n_s_right, __pyx_n_s_is_or_evals_to_number, __pyx_n_s_is_or_evals_to_number, __pyx_n_s_left_num, __pyx_n_s_right_num, __pyx_n_s_number, __pyx_n_s_variables, __pyx_n_s_variables_on_left, __pyx_n_s_number_is_int, __pyx_n_s_operators, __pyx_n_s_operators_found, __pyx_n_s_operator, __pyx_n_s_splitted, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 71, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 23, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_numeric_constraint, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 71, __pyx_L1_error) - - /* "constraint/parser.py":172 - * return None - * - * def to_equality_constraint( # <<<<<<<<<<<<<< - * restriction: str, params: list[str] - * ) -> Optional[Union[AllEqualConstraint, AllDifferentConstraint]]: - */ - __pyx_tuple__24 = PyTuple_Pack(8, __pyx_n_s_restriction, __pyx_n_s_params, __pyx_n_s_equalities_found, __pyx_n_s_inequalities_found, __pyx_n_s_comparator, __pyx_n_s_splitted, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 172, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__24); - __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_to_equality_constraint, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 172, __pyx_L1_error) - - /* "constraint/parser.py":203 - * if all(isinstance(r, str) for r in restrictions): - * # clean the restriction strings to functional equivalence - * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< - * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order - * # get the indices of the unique restrictions, use these to build a new list of restrictions - */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_kp_u__26, __pyx_kp_u__27); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - - /* "constraint/parser.py":223 - * parsed_restriction[0] == "(" - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< - * and ")" not in parsed_restriction[:1] - * ): - */ - __pyx_slice__31 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__31); - __Pyx_GIVEREF(__pyx_slice__31); - - /* "constraint/parser.py":224 - * and parsed_restriction[-1] == ")" - * and "(" not in parsed_restriction[1:] - * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< - * ): - * parsed_restriction = parsed_restriction[1:-1] - */ - __pyx_slice__32 = PySlice_New(Py_None, __pyx_int_1, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__32); - __Pyx_GIVEREF(__pyx_slice__32); - - /* "constraint/parser.py":226 - * and ")" not in parsed_restriction[:1] - * ): - * parsed_restriction = parsed_restriction[1:-1] # <<<<<<<<<<<<<< - * # check if we can turn this into the built-in numeric comparison constraint - * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) - */ - __pyx_slice__33 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice__33); - __Pyx_GIVEREF(__pyx_slice__33); - - /* "constraint/parser.py":23 - * ) - * - * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< - * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 - * # rewrite the restrictions so variables are singled out - */ - __pyx_tuple__37 = PyTuple_Pack(27, __pyx_n_s_restrictions, __pyx_n_s_tune_params, __pyx_n_s_regex_match_variable, __pyx_n_s_replace_params, __pyx_n_s_replace_params, __pyx_n_s_replace_params_split, __pyx_n_s_replace_params_split, __pyx_n_s_to_multiple_restrictions, __pyx_n_s_to_multiple_restrictions, __pyx_n_s_to_numeric_constraint, __pyx_n_s_to_numeric_constraint, __pyx_n_s_to_equality_constraint, __pyx_n_s_to_equality_constraint, __pyx_n_s_restrictions_cleaned, __pyx_n_s_restrictions_cleaned_unique, __pyx_n_s_restrictions_unique_indices, __pyx_n_s_parsed_restrictions, __pyx_n_s_res, __pyx_n_s_params_used, __pyx_n_s_parsed_restriction, __pyx_n_s_params_used_list, __pyx_n_s_finalized_constraint, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_r, __pyx_n_s_r, __pyx_n_s_i); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__37); - __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_parse_restrictions, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 23, __pyx_L1_error) - - /* "constraint/parser.py":239 - * return parsed_restrictions - * - * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< - * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. - * - */ - __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_constraints, __pyx_n_s_domains, __pyx_n_s_picklable, __pyx_n_s_parsed_restrictions, __pyx_n_s_compiled_constraints, __pyx_n_s_restriction, __pyx_n_s_params_used, __pyx_n_s_constraint, __pyx_n_s_code_object, __pyx_n_s_func); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_parser_py, __pyx_n_s_compile_to_constraints, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_tuple__41 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 239, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyList_Type_index.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_index.method_name = &__pyx_n_s_index; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); - /*--- Global init code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_variable_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); - /*--- Variable export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_function_export_code(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); - /*--- Function export code ---*/ - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions)) __PYX_ERR(0, 23, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions)) __PYX_ERR(0, 23, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions = &__pyx_type_10constraint_6parser___pyx_scope_struct__parse_restrictions; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions) < 0) __PYX_ERR(0, 23, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct__parse_restrictions->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)) __PYX_ERR(0, 71, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint)) __PYX_ERR(0, 71, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint) < 0) __PYX_ERR(0, 71, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_1_to_numeric_constraint->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 83, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 83, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 144, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 144, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 144, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 151, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)) __PYX_ERR(0, 172, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint)) __PYX_ERR(0, 172, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint = &__pyx_type_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint) < 0) __PYX_ERR(0, 172, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_5_to_equality_constraint->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 191, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 191, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 191, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 201, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr)) __PYX_ERR(0, 201, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #else - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr = &__pyx_type_10constraint_6parser___pyx_scope_struct_7_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr) < 0) __PYX_ERR(0, 201, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_6parser___pyx_scope_struct_7_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -12034,38 +10682,42 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_parser(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_parser}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + #endif {0, NULL} }; #endif @@ -12083,7 +10735,7 @@ namespace { #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + sizeof(__pyx_mstatetype), /* m_size */ #else -1, /* m_size */ #endif @@ -12106,50 +10758,37 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initparser(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initparser(void) -#else __Pyx_PyMODINIT_FUNC PyInit_parser(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_parser(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { + if (__Pyx_VersionSanityCheck() < 0) return NULL; return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif { PyErr_SetString( PyExc_ImportError, @@ -12213,12 +10852,15 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_module) #endif -#endif { + #if !CYTHON_PEP489_MULTI_PHASE_INIT + if (__Pyx_VersionSanityCheck() < 0) return NULL; + #endif int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -12232,7 +10874,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu PyErr_SetString(PyExc_RuntimeError, "Module 'parser' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ @@ -12240,10 +10882,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("parser", __pyx_methods, __pyx_k_Module_containing_the_code_for_p, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE + #if CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); @@ -12255,13 +10894,18 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_parser(PyObject *__pyx_pyinit_modu __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); #endif + #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -12271,14 +10915,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_parser(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_parser", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -12294,58 +10939,44 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__parser) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.parser")) { if (unlikely((PyDict_SetItemString(modules, "constraint.parser", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/parser.py":2 * """Module containing the code for parsing string constraints.""" * import re # <<<<<<<<<<<<<< * from types import FunctionType * from typing import Union, Optional - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_re, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":3 @@ -12354,18 +10985,15 @@ if (!__Pyx_RefNanny) { * from types import FunctionType # <<<<<<<<<<<<<< * from typing import Union, Optional * from constraint.constraints import ( - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_FunctionType); - __Pyx_GIVEREF(__pyx_n_s_FunctionType); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FunctionType)) __PYX_ERR(0, 3, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12375,25 +11003,19 @@ if (!__Pyx_RefNanny) { * from typing import Union, Optional # <<<<<<<<<<<<<< * from constraint.constraints import ( * AllDifferentConstraint, - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_Union, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Union)) __PYX_ERR(0, 4, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12403,39 +11025,9 @@ if (!__Pyx_RefNanny) { * AllDifferentConstraint, # <<<<<<<<<<<<<< * AllEqualConstraint, * Constraint, - */ - __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_AllDifferentConstraint); - __Pyx_GIVEREF(__pyx_n_s_AllDifferentConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_AllDifferentConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_AllEqualConstraint); - __Pyx_GIVEREF(__pyx_n_s_AllEqualConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_AllEqualConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Constraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ExactSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_ExactSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_ExactSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MaxProdConstraint); - __Pyx_GIVEREF(__pyx_n_s_MaxProdConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_MaxProdConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MaxSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_MaxSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_MaxSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MinProdConstraint); - __Pyx_GIVEREF(__pyx_n_s_MinProdConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_MinProdConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_MinSumConstraint); - __Pyx_GIVEREF(__pyx_n_s_MinSumConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_MinSumConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); /* "constraint/parser.py":5 * from types import FunctionType @@ -12443,49 +11035,49 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import ( # <<<<<<<<<<<<<< * AllDifferentConstraint, * AllEqualConstraint, - */ - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_AllDifferentConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllDifferentConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_AllEqualConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_AllEqualConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AllEqualConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ExactSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MaxSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinProdConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinProdConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinSumConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinSumConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -12495,17 +11087,17 @@ if (!__Pyx_RefNanny) { * def parse_restrictions(restrictions: list[str], tune_params: dict) -> list[tuple[Union[Constraint, str], list[str]]]: # <<<<<<<<<<<<<< * """Parses restrictions (constraints in string format) from a list of strings into compilable functions and constraints. Returns a list of tuples of (strings or constraints) and parameters.""" # noqa: E501 * # rewrite the restrictions so variables are singled out - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_restrictions, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tune_params, __pyx_n_s_dict) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_tuple_Union_Constraint_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_1parse_restrictions, 0, __pyx_n_s_parse_restrictions, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_restrictions, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_tune_params, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Union_Constraint_str) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_1parse_restrictions, 0, __pyx_mstate_global->__pyx_n_u_parse_restrictions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parse_restrictions, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/parser.py":239 @@ -12514,28 +11106,28 @@ if (!__Pyx_RefNanny) { * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_list_tuple_Constraint_list_str_U) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_3compile_to_constraints, 0, __pyx_n_s_compile_to_constraints, NULL, __pyx_n_s_constraint_parser, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_list_str_U) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_6parser_3compile_to_constraints, 0, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, NULL, __pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__41); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1]); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/parser.py":1 * """Module containing the code for parsing string constraints.""" # <<<<<<<<<<<<<< * import re * from types import FunctionType - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ @@ -12545,7 +11137,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.parser", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -12566,12 +11158,427 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_AllDifferentConstraint, sizeof(__pyx_k_AllDifferentConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllDifferentConstraint */ + {__pyx_k_AllEqualConstraint, sizeof(__pyx_k_AllEqualConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllEqualConstraint */ + {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */ + {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ + {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ + {__pyx_k_ExactSumConstraint, sizeof(__pyx_k_ExactSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ExactSumConstraint */ + {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ + {__pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionType */ + {__pyx_k_Invalid_comparator, sizeof(__pyx_k_Invalid_comparator), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_comparator */ + {__pyx_k_Invalid_operator, sizeof(__pyx_k_Invalid_operator), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_operator */ + {__pyx_k_MaxProdConstraint, sizeof(__pyx_k_MaxProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxProdConstraint */ + {__pyx_k_MaxSumConstraint, sizeof(__pyx_k_MaxSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MaxSumConstraint */ + {__pyx_k_MinProdConstraint, sizeof(__pyx_k_MinProdConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinProdConstraint */ + {__pyx_k_MinSumConstraint, sizeof(__pyx_k_MinSumConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinSumConstraint */ + {__pyx_k_Not_possible_comparator_should_b, sizeof(__pyx_k_Not_possible_comparator_should_b), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Not_possible_comparator_should_b */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ + {__pyx_k_Optional_Union_AllEqualConstrain, sizeof(__pyx_k_Optional_Union_AllEqualConstrain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_AllEqualConstrain */ + {__pyx_k_Optional_Union_MinSumConstraint, sizeof(__pyx_k_Optional_Union_MinSumConstraint), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_MinSumConstraint */ + {__pyx_k_Optional_Union_int_float, sizeof(__pyx_k_Optional_Union_int_float), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Union_int_float */ + {__pyx_k_Restriction, sizeof(__pyx_k_Restriction), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Restriction */ + {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ + {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */ + {__pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__10 */ + {__pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__11 */ + {__pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__12 */ + {__pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__13 */ + {__pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__14 */ + {__pyx_k__15, sizeof(__pyx_k__15), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__15 */ + {__pyx_k__16, sizeof(__pyx_k__16), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__16 */ + {__pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__17 */ + {__pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__18 */ + {__pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__19 */ + {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ + {__pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__20 */ + {__pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__21 */ + {__pyx_k__22, sizeof(__pyx_k__22), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__22 */ + {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ + {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */ + {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__5 */ + {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */ + {__pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__7 */ + {__pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__8 */ + {__pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__9 */ + {__pyx_k_a_zA_Z__a_zA_Z__0_9, sizeof(__pyx_k_a_zA_Z__a_zA_Z__0_9), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_a_zA_Z__a_zA_Z__0_9 */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_and */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ + {__pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_co_consts */ + {__pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_code_object */ + {__pyx_k_comparator, sizeof(__pyx_k_comparator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparator */ + {__pyx_k_comparators, sizeof(__pyx_k_comparators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators */ + {__pyx_k_comparators_found, sizeof(__pyx_k_comparators_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators_found */ + {__pyx_k_comparators_indices, sizeof(__pyx_k_comparators_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_comparators_indices */ + {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */ + {__pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_constraints */ + {__pyx_k_compiled_constraints, sizeof(__pyx_k_compiled_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compiled_constraints */ + {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ + {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ + {__pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_parser */ + {__pyx_k_constraint_parser_py, sizeof(__pyx_k_constraint_parser_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_parser_py */ + {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ + {__pyx_k_def_r, sizeof(__pyx_k_def_r), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_def_r */ + {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ + {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ + {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ + {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ + {__pyx_k_end, sizeof(__pyx_k_end), 0, 1, 1}, /* PyObject cname: __pyx_n_u_end */ + {__pyx_k_equalities_found, sizeof(__pyx_k_equalities_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equalities_found */ + {__pyx_k_eval, sizeof(__pyx_k_eval), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eval */ + {__pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exec */ + {__pyx_k_finalized_constraint, sizeof(__pyx_k_finalized_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_finalized_constraint */ + {__pyx_k_findall, sizeof(__pyx_k_findall), 0, 1, 1}, /* PyObject cname: __pyx_n_u_findall */ + {__pyx_k_finditer, sizeof(__pyx_k_finditer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_finditer */ + {__pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromkeys */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ + {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ + {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ + {__pyx_k_group, sizeof(__pyx_k_group), 0, 1, 1}, /* PyObject cname: __pyx_n_u_group */ + {__pyx_k_i, sizeof(__pyx_k_i), 0, 1, 1}, /* PyObject cname: __pyx_n_u_i */ + {__pyx_k_index, sizeof(__pyx_k_index), 0, 1, 1}, /* PyObject cname: __pyx_n_u_index */ + {__pyx_k_inequalities_found, sizeof(__pyx_k_inequalities_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_inequalities_found */ + {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_is_neither_a_string_or_Constrai, sizeof(__pyx_k_is_neither_a_string_or_Constrai), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_neither_a_string_or_Constrai */ + {__pyx_k_is_or_evals_to_number, sizeof(__pyx_k_is_or_evals_to_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_or_evals_to_number */ + {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ + {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */ + {__pyx_k_left, sizeof(__pyx_k_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left */ + {__pyx_k_left_num, sizeof(__pyx_k_left_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_left_num */ + {__pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_str */ + {__pyx_k_list_tuple_Constraint_list_str_U, sizeof(__pyx_k_list_tuple_Constraint_list_str_U), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Constraint_list_str_U */ + {__pyx_k_list_tuple_Union_Constraint_str, sizeof(__pyx_k_list_tuple_Union_Constraint_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Union_Constraint_str */ + {__pyx_k_m, sizeof(__pyx_k_m), 0, 1, 1}, /* PyObject cname: __pyx_n_u_m */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_match_object, sizeof(__pyx_k_match_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_match_object */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ + {__pyx_k_next_stop, sizeof(__pyx_k_next_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next_stop */ + {__pyx_k_number, sizeof(__pyx_k_number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number */ + {__pyx_k_number_is_int, sizeof(__pyx_k_number_is_int), 0, 1, 1}, /* PyObject cname: __pyx_n_u_number_is_int */ + {__pyx_k_o, sizeof(__pyx_k_o), 0, 1, 1}, /* PyObject cname: __pyx_n_u_o */ + {__pyx_k_operator, sizeof(__pyx_k_operator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operator */ + {__pyx_k_operators, sizeof(__pyx_k_operators), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators */ + {__pyx_k_operators_found, sizeof(__pyx_k_operators_found), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operators_found */ + {__pyx_k_or, sizeof(__pyx_k_or), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_or */ + {__pyx_k_param, sizeof(__pyx_k_param), 0, 1, 1}, /* PyObject cname: __pyx_n_u_param */ + {__pyx_k_params, sizeof(__pyx_k_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params */ + {__pyx_k_params_params_index, sizeof(__pyx_k_params_params_index), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_params_params_index */ + {__pyx_k_params_used, sizeof(__pyx_k_params_used), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_used */ + {__pyx_k_params_used_list, sizeof(__pyx_k_params_used_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params_used_list */ + {__pyx_k_parse_restrictions, sizeof(__pyx_k_parse_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions */ + {__pyx_k_parse_restrictions_locals_genexp, sizeof(__pyx_k_parse_restrictions_locals_genexp), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_genexp */ + {__pyx_k_parse_restrictions_locals_replac, sizeof(__pyx_k_parse_restrictions_locals_replac), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_replac */ + {__pyx_k_parse_restrictions_locals_replac_2, sizeof(__pyx_k_parse_restrictions_locals_replac_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_replac_2 */ + {__pyx_k_parse_restrictions_locals_to_equ, sizeof(__pyx_k_parse_restrictions_locals_to_equ), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_equ */ + {__pyx_k_parse_restrictions_locals_to_equ_2, sizeof(__pyx_k_parse_restrictions_locals_to_equ_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_equ_2 */ + {__pyx_k_parse_restrictions_locals_to_mul, sizeof(__pyx_k_parse_restrictions_locals_to_mul), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_mul */ + {__pyx_k_parse_restrictions_locals_to_num, sizeof(__pyx_k_parse_restrictions_locals_to_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num */ + {__pyx_k_parse_restrictions_locals_to_num_2, sizeof(__pyx_k_parse_restrictions_locals_to_num_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num_2 */ + {__pyx_k_parse_restrictions_locals_to_num_3, sizeof(__pyx_k_parse_restrictions_locals_to_num_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parse_restrictions_locals_to_num_3 */ + {__pyx_k_parsed_restriction, sizeof(__pyx_k_parsed_restriction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed_restriction */ + {__pyx_k_parsed_restrictions, sizeof(__pyx_k_parsed_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed_restrictions */ + {__pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_picklable */ + {__pyx_k_prev_stop, sizeof(__pyx_k_prev_stop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prev_stop */ + {__pyx_k_r, sizeof(__pyx_k_r), 0, 1, 1}, /* PyObject cname: __pyx_n_u_r */ + {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ + {__pyx_k_re, sizeof(__pyx_k_re), 0, 1, 1}, /* PyObject cname: __pyx_n_u_re */ + {__pyx_k_regex_match_variable, sizeof(__pyx_k_regex_match_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_regex_match_variable */ + {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */ + {__pyx_k_replace_params, sizeof(__pyx_k_replace_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace_params */ + {__pyx_k_replace_params_split, sizeof(__pyx_k_replace_params_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace_params_split */ + {__pyx_k_res, sizeof(__pyx_k_res), 0, 1, 1}, /* PyObject cname: __pyx_n_u_res */ + {__pyx_k_restriction, sizeof(__pyx_k_restriction), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restriction */ + {__pyx_k_restrictions, sizeof(__pyx_k_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions */ + {__pyx_k_restrictions_cleaned, sizeof(__pyx_k_restrictions_cleaned), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_cleaned */ + {__pyx_k_restrictions_cleaned_unique, sizeof(__pyx_k_restrictions_cleaned_unique), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_cleaned_unique */ + {__pyx_k_restrictions_unique_indices, sizeof(__pyx_k_restrictions_unique_indices), 0, 1, 1}, /* PyObject cname: __pyx_n_u_restrictions_unique_indices */ + {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ + {__pyx_k_return_2, sizeof(__pyx_k_return_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_return_2 */ + {__pyx_k_right, sizeof(__pyx_k_right), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right */ + {__pyx_k_right_num, sizeof(__pyx_k_right_num), 0, 1, 1}, /* PyObject cname: __pyx_n_u_right_num */ + {__pyx_k_s, sizeof(__pyx_k_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_s */ + {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ + {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ + {__pyx_k_split, sizeof(__pyx_k_split), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split */ + {__pyx_k_split_restrictions, sizeof(__pyx_k_split_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_split_restrictions */ + {__pyx_k_splitted, sizeof(__pyx_k_splitted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_splitted */ + {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */ + {__pyx_k_str, sizeof(__pyx_k_str), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str */ + {__pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_string */ + {__pyx_k_strip, sizeof(__pyx_k_strip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_strip */ + {__pyx_k_sub, sizeof(__pyx_k_sub), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sub */ + {__pyx_k_temp_copy, sizeof(__pyx_k_temp_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_temp_copy */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ + {__pyx_k_to_equality_constraint, sizeof(__pyx_k_to_equality_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_equality_constraint */ + {__pyx_k_to_multiple_restrictions, sizeof(__pyx_k_to_multiple_restrictions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_multiple_restrictions */ + {__pyx_k_to_numeric_constraint, sizeof(__pyx_k_to_numeric_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_numeric_constraint */ + {__pyx_k_tune_params, sizeof(__pyx_k_tune_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tune_params */ + {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */ + {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ + {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ + {__pyx_k_variables_on_left, sizeof(__pyx_k_variables_on_left), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables_on_left */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 140, __pyx_L1_error) + __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 258, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/parser.py":203 + * if all(isinstance(r, str) for r in restrictions): + * # clean the restriction strings to functional equivalence + * restrictions_cleaned = [r.replace(' ', '') for r in restrictions] # <<<<<<<<<<<<<< + * restrictions_cleaned_unique = list(dict.fromkeys(restrictions_cleaned)) # dict preserves order + * # get the indices of the unique restrictions, use these to build a new list of restrictions +*/ + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__15, __pyx_mstate_global->__pyx_kp_u__16); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/parser.py":223 + * parsed_restriction[0] == "(" + * and parsed_restriction[-1] == ")" + * and "(" not in parsed_restriction[1:] # <<<<<<<<<<<<<< + * and ")" not in parsed_restriction[:1] + * ): +*/ + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/parser.py":224 + * and parsed_restriction[-1] == ")" + * and "(" not in parsed_restriction[1:] + * and ")" not in parsed_restriction[:1] # <<<<<<<<<<<<<< + * ): + * parsed_restriction = parsed_restriction[1:-1] +*/ + __pyx_mstate_global->__pyx_slice[1] = PySlice_New(Py_None, __pyx_mstate_global->__pyx_int_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]); + + /* "constraint/parser.py":226 + * and ")" not in parsed_restriction[:1] + * ): + * parsed_restriction = parsed_restriction[1:-1] # <<<<<<<<<<<<<< + * # check if we can turn this into the built-in numeric comparison constraint + * finalized_constraint = to_numeric_constraint(parsed_restriction, params_used_list) +*/ + __pyx_mstate_global->__pyx_slice[2] = PySlice_New(__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]); + + /* "constraint/parser.py":239 + * return parsed_restrictions + * + * def compile_to_constraints(constraints: list[str], domains: dict, picklable=False) -> list[tuple[Constraint, list[str], Union[str, None]]]: # noqa: E501 # <<<<<<<<<<<<<< + * """Parses constraints in string format (referred to as restrictions) from a list of strings into a list of Constraints, parameters used, and source if applicable. + * +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyList_Type__index.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__index.method_name = &__pyx_mstate->__pyx_n_u_index; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_neg_1 = PyLong_FromLong(-1); if (unlikely(!__pyx_mstate->__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 8; + unsigned int line_table_length : 14; +} __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + PyObject* tuple_dedup_map = PyDict_New(); + if (unlikely(!tuple_dedup_map)) return -1; + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 83, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 144, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_o}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 151, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__23, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86, 45}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_number}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_k_XQ_Qa_z_5_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 191, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_s}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__23, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 201, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_r}; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 50}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_match_object, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_param}; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params, __pyx_k_A_l_4s_Cq_2V2Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36, 50}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_match_object, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_param}; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_k_A_l_4s_Cq_t1A_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 46, 251}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_restrictions, __pyx_mstate->__pyx_n_u_split_restrictions, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_comparators, __pyx_mstate->__pyx_n_u_comparators_indices, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_temp_copy, __pyx_mstate->__pyx_n_u_prev_stop, __pyx_mstate->__pyx_n_u_next_stop, __pyx_mstate->__pyx_n_u_m}; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_k_Q_G1_xs_c_1_6_uA_AV1D_Qd_e2YasR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 71, 749}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_comparators, __pyx_mstate->__pyx_n_u_comparators_found, __pyx_mstate->__pyx_n_u_comparator, __pyx_mstate->__pyx_n_u_left, __pyx_mstate->__pyx_n_u_right, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_mstate->__pyx_n_u_is_or_evals_to_number, __pyx_mstate->__pyx_n_u_left_num, __pyx_mstate->__pyx_n_u_right_num, __pyx_mstate->__pyx_n_u_number, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variables_on_left, __pyx_mstate->__pyx_n_u_number_is_int, __pyx_mstate->__pyx_n_u_operators, __pyx_mstate->__pyx_n_u_operators_found, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_splitted, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_k_A_avV6_a_Bhas_q_a_3a_Q_1_aq_he81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 172, 211}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_equalities_found, __pyx_mstate->__pyx_n_u_inequalities_found, __pyx_mstate->__pyx_n_u_comparator, __pyx_mstate->__pyx_n_u_splitted, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_k_A_3axs_Qa_1_2XQfA_Rxq_a_5_1_b_Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 27, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 23, 386}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_restrictions, __pyx_mstate->__pyx_n_u_tune_params, __pyx_mstate->__pyx_n_u_regex_match_variable, __pyx_mstate->__pyx_n_u_replace_params, __pyx_mstate->__pyx_n_u_replace_params, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_mstate->__pyx_n_u_replace_params_split, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_mstate->__pyx_n_u_to_multiple_restrictions, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_mstate->__pyx_n_u_to_numeric_constraint, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_mstate->__pyx_n_u_to_equality_constraint, __pyx_mstate->__pyx_n_u_restrictions_cleaned, __pyx_mstate->__pyx_n_u_restrictions_cleaned_unique, __pyx_mstate->__pyx_n_u_restrictions_unique_indices, __pyx_mstate->__pyx_n_u_parsed_restrictions, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_params_used, __pyx_mstate->__pyx_n_u_parsed_restriction, __pyx_mstate->__pyx_n_u_params_used_list, __pyx_mstate->__pyx_n_u_finalized_constraint, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i}; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_parse_restrictions, __pyx_k_Ya_1_Q2_U_F_U_6_Q_q_t4uA_d_4y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239, 177}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_picklable, __pyx_mstate->__pyx_n_u_parsed_restrictions, __pyx_mstate->__pyx_n_u_compiled_constraints, __pyx_mstate->__pyx_n_u_restriction, __pyx_mstate->__pyx_n_u_params_used, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_code_object, __pyx_mstate->__pyx_n_u_func_2}; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_parser_py, __pyx_mstate->__pyx_n_u_compile_to_constraints, __pyx_k_FBVVW_A_UUV__A_Qm1_q_9_gQm_q_1K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -12612,11 +11619,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif @@ -12738,7 +11739,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -12754,20 +11755,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -12781,8 +11798,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -12805,7 +11821,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -12852,55 +11869,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -12918,9 +11919,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -12930,9 +11928,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -12940,14 +11935,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -12956,14 +11945,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -13023,12 +12023,7 @@ static void __Pyx_RaiseDoubleKeywordsError( PyObject* kw_name) { PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } /* ParseKeywords */ @@ -13051,7 +12046,7 @@ static int __Pyx_ParseOptionalKeywords( Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); @@ -13094,38 +12089,11 @@ static int __Pyx_ParseOptionalKeywords( #endif Py_INCREF(value); name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**name) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); @@ -13144,8 +12112,8 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**argname) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -13172,15 +12140,9 @@ static int __Pyx_ParseOptionalKeywords( "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif bad: Py_XDECREF(key); Py_XDECREF(value); @@ -13192,23 +12154,44 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; @@ -13249,9 +12232,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -13259,19 +12240,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -13308,9 +12281,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -13319,17 +12290,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -13344,13 +12308,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -13369,13 +12328,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -13397,7 +12351,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -13426,12 +12380,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -13439,7 +12391,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else @@ -13453,10 +12405,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, (size_t)nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -13470,6 +12424,70 @@ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } +/* UnicodeConcatInPlace */ +# if CYTHON_COMPILING_IN_CPYTHON +static int +__Pyx_unicode_modifiable(PyObject *unicode) +{ + if (Py_REFCNT(unicode) != 1) + return 0; + if (!PyUnicode_CheckExact(unicode)) + return 0; + if (PyUnicode_CHECK_INTERNED(unicode)) + return 0; + return 1; +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right + #if CYTHON_REFNANNY + , void* __pyx_refnanny + #endif + ) { + PyObject *left = *p_left; + Py_ssize_t left_len, right_len, new_len; + if (unlikely(__Pyx_PyUnicode_READY(left) == -1)) + return NULL; + if (unlikely(__Pyx_PyUnicode_READY(right) == -1)) + return NULL; + left_len = PyUnicode_GET_LENGTH(left); + if (left_len == 0) { + Py_INCREF(right); + return right; + } + right_len = PyUnicode_GET_LENGTH(right); + if (right_len == 0) { + Py_INCREF(left); + return left; + } + if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) { + PyErr_SetString(PyExc_OverflowError, + "strings are too large to concat"); + return NULL; + } + new_len = left_len + right_len; + if (__Pyx_unicode_modifiable(left) + && PyUnicode_CheckExact(right) + && PyUnicode_KIND(right) <= PyUnicode_KIND(left) + && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) { + int ret; + __Pyx_GIVEREF(*p_left); + ret = PyUnicode_Resize(p_left, new_len); + __Pyx_GOTREF(*p_left); + if (unlikely(ret != 0)) + return NULL; + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; + #else + _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); + #endif + __Pyx_INCREF(*p_left); + __Pyx_GIVEREF(*p_left); + return *p_left; + } else { + return __Pyx_PyUnicode_Concat(left, right); + } + } +#endif + /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { @@ -13504,16 +12522,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } @@ -13521,16 +12530,23 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) +#elif !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif !CYTHON_AVOID_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = PyObject_GetItem(__pyx_mstate_global->__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -13545,24 +12561,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } -/* PyIntBinop */ +/* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; @@ -13662,40 +12666,22 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); double result; - PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif -/* PyIntBinop */ +/* PyLongBinop */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { +static PyObject* __Pyx_PyLong_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a - (unsigned long)b); - if (likely((x^a) >= 0 || (x^~b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_subtract(op1, op2); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; @@ -13795,16 +12781,10 @@ static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long int #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); double result; - PyFPE_START_PROTECT("subtract", return NULL) result = ((double)a) - (double)b; - PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2); @@ -13822,7 +12802,7 @@ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); @@ -13832,7 +12812,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -13840,7 +12820,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); @@ -13850,7 +12830,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -13858,13 +12838,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, n); } } else if (PyTuple_CheckExact(o)) { @@ -13878,7 +12856,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); + PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); @@ -13903,7 +12881,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } /* ObjectGetItem */ @@ -13927,7 +12905,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { @@ -13963,50 +12941,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -14020,7 +12957,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -14029,7 +12966,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -14045,74 +12982,28 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, #if CYTHON_USE_TYPE_SLOTS result = mp->mp_subscript(obj, py_slice); #else - result = PyObject_GetItem(obj, py_slice); -#endif - if (!_py_slice) { - Py_DECREF(py_slice); - } - return result; - } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); -bad: - return NULL; -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; + result = PyObject_GetItem(obj, py_slice); +#endif + if (!_py_slice) { + Py_DECREF(py_slice); } + return result; } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); +bad: + return NULL; } -#else + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* RaiseException */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -14197,9 +13088,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -14219,7 +13110,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE @@ -14341,12 +13231,10 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -14405,32 +13293,32 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* RaiseTooManyValuesToUnpack */ @@ -14521,7 +13409,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -14625,8 +13513,53 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec } #endif +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -14637,7 +13570,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -14653,10 +13591,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif Py_INCREF(key); Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -14674,16 +13621,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -14691,8 +13651,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -14717,11 +13694,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -14751,10 +13724,8 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -14766,12 +13737,7 @@ static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -14791,12 +13757,7 @@ static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -14976,9 +13937,8 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -14991,7 +13951,7 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); @@ -15002,10 +13962,39 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { ignore: PyErr_Clear(); } -#endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { @@ -15019,24 +14008,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif @@ -15044,23 +14033,21 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -15069,18 +14056,14 @@ static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -15122,8 +14105,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -15185,14 +14166,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -15209,6 +14183,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -15216,40 +14194,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __Pyx_VISIT_CONST(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -15271,7 +14238,7 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15279,24 +14246,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -15315,18 +14273,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -15334,16 +14283,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -15360,10 +14301,10 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -15375,11 +14316,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -15387,14 +14328,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -15404,21 +14340,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -15426,13 +14362,18 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15440,29 +14381,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -15470,29 +14420,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15500,17 +14459,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -15518,6 +14481,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -15525,12 +14494,17 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS @@ -15553,9 +14527,13 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif +#endif // CYTHON_METH_FASTCALL Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -15575,11 +14553,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #endif 0, 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else 0, -#endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, @@ -15601,11 +14575,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else offsetof(PyCFunctionObject, m_weakreflist), -#endif 0, 0, __pyx_CyFunction_methods, @@ -15628,9 +14598,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -#if PY_VERSION_HEX >= 0x030400a1 0, -#endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif @@ -15649,25 +14617,22 @@ static PyTypeObject __pyx_CyFunctionType_type = { }; #endif static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -15690,7 +14655,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -15715,6 +14680,12 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } +/* PyObjectCall2Args */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { + PyObject *args[3] = {NULL, arg1, arg2}; + return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -15737,11 +14708,7 @@ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; @@ -15784,13 +14751,9 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + } else if (flag == METH_FASTCALL) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } @@ -15798,81 +14761,70 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -15891,10 +14843,20 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } @@ -15926,11 +14888,7 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); @@ -15938,13 +14896,80 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { /* Globals */ static PyObject* __Pyx_Globals(void) { - return __Pyx_NewRef(__pyx_d); + return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); } -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg[2] = {NULL, NULL}; - return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +/* PyVersionSanityCheck */ +static int __Pyx_VersionSanityCheck(void) { + #if CYTHON_COMPILING_IN_CPYTHON + #if PY_VERSION_HEX < 0x03080000 + if (PySys_GetObject("gettotalrefcount")) { + #ifndef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a non-debug version of Python but imported into a debug version." + ); + return -1; + #endif + } else { + #ifdef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a debug version of Python but imported into a non-debug version." + ); + return -1; + #endif + } + #endif // Py_VERSION_HEX < 0x03080000 + #if PY_VERSION_HEX >= 0x030d0000 + if (PyRun_SimpleStringFlags( + "if " + #ifdef Py_GIL_DISABLED + "not " + #endif + "__import__('sysconfig').get_config_var('Py_GIL_DISABLED'): raise ImportError", + NULL + ) == -1) { + PyErr_SetString( + PyExc_ImportError, + #ifdef Py_GIL_DISABLED + "Module was compiled with a freethreading build of Python but imported into a non-freethreading build." + #else + "Module was compiled with a non-freethreading build of Python but imported into a freethreading build." + #endif + ); + return -1; + } + #endif // version hex 3.13+ + if (PySys_GetObject("getobjects")) { + #ifndef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled without Py_TRACE_REFS but imported into a build of Python with." + ); + return -1; + #endif + } else { + #ifdef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with Py_TRACE_REFS but imported into a build of Python without." + ); + return -1; + #endif + } + const char code[] = "if __import__('sys').getsizeof(object()) != %u: raise ImportError"; + char formattedCode[sizeof(code)+50]; + PyOS_snprintf(formattedCode, sizeof(formattedCode), code, (unsigned int)sizeof(PyObject)); + if (PyRun_SimpleStringFlags(formattedCode, NULL) == -1) { + PyErr_SetString( + PyExc_ImportError, + "Runtime and compile-time PyObject size do not match." + ); + return -1; + } + #endif + return 0; } /* PyObjectGetMethod */ @@ -15970,18 +14995,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -16021,13 +15040,8 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -16068,14 +15082,15 @@ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -16084,18 +15099,6 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) @@ -16112,7 +15115,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -16132,7 +15135,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -16162,7 +15165,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -16171,12 +15174,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -16184,7 +15188,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -16203,7 +15207,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -16212,7 +15216,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -16231,114 +15235,50 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + Py_ssize_t size; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(parts_tuple); +#else + size = PyTuple_Size(parts_tuple); + if (size < 0) goto bad; +#endif + if (likely(size == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); @@ -16350,28 +15290,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -16382,17 +15312,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; +#if CYTHON_ASSUME_SAFE_SIZE nparts = PyTuple_GET_SIZE(parts_tuple); +#else + nparts = PyTuple_Size(parts_tuple); + if (nparts < 0) return NULL; +#endif for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else - part = PySequence_ITEM(parts_tuple, i); + part = __Pyx_PySequence_ITEM(parts_tuple, i); + if (!part) return NULL; #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -16406,20 +15340,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__14; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -16431,15 +15352,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; @@ -16459,6 +15379,25 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) return __Pyx__ImportDottedModule(name, parts_tuple); } +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_kp_u__21); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -16492,18 +15432,13 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -16511,20 +15446,20 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -16535,7 +15470,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; @@ -16546,7 +15481,6 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -16568,8 +15502,8 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; @@ -16582,7 +15516,8 @@ static PyCodeObject *__pyx_find_code_object(int code_line) { Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { @@ -16602,7 +15537,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; @@ -16625,7 +15560,6 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } -#endif /* AddTraceback */ #include "compile.h" @@ -16645,8 +15579,7 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } @@ -16686,20 +15619,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -16725,58 +15664,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -16807,7 +15705,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -16819,8 +15717,40 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } #endif +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16832,7 +15762,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG @@ -16842,7 +15772,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -16863,25 +15793,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -16896,11 +15826,11 @@ static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); + __pyx_mstate_global->__pyx_n_u_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__42); + name = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__22); } return name; } @@ -16929,7 +15859,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16939,24 +15869,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -17196,7 +16113,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -17206,24 +16123,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -17503,29 +16407,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -17533,21 +16414,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif } /* PyObjectCallMethod1 */ @@ -17666,7 +16558,53 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif } +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async) { + if (value == Py_None) { + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if (PY_VERSION_HEX >= 0x030C00A6 + || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -17674,7 +16612,14 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -17692,20 +16637,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -17733,27 +16693,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -17790,26 +16758,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -17820,26 +16769,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -17849,7 +16794,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -17895,10 +16840,14 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -17925,17 +16874,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif + PyObject *exc = + #ifdef __Pyx_AsyncGen_USED + __Pyx_AsyncGen_CheckExact(gen) ? PyExc_StopAsyncIteration : + #endif + PyExc_StopIteration; __Pyx_PyErr_SetNone(exc); } } return retval; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async); + Py_XDECREF(retval); + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -17972,25 +16936,57 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult result; + gen->is_running = 1; + result = gen_am_send(gen->yieldfrom, value, &ret); + gen->is_running = 0; + if (result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + return __Pyx_Coroutine_SendEx(gen, ret, retval, 0); +} +#endif +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -18006,66 +17002,65 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } gen->is_running = 0; if (likely(ret)) { - return ret; + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; + result = PYGEN_RETURN; gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -18073,20 +17068,29 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(gen->is_running)) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED @@ -18094,36 +17098,47 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); gen->is_running = 0; if (likely(ret)) { return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; + __Pyx_PySendResult result; PyObject *yf = gen->yieldfrom; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -18132,10 +17147,23 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -18143,25 +17171,14 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { @@ -18170,6 +17187,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -18177,7 +17195,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } gen->is_running = 1; @@ -18195,7 +17213,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { @@ -18216,20 +17234,25 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(self, ret); + if (ret) + return ret; + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -18244,6 +17267,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -18253,7 +17280,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -18274,10 +17301,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -18296,6 +17326,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if !(CYTHON_USE_TYPE_SPECS && !CYTHON_USE_TP_FINALIZE) static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -18332,42 +17363,18 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); @@ -18377,9 +17384,13 @@ static void __Pyx_Coroutine_del(PyObject *self) { return; } { +#if !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); +#else + #error __Pyx_Coroutine_del with Limited API and without CYTHON_USE_TP_FINALIZE should never be compiled +#endif } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && @@ -18392,6 +17403,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif #endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -18405,12 +17417,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -18432,12 +17439,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -18449,6 +17451,7 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { @@ -18458,7 +17461,7 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) @@ -18467,6 +17470,11 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) } Py_INCREF(frame); return frame; +#else + CYTHON_UNUSED_VAR(self); + CYTHON_UNUSED_VAR(context); + Py_RETURN_NONE; +#endif } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -18486,7 +17494,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -18510,131 +17519,34 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( return gen; } -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, + {"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + PyDoc_STR("object being iterated by 'yield from', or None")}, + {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS @@ -18646,9 +17558,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -18660,6 +17575,12 @@ static PyType_Spec __pyx_GeneratorType_spec = { __pyx_GeneratorType_slots }; #else +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async = { + 0, + 0, + 0, + __Pyx_Coroutine_AmSend, +}; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", @@ -18669,6 +17590,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, + __Pyx_SlotTpAsAsync(__pyx_Generator_as_async), 0, 0, 0, @@ -18679,8 +17601,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, @@ -18714,7 +17635,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 +#else 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) @@ -18735,45 +17656,60 @@ static PyTypeObject __pyx_GeneratorType_type = { }; #endif static int __pyx_Generator_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif - if (unlikely(!__pyx_GeneratorType)) { + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -18796,45 +17732,164 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject* filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000)) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -18862,31 +17917,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -18898,16 +17952,12 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif @@ -18939,9 +17989,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -18955,74 +18004,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -19068,23 +18087,19 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } @@ -19092,8 +18107,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } diff --git a/constraint/problem.c b/constraint/problem.c index 18c4f48..e42617a 100644 --- a/constraint/problem.c +++ b/constraint/problem.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.0a1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_0a1" +#define CYTHON_HEX_VERSION 0x030100A1 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,8 +178,13 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,7 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -248,11 +246,17 @@ END: Cython Metadata */ #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -262,80 +266,20 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 - #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +288,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +309,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +342,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +519,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +536,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,62 +551,12 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif @@ -673,31 +578,6 @@ END: Cython Metadata */ #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) @@ -757,7 +637,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +675,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -836,8 +716,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +730,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +742,40 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +799,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +815,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +844,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +857,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +867,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,26 +884,69 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && PY_VERSION_HEX >= 0x030d00b1 +#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS +#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +#endif +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItem(dict, key); + if (*result == NULL) { + return 0; + } + Py_INCREF(*result); + return 1; +} +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (PyErr_Occurred()) { + return -1; + } else if (*result == NULL) { + return 0; + } + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) @@ -1132,64 +957,48 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject +#define PyBoolObject PyLongObject +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + #define __Pyx_pyiter_sendfunc sendfunc #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 +#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND && __PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif + #define __Pyx_SlotTpAsAsync(s) (&(s)) #else - #define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)&(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1209,8 +1018,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1060,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1104,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1127,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1211,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,26 +1228,38 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/problem.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ @@ -1501,13 +1272,13 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr; -/* "constraint/problem.py":151 +/* "constraint/problem.py":162 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1515,26 +1286,26 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr { }; -/* "constraint/problem.py":226 +/* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList { PyObject_HEAD PyObject *__pyx_v_get_in_order; }; -/* "constraint/problem.py":230 +/* "constraint/problem.py":241 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1542,13 +1313,13 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr { }; -/* "constraint/problem.py":232 +/* "constraint/problem.py":243 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_outer_scope; @@ -1557,13 +1328,13 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr { }; -/* "constraint/problem.py":275 +/* "constraint/problem.py":286 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< * * vconstraints = {} - */ +*/ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; @@ -1590,7 +1361,6 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1604,11 +1374,6 @@ struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1720,6 +1485,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1753,10 +1520,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) @@ -1775,9 +1542,12 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1825,7 +1595,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -1856,12 +1626,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1892,6 +1656,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) @@ -1901,30 +1668,39 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif -/* SliceObject.proto */ -#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ - __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) -static CYTHON_INLINE int __Pyx_PyObject_SetSlice( - PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** py_start, PyObject** py_stop, PyObject** py_slice, - int has_cstart, int has_cstop, int wraparound); - -/* PySequenceContains.proto */ -static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} +/* AssertionsEnabled.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) + static int __pyx_assertions_enabled_flag; + #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) + static int __Pyx_init_assertions_enabled(void) { + PyObject *builtins, *debug, *debug_str; + int flag; + builtins = PyEval_GetBuiltins(); + if (!builtins) goto bad; + debug_str = PyUnicode_FromStringAndSize("__debug__", 9); + if (!debug_str) goto bad; + debug = PyObject_GetItem(builtins, debug_str); + Py_DECREF(debug_str); + if (!debug) goto bad; + flag = PyObject_IsTrue(debug); + Py_DECREF(debug); + if (flag == -1) goto bad; + __pyx_assertions_enabled_flag = flag; + return 0; + bad: + __pyx_assertions_enabled_flag = 1; + return -1; + } +#else + #define __Pyx_init_assertions_enabled() (0) + #define __pyx_assertions_enabled() (!Py_OptimizeFlag) +#endif /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -1937,17 +1713,39 @@ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* s PyObject_Format(s, f)) #endif -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); -/* GetAttr.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* SliceObject.proto */ +#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\ + __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) +static CYTHON_INLINE int __Pyx_PyObject_SetSlice( + PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** py_start, PyObject** py_stop, PyObject** py_slice, + int has_cstart, int has_cstop, int wraparound); + +/* PySequenceContains.proto */ +static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + +/* PyUnicode_Unicode.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* HasAttr.proto */ +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n) +#else static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); +#endif /* RaiseUnboundLocalError.proto */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); @@ -1996,44 +1794,31 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); -/* AssertionsEnabled.proto */ -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (1) -#elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000) - static int __pyx_assertions_enabled_flag; - #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag) - static int __Pyx_init_assertions_enabled(void) { - PyObject *builtins, *debug, *debug_str; - int flag; - builtins = PyEval_GetBuiltins(); - if (!builtins) goto bad; - debug_str = PyUnicode_FromStringAndSize("__debug__", 9); - if (!debug_str) goto bad; - debug = PyObject_GetItem(builtins, debug_str); - Py_DECREF(debug_str); - if (!debug) goto bad; - flag = PyObject_IsTrue(debug); - Py_DECREF(debug); - if (flag == -1) goto bad; - __pyx_assertions_enabled_flag = flag; - return 0; - bad: - __pyx_assertions_enabled_flag = 1; - return -1; - } -#else - #define __Pyx_init_assertions_enabled() (0) - #define __pyx_assertions_enabled() (!Py_OptimizeFlag) -#endif - /* CallableCheck.proto */ -#if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 +#if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) PyDict_New() +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); @@ -2080,7 +1865,7 @@ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); /* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) #else @@ -2098,7 +1883,7 @@ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right)) /* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ @@ -2117,9 +1902,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t #define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop) #endif -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); @@ -2130,12 +1912,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2147,8 +1925,15 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict); -/* IncludeStructmemberH.proto */ -#include +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); +#endif + +/* PyVersionSanityCheck.proto */ +static int __Pyx_VersionSanityCheck(void); /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS @@ -2163,25 +1948,35 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + /* FetchSharedCythonModule.proto */ static PyObject *__Pyx_FetchSharedCythonABIModule(void); @@ -2193,34 +1988,10 @@ static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec #endif /* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} -#else - #define __Pyx_PyMethod_New PyMethod_New -#endif +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2254,10 +2025,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2270,9 +2042,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2281,9 +2051,9 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) @@ -2293,9 +2063,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2308,7 +2077,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2323,7 +2092,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject* code); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2353,16 +2122,20 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { @@ -2372,9 +2145,8 @@ struct __Pyx_CodeObjectCache { }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2399,13 +2171,13 @@ typedef const char *__Pyx_TypeName; #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2419,25 +2191,16 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) - -/* GetTopmostException.proto */ -#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE -static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); -#endif - -/* SaveResetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) #else -#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) -#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) #endif /* SwapException.proto */ @@ -2448,6 +2211,15 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* IterNextPlain.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); +#endif + +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2468,11 +2240,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2484,8 +2261,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2510,28 +2288,45 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #define __PYX_LIMITED_ABI_SUFFIX "limited" +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.problem" */ /* #### Code section: typeinfo ### */ @@ -2542,30 +2337,39 @@ int __pyx_module_is_main_constraint__problem = 0; /* Implementation of "constraint.problem" */ /* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_ImportError; +static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_range; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = ")."; +static const char __pyx_k_Q[] = "\230Q"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_v[] = "v"; -static const char __pyx_k__4[] = "*"; -static const char __pyx_k__5[] = "."; +static const char __pyx_k__2[] = "."; +static const char __pyx_k__3[] = "?"; +static const char __pyx_k__4[] = "\240\021"; +static const char __pyx_k__5[] = "\240\001"; +static const char __pyx_k__6[] = "_"; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__28[] = "_"; -static const char __pyx_k__32[] = "?"; +static const char __pyx_k_Q_2[] = "\240Q"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_msg[] = "msg"; +static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_args[] = "args"; +static const char __pyx_k_A_Kq[] = "\200A\360\032\000\t\r\210K\220q"; +static const char __pyx_k_A_t1[] = "\200A\360\030\000\t\020\210t\2201"; +static const char __pyx_k_None[] = "None"; static const char __pyx_k_bool[] = "bool"; static const char __pyx_k_copy[] = "copy"; -static const char __pyx_k_dict[] = "__dict__"; +static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_spec[] = "__spec__"; @@ -2577,22 +2381,23 @@ static const char __pyx_k_close[] = "close"; static const char __pyx_k_order[] = "order"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_reset[] = "reset"; -static const char __pyx_k_super[] = "super"; static const char __pyx_k_throw[] = "throw"; +static const char __pyx_k_value[] = "value"; static const char __pyx_k_Domain[] = "Domain"; static const char __pyx_k_Solver[] = "Solver"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_extend[] = "extend"; -static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_params[] = "params"; static const char __pyx_k_parsed[] = "parsed"; static const char __pyx_k_return[] = "return"; static const char __pyx_k_solver[] = "solver"; static const char __pyx_k_typing[] = "typing"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_Problem[] = "Problem"; +static const char __pyx_k_a_L_AZq[] = "\320\004&\240a\360(\000\t\r\210L\230\001\330\014\020\220\014\230A\230Z\240q"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_domains[] = "domains"; static const char __pyx_k_genexpr[] = "genexpr"; @@ -2603,15 +2408,17 @@ static const char __pyx_k_Callable[] = "Callable"; static const char __pyx_k_Hashable[] = "Hashable"; static const char __pyx_k_Optional[] = "Optional"; static const char __pyx_k_Sequence[] = "Sequence"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_deepcopy[] = "deepcopy"; static const char __pyx_k_list_str[] = "list[str]"; static const char __pyx_k_operator[] = "operator"; static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; +static const char __pyx_k_solution[] = "solution"; static const char __pyx_k_solver_2[] = "_solver"; static const char __pyx_k_validate[] = "validate"; static const char __pyx_k_variable[] = "variable"; static const char __pyx_k_warnings[] = "warnings"; +static const char __pyx_k_A_D_Q_KvQ[] = "\200A\360\024\000\t\r\210D\220\r\230Q\330\010\014\210K\220v\230Q"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_getSolver[] = "getSolver"; static const char __pyx_k_isenabled[] = "isenabled"; @@ -2629,6 +2436,7 @@ static const char __pyx_k_itemgetter[] = "itemgetter"; static const char __pyx_k_list_tuple[] = "list[tuple]"; static const char __pyx_k_preProcess[] = "preProcess"; static const char __pyx_k_resetState[] = "resetState"; +static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_addVariable[] = "addVariable"; static const char __pyx_k_constraints[] = "_constraints"; static const char __pyx_k_getSolution[] = "getSolution"; @@ -2639,14 +2447,16 @@ static const char __pyx_k_getSolutions[] = "getSolutions"; static const char __pyx_k_get_in_order[] = "get_in_order"; static const char __pyx_k_initializing[] = "_initializing"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_process_mode[] = "_process_mode"; static const char __pyx_k_vconstraints[] = "vconstraints"; static const char __pyx_k_Problem_reset[] = "Problem.reset"; static const char __pyx_k_addConstraint[] = "addConstraint"; static const char __pyx_k_constraints_2[] = "constraints"; -static const char __pyx_k_init_subclass[] = "__init_subclass__"; +static const char __pyx_k_freethreading[] = "freethreading"; static const char __pyx_k_AssertionError[] = "AssertionError"; static const char __pyx_k_ParallelSolver[] = "ParallelSolver"; static const char __pyx_k_Problem___init[] = "Problem.__init__"; +static const char __pyx_k_is_gil_enabled[] = "_is_gil_enabled"; static const char __pyx_k_solutions_dict[] = "solutions_dict"; static const char __pyx_k_solutions_list[] = "solutions_list"; static const char __pyx_k_Domain_is_empty[] = "Domain is empty"; @@ -2665,33 +2475,43 @@ static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_constraint_problem[] = "constraint.problem"; static const char __pyx_k_constraint_solvers[] = "constraint.solvers"; +static const char __pyx_k_A_oT_T_QR_4q_1_t8_q[] = "\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230=\250\001\250\031\260-\270q"; static const char __pyx_k_Problem_addVariable[] = "Problem.addVariable"; static const char __pyx_k_Problem_getSolution[] = "Problem.getSolution"; static const char __pyx_k_Problem_addVariables[] = "Problem.addVariables"; static const char __pyx_k_Problem_getSolutions[] = "Problem.getSolutions"; +static const char __pyx_k_A_oT_T_QR_4q_1_t8_q_a[] = "\200A\360\034\000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2201\330\010\017\210t\2208\230<\240q\250\t\260\035\270a"; +static const char __pyx_k_A_oT_T_QR_4q_4q_t8_1I[] = "\200A\360 \000\t\022\220\035\230o\250T\260\031\270!\270:\300T\310\030\320QR\330\010\013\2104\210q\330\014\023\2204\220q\230\001\330\010\017\210t\2208\320\033+\2501\250I\260]\300!"; static const char __pyx_k_Problem_addConstraint[] = "Problem.addConstraint"; -static const char __pyx_k_Problem_reset_line_33[] = "Problem.reset (line 33)"; +static const char __pyx_k_Problem_reset_line_44[] = "Problem.reset (line 44)"; static const char __pyx_k_constraint_problem_py[] = "constraint/problem.py"; +static const char __pyx_k_g_B_M_6_E_Cq_s_vQ_z_1[] = "\320\004&\240g\320-B\300!\340\010 \240\004\240M\260\021\330\010\013\2106\220\023\220E\230\023\230C\230q\240\007\240s\250!\330\014\027\220v\230Q\330\010\027\220z\240\022\2401\330\010\023\220=\240\001"; static const char __pyx_k_compile_to_constraints[] = "compile_to_constraints"; static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; static const char __pyx_k_getSolutionsAsListDict[] = "getSolutionsAsListDict"; static const char __pyx_k_Problem_getSolutionIter[] = "Problem.getSolutionIter"; static const char __pyx_k_getSolutionsOrderedList[] = "getSolutionsOrderedList"; -static const char __pyx_k_Problem_getSolver_line_61[] = "Problem.getSolver (line 61)"; -static const char __pyx_k_Problem_setSolver_line_46[] = "Problem.setSolver (line 46)"; +static const char __pyx_k_Problem_getSolver_line_72[] = "Problem.getSolver (line 72)"; +static const char __pyx_k_Problem_setSolver_line_57[] = "Problem.setSolver (line 57)"; static const char __pyx_k_OptimizedBacktrackingSolver[] = "OptimizedBacktrackingSolver"; -static const char __pyx_k_Problem_addVariable_line_75[] = "Problem.addVariable (line 75)"; +static const char __pyx_k_Problem_addVariable_line_86[] = "Problem.addVariable (line 86)"; static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; -static const char __pyx_k_Problem_getSolution_line_167[] = "Problem.getSolution (line 167)"; -static const char __pyx_k_Problem_addVariables_line_105[] = "Problem.addVariables (line 105)"; -static const char __pyx_k_Problem_getSolutions_line_186[] = "Problem.getSolutions (line 186)"; +static const char __pyx_k_Problem_getSolution_line_178[] = "Problem.getSolution (line 178)"; +static const char __pyx_k_Problem_addVariables_line_116[] = "Problem.addVariables (line 116)"; +static const char __pyx_k_Problem_getSolutions_line_197[] = "Problem.getSolutions (line 197)"; static const char __pyx_k_Union_Constraint_Callable_str[] = "Union[Constraint, Callable, str]"; -static const char __pyx_k_Problem_addConstraint_line_128[] = "Problem.addConstraint (line 128)"; +static const char __pyx_k_A_9Ct1_D_AQ_Qha_T_1_AXQ_V1A_1A[] = "\320\004$\240A\360 \000\t\014\2109\220C\220t\2301\330\014\022\220\"\320\024<\270D\300\001\300\021\330\014\022\220*\230A\230Q\330\010\013\210:\220Q\220h\230a\330\014\025\220T\230\031\240!\2401\330\r\024\220A\220X\230Q\330\014\025\220V\2301\230A\340\014\022\220!\330\014\022\220)\2301\230A\330\010\013\2104\210q\330\014\022\220*\230A\230Q\330\010\014\210K\220q\230\014\240A"; +static const char __pyx_k_Problem_addConstraint_line_139[] = "Problem.addConstraint (line 139)"; static const char __pyx_k_Problem_getSolutionsAsListDict[] = "Problem.getSolutionsAsListDict"; +static const char __pyx_k_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs[] = "\320\004\027\220q\330\010\022\220$\220k\240\025\240a\330\010\027\220w\230e\2401\330\0105\260Q\360\006\000\t\014\2103\210a\210t\320\023&\240b\250\001\340\014\020\220\016\230d\240!\330\020\031\320\031/\250q\260\001\260\035\270i\300z\320QR\330\020\024\220C\220s\230%\230q\330\024\030\230\016\240a\240s\250!\360\006\000\t\r\210L\230\r\240T\250\021\330\014\017\210t\2201\330\020\034\230D\240\001\240\021\330\014\027\220w\230b\240\014\250A\360\006\000\t\014\2101\330\014\023\320\023%\320%Y\320YZ\340\010\027\220q\330\010\014\210L\230\001\330\014\030\230\001\230\034\240Q\330\010\014\210L\230\r\240Q\330\014\020\220\014\230A\330\020\034\230A\230Y\240g\250R\250|\2701\330\010\014\210L\230\r\240[\260\001\330\014\026\220k\240\021\240+\250Y\260m\3001\330\010\014\210J\220g\230W\240A\330\014\022\220+\230Q\330\014\017\210t\2201\330\020\027\220v\230V\2401\340\010\017\210y\230\r\240Q"; +static const char __pyx_k_xq_Kwc_A_1_2_z_j_3ddhhiimmn_Qd[] = "\320\004\027\220x\230q\360\014\000\t\r\210K\220w\230c\320!<\270A\330\010\014\320\014:\270!\330\010\014\320\014+\2501\330\010\014\320\0142\260!\360\006\000\t\020\210z\230\021\230$\230j\250\t\260\022\3203d\320dh\320hi\320im\320mn\360\006\000\t\014\210:\220Q\220d\230*\240A\330\014\020\220\001\220\021\330\014\017\210t\2204\220x\230\250d\260$\260a\330\020\024\220A\220Q"; +static const char __pyx_k_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j[] = "\200A\330\016\025\320\025'\240z\260\021\330\t\n\340\010\031\230\024\320\0355\260Q\260a\330\010\024\220C\220q\230\001\330\010\037\230t\2401\240C\240q\320(8\270\005\270Q\270a\330\010\013\2101\340\014\030\230\003\2301\230A\330\014\017\210z\230\023\230A\330\020\026\220j\240\001\330\024\026\220d\230*\240B\240a\340\010\t\330\014\r\330\014\r\330\014\r"; static const char __pyx_k_Add_a_constraint_to_the_problem[] = "Add a constraint to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b == a+1, [\"a\", \"b\"])\n >>> problem.addConstraint(\"b == a+1 and a+b >= 2\") # experimental string format, automatically parsed, preferable over callables\n >>> solutions = problem.getSolutions()\n >>>\n\n Args:\n constraint (instance of :py:class:`Constraint`, function to be wrapped by :py:class:`FunctionConstraint`, or string expression):\n Constraint to be included in the problem. Can be either a Constraint, a callable (function or lambda), or Python-evaluable string expression that will be parsed automatically.\n variables (set or sequence of variables): :py:class:`Variables` affected\n by the constraint (default to all variables). Depending\n on the constraint type the order may be important.\n "; +static const char __pyx_k_J_UV_Ql_q_A_Bnno_4z_a_xq_q_1L_9[] = "\320\004(\320(J\310+\320UV\360&\000\t\014\210:\220Q\220l\240!\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\330\r\027\220q\230\014\240A\330\014!\320!@\300\002\320Bn\320no\330\014\020\320\020!\240\027\250\001\250\021\330\014\r\360\006\000\t\014\2104\210z\230\021\230,\240a\330\014\017\210x\220q\230\001\340\020\035\320\035/\250q\260\001\330\021\033\2301\230L\250\001\330\020\035\320\0359\270\021\270!\340\020\026\220a\330\020\026\220j\240\001\240\021\330\010\014\210M\230\027\240\002\240,\250a"; static const char __pyx_k_Problem__getArgs_locals_genexpr[] = "Problem._getArgs..genexpr"; static const char __pyx_k_Problem_getSolutionsOrderedList[] = "Problem.getSolutionsOrderedList..genexpr"; static const char __pyx_k_duplicate_parameter_configurati[] = " duplicate parameter configurations in searchspace, should not happen."; +static const char __pyx_k_solver_is_not_instance_of_Solve[] = "`solver` is not instance of Solver class (is "; static const char __pyx_k_tuple_list_tuple_dict_tuple_int[] = "tuple[list[tuple], dict[tuple, int], int]"; static const char __pyx_k_Add_a_variable_to_the_problem_Ex[] = "Add a variable to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.getSolution() in ({'a': 1}, {'a': 2})\n True\n\n Args:\n variable (hashable object): Object representing a problem\n variable\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variable may\n assume\n "; static const char __pyx_k_Add_one_or_more_variables_to_the[] = "Add one or more variables to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> solutions = problem.getSolutions()\n >>> len(solutions)\n 9\n >>> {'a': 3, 'b': 1} in solutions\n True\n\n Args:\n variables (sequence of hashable objects): Any object\n containing a sequence of objects represeting problem\n variables\n domain (list, tuple, or instance of :py:class:`Domain`): Set of items\n defining the possible values that the given variables\n may assume\n "; @@ -2703,13 +2523,15 @@ static const char __pyx_k_Expected_constraints_to_be_strin[] = "Expected constra static const char __pyx_k_Find_and_return_a_solution_to_th[] = "Find and return a solution to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolution() is None\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolution()\n {'a': 42}\n\n Returns:\n dictionary mapping variables to values: Solution for the problem\n "; static const char __pyx_k_Find_and_return_all_solutions_to[] = "Find and return all solutions to the problem.\n\n Example:\n >>> problem = Problem()\n >>> problem.getSolutions() == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> problem.getSolutions()\n [{'a': 42}]\n\n Returns:\n list of dictionaries mapping variables to values: All solutions for the problem\n "; static const char __pyx_k_Module_containing_the_code_for_p[] = "Module containing the code for problem definitions."; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; static const char __pyx_k_Obtain_the_problem_solver_curren[] = "Obtain the problem solver currently in use.\n\n Example:\n >>> solver = OptimizedBacktrackingSolver()\n >>> problem = Problem(solver)\n >>> problem.getSolver() is solver\n True\n\n Returns:\n instance of a :py:class:`Solver` subclass: Solver currently in use\n "; static const char __pyx_k_ParallelSolver_is_currently_expe[] = "ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues."; static const char __pyx_k_Problem_addConstraint_locals_gen[] = "Problem.addConstraint..genexpr"; -static const char __pyx_k_Problem_getSolutionIter_line_205[] = "Problem.getSolutionIter (line 205)"; +static const char __pyx_k_Problem_getSolutionIter_line_216[] = "Problem.getSolutionIter (line 216)"; static const char __pyx_k_Reset_the_current_problem_defini[] = "Reset the current problem definition.\n\n Example:\n >>> problem = Problem()\n >>> problem.addVariable(\"a\", [1, 2])\n >>> problem.reset()\n >>> problem.getSolution()\n >>>\n "; static const char __pyx_k_Return_an_iterator_to_the_soluti[] = "Return an iterator to the solutions of the problem.\n\n Example:\n >>> problem = Problem()\n >>> list(problem.getSolutionIter()) == []\n True\n >>> problem.addVariables([\"a\"], [42])\n >>> iter = problem.getSolutionIter()\n >>> next(iter)\n {'a': 42}\n >>> next(iter)\n Traceback (most recent call last):\n ...\n StopIteration\n "; static const char __pyx_k_Tried_to_insert_duplicated_varia[] = "Tried to insert duplicated variable "; +static const char __pyx_k_Using_the_ParallelSolver_in_Thre[] = "Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance."; static const char __pyx_k_You_have_used_FunctionConstraint[] = "You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)"; static const char __pyx_k_Problem_getSolutionsOrderedList_2[] = "Problem.getSolutionsOrderedList"; /* #### Code section: decls ### */ @@ -2737,14 +2559,25 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ -typedef struct { - PyObject *__pyx_d; - PyObject *__pyx_b; - PyObject *__pyx_cython_runtime; - PyObject *__pyx_empty_tuple; - PyObject *__pyx_empty_bytes; - PyObject *__pyx_empty_unicode; - #ifdef __Pyx_CyFunction_USED +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED PyTypeObject *__pyx_CyFunctionType; #endif #ifdef __Pyx_FusedFunction_USED @@ -2762,238 +2595,257 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; - #endif PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr; - PyObject *__pyx_kp_u_Add_a_constraint_to_the_problem; - PyObject *__pyx_kp_u_Add_a_variable_to_the_problem_Ex; - PyObject *__pyx_kp_u_Add_one_or_more_variables_to_the; - PyObject *__pyx_n_s_AssertionError; - PyObject *__pyx_n_s_Callable; - PyObject *__pyx_kp_u_Change_the_problem_solver_curren; - PyObject *__pyx_kp_s_Class_used_to_define_a_problem_a; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_kp_u_Constraints_must_be_instances_of; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_kp_u_Domain_is_empty; - PyObject *__pyx_kp_u_Domains_must_be_instances_of_sub; - PyObject *__pyx_kp_u_Expected_constraints_to_be_strin; - PyObject *__pyx_kp_u_Find_and_return_a_solution_to_th; - PyObject *__pyx_kp_u_Find_and_return_all_solutions_to; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_Hashable; - PyObject *__pyx_kp_u_Obtain_the_problem_solver_curren; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver; - PyObject *__pyx_n_s_Optional; - PyObject *__pyx_kp_s_Optional_Sequence; - PyObject *__pyx_n_s_ParallelSolver; - PyObject *__pyx_kp_u_ParallelSolver_is_currently_expe; - PyObject *__pyx_n_s_Problem; - PyObject *__pyx_n_s_Problem___init; - PyObject *__pyx_n_s_Problem__getArgs; - PyObject *__pyx_n_s_Problem__getArgs_locals_genexpr; - PyObject *__pyx_n_s_Problem_addConstraint; - PyObject *__pyx_kp_u_Problem_addConstraint_line_128; - PyObject *__pyx_n_s_Problem_addConstraint_locals_gen; - PyObject *__pyx_n_s_Problem_addVariable; - PyObject *__pyx_kp_u_Problem_addVariable_line_75; - PyObject *__pyx_n_s_Problem_addVariables; - PyObject *__pyx_kp_u_Problem_addVariables_line_105; - PyObject *__pyx_n_s_Problem_getSolution; - PyObject *__pyx_n_s_Problem_getSolutionIter; - PyObject *__pyx_kp_u_Problem_getSolutionIter_line_205; - PyObject *__pyx_kp_u_Problem_getSolution_line_167; - PyObject *__pyx_n_s_Problem_getSolutions; - PyObject *__pyx_n_s_Problem_getSolutionsAsListDict; - PyObject *__pyx_n_s_Problem_getSolutionsOrderedList; - PyObject *__pyx_n_s_Problem_getSolutionsOrderedList_2; - PyObject *__pyx_kp_u_Problem_getSolutions_line_186; - PyObject *__pyx_n_s_Problem_getSolver; - PyObject *__pyx_kp_u_Problem_getSolver_line_61; - PyObject *__pyx_n_s_Problem_reset; - PyObject *__pyx_kp_u_Problem_reset_line_33; - PyObject *__pyx_n_s_Problem_setSolver; - PyObject *__pyx_kp_u_Problem_setSolver_line_46; - PyObject *__pyx_kp_u_Reset_the_current_problem_defini; - PyObject *__pyx_kp_u_Return_an_iterator_to_the_soluti; - PyObject *__pyx_n_s_Sequence; - PyObject *__pyx_n_s_Solver; - PyObject *__pyx_kp_u_Tried_to_insert_duplicated_varia; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s_Union; - PyObject *__pyx_kp_s_Union_Constraint_Callable_str; - PyObject *__pyx_n_s_ValueError; - PyObject *__pyx_kp_u_You_have_used_FunctionConstraint; - PyObject *__pyx_n_s__28; - PyObject *__pyx_n_s__32; - PyObject *__pyx_n_s__4; - PyObject *__pyx_kp_u__5; - PyObject *__pyx_n_s_addConstraint; - PyObject *__pyx_n_s_addVariable; - PyObject *__pyx_n_s_addVariables; - PyObject *__pyx_n_s_allvariables; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_c; - PyObject *__pyx_n_s_clear; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_compile_to_constraints; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraint_parser; - PyObject *__pyx_n_s_constraint_problem; - PyObject *__pyx_kp_s_constraint_problem_py; - PyObject *__pyx_n_s_constraint_solvers; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_constraints_2; - PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_deepcopy; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_duplicate_parameter_configurati; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_extend; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_getArgs; - PyObject *__pyx_n_s_getSolution; - PyObject *__pyx_n_s_getSolutionIter; - PyObject *__pyx_n_s_getSolutions; - PyObject *__pyx_n_s_getSolutionsAsListDict; - PyObject *__pyx_n_s_getSolutionsOrderedList; - PyObject *__pyx_n_s_getSolver; - PyObject *__pyx_n_s_get_in_order; - PyObject *__pyx_n_u_getitem; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_itemgetter; - PyObject *__pyx_n_s_keys; - PyObject *__pyx_kp_s_list_str; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_msg; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_operator; - PyObject *__pyx_n_s_order; - PyObject *__pyx_n_s_parsed; - PyObject *__pyx_n_s_picklable; - PyObject *__pyx_n_s_preProcess; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_requires_pickling; - PyObject *__pyx_n_s_reset; - PyObject *__pyx_n_s_resetState; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_setSolver; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_size_dict; - PyObject *__pyx_n_s_size_list; - PyObject *__pyx_n_s_solutions; - PyObject *__pyx_n_s_solutions_dict; - PyObject *__pyx_n_s_solutions_list; - PyObject *__pyx_n_s_solver; - PyObject *__pyx_n_s_solver_2; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_str_constraints; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_kp_s_tuple_list_tuple_dict_tuple_int; - PyObject *__pyx_n_s_typing; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_validate; - PyObject *__pyx_n_s_values; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_variables_2; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_warn; - PyObject *__pyx_n_s_warnings; - PyObject *__pyx_n_s_zip; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__6; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__9; - PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__15; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__19; - PyObject *__pyx_tuple__23; - PyObject *__pyx_tuple__25; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__29; - PyObject *__pyx_tuple__31; - PyObject *__pyx_codeobj__7; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__20; - PyObject *__pyx_codeobj__21; - PyObject *__pyx_codeobj__22; - PyObject *__pyx_codeobj__24; - PyObject *__pyx_codeobj__26; - PyObject *__pyx_codeobj__30; -} __pyx_mstate; + PyObject *__pyx_slice[1]; + PyObject *__pyx_tuple[5]; + PyObject *__pyx_codeobj_tab[17]; + PyObject *__pyx_string_tab[172]; +/* #### Code section: module_state_contents ### */ + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[8]; +int __pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr; +#endif +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_Add_a_constraint_to_the_problem __pyx_string_tab[1] +#define __pyx_kp_u_Add_a_variable_to_the_problem_Ex __pyx_string_tab[2] +#define __pyx_kp_u_Add_one_or_more_variables_to_the __pyx_string_tab[3] +#define __pyx_n_u_AssertionError __pyx_string_tab[4] +#define __pyx_n_u_Callable __pyx_string_tab[5] +#define __pyx_kp_u_Change_the_problem_solver_curren __pyx_string_tab[6] +#define __pyx_kp_u_Class_used_to_define_a_problem_a __pyx_string_tab[7] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[8] +#define __pyx_n_u_Constraint __pyx_string_tab[9] +#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_string_tab[10] +#define __pyx_n_u_Domain __pyx_string_tab[11] +#define __pyx_kp_u_Domain_is_empty __pyx_string_tab[12] +#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_string_tab[13] +#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_string_tab[14] +#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_string_tab[15] +#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_string_tab[16] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[17] +#define __pyx_n_u_Hashable __pyx_string_tab[18] +#define __pyx_n_u_ImportError __pyx_string_tab[19] +#define __pyx_kp_u_None __pyx_string_tab[20] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[21] +#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_string_tab[22] +#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[23] +#define __pyx_n_u_Optional __pyx_string_tab[24] +#define __pyx_kp_u_Optional_Sequence __pyx_string_tab[25] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[26] +#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_string_tab[27] +#define __pyx_n_u_Problem __pyx_string_tab[28] +#define __pyx_n_u_Problem___init __pyx_string_tab[29] +#define __pyx_n_u_Problem__getArgs __pyx_string_tab[30] +#define __pyx_n_u_Problem__getArgs_locals_genexpr __pyx_string_tab[31] +#define __pyx_n_u_Problem_addConstraint __pyx_string_tab[32] +#define __pyx_kp_u_Problem_addConstraint_line_139 __pyx_string_tab[33] +#define __pyx_n_u_Problem_addConstraint_locals_gen __pyx_string_tab[34] +#define __pyx_n_u_Problem_addVariable __pyx_string_tab[35] +#define __pyx_kp_u_Problem_addVariable_line_86 __pyx_string_tab[36] +#define __pyx_n_u_Problem_addVariables __pyx_string_tab[37] +#define __pyx_kp_u_Problem_addVariables_line_116 __pyx_string_tab[38] +#define __pyx_n_u_Problem_getSolution __pyx_string_tab[39] +#define __pyx_n_u_Problem_getSolutionIter __pyx_string_tab[40] +#define __pyx_kp_u_Problem_getSolutionIter_line_216 __pyx_string_tab[41] +#define __pyx_kp_u_Problem_getSolution_line_178 __pyx_string_tab[42] +#define __pyx_n_u_Problem_getSolutions __pyx_string_tab[43] +#define __pyx_n_u_Problem_getSolutionsAsListDict __pyx_string_tab[44] +#define __pyx_n_u_Problem_getSolutionsOrderedList __pyx_string_tab[45] +#define __pyx_n_u_Problem_getSolutionsOrderedList_2 __pyx_string_tab[46] +#define __pyx_kp_u_Problem_getSolutions_line_197 __pyx_string_tab[47] +#define __pyx_n_u_Problem_getSolver __pyx_string_tab[48] +#define __pyx_kp_u_Problem_getSolver_line_72 __pyx_string_tab[49] +#define __pyx_n_u_Problem_reset __pyx_string_tab[50] +#define __pyx_kp_u_Problem_reset_line_44 __pyx_string_tab[51] +#define __pyx_n_u_Problem_setSolver __pyx_string_tab[52] +#define __pyx_kp_u_Problem_setSolver_line_57 __pyx_string_tab[53] +#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_string_tab[54] +#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_string_tab[55] +#define __pyx_n_u_Sequence __pyx_string_tab[56] +#define __pyx_n_u_Solver __pyx_string_tab[57] +#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_string_tab[58] +#define __pyx_n_u_TypeError __pyx_string_tab[59] +#define __pyx_n_u_Union __pyx_string_tab[60] +#define __pyx_kp_u_Union_Constraint_Callable_str __pyx_string_tab[61] +#define __pyx_kp_u_Using_the_ParallelSolver_in_Thre __pyx_string_tab[62] +#define __pyx_n_u_ValueError __pyx_string_tab[63] +#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_string_tab[64] +#define __pyx_kp_u__2 __pyx_string_tab[65] +#define __pyx_kp_u__3 __pyx_string_tab[66] +#define __pyx_n_u__6 __pyx_string_tab[67] +#define __pyx_n_u_addConstraint __pyx_string_tab[68] +#define __pyx_n_u_addVariable __pyx_string_tab[69] +#define __pyx_n_u_addVariables __pyx_string_tab[70] +#define __pyx_kp_u_add_note __pyx_string_tab[71] +#define __pyx_n_u_allvariables __pyx_string_tab[72] +#define __pyx_n_u_append __pyx_string_tab[73] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[74] +#define __pyx_n_u_bool __pyx_string_tab[75] +#define __pyx_n_u_c __pyx_string_tab[76] +#define __pyx_n_u_clear __pyx_string_tab[77] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[78] +#define __pyx_n_u_close __pyx_string_tab[79] +#define __pyx_n_u_collections_abc __pyx_string_tab[80] +#define __pyx_n_u_compile_to_constraints __pyx_string_tab[81] +#define __pyx_n_u_constraint __pyx_string_tab[82] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[83] +#define __pyx_n_u_constraint_domain __pyx_string_tab[84] +#define __pyx_n_u_constraint_parser __pyx_string_tab[85] +#define __pyx_n_u_constraint_problem __pyx_string_tab[86] +#define __pyx_kp_u_constraint_problem_py __pyx_string_tab[87] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[88] +#define __pyx_n_u_constraints __pyx_string_tab[89] +#define __pyx_n_u_constraints_2 __pyx_string_tab[90] +#define __pyx_n_u_copy __pyx_string_tab[91] +#define __pyx_n_u_deepcopy __pyx_string_tab[92] +#define __pyx_kp_u_disable __pyx_string_tab[93] +#define __pyx_n_u_doc __pyx_string_tab[94] +#define __pyx_n_u_domain __pyx_string_tab[95] +#define __pyx_n_u_domains __pyx_string_tab[96] +#define __pyx_kp_u_duplicate_parameter_configurati __pyx_string_tab[97] +#define __pyx_kp_u_enable __pyx_string_tab[98] +#define __pyx_n_u_extend __pyx_string_tab[99] +#define __pyx_n_u_freethreading __pyx_string_tab[100] +#define __pyx_n_u_func __pyx_string_tab[101] +#define __pyx_kp_u_gc __pyx_string_tab[102] +#define __pyx_n_u_genexpr __pyx_string_tab[103] +#define __pyx_n_u_getArgs __pyx_string_tab[104] +#define __pyx_n_u_getSolution __pyx_string_tab[105] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[106] +#define __pyx_n_u_getSolutions __pyx_string_tab[107] +#define __pyx_n_u_getSolutionsAsListDict __pyx_string_tab[108] +#define __pyx_n_u_getSolutionsOrderedList __pyx_string_tab[109] +#define __pyx_n_u_getSolver __pyx_string_tab[110] +#define __pyx_n_u_get_in_order __pyx_string_tab[111] +#define __pyx_n_u_getitem __pyx_string_tab[112] +#define __pyx_n_u_init __pyx_string_tab[113] +#define __pyx_n_u_initializing __pyx_string_tab[114] +#define __pyx_n_u_is_coroutine __pyx_string_tab[115] +#define __pyx_n_u_is_gil_enabled __pyx_string_tab[116] +#define __pyx_kp_u_isenabled __pyx_string_tab[117] +#define __pyx_n_u_itemgetter __pyx_string_tab[118] +#define __pyx_n_u_keys __pyx_string_tab[119] +#define __pyx_kp_u_list_str __pyx_string_tab[120] +#define __pyx_kp_u_list_tuple __pyx_string_tab[121] +#define __pyx_n_u_main __pyx_string_tab[122] +#define __pyx_n_u_metaclass __pyx_string_tab[123] +#define __pyx_n_u_module __pyx_string_tab[124] +#define __pyx_n_u_msg __pyx_string_tab[125] +#define __pyx_n_u_name __pyx_string_tab[126] +#define __pyx_n_u_next __pyx_string_tab[127] +#define __pyx_n_u_operator __pyx_string_tab[128] +#define __pyx_n_u_order __pyx_string_tab[129] +#define __pyx_n_u_params __pyx_string_tab[130] +#define __pyx_n_u_parsed __pyx_string_tab[131] +#define __pyx_n_u_picklable __pyx_string_tab[132] +#define __pyx_n_u_preProcess __pyx_string_tab[133] +#define __pyx_n_u_prepare __pyx_string_tab[134] +#define __pyx_n_u_process_mode __pyx_string_tab[135] +#define __pyx_n_u_qualname __pyx_string_tab[136] +#define __pyx_n_u_range __pyx_string_tab[137] +#define __pyx_n_u_requires_pickling __pyx_string_tab[138] +#define __pyx_n_u_reset __pyx_string_tab[139] +#define __pyx_n_u_resetState __pyx_string_tab[140] +#define __pyx_n_u_return __pyx_string_tab[141] +#define __pyx_n_u_self __pyx_string_tab[142] +#define __pyx_n_u_send __pyx_string_tab[143] +#define __pyx_n_u_setSolver __pyx_string_tab[144] +#define __pyx_n_u_size_dict __pyx_string_tab[145] +#define __pyx_n_u_size_list __pyx_string_tab[146] +#define __pyx_n_u_solution __pyx_string_tab[147] +#define __pyx_n_u_solutions __pyx_string_tab[148] +#define __pyx_n_u_solutions_dict __pyx_string_tab[149] +#define __pyx_n_u_solutions_list __pyx_string_tab[150] +#define __pyx_n_u_solver __pyx_string_tab[151] +#define __pyx_n_u_solver_2 __pyx_string_tab[152] +#define __pyx_kp_u_solver_is_not_instance_of_Solve __pyx_string_tab[153] +#define __pyx_n_u_spec __pyx_string_tab[154] +#define __pyx_n_u_str_constraints __pyx_string_tab[155] +#define __pyx_n_u_sys __pyx_string_tab[156] +#define __pyx_n_u_test __pyx_string_tab[157] +#define __pyx_n_u_throw __pyx_string_tab[158] +#define __pyx_kp_u_tuple_list_tuple_dict_tuple_int __pyx_string_tab[159] +#define __pyx_n_u_typing __pyx_string_tab[160] +#define __pyx_n_u_v __pyx_string_tab[161] +#define __pyx_n_u_validate __pyx_string_tab[162] +#define __pyx_n_u_value __pyx_string_tab[163] +#define __pyx_n_u_values __pyx_string_tab[164] +#define __pyx_n_u_variable __pyx_string_tab[165] +#define __pyx_n_u_variables __pyx_string_tab[166] +#define __pyx_n_u_variables_2 __pyx_string_tab[167] +#define __pyx_n_u_vconstraints __pyx_string_tab[168] +#define __pyx_n_u_warn __pyx_string_tab[169] +#define __pyx_n_u_warnings __pyx_string_tab[170] +#define __pyx_n_u_zip __pyx_string_tab[171] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3017,211 +2869,24 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_a_constraint_to_the_problem); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_a_variable_to_the_problem_Ex); - Py_CLEAR(clear_module_state->__pyx_kp_u_Add_one_or_more_variables_to_the); - Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError); - Py_CLEAR(clear_module_state->__pyx_n_s_Callable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Change_the_problem_solver_curren); - Py_CLEAR(clear_module_state->__pyx_kp_s_Class_used_to_define_a_problem_a); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Constraints_must_be_instances_of); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_kp_u_Domain_is_empty); - Py_CLEAR(clear_module_state->__pyx_kp_u_Domains_must_be_instances_of_sub); - Py_CLEAR(clear_module_state->__pyx_kp_u_Expected_constraints_to_be_strin); - Py_CLEAR(clear_module_state->__pyx_kp_u_Find_and_return_a_solution_to_th); - Py_CLEAR(clear_module_state->__pyx_kp_u_Find_and_return_all_solutions_to); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Hashable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Obtain_the_problem_solver_curren); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_Optional); - Py_CLEAR(clear_module_state->__pyx_kp_s_Optional_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_ParallelSolver_is_currently_expe); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem___init); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem__getArgs); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem__getArgs_locals_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addConstraint); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addConstraint_line_128); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addConstraint_locals_gen); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addVariable); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addVariable_line_75); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_addVariables); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_addVariables_line_105); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolutionIter_line_205); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolution_line_167); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsAsListDict); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsOrderedList); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolutionsOrderedList_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolutions_line_186); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_getSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_getSolver_line_61); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_reset); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_reset_line_33); - Py_CLEAR(clear_module_state->__pyx_n_s_Problem_setSolver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Problem_setSolver_line_46); - Py_CLEAR(clear_module_state->__pyx_kp_u_Reset_the_current_problem_defini); - Py_CLEAR(clear_module_state->__pyx_kp_u_Return_an_iterator_to_the_soluti); - Py_CLEAR(clear_module_state->__pyx_n_s_Sequence); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver); - Py_CLEAR(clear_module_state->__pyx_kp_u_Tried_to_insert_duplicated_varia); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Union); - Py_CLEAR(clear_module_state->__pyx_kp_s_Union_Constraint_Callable_str); - Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); - Py_CLEAR(clear_module_state->__pyx_kp_u_You_have_used_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s__28); - Py_CLEAR(clear_module_state->__pyx_n_s__32); - Py_CLEAR(clear_module_state->__pyx_n_s__4); - Py_CLEAR(clear_module_state->__pyx_kp_u__5); - Py_CLEAR(clear_module_state->__pyx_n_s_addConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_addVariable); - Py_CLEAR(clear_module_state->__pyx_n_s_addVariables); - Py_CLEAR(clear_module_state->__pyx_n_s_allvariables); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_c); - Py_CLEAR(clear_module_state->__pyx_n_s_clear); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_parser); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_problem); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_problem_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_solvers); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints_2); - Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_deepcopy); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_duplicate_parameter_configurati); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_extend); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_getArgs); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsAsListDict); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsOrderedList); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_get_in_order); - Py_CLEAR(clear_module_state->__pyx_n_u_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_itemgetter); - Py_CLEAR(clear_module_state->__pyx_n_s_keys); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_str); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_msg); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_operator); - Py_CLEAR(clear_module_state->__pyx_n_s_order); - Py_CLEAR(clear_module_state->__pyx_n_s_parsed); - Py_CLEAR(clear_module_state->__pyx_n_s_picklable); - Py_CLEAR(clear_module_state->__pyx_n_s_preProcess); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_requires_pickling); - Py_CLEAR(clear_module_state->__pyx_n_s_reset); - Py_CLEAR(clear_module_state->__pyx_n_s_resetState); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_setSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_size_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_size_list); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions_list); - Py_CLEAR(clear_module_state->__pyx_n_s_solver); - Py_CLEAR(clear_module_state->__pyx_n_s_solver_2); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_str_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_list_tuple_dict_tuple_int); - Py_CLEAR(clear_module_state->__pyx_n_s_typing); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_validate); - Py_CLEAR(clear_module_state->__pyx_n_s_values); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_variables_2); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_warn); - Py_CLEAR(clear_module_state->__pyx_n_s_warnings); - Py_CLEAR(clear_module_state->__pyx_n_s_zip); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__6); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__9); - Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__15); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__19); - Py_CLEAR(clear_module_state->__pyx_tuple__23); - Py_CLEAR(clear_module_state->__pyx_tuple__25); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__29); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__20); - Py_CLEAR(clear_module_state->__pyx_codeobj__21); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - Py_CLEAR(clear_module_state->__pyx_codeobj__24); - Py_CLEAR(clear_module_state->__pyx_codeobj__26); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<172; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif @@ -3238,437 +2903,22 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_a_constraint_to_the_problem); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_a_variable_to_the_problem_Ex); - Py_VISIT(traverse_module_state->__pyx_kp_u_Add_one_or_more_variables_to_the); - Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError); - Py_VISIT(traverse_module_state->__pyx_n_s_Callable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Change_the_problem_solver_curren); - Py_VISIT(traverse_module_state->__pyx_kp_s_Class_used_to_define_a_problem_a); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Constraints_must_be_instances_of); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_kp_u_Domain_is_empty); - Py_VISIT(traverse_module_state->__pyx_kp_u_Domains_must_be_instances_of_sub); - Py_VISIT(traverse_module_state->__pyx_kp_u_Expected_constraints_to_be_strin); - Py_VISIT(traverse_module_state->__pyx_kp_u_Find_and_return_a_solution_to_th); - Py_VISIT(traverse_module_state->__pyx_kp_u_Find_and_return_all_solutions_to); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Hashable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Obtain_the_problem_solver_curren); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_Optional); - Py_VISIT(traverse_module_state->__pyx_kp_s_Optional_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_ParallelSolver_is_currently_expe); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem___init); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem__getArgs); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem__getArgs_locals_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addConstraint); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addConstraint_line_128); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addConstraint_locals_gen); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addVariable); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addVariable_line_75); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_addVariables); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_addVariables_line_105); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolutionIter_line_205); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolution_line_167); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsAsListDict); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsOrderedList); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolutionsOrderedList_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolutions_line_186); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_getSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_getSolver_line_61); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_reset); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_reset_line_33); - Py_VISIT(traverse_module_state->__pyx_n_s_Problem_setSolver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Problem_setSolver_line_46); - Py_VISIT(traverse_module_state->__pyx_kp_u_Reset_the_current_problem_defini); - Py_VISIT(traverse_module_state->__pyx_kp_u_Return_an_iterator_to_the_soluti); - Py_VISIT(traverse_module_state->__pyx_n_s_Sequence); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver); - Py_VISIT(traverse_module_state->__pyx_kp_u_Tried_to_insert_duplicated_varia); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Union); - Py_VISIT(traverse_module_state->__pyx_kp_s_Union_Constraint_Callable_str); - Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); - Py_VISIT(traverse_module_state->__pyx_kp_u_You_have_used_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s__28); - Py_VISIT(traverse_module_state->__pyx_n_s__32); - Py_VISIT(traverse_module_state->__pyx_n_s__4); - Py_VISIT(traverse_module_state->__pyx_kp_u__5); - Py_VISIT(traverse_module_state->__pyx_n_s_addConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_addVariable); - Py_VISIT(traverse_module_state->__pyx_n_s_addVariables); - Py_VISIT(traverse_module_state->__pyx_n_s_allvariables); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_c); - Py_VISIT(traverse_module_state->__pyx_n_s_clear); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_parser); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_problem); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_problem_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_solvers); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints_2); - Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_deepcopy); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_duplicate_parameter_configurati); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_extend); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_getArgs); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsAsListDict); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsOrderedList); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_get_in_order); - Py_VISIT(traverse_module_state->__pyx_n_u_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_itemgetter); - Py_VISIT(traverse_module_state->__pyx_n_s_keys); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_str); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_msg); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_operator); - Py_VISIT(traverse_module_state->__pyx_n_s_order); - Py_VISIT(traverse_module_state->__pyx_n_s_parsed); - Py_VISIT(traverse_module_state->__pyx_n_s_picklable); - Py_VISIT(traverse_module_state->__pyx_n_s_preProcess); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_requires_pickling); - Py_VISIT(traverse_module_state->__pyx_n_s_reset); - Py_VISIT(traverse_module_state->__pyx_n_s_resetState); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_setSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_size_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_size_list); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions_list); - Py_VISIT(traverse_module_state->__pyx_n_s_solver); - Py_VISIT(traverse_module_state->__pyx_n_s_solver_2); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_str_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_list_tuple_dict_tuple_int); - Py_VISIT(traverse_module_state->__pyx_n_s_typing); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_validate); - Py_VISIT(traverse_module_state->__pyx_n_s_values); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_variables_2); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_warn); - Py_VISIT(traverse_module_state->__pyx_n_s_warnings); - Py_VISIT(traverse_module_state->__pyx_n_s_zip); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__6); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__9); - Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__15); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__19); - Py_VISIT(traverse_module_state->__pyx_tuple__23); - Py_VISIT(traverse_module_state->__pyx_tuple__25); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__29); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__20); - Py_VISIT(traverse_module_state->__pyx_codeobj__21); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - Py_VISIT(traverse_module_state->__pyx_codeobj__24); - Py_VISIT(traverse_module_state->__pyx_codeobj__26); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<172; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList -#define __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr -#endif -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr -#define __pyx_kp_u_Add_a_constraint_to_the_problem __pyx_mstate_global->__pyx_kp_u_Add_a_constraint_to_the_problem -#define __pyx_kp_u_Add_a_variable_to_the_problem_Ex __pyx_mstate_global->__pyx_kp_u_Add_a_variable_to_the_problem_Ex -#define __pyx_kp_u_Add_one_or_more_variables_to_the __pyx_mstate_global->__pyx_kp_u_Add_one_or_more_variables_to_the -#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError -#define __pyx_n_s_Callable __pyx_mstate_global->__pyx_n_s_Callable -#define __pyx_kp_u_Change_the_problem_solver_curren __pyx_mstate_global->__pyx_kp_u_Change_the_problem_solver_curren -#define __pyx_kp_s_Class_used_to_define_a_problem_a __pyx_mstate_global->__pyx_kp_s_Class_used_to_define_a_problem_a -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_kp_u_Constraints_must_be_instances_of __pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_kp_u_Domain_is_empty __pyx_mstate_global->__pyx_kp_u_Domain_is_empty -#define __pyx_kp_u_Domains_must_be_instances_of_sub __pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub -#define __pyx_kp_u_Expected_constraints_to_be_strin __pyx_mstate_global->__pyx_kp_u_Expected_constraints_to_be_strin -#define __pyx_kp_u_Find_and_return_a_solution_to_th __pyx_mstate_global->__pyx_kp_u_Find_and_return_a_solution_to_th -#define __pyx_kp_u_Find_and_return_all_solutions_to __pyx_mstate_global->__pyx_kp_u_Find_and_return_all_solutions_to -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_Hashable __pyx_mstate_global->__pyx_n_s_Hashable -#define __pyx_kp_u_Obtain_the_problem_solver_curren __pyx_mstate_global->__pyx_kp_u_Obtain_the_problem_solver_curren -#define __pyx_n_s_OptimizedBacktrackingSolver __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver -#define __pyx_n_s_Optional __pyx_mstate_global->__pyx_n_s_Optional -#define __pyx_kp_s_Optional_Sequence __pyx_mstate_global->__pyx_kp_s_Optional_Sequence -#define __pyx_n_s_ParallelSolver __pyx_mstate_global->__pyx_n_s_ParallelSolver -#define __pyx_kp_u_ParallelSolver_is_currently_expe __pyx_mstate_global->__pyx_kp_u_ParallelSolver_is_currently_expe -#define __pyx_n_s_Problem __pyx_mstate_global->__pyx_n_s_Problem -#define __pyx_n_s_Problem___init __pyx_mstate_global->__pyx_n_s_Problem___init -#define __pyx_n_s_Problem__getArgs __pyx_mstate_global->__pyx_n_s_Problem__getArgs -#define __pyx_n_s_Problem__getArgs_locals_genexpr __pyx_mstate_global->__pyx_n_s_Problem__getArgs_locals_genexpr -#define __pyx_n_s_Problem_addConstraint __pyx_mstate_global->__pyx_n_s_Problem_addConstraint -#define __pyx_kp_u_Problem_addConstraint_line_128 __pyx_mstate_global->__pyx_kp_u_Problem_addConstraint_line_128 -#define __pyx_n_s_Problem_addConstraint_locals_gen __pyx_mstate_global->__pyx_n_s_Problem_addConstraint_locals_gen -#define __pyx_n_s_Problem_addVariable __pyx_mstate_global->__pyx_n_s_Problem_addVariable -#define __pyx_kp_u_Problem_addVariable_line_75 __pyx_mstate_global->__pyx_kp_u_Problem_addVariable_line_75 -#define __pyx_n_s_Problem_addVariables __pyx_mstate_global->__pyx_n_s_Problem_addVariables -#define __pyx_kp_u_Problem_addVariables_line_105 __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_105 -#define __pyx_n_s_Problem_getSolution __pyx_mstate_global->__pyx_n_s_Problem_getSolution -#define __pyx_n_s_Problem_getSolutionIter __pyx_mstate_global->__pyx_n_s_Problem_getSolutionIter -#define __pyx_kp_u_Problem_getSolutionIter_line_205 __pyx_mstate_global->__pyx_kp_u_Problem_getSolutionIter_line_205 -#define __pyx_kp_u_Problem_getSolution_line_167 __pyx_mstate_global->__pyx_kp_u_Problem_getSolution_line_167 -#define __pyx_n_s_Problem_getSolutions __pyx_mstate_global->__pyx_n_s_Problem_getSolutions -#define __pyx_n_s_Problem_getSolutionsAsListDict __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsAsListDict -#define __pyx_n_s_Problem_getSolutionsOrderedList __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsOrderedList -#define __pyx_n_s_Problem_getSolutionsOrderedList_2 __pyx_mstate_global->__pyx_n_s_Problem_getSolutionsOrderedList_2 -#define __pyx_kp_u_Problem_getSolutions_line_186 __pyx_mstate_global->__pyx_kp_u_Problem_getSolutions_line_186 -#define __pyx_n_s_Problem_getSolver __pyx_mstate_global->__pyx_n_s_Problem_getSolver -#define __pyx_kp_u_Problem_getSolver_line_61 __pyx_mstate_global->__pyx_kp_u_Problem_getSolver_line_61 -#define __pyx_n_s_Problem_reset __pyx_mstate_global->__pyx_n_s_Problem_reset -#define __pyx_kp_u_Problem_reset_line_33 __pyx_mstate_global->__pyx_kp_u_Problem_reset_line_33 -#define __pyx_n_s_Problem_setSolver __pyx_mstate_global->__pyx_n_s_Problem_setSolver -#define __pyx_kp_u_Problem_setSolver_line_46 __pyx_mstate_global->__pyx_kp_u_Problem_setSolver_line_46 -#define __pyx_kp_u_Reset_the_current_problem_defini __pyx_mstate_global->__pyx_kp_u_Reset_the_current_problem_defini -#define __pyx_kp_u_Return_an_iterator_to_the_soluti __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti -#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence -#define __pyx_n_s_Solver __pyx_mstate_global->__pyx_n_s_Solver -#define __pyx_kp_u_Tried_to_insert_duplicated_varia __pyx_mstate_global->__pyx_kp_u_Tried_to_insert_duplicated_varia -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s_Union __pyx_mstate_global->__pyx_n_s_Union -#define __pyx_kp_s_Union_Constraint_Callable_str __pyx_mstate_global->__pyx_kp_s_Union_Constraint_Callable_str -#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError -#define __pyx_kp_u_You_have_used_FunctionConstraint __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint -#define __pyx_n_s__28 __pyx_mstate_global->__pyx_n_s__28 -#define __pyx_n_s__32 __pyx_mstate_global->__pyx_n_s__32 -#define __pyx_n_s__4 __pyx_mstate_global->__pyx_n_s__4 -#define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 -#define __pyx_n_s_addConstraint __pyx_mstate_global->__pyx_n_s_addConstraint -#define __pyx_n_s_addVariable __pyx_mstate_global->__pyx_n_s_addVariable -#define __pyx_n_s_addVariables __pyx_mstate_global->__pyx_n_s_addVariables -#define __pyx_n_s_allvariables __pyx_mstate_global->__pyx_n_s_allvariables -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c -#define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_compile_to_constraints __pyx_mstate_global->__pyx_n_s_compile_to_constraints -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraint_parser __pyx_mstate_global->__pyx_n_s_constraint_parser -#define __pyx_n_s_constraint_problem __pyx_mstate_global->__pyx_n_s_constraint_problem -#define __pyx_kp_s_constraint_problem_py __pyx_mstate_global->__pyx_kp_s_constraint_problem_py -#define __pyx_n_s_constraint_solvers __pyx_mstate_global->__pyx_n_s_constraint_solvers -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_constraints_2 __pyx_mstate_global->__pyx_n_s_constraints_2 -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_deepcopy __pyx_mstate_global->__pyx_n_s_deepcopy -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_duplicate_parameter_configurati __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_getArgs __pyx_mstate_global->__pyx_n_s_getArgs -#define __pyx_n_s_getSolution __pyx_mstate_global->__pyx_n_s_getSolution -#define __pyx_n_s_getSolutionIter __pyx_mstate_global->__pyx_n_s_getSolutionIter -#define __pyx_n_s_getSolutions __pyx_mstate_global->__pyx_n_s_getSolutions -#define __pyx_n_s_getSolutionsAsListDict __pyx_mstate_global->__pyx_n_s_getSolutionsAsListDict -#define __pyx_n_s_getSolutionsOrderedList __pyx_mstate_global->__pyx_n_s_getSolutionsOrderedList -#define __pyx_n_s_getSolver __pyx_mstate_global->__pyx_n_s_getSolver -#define __pyx_n_s_get_in_order __pyx_mstate_global->__pyx_n_s_get_in_order -#define __pyx_n_u_getitem __pyx_mstate_global->__pyx_n_u_getitem -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_itemgetter __pyx_mstate_global->__pyx_n_s_itemgetter -#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys -#define __pyx_kp_s_list_str __pyx_mstate_global->__pyx_kp_s_list_str -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_operator __pyx_mstate_global->__pyx_n_s_operator -#define __pyx_n_s_order __pyx_mstate_global->__pyx_n_s_order -#define __pyx_n_s_parsed __pyx_mstate_global->__pyx_n_s_parsed -#define __pyx_n_s_picklable __pyx_mstate_global->__pyx_n_s_picklable -#define __pyx_n_s_preProcess __pyx_mstate_global->__pyx_n_s_preProcess -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_requires_pickling __pyx_mstate_global->__pyx_n_s_requires_pickling -#define __pyx_n_s_reset __pyx_mstate_global->__pyx_n_s_reset -#define __pyx_n_s_resetState __pyx_mstate_global->__pyx_n_s_resetState -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_setSolver __pyx_mstate_global->__pyx_n_s_setSolver -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_size_dict __pyx_mstate_global->__pyx_n_s_size_dict -#define __pyx_n_s_size_list __pyx_mstate_global->__pyx_n_s_size_list -#define __pyx_n_s_solutions __pyx_mstate_global->__pyx_n_s_solutions -#define __pyx_n_s_solutions_dict __pyx_mstate_global->__pyx_n_s_solutions_dict -#define __pyx_n_s_solutions_list __pyx_mstate_global->__pyx_n_s_solutions_list -#define __pyx_n_s_solver __pyx_mstate_global->__pyx_n_s_solver -#define __pyx_n_s_solver_2 __pyx_mstate_global->__pyx_n_s_solver_2 -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_str_constraints __pyx_mstate_global->__pyx_n_s_str_constraints -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_kp_s_tuple_list_tuple_dict_tuple_int __pyx_mstate_global->__pyx_kp_s_tuple_list_tuple_dict_tuple_int -#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_validate __pyx_mstate_global->__pyx_n_s_validate -#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_variables_2 __pyx_mstate_global->__pyx_n_s_variables_2 -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn -#define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings -#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 -#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 -#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 -#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 -#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 /* #### Code section: module_code ### */ -/* "constraint/problem.py":18 +/* "constraint/problem.py":24 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_1__init__(PyObject *__pyx_self, @@ -3701,7 +2951,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3709,14 +2959,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solver,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solver,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -3724,29 +2977,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_solver); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 24, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 18, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 24, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -3756,7 +3015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 24, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -3790,159 +3049,249 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_5[3]; unsigned int __pyx_t_6; + int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); - /* "constraint/problem.py":24 + /* "constraint/problem.py":30 * solver (instance of a :py:class:`Solver`): Problem solver (default :py:class:`OptimizedBacktrackingSolver`) * """ * self._solver = solver or OptimizedBacktrackingSolver() # <<<<<<<<<<<<<< * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_solver); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 24, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_solver); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 30, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_solver); __pyx_t_1 = __pyx_v_solver; goto __pyx_L3_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L3_bool_binop_done:; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_solver_2, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":25 + /* "constraint/problem.py":31 * """ * self._solver = solver or OptimizedBacktrackingSolver() * self._constraints: list[tuple[Constraint, any]] = [] # <<<<<<<<<<<<<< * self._str_constraints: list[str] = [] * self._variables: dict[Hashable, Domain] = {} - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":26 + /* "constraint/problem.py":32 * self._solver = solver or OptimizedBacktrackingSolver() * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] # <<<<<<<<<<<<<< * self._variables: dict[Hashable, Domain] = {} * - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error) +*/ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":27 + /* "constraint/problem.py":33 * self._constraints: list[tuple[Constraint, any]] = [] * self._str_constraints: list[str] = [] * self._variables: dict[Hashable, Domain] = {} # <<<<<<<<<<<<<< * - * # warn for experimental parallel solver - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + * # check if solver is instance instead of class +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_variables, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":30 + /* "constraint/problem.py":36 + * + * # check if solver is instance instead of class + * assert isinstance(self._solver, Solver), f"`solver` is not instance of Solver class (is {type(self._solver)})." # <<<<<<<<<<<<<< + * + * # warn for experimental parallel solver +*/ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_t_4)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_solver_is_not_instance_of_Solve; + __pyx_t_5[1] = __pyx_t_1; + __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_; + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 45 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1)); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(0, 36, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 36, __pyx_L1_error) + #endif + + /* "constraint/problem.py":39 * * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): # <<<<<<<<<<<<<< * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 - * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + * if not self._solver._process_mode and not freethreading: +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ParallelSolver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_IsInstance(__pyx_t_1, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "constraint/problem.py":31 + /* "constraint/problem.py":40 * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 # <<<<<<<<<<<<<< - * - * def reset(self): - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = NULL; + * if not self._solver._process_mode and not freethreading: + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") +*/ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_ParallelSolver_is_currently_expe}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "constraint/problem.py":41 + * if isinstance(self._solver, ParallelSolver): + * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 + * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") + * +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_process_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { + } else { + __pyx_t_2 = __pyx_t_8; + goto __pyx_L7_bool_binop_done; + } + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_freethreading); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 41, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = (!__pyx_t_8); + __pyx_t_2 = __pyx_t_7; + __pyx_L7_bool_binop_done:; + if (__pyx_t_2) { + + /* "constraint/problem.py":42 + * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 + * if not self._solver._process_mode and not freethreading: + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") # <<<<<<<<<<<<<< + * + * def reset(self): +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_3); PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Using_the_ParallelSolver_in_Thre}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "constraint/problem.py":41 + * if isinstance(self._solver, ParallelSolver): + * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 + * if not self._solver._process_mode and not freethreading: # <<<<<<<<<<<<<< + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") + * +*/ } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_ParallelSolver_is_currently_expe}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":30 + /* "constraint/problem.py":39 * * # warn for experimental parallel solver * if isinstance(self._solver, ParallelSolver): # <<<<<<<<<<<<<< * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 - * - */ + * if not self._solver._process_mode and not freethreading: +*/ } - /* "constraint/problem.py":18 + /* "constraint/problem.py":24 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -3951,7 +3300,6 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("constraint.problem.Problem.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -3960,13 +3308,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem___init__(CYTHON_UNUSED return __pyx_r; } -/* "constraint/problem.py":33 - * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 +/* "constraint/problem.py":44 + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_3reset(PyObject *__pyx_self, @@ -3998,7 +3346,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reset (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4006,11 +3354,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4018,16 +3367,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reset") < 0)) __PYX_ERR(0, 33, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reset") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4038,7 +3387,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 33, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("reset", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4070,68 +3419,47 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("reset", 1); + __Pyx_RefNannySetupContext("reset", 0); - /* "constraint/problem.py":43 + /* "constraint/problem.py":54 * >>> * """ * del self._constraints[:] # <<<<<<<<<<<<<< * self._variables.clear() * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1) < 0) __PYX_ERR(0, 43, __pyx_L1_error) + if (__Pyx_PyObject_DelSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < 0) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":44 + /* "constraint/problem.py":55 * """ * del self._constraints[:] * self._variables.clear() # <<<<<<<<<<<<<< * * def setSolver(self, solver): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":33 - * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 + /* "constraint/problem.py":44 + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4139,7 +3467,6 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.problem.Problem.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -4148,13 +3475,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_2reset(CYTHON_UNUSED Py return __pyx_r; } -/* "constraint/problem.py":46 +/* "constraint/problem.py":57 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_5setSolver(PyObject *__pyx_self, @@ -4187,7 +3514,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("setSolver (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4195,13 +3522,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solver,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solver,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4209,26 +3538,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solver)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_solver)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, 1); __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, 1); __PYX_ERR(0, 57, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolver") < 0)) __PYX_ERR(0, 46, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setSolver") < 0)) __PYX_ERR(0, 57, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -4241,7 +3570,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 46, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setSolver", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4274,24 +3603,24 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("setSolver", 1); + __Pyx_RefNannySetupContext("setSolver", 0); - /* "constraint/problem.py":59 + /* "constraint/problem.py":70 * solver * """ * self._solver = solver # <<<<<<<<<<<<<< * * def getSolver(self): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_solver_2, __pyx_v_solver) < 0) __PYX_ERR(0, 59, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2, __pyx_v_solver) < 0) __PYX_ERR(0, 70, __pyx_L1_error) - /* "constraint/problem.py":46 + /* "constraint/problem.py":57 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4305,13 +3634,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_4setSolver(CYTHON_UNUSE return __pyx_r; } -/* "constraint/problem.py":61 +/* "constraint/problem.py":72 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_7getSolver(PyObject *__pyx_self, @@ -4343,7 +3672,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolver (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4351,11 +3680,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4363,16 +3693,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolver") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolver") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -4383,7 +3713,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolver", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4417,29 +3747,29 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolver", 1); + __Pyx_RefNannySetupContext("getSolver", 0); - /* "constraint/problem.py":73 + /* "constraint/problem.py":84 * instance of a :py:class:`Solver` subclass: Solver currently in use * """ * return self._solver # <<<<<<<<<<<<<< * * def addVariable(self, variable: Hashable, domain): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":61 + /* "constraint/problem.py":72 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4452,13 +3782,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_6getSolver(CYTHON_UNUSE return __pyx_r; } -/* "constraint/problem.py":75 +/* "constraint/problem.py":86 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_9addVariable(PyObject *__pyx_self, @@ -4492,7 +3822,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addVariable (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4500,15 +3830,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variable,&__pyx_n_s_domain,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variable,&__pyx_mstate_global->__pyx_n_u_domain,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4516,36 +3849,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variable)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variable)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 1); __PYX_ERR(0, 75, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 1); __PYX_ERR(0, 86, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domain)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 2); __PYX_ERR(0, 75, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, 2); __PYX_ERR(0, 86, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariable") < 0)) __PYX_ERR(0, 75, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariable") < 0)) __PYX_ERR(0, 86, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -4560,7 +3893,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 75, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariable", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 86, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4603,82 +3936,82 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU __Pyx_RefNannySetupContext("addVariable", 0); __Pyx_INCREF(__pyx_v_domain); - /* "constraint/problem.py":91 + /* "constraint/problem.py":102 * assume * """ * if variable in self._variables: # <<<<<<<<<<<<<< * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_variable, __pyx_t_1, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_2)) { - /* "constraint/problem.py":92 + /* "constraint/problem.py":103 * """ * if variable in self._variables: * msg = f"Tried to insert duplicated variable {repr(variable)}" # <<<<<<<<<<<<<< * raise ValueError(msg) * if isinstance(domain, Domain): - */ - __pyx_t_1 = PyObject_Repr(__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) +*/ + __pyx_t_1 = PyObject_Repr(__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":93 + /* "constraint/problem.py":104 * if variable in self._variables: * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) # <<<<<<<<<<<<<< * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 93, __pyx_L1_error) + __PYX_ERR(0, 104, __pyx_L1_error) - /* "constraint/problem.py":91 + /* "constraint/problem.py":102 * assume * """ * if variable in self._variables: # <<<<<<<<<<<<<< * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) - */ +*/ } - /* "constraint/problem.py":94 + /* "constraint/problem.py":105 * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) * if isinstance(domain, Domain): # <<<<<<<<<<<<<< * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_domain, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_domain, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "constraint/problem.py":95 + /* "constraint/problem.py":106 * raise ValueError(msg) * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) # <<<<<<<<<<<<<< * elif hasattr(domain, "__getitem__"): * domain = Domain(domain) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_deepcopy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -4686,168 +4019,166 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_domain}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":94 + /* "constraint/problem.py":105 * msg = f"Tried to insert duplicated variable {repr(variable)}" * raise ValueError(msg) * if isinstance(domain, Domain): # <<<<<<<<<<<<<< * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): - */ +*/ goto __pyx_L4; } - /* "constraint/problem.py":96 + /* "constraint/problem.py":107 * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: - */ - __pyx_t_2 = __Pyx_HasAttr(__pyx_v_domain, __pyx_n_u_getitem); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 96, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_HasAttr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_getitem); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error) if (likely(__pyx_t_2)) { - /* "constraint/problem.py":97 + /* "constraint/problem.py":108 * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): * domain = Domain(domain) # <<<<<<<<<<<<<< * else: * msg = "Domains must be instances of subclasses of the Domain class" - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_domain}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_domain, __pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":96 + /* "constraint/problem.py":107 * if isinstance(domain, Domain): * domain = copy.deepcopy(domain) * elif hasattr(domain, "__getitem__"): # <<<<<<<<<<<<<< * domain = Domain(domain) * else: - */ +*/ goto __pyx_L4; } - /* "constraint/problem.py":99 + /* "constraint/problem.py":110 * domain = Domain(domain) * else: * msg = "Domains must be instances of subclasses of the Domain class" # <<<<<<<<<<<<<< * raise TypeError(msg) * if not domain: - */ +*/ /*else*/ { - __Pyx_INCREF(__pyx_kp_u_Domains_must_be_instances_of_sub); - __pyx_v_msg = __pyx_kp_u_Domains_must_be_instances_of_sub; + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub); + __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Domains_must_be_instances_of_sub; - /* "constraint/problem.py":100 + /* "constraint/problem.py":111 * else: * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) # <<<<<<<<<<<<<< * if not domain: * raise ValueError("Domain is empty") - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 100, __pyx_L1_error) + __PYX_ERR(0, 111, __pyx_L1_error) } __pyx_L4:; - /* "constraint/problem.py":101 + /* "constraint/problem.py":112 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< * raise ValueError("Domain is empty") * self._variables[variable] = domain - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 101, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_t_6 = (!__pyx_t_2); if (unlikely(__pyx_t_6)) { - /* "constraint/problem.py":102 + /* "constraint/problem.py":113 * raise TypeError(msg) * if not domain: * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< * self._variables[variable] = domain * - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 102, __pyx_L1_error) + __PYX_ERR(0, 113, __pyx_L1_error) - /* "constraint/problem.py":101 + /* "constraint/problem.py":112 * msg = "Domains must be instances of subclasses of the Domain class" * raise TypeError(msg) * if not domain: # <<<<<<<<<<<<<< * raise ValueError("Domain is empty") * self._variables[variable] = domain - */ +*/ } - /* "constraint/problem.py":103 + /* "constraint/problem.py":114 * if not domain: * raise ValueError("Domain is empty") * self._variables[variable] = domain # <<<<<<<<<<<<<< * * def addVariables(self, variables: Sequence, domain): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_variable, __pyx_v_domain) < 0))) __PYX_ERR(0, 103, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_variable, __pyx_v_domain) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":75 + /* "constraint/problem.py":86 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -4866,13 +4197,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8addVariable(CYTHON_UNU return __pyx_r; } -/* "constraint/problem.py":105 +/* "constraint/problem.py":116 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_11addVariables(PyObject *__pyx_self, @@ -4906,7 +4237,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4914,15 +4245,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_variables_2,&__pyx_n_s_domain,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_variables_2,&__pyx_mstate_global->__pyx_n_u_domain,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4930,36 +4264,36 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables_2)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables_2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 1); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 1); __PYX_ERR(0, 116, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domain)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domain)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 2); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, 2); __PYX_ERR(0, 116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariables") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addVariables") < 0)) __PYX_ERR(0, 116, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -4974,7 +4308,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addVariables", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5015,52 +4349,58 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("addVariables", 1); + __Pyx_RefNannySetupContext("addVariables", 0); - /* "constraint/problem.py":125 + /* "constraint/problem.py":136 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< * self.addVariable(variable, domain) * - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { __pyx_t_1 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 125, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 125, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 125, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -5070,7 +4410,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 125, __pyx_L1_error) + else __PYX_ERR(0, 136, __pyx_L1_error) } break; } @@ -5079,56 +4419,55 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":126 + /* "constraint/problem.py":137 * """ * for variable in variables: * self.addVariable(variable, domain) # <<<<<<<<<<<<<< * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addVariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_addVariable); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_7 = 1; - } + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_7 = 1; } #endif { PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_variable, __pyx_v_domain}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "constraint/problem.py":125 + /* "constraint/problem.py":136 * may assume * """ * for variable in variables: # <<<<<<<<<<<<<< * self.addVariable(variable, domain) * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":105 + /* "constraint/problem.py":116 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5147,13 +4486,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_10addVariables(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":128 +/* "constraint/problem.py":139 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_13addConstraint(PyObject *__pyx_self, @@ -5187,7 +4526,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("addConstraint (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5195,16 +4534,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_constraint,&__pyx_n_s_variables_2,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_constraint,&__pyx_mstate_global->__pyx_n_u_variables_2,0}; values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5212,39 +4555,45 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, 1); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, 1); __PYX_ERR(0, 139, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_variables_2); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_variables_2); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addConstraint") < 0)) __PYX_ERR(0, 128, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addConstraint") < 0)) __PYX_ERR(0, 139, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; @@ -5256,7 +4605,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 128, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addConstraint", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 139, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5284,13 +4633,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":151 +/* "constraint/problem.py":162 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_cur_scope; @@ -5300,11 +4649,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 151, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -5312,7 +4661,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_addConstraint_locals_gen, __pyx_n_s_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_13addConstraint_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint_locals_gen, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -5350,45 +4699,51 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 151, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 151, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 162, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 162, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 162, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 151, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -5398,7 +4753,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 151, __pyx_L1_error) + else __PYX_ERR(0, 162, __pyx_L1_error) } break; } @@ -5430,10 +4785,12 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -5445,13 +4802,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_13addConstraint_2genera return __pyx_r; } -/* "constraint/problem.py":128 +/* "constraint/problem.py":139 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_constraint, PyObject *__pyx_v_variables) { PyObject *__pyx_v_msg = NULL; @@ -5471,99 +4828,99 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ __Pyx_RefNannySetupContext("addConstraint", 0); __Pyx_INCREF(__pyx_v_constraint); - /* "constraint/problem.py":147 + /* "constraint/problem.py":158 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< * self._str_constraints.append(constraint) * return - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_constraint); if (__pyx_t_1) { - /* "constraint/problem.py":148 + /* "constraint/problem.py":159 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): * self._str_constraints.append(constraint) # <<<<<<<<<<<<<< * return * elif isinstance(constraint, list): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_constraint); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_constraint); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":149 + /* "constraint/problem.py":160 * if isinstance(constraint, str): * self._str_constraints.append(constraint) * return # <<<<<<<<<<<<<< * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":147 + /* "constraint/problem.py":158 * """ # noqa: E501 * # compile string constraints (variables argument ignored as it is inferred from the string and may be reordered) * if isinstance(constraint, str): # <<<<<<<<<<<<<< * self._str_constraints.append(constraint) * return - */ +*/ } - /* "constraint/problem.py":150 + /* "constraint/problem.py":161 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) - */ +*/ __pyx_t_1 = PyList_Check(__pyx_v_constraint); if (__pyx_t_1) { - /* "constraint/problem.py":151 + /* "constraint/problem.py":162 * return * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" # <<<<<<<<<<<<<< * self._str_constraints.extend(constraint) * return - */ +*/ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(NULL, __pyx_v_constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_13addConstraint_genexpr(NULL, __pyx_v_constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) { - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_constraint, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_constraint, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 151, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 151, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 162, __pyx_L1_error) #endif - /* "constraint/problem.py":152 + /* "constraint/problem.py":163 * elif isinstance(constraint, list): * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) # <<<<<<<<<<<<<< * return * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_extend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_extend); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5571,230 +4928,227 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":153 + /* "constraint/problem.py":164 * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) * return # <<<<<<<<<<<<<< * * # add regular constraints - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":150 + /* "constraint/problem.py":161 * self._str_constraints.append(constraint) * return * elif isinstance(constraint, list): # <<<<<<<<<<<<<< * assert all(isinstance(c, str) for c in constraint), f"Expected constraints to be strings, got {constraint}" * self._str_constraints.extend(constraint) - */ +*/ } - /* "constraint/problem.py":156 + /* "constraint/problem.py":167 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_IsInstance(__pyx_v_constraint, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_1 = PyObject_IsInstance(__pyx_v_constraint, __pyx_t_2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = (!__pyx_t_1); if (__pyx_t_7) { - /* "constraint/problem.py":157 + /* "constraint/problem.py":168 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) - */ - __pyx_t_7 = __Pyx_PyCallable_Check(__pyx_v_constraint); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 157, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_PyCallable_Check(__pyx_v_constraint); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 168, __pyx_L1_error) if (__pyx_t_7) { - /* "constraint/problem.py":159 + /* "constraint/problem.py":170 * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) # <<<<<<<<<<<<<< * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":157 + /* "constraint/problem.py":168 * # add regular constraints * if not isinstance(constraint, Constraint): * if callable(constraint): # <<<<<<<<<<<<<< * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) - */ +*/ goto __pyx_L5; } - /* "constraint/problem.py":160 + /* "constraint/problem.py":171 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(constraint) * else: - */ +*/ __pyx_t_7 = PyUnicode_Check(__pyx_v_constraint); if (likely(__pyx_t_7)) { - /* "constraint/problem.py":161 + /* "constraint/problem.py":172 * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): * constraint = CompilableFunctionConstraint(constraint) # <<<<<<<<<<<<<< * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" - */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_constraint}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF_SET(__pyx_v_constraint, __pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":160 + /* "constraint/problem.py":171 * # future warn("A function or lambda has been used for a constraint, consider using string constraints") * constraint = FunctionConstraint(constraint) * elif isinstance(constraint, str): # <<<<<<<<<<<<<< * constraint = CompilableFunctionConstraint(constraint) * else: - */ +*/ goto __pyx_L5; } - /* "constraint/problem.py":163 + /* "constraint/problem.py":174 * constraint = CompilableFunctionConstraint(constraint) * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" # <<<<<<<<<<<<<< * raise ValueError(msg) * self._constraints.append((constraint, variables)) - */ +*/ /*else*/ { - __Pyx_INCREF(__pyx_kp_u_Constraints_must_be_instances_of); - __pyx_v_msg = __pyx_kp_u_Constraints_must_be_instances_of; + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of); + __pyx_v_msg = __pyx_mstate_global->__pyx_kp_u_Constraints_must_be_instances_of; - /* "constraint/problem.py":164 + /* "constraint/problem.py":175 * else: * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) # <<<<<<<<<<<<<< * self._constraints.append((constraint, variables)) * - */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 164, __pyx_L1_error) + __PYX_ERR(0, 175, __pyx_L1_error) } __pyx_L5:; - /* "constraint/problem.py":156 + /* "constraint/problem.py":167 * * # add regular constraints * if not isinstance(constraint, Constraint): # <<<<<<<<<<<<<< * if callable(constraint): * # future warn("A function or lambda has been used for a constraint, consider using string constraints") - */ +*/ } - /* "constraint/problem.py":165 + /* "constraint/problem.py":176 * msg = "Constraints must be instances of subclasses " "of the Constraint class" * raise ValueError(msg) * self._constraints.append((constraint, variables)) # <<<<<<<<<<<<<< * * def getSolution(self): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_constraint)) __PYX_ERR(0, 165, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 176, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_variables)) __PYX_ERR(0, 165, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 165, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 176, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_5); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "constraint/problem.py":128 + /* "constraint/problem.py":139 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -5814,13 +5168,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_12addConstraint(CYTHON_ return __pyx_r; } -/* "constraint/problem.py":167 +/* "constraint/problem.py":178 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_15getSolution(PyObject *__pyx_self, @@ -5852,7 +5206,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5860,11 +5214,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5872,16 +5227,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolution") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5892,7 +5247,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolution", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 178, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5929,175 +5284,198 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + unsigned int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); - /* "constraint/problem.py":181 + /* "constraint/problem.py":192 * dictionary mapping variables to values: Solution for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return None - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getArgs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + #endif + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + { + PyObject *__pyx_callargs[2+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL}; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(0, 192, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); + index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 3) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 181, __pyx_L1_error) + __PYX_ERR(0, 192, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_2; __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_vconstraints = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/problem.py":182 + /* "constraint/problem.py":193 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return None * return self._solver.getSolution(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 182, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { - /* "constraint/problem.py":183 + /* "constraint/problem.py":194 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return None # <<<<<<<<<<<<<< * return self._solver.getSolution(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "constraint/problem.py":182 + /* "constraint/problem.py":193 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return None * return self._solver.getSolution(domains, constraints, vconstraints) - */ +*/ } - /* "constraint/problem.py":184 + /* "constraint/problem.py":195 * if not domains: * return None * return self._solver.getSolution(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutions(self): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolution); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolution); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_5 = 1; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":167 + /* "constraint/problem.py":178 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6105,7 +5483,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6117,13 +5495,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_14getSolution(CYTHON_UN return __pyx_r; } -/* "constraint/problem.py":186 +/* "constraint/problem.py":197 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_17getSolutions(PyObject *__pyx_self, @@ -6155,7 +5533,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6163,11 +5541,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6175,16 +5554,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 186, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutions") < 0)) __PYX_ERR(0, 197, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6195,7 +5574,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 186, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutions", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 197, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6232,178 +5611,201 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + unsigned int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); - /* "constraint/problem.py":200 + /* "constraint/problem.py":211 * list of dictionaries mapping variables to values: All solutions for the problem * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return [] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getArgs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + #endif + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + { + PyObject *__pyx_callargs[2+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL}; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 211, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 200, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); + index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 3) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 211, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_2; __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_vconstraints = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/problem.py":201 + /* "constraint/problem.py":212 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 201, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { - /* "constraint/problem.py":202 + /* "constraint/problem.py":213 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return [] # <<<<<<<<<<<<<< * return self._solver.getSolutions(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":201 + /* "constraint/problem.py":212 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) - */ +*/ } - /* "constraint/problem.py":203 + /* "constraint/problem.py":214 * if not domains: * return [] * return self._solver.getSolutions(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutionIter(self): - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_5 = 1; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":186 + /* "constraint/problem.py":197 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6411,7 +5813,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.getSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6423,13 +5825,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_16getSolutions(CYTHON_U return __pyx_r; } -/* "constraint/problem.py":205 +/* "constraint/problem.py":216 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_19getSolutionIter(PyObject *__pyx_self, @@ -6461,7 +5863,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6469,11 +5871,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6481,16 +5884,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 205, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionIter") < 0)) __PYX_ERR(0, 216, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6501,7 +5904,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 205, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionIter", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 216, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6538,178 +5941,201 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; + unsigned int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; - unsigned int __pyx_t_9; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionIter", 1); + __Pyx_RefNannySetupContext("getSolutionIter", 0); - /* "constraint/problem.py":221 + /* "constraint/problem.py":232 * StopIteration * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) # <<<<<<<<<<<<<< * if not domains: * return iter(()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getArgs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getArgs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_t_4) < 0) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { - PyObject* sequence = __pyx_t_4; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + #endif + __pyx_t_6 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + { + PyObject *__pyx_callargs[2+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_3, NULL}; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_t_4, __pyx_t_6, __pyx_callargs+1, 0) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5, __pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 221, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); #endif - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed; + __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); + index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 2; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 3) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 221, __pyx_L1_error) + __PYX_ERR(0, 232, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_domains = __pyx_t_2; __pyx_t_2 = 0; - __pyx_v_constraints = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_vconstraints = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_constraints = __pyx_t_6; + __pyx_t_6 = 0; + __pyx_v_vconstraints = __pyx_t_4; + __pyx_t_4 = 0; - /* "constraint/problem.py":222 + /* "constraint/problem.py":233 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 222, __pyx_L1_error) - __pyx_t_8 = (!__pyx_t_7); - if (__pyx_t_8) { +*/ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domains); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_9 = (!__pyx_t_8); + if (__pyx_t_9) { - /* "constraint/problem.py":223 + /* "constraint/problem.py":234 * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: * return iter(()) # <<<<<<<<<<<<<< * return self._solver.getSolutionIter(domains, constraints, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyObject_GetIter(__pyx_empty_tuple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_1 = PyObject_GetIter(__pyx_mstate_global->__pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":222 + /* "constraint/problem.py":233 * """ * domains, constraints, vconstraints = self._getArgs(picklable=self._solver.requires_pickling) * if not domains: # <<<<<<<<<<<<<< * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) - */ +*/ } - /* "constraint/problem.py":224 + /* "constraint/problem.py":235 * if not domains: * return iter(()) * return self._solver.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_solver_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_9 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_solver_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutionIter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_9 = 1; - } + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_5 = 1; } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":205 + /* "constraint/problem.py":216 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6717,7 +6143,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -6729,13 +6155,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_18getSolutionIter(CYTHO return __pyx_r; } -/* "constraint/problem.py":226 +/* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_21getSolutionsOrderedList(PyObject *__pyx_self, @@ -6768,7 +6194,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsOrderedList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6776,14 +6202,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_order,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_order,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6791,29 +6220,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_order); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsOrderedList") < 0)) __PYX_ERR(0, 226, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsOrderedList") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -6823,7 +6258,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 226, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionsOrderedList", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 237, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6837,7 +6272,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 1))) __PYX_ERR(0, 226, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(__pyx_self, __pyx_v_self, __pyx_v_order); /* function exit code */ @@ -6856,13 +6291,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":230 +/* "constraint/problem.py":241 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_cur_scope; @@ -6872,11 +6307,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 230, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -6884,7 +6319,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_getSolutionsOrderedList, __pyx_n_s_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_2generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6908,8 +6343,6 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -6922,63 +6355,47 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 230, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 241, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 230, __pyx_L1_error) + __PYX_ERR(0, 241, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 241, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_solution); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_solution, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_solution, __pyx_n_s_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_solution, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -6987,12 +6404,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -7005,13 +6423,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi } static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":232 +/* "constraint/problem.py":243 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -7021,11 +6439,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7036,7 +6454,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedLi __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem_getSolutionsOrderedList, __pyx_n_s_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedList_5generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7074,59 +6492,61 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 232, __pyx_L1_error) - __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 232, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 243, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 232, __pyx_L1_error) + __PYX_ERR(0, 243, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 232, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 243, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_params); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_params, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order)) { __Pyx_RaiseClosureNameError("get_in_order"); __PYX_ERR(0, 232, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order)) { __Pyx_RaiseClosureNameError("get_in_order"); __PYX_ERR(0, 243, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order); __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_get_in_order; __pyx_t_5 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_params}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 232, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7136,12 +6556,14 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -7153,13 +6575,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_23getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":226 +/* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_cur_scope; @@ -7170,157 +6592,137 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; + int __pyx_t_3; + int __pyx_t_4; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsOrderedList", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 226, __pyx_L1_error) + __PYX_ERR(0, 237, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "constraint/problem.py":228 + /* "constraint/problem.py":239 * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() # <<<<<<<<<<<<<< * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 228, __pyx_L1_error) - __pyx_v_solutions = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_v_solutions = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/problem.py":229 + /* "constraint/problem.py":240 * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: # <<<<<<<<<<<<<< * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) - */ - __pyx_t_6 = (__pyx_v_order == ((PyObject*)Py_None)); - if (!__pyx_t_6) { +*/ + __pyx_t_4 = (__pyx_v_order == ((PyObject*)Py_None)); + if (!__pyx_t_4) { } else { - __pyx_t_5 = __pyx_t_6; + __pyx_t_3 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } if (unlikely(__pyx_v_order == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 229, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_order); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 229, __pyx_L1_error) - __pyx_t_6 = (__pyx_t_7 == 1); - __pyx_t_5 = __pyx_t_6; + __pyx_t_5 = __Pyx_PyList_GET_SIZE(__pyx_v_order); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_4 = (__pyx_t_5 == 1); + __pyx_t_3 = __pyx_t_4; __pyx_L4_bool_binop_done:; - if (__pyx_t_5) { + if (__pyx_t_3) { - /* "constraint/problem.py":230 + /* "constraint/problem.py":241 * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) # <<<<<<<<<<<<<< * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(NULL, __pyx_v_solutions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_genexpr(NULL, __pyx_v_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":229 + /* "constraint/problem.py":240 * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() * if order is None or len(order) == 1: # <<<<<<<<<<<<<< * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) - */ +*/ } - /* "constraint/problem.py":231 + /* "constraint/problem.py":242 * if order is None or len(order) == 1: * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) # <<<<<<<<<<<<<< * return list(get_in_order(params) for params in solutions) * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_Tuple(__pyx_v_order); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_Tuple(__pyx_v_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_get_in_order = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_6); + __pyx_cur_scope->__pyx_v_get_in_order = __pyx_t_6; + __pyx_t_6 = 0; - /* "constraint/problem.py":232 + /* "constraint/problem.py":243 * return list(tuple(solution.values()) for solution in solutions) * get_in_order = itemgetter(*order) * return list(get_in_order(params) for params in solutions) # <<<<<<<<<<<<<< * * def getSolutionsAsListDict( - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_solutions); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_6 = __pyx_pf_10constraint_7problem_7Problem_23getSolutionsOrderedList_3genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_solutions); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/problem.py":226 + /* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("constraint.problem.Problem.getSolutionsOrderedList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -7333,13 +6735,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_20getSolutionsOrderedLi return __pyx_r; } -/* "constraint/problem.py":234 +/* "constraint/problem.py":245 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_23getSolutionsAsListDict(PyObject *__pyx_self, @@ -7373,7 +6775,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsAsListDict (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -7381,25 +6783,30 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_order,&__pyx_n_s_validate,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_order,&__pyx_mstate_global->__pyx_n_u_validate,0}; - /* "constraint/problem.py":235 + /* "constraint/problem.py":246 * * def getSolutionsAsListDict( * self, order: list[str] = None, validate: bool = True # <<<<<<<<<<<<<< * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" - */ +*/ values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None)); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -7407,38 +6814,49 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_order); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_order); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_validate); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_validate); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsAsListDict") < 0)) __PYX_ERR(0, 234, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getSolutionsAsListDict") < 0)) __PYX_ERR(0, 245, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -7449,7 +6867,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 234, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getSolutionsAsListDict", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 245, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7463,16 +6881,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 1))) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_order), (&PyList_Type), 1, "order", 2))) __PYX_ERR(0, 246, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDict(__pyx_self, __pyx_v_self, __pyx_v_order, __pyx_v_validate); - /* "constraint/problem.py":234 + /* "constraint/problem.py":245 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* function exit code */ goto __pyx_L0; @@ -7505,202 +6923,201 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionsAsListDict", 1); + __Pyx_RefNannySetupContext("getSolutionsAsListDict", 0); - /* "constraint/problem.py":238 + /* "constraint/problem.py":249 * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" * solutions_list = self.getSolutionsOrderedList(order) # <<<<<<<<<<<<<< * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsOrderedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_order}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_solutions_list = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":239 + /* "constraint/problem.py":250 * """Returns the searchspace as a list of tuples, a dict of the searchspace for fast lookups and the size.""" * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) # <<<<<<<<<<<<<< * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: - */ - __pyx_t_5 = PyObject_Length(__pyx_v_solutions_list); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) +*/ + __pyx_t_5 = PyObject_Length(__pyx_v_solutions_list); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_size_list = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":240 + /* "constraint/problem.py":251 * solutions_list = self.getSolutionsOrderedList(order) * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) # <<<<<<<<<<<<<< * if validate: * # check for duplicates - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_size_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_size_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_solutions_list); __Pyx_GIVEREF(__pyx_v_solutions_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_solutions_list)) __PYX_ERR(0, 240, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 251, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_solutions_dict = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":241 + /* "constraint/problem.py":252 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< * # check for duplicates * size_dict = len(solutions_dict) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_validate); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 241, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_validate); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) if (__pyx_t_6) { - /* "constraint/problem.py":243 + /* "constraint/problem.py":254 * if validate: * # check for duplicates * size_dict = len(solutions_dict) # <<<<<<<<<<<<<< * if size_list != size_dict: * raise ValueError( - */ - __pyx_t_5 = PyDict_Size(__pyx_v_solutions_dict); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 243, __pyx_L1_error) - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) +*/ + __pyx_t_5 = PyDict_Size(__pyx_v_solutions_dict); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_size_dict = __pyx_t_2; __pyx_t_2 = 0; - /* "constraint/problem.py":244 + /* "constraint/problem.py":255 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_size_list, __pyx_v_size_dict, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 244, __pyx_L1_error) +*/ + __pyx_t_2 = PyObject_RichCompare(__pyx_v_size_list, __pyx_v_size_dict, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_6)) { - /* "constraint/problem.py":246 + /* "constraint/problem.py":257 * if size_list != size_dict: * raise ValueError( * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." # <<<<<<<<<<<<<< * ) * return ( - */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) +*/ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_size_list, __pyx_v_size_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_duplicate_parameter_configurati); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_duplicate_parameter_configurati); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":245 + /* "constraint/problem.py":256 * size_dict = len(solutions_dict) * if size_list != size_dict: * raise ValueError( # <<<<<<<<<<<<<< * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." * ) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 245, __pyx_L1_error) + __PYX_ERR(0, 256, __pyx_L1_error) - /* "constraint/problem.py":244 + /* "constraint/problem.py":255 * # check for duplicates * size_dict = len(solutions_dict) * if size_list != size_dict: # <<<<<<<<<<<<<< * raise ValueError( * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." - */ +*/ } - /* "constraint/problem.py":241 + /* "constraint/problem.py":252 * size_list = len(solutions_list) * solutions_dict: dict = dict(zip(solutions_list, range(size_list))) * if validate: # <<<<<<<<<<<<<< * # check for duplicates * size_dict = len(solutions_dict) - */ +*/ } - /* "constraint/problem.py":248 + /* "constraint/problem.py":259 * f"{size_list - size_dict} duplicate parameter configurations in searchspace, should not happen." * ) * return ( # <<<<<<<<<<<<<< * solutions_list, * solutions_dict, - */ +*/ __Pyx_XDECREF(__pyx_r); - /* "constraint/problem.py":249 + /* "constraint/problem.py":260 * ) * return ( * solutions_list, # <<<<<<<<<<<<<< * solutions_dict, * size_list, - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) +*/ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_solutions_list); __Pyx_GIVEREF(__pyx_v_solutions_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list)) __PYX_ERR(0, 249, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_solutions_list) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); __Pyx_INCREF(__pyx_v_solutions_dict); __Pyx_GIVEREF(__pyx_v_solutions_dict); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict)) __PYX_ERR(0, 249, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_solutions_dict) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); __Pyx_INCREF(__pyx_v_size_list); __Pyx_GIVEREF(__pyx_v_size_list); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list)) __PYX_ERR(0, 249, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_size_list) != (0)) __PYX_ERR(0, 260, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "constraint/problem.py":234 + /* "constraint/problem.py":245 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -7719,13 +7136,13 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_22getSolutionsAsListDic return __pyx_r; } -/* "constraint/problem.py":254 +/* "constraint/problem.py":265 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7problem_7Problem_25_getArgs(PyObject *__pyx_self, @@ -7757,7 +7174,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_getArgs (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -7765,14 +7182,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_picklable,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_picklable,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -7780,29 +7200,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_picklable); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 254, __pyx_L3_error) + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_picklable); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_getArgs") < 0)) __PYX_ERR(0, 254, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_getArgs") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -7812,7 +7238,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 254, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_getArgs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7840,13 +7266,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "constraint/problem.py":275 +/* "constraint/problem.py":286 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< * * vconstraints = {} - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_cur_scope; @@ -7856,11 +7282,11 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHO const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 275, __pyx_L1_error) + __PYX_ERR(0, 286, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -7868,7 +7294,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(CYTHO __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Problem__getArgs_locals_genexpr, __pyx_n_s_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Problem__getArgs_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_problem); if (unlikely(!gen)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -7908,22 +7334,25 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 275, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 275, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 286, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 286, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 275, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { @@ -7932,36 +7361,40 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 275, __pyx_L1_error) + __PYX_ERR(0, 286, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7_unpacking_done; @@ -7969,7 +7402,7 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 275, __pyx_L1_error) + __PYX_ERR(0, 286, __pyx_L1_error) __pyx_L7_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_c); @@ -7980,9 +7413,9 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_8 = PyObject_IsInstance(__pyx_cur_scope->__pyx_v_c, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { __Pyx_XDECREF(__pyx_r); @@ -8004,13 +7437,15 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -8022,13 +7457,13 @@ static PyObject *__pyx_gb_10constraint_7problem_7Problem_8_getArgs_2generator3(_ return __pyx_r; } -/* "constraint/problem.py":254 +/* "constraint/problem.py":265 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_picklable) { PyObject *__pyx_v_domains = NULL; @@ -8048,16 +7483,16 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - Py_ssize_t __pyx_t_5; - int __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); + Py_ssize_t __pyx_t_3; + int __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; + unsigned int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + Py_ssize_t __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); PyObject *__pyx_t_13 = NULL; PyObject *(*__pyx_t_14)(PyObject *); int __pyx_t_15; @@ -8067,305 +7502,295 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_getArgs", 1); + __Pyx_RefNannySetupContext("_getArgs", 0); - /* "constraint/problem.py":255 + /* "constraint/problem.py":266 * * def _getArgs(self, picklable=False): * domains = self._variables.copy() # <<<<<<<<<<<<<< * allvariables = domains.keys() * constraints: list[tuple[Constraint, list]] = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } __pyx_v_domains = __pyx_t_1; __pyx_t_1 = 0; - /* "constraint/problem.py":256 + /* "constraint/problem.py":267 * def _getArgs(self, picklable=False): * domains = self._variables.copy() * allvariables = domains.keys() # <<<<<<<<<<<<<< * constraints: list[tuple[Constraint, list]] = [] * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_domains, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_v_allvariables = __pyx_t_1; - __pyx_t_1 = 0; +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domains, __pyx_mstate_global->__pyx_n_u_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_allvariables = __pyx_t_2; + __pyx_t_2 = 0; - /* "constraint/problem.py":257 + /* "constraint/problem.py":268 * domains = self._variables.copy() * allvariables = domains.keys() * constraints: list[tuple[Constraint, list]] = [] # <<<<<<<<<<<<<< * * # parse string constraints - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_constraints = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_constraints = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/problem.py":260 + /* "constraint/problem.py":271 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 260, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = (__pyx_t_5 > 0); - if (__pyx_t_6) { +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_3 > 0); + if (__pyx_t_4) { - /* "constraint/problem.py":262 + /* "constraint/problem.py":273 * if len(self._str_constraints) > 0: * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: # <<<<<<<<<<<<<< * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_str_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; - __pyx_t_7 = NULL; +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_str_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 273, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_1 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_1)) { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 262, __pyx_L1_error) + else __PYX_ERR(0, 273, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/problem.py":263 + /* "constraint/problem.py":274 * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) # <<<<<<<<<<<<<< * for c, v, _ in parsed: * self.addConstraint(c, v) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_compile_to_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_constraint)) __PYX_ERR(0, 263, __pyx_L1_error); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_domains); - __Pyx_GIVEREF(__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_domains)) __PYX_ERR(0, 263, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_picklable, __pyx_v_picklable) < 0) __PYX_ERR(0, 263, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 263, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_9); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 274, __pyx_L1_error); + __pyx_t_8 = NULL; __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; + } + #endif + __pyx_t_10 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + { + PyObject *__pyx_callargs[3+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_7, __pyx_v_domains}; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_picklable, __pyx_v_picklable, __pyx_t_10, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_2 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9, __pyx_t_10); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_parsed, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/problem.py":264 + /* "constraint/problem.py":275 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< * self.addConstraint(c, v) * - */ +*/ if (likely(PyList_CheckExact(__pyx_v_parsed)) || PyTuple_CheckExact(__pyx_v_parsed)) { - __pyx_t_9 = __pyx_v_parsed; __Pyx_INCREF(__pyx_t_9); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; + __pyx_t_2 = __pyx_v_parsed; __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_12 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_parsed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 275, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 275, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_6); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_2 = __pyx_t_11(__pyx_t_9); - if (unlikely(!__pyx_t_2)) { + __pyx_t_6 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 264, __pyx_L1_error) + else __PYX_ERR(0, 275, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_6); } - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; + if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { + PyObject* sequence = __pyx_t_6; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 3)) { if (size > 3) __Pyx_RaiseTooManyValuesError(3); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 264, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_8 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_13 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); - index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_10); + index = 1; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; + __Pyx_GOTREF(__pyx_t_7); + index = 2; __pyx_t_8 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_8); - index = 1; __pyx_t_1 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 264, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 3) < 0) __PYX_ERR(0, 275, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L9_unpacking_done; @@ -8373,819 +7798,834 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 264, __pyx_L1_error) + __PYX_ERR(0, 275, __pyx_L1_error) __pyx_L9_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_8); + __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_10); + __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_7); + __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); - __pyx_t_1 = 0; - __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_12); - __pyx_t_12 = 0; - /* "constraint/problem.py":265 + /* "constraint/problem.py":276 * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: * self.addConstraint(c, v) # <<<<<<<<<<<<<< * * # add regular constraints - */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_addConstraint); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = NULL; - __pyx_t_4 = 0; +*/ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_addConstraint); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = NULL; + __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_4 = 1; - } + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + assert(__pyx_t_7); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_9 = 1; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_c, __pyx_v_v}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_c, __pyx_v_v}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":264 + /* "constraint/problem.py":275 * for constraint in self._str_constraints: * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: # <<<<<<<<<<<<<< * self.addConstraint(c, v) * - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":262 + /* "constraint/problem.py":273 * if len(self._str_constraints) > 0: * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: # <<<<<<<<<<<<<< * parsed = compile_to_constraints([constraint], domains, picklable=picklable) * for c, v, _ in parsed: - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":260 + /* "constraint/problem.py":271 * * # parse string constraints * if len(self._str_constraints) > 0: # <<<<<<<<<<<<<< * # warn("String constraints are a beta feature, please report issues experienced.") # future: remove * for constraint in self._str_constraints: - */ +*/ } - /* "constraint/problem.py":268 + /* "constraint/problem.py":279 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< * if not variables: * variables = list(allvariables) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); - __pyx_t_5 = 0; - __pyx_t_7 = NULL; +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_constraints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 279, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_3 = __pyx_t_7(__pyx_t_9); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 268, __pyx_L1_error) + else __PYX_ERR(0, 279, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); } - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 268, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_12 = PyList_GET_ITEM(sequence, 1); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 268, __pyx_L1_error) - __pyx_t_14 = NULL; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 279, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); + index = 0; __pyx_t_6 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + index = 1; __pyx_t_8 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L14_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 2) < 0) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_unpacking_done; __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 268, __pyx_L1_error) + __PYX_ERR(0, 279, __pyx_L1_error) __pyx_L15_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_12); - __pyx_t_12 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_6); + __pyx_t_6 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_8); + __pyx_t_8 = 0; - /* "constraint/problem.py":269 + /* "constraint/problem.py":280 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< * variables = list(allvariables) * constraints.append((constraint, variables)) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_variables); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 269, __pyx_L1_error) - __pyx_t_15 = (!__pyx_t_6); +*/ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_variables); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_15 = (!__pyx_t_4); if (__pyx_t_15) { - /* "constraint/problem.py":270 + /* "constraint/problem.py":281 * for constraint, variables in self._constraints: * if not variables: * variables = list(allvariables) # <<<<<<<<<<<<<< * constraints.append((constraint, variables)) * - */ - __pyx_t_3 = PySequence_List(__pyx_v_allvariables); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = PySequence_List(__pyx_v_allvariables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_variables, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/problem.py":269 + /* "constraint/problem.py":280 * # add regular constraints * for constraint, variables in self._constraints: * if not variables: # <<<<<<<<<<<<<< * variables = list(allvariables) * constraints.append((constraint, variables)) - */ +*/ } - /* "constraint/problem.py":271 + /* "constraint/problem.py":282 * if not variables: * variables = list(allvariables) * constraints.append((constraint, variables)) # <<<<<<<<<<<<<< * * # check if there are any precompiled FunctionConstraints when there shouldn't be - */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); +*/ + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_constraint)) __PYX_ERR(0, 271, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 282, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_variables)) __PYX_ERR(0, 271, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_constraints, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 282, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_constraints, __pyx_t_1); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":268 + /* "constraint/problem.py":279 * * # add regular constraints * for constraint, variables in self._constraints: # <<<<<<<<<<<<<< * if not variables: * variables = list(allvariables) - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":274 + /* "constraint/problem.py":285 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 * - */ - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 274, __pyx_L1_error) +*/ + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_picklable); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) if (__pyx_t_15) { - /* "constraint/problem.py":275 + /* "constraint/problem.py":286 * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 # <<<<<<<<<<<<<< * * vconstraints = {} - */ +*/ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_9 = __pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(NULL, __pyx_v_constraints); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 275, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = (!__pyx_t_15); - if (unlikely(!__pyx_t_6)) { - __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); - __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10constraint_7problem_7Problem_8_getArgs_genexpr(NULL, __pyx_v_constraints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_Generator_GetInlinedResult(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_15 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = (!__pyx_t_15); + if (unlikely(!__pyx_t_4)) { + __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_mstate_global->__pyx_kp_u_You_have_used_FunctionConstraint, 0, 0); + __PYX_ERR(0, 286, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 275, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 286, __pyx_L1_error) #endif - /* "constraint/problem.py":274 + /* "constraint/problem.py":285 * * # check if there are any precompiled FunctionConstraints when there shouldn't be * if picklable: # <<<<<<<<<<<<<< * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 * - */ +*/ } - /* "constraint/problem.py":277 + /* "constraint/problem.py":288 * assert not any(isinstance(c, FunctionConstraint) for c, _ in constraints), f"You have used FunctionConstraints with ParallelSolver(process_mode=True). Please use string constraints instead (see https://python-constraint.github.io/python-constraint/reference.html#constraint.ParallelSolver docs as to why)" # noqa E501 * * vconstraints = {} # <<<<<<<<<<<<<< * for variable in domains: * vconstraints[variable] = [] - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_vconstraints = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; +*/ + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_vconstraints = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/problem.py":278 + /* "constraint/problem.py":289 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< * vconstraints[variable] = [] * for constraint, variables in constraints: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_domains)) || PyTuple_CheckExact(__pyx_v_domains)) { - __pyx_t_3 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; - __pyx_t_7 = NULL; + __pyx_t_1 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 278, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 278, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_9 = __pyx_t_7(__pyx_t_3); - if (unlikely(!__pyx_t_9)) { + __pyx_t_2 = __pyx_t_5(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 278, __pyx_L1_error) + else __PYX_ERR(0, 289, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_9); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_9); - __pyx_t_9 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); + __pyx_t_2 = 0; - /* "constraint/problem.py":279 + /* "constraint/problem.py":290 * vconstraints = {} * for variable in domains: * vconstraints[variable] = [] # <<<<<<<<<<<<<< * for constraint, variables in constraints: * for variable in variables: - */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_9) < 0))) __PYX_ERR(0, 279, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +*/ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely((PyDict_SetItem(__pyx_v_vconstraints, __pyx_v_variable, __pyx_t_2) < 0))) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":278 + /* "constraint/problem.py":289 * * vconstraints = {} * for variable in domains: # <<<<<<<<<<<<<< * vconstraints[variable] = [] * for constraint, variables in constraints: - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":280 + /* "constraint/problem.py":291 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< * for variable in variables: * vconstraints[variable].append((constraint, variables)) - */ - __pyx_t_3 = __pyx_v_constraints; __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = 0; +*/ + __pyx_t_1 = __pyx_v_constraints; __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 280, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 291, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) { - PyObject* sequence = __pyx_t_9; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 280, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L24_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L24_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); + index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L24_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 2) < 0) __PYX_ERR(0, 291, __pyx_L1_error) __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L25_unpacking_done; __pyx_L24_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 280, __pyx_L1_error) + __PYX_ERR(0, 291, __pyx_L1_error) __pyx_L25_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_12); - __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/problem.py":281 + /* "constraint/problem.py":292 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_variables)) || PyTuple_CheckExact(__pyx_v_variables)) { - __pyx_t_9 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_9); - __pyx_t_10 = 0; - __pyx_t_7 = NULL; + __pyx_t_2 = __pyx_v_variables; __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = 0; + __pyx_t_5 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_7)) { - if (likely(PyList_CheckExact(__pyx_t_9))) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 281, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_11); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 281, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 292, __pyx_L1_error) #endif - if (__pyx_t_10 >= __pyx_temp) break; + if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_6); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_2 = __pyx_t_7(__pyx_t_9); - if (unlikely(!__pyx_t_2)) { + __pyx_t_6 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 281, __pyx_L1_error) + else __PYX_ERR(0, 292, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/problem.py":282 + /* "constraint/problem.py":293 * for constraint, variables in constraints: * for variable in variables: * vconstraints[variable].append((constraint, variables)) # <<<<<<<<<<<<<< * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) - */ - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); +*/ + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_constraint); __Pyx_GIVEREF(__pyx_v_constraint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_constraint)) __PYX_ERR(0, 282, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_constraint) != (0)) __PYX_ERR(0, 293, __pyx_L1_error); __Pyx_INCREF(__pyx_v_variables); __Pyx_GIVEREF(__pyx_v_variables); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_variables)) __PYX_ERR(0, 282, __pyx_L1_error); - __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_12); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_variables) != (0)) __PYX_ERR(0, 293, __pyx_L1_error); + __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_8); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "constraint/problem.py":281 + /* "constraint/problem.py":292 * vconstraints[variable] = [] * for constraint, variables in constraints: * for variable in variables: # <<<<<<<<<<<<<< * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":280 + /* "constraint/problem.py":291 * for variable in domains: * vconstraints[variable] = [] * for constraint, variables in constraints: # <<<<<<<<<<<<<< * for variable in variables: * vconstraints[variable].append((constraint, variables)) - */ +*/ } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":283 + /* "constraint/problem.py":294 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): - */ - __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_constraints, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); - __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +*/ + __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_constraints, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 283, __pyx_L1_error) + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error) #endif - if (__pyx_t_5 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 283, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); } else { - __pyx_t_12 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_6); } - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_12)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_12); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_1), 2) < 0) __PYX_ERR(0, 283, __pyx_L1_error) - __pyx_t_14 = NULL; + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); + index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_8)) goto __pyx_L32_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L32_unpacking_failed; + __Pyx_GOTREF(__pyx_t_6); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_7), 2) < 0) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L33_unpacking_done; __pyx_L32_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 283, __pyx_L1_error) + __PYX_ERR(0, 294, __pyx_L1_error) __pyx_L33_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_12); - __pyx_t_12 = 0; - __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); + __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_6); + __pyx_t_6 = 0; - /* "constraint/problem.py":284 + /* "constraint/problem.py":295 * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) # <<<<<<<<<<<<<< * for domain in domains.values(): * domain.resetState() - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_n_s_preProcess); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; - __pyx_t_4 = 0; +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_mstate_global->__pyx_n_u_preProcess); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = NULL; + __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6); + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_9 = 1; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_12, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_variables, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 4+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "constraint/problem.py":283 + /* "constraint/problem.py":294 * for variable in variables: * vconstraints[variable].append((constraint, variables)) * for constraint, variables in constraints[:]: # <<<<<<<<<<<<<< * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): - */ +*/ } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":285 + /* "constraint/problem.py":296 * for constraint, variables in constraints[:]: * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): # <<<<<<<<<<<<<< * domain.resetState() * if not domain: - */ - __pyx_t_5 = 0; +*/ + __pyx_t_3 = 0; if (unlikely(__pyx_v_domains == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values"); - __PYX_ERR(0, 285, __pyx_L1_error) + __PYX_ERR(0, 296, __pyx_L1_error) } - __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_domains, 0, __pyx_n_s_values, (&__pyx_t_10), (&__pyx_t_17)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_9); - __pyx_t_9 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_domains, 0, __pyx_mstate_global->__pyx_n_u_values, (&__pyx_t_11), (&__pyx_t_17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __pyx_t_2 = __pyx_t_1; + __pyx_t_1 = 0; while (1) { - __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_10, &__pyx_t_5, NULL, &__pyx_t_3, NULL, __pyx_t_17); + __pyx_t_18 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_11, &__pyx_t_3, NULL, &__pyx_t_1, NULL, __pyx_t_17); if (unlikely(__pyx_t_18 == 0)) break; - if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 285, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_3); - __pyx_t_3 = 0; + if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); + __pyx_t_1 = 0; - /* "constraint/problem.py":286 + /* "constraint/problem.py":297 * constraint.preProcess(variables, domains, constraints, vconstraints) * for domain in domains.values(): * domain.resetState() # <<<<<<<<<<<<<< - * if not domain: - * return None, None, None - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_resetState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + * if not domain: + * return None, None, None +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_resetState); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "constraint/problem.py":287 + /* "constraint/problem.py":298 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 287, __pyx_L1_error) - __pyx_t_15 = (!__pyx_t_6); +*/ + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_15 = (!__pyx_t_4); if (__pyx_t_15) { - /* "constraint/problem.py":288 + /* "constraint/problem.py":299 * domain.resetState() * if not domain: * return None, None, None # <<<<<<<<<<<<<< * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_tuple__3); - __pyx_r = __pyx_tuple__3; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[1]); + __pyx_r = __pyx_mstate_global->__pyx_tuple[1]; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/problem.py":287 + /* "constraint/problem.py":298 * for domain in domains.values(): * domain.resetState() * if not domain: # <<<<<<<<<<<<<< * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) - */ +*/ } } - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":290 + /* "constraint/problem.py":301 * return None, None, None * # doArc8(getArcs(domains, constraints), domains, {}) * return domains, constraints, vconstraints # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_domains); __Pyx_GIVEREF(__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_domains)) __PYX_ERR(0, 290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_domains) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); __Pyx_INCREF(__pyx_v_constraints); __Pyx_GIVEREF(__pyx_v_constraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_constraints)) __PYX_ERR(0, 290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_constraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_v_vconstraints); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_vconstraints)) __PYX_ERR(0, 290, __pyx_L1_error); - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_vconstraints) != (0)) __PYX_ERR(0, 301, __pyx_L1_error); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "constraint/problem.py":254 + /* "constraint/problem.py":265 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("constraint.problem.Problem._getArgs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; @@ -9207,11 +8647,7 @@ static PyObject *__pyx_pf_10constraint_7problem_7Problem_24_getArgs(CYTHON_UNUSE __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr = 0; -#endif +/* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -9220,8 +8656,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct__genexpr( o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9248,12 +8684,12 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr(P Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9267,6 +8703,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct__genexpr(P static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct__genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -9305,12 +8745,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9351,13 +8786,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9376,11 +8809,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct__genexpr }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -9388,8 +8816,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_1_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9415,12 +8843,12 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolut PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_get_in_order); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9434,6 +8862,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_1_getSolut static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_get_in_order) { e = (*v)(p->__pyx_v_get_in_order, a); if (e) return e; } @@ -9479,12 +8911,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9525,13 +8952,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9550,11 +8975,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_1_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -9562,8 +8982,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_2_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9590,12 +9010,12 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_solution); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_2_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9609,6 +9029,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_2_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_2_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -9647,12 +9071,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9693,13 +9112,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9718,11 +9135,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_2_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -9730,8 +9142,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_3_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9759,12 +9171,12 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_params); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9778,6 +9190,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_3_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_3_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -9819,12 +9235,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -9865,13 +9276,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -9890,11 +9299,6 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_3_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[8]; -static int __pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -9902,8 +9306,8 @@ static PyObject *__pyx_tp_new_10constraint_7problem___pyx_scope_struct_4_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[--__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -9931,12 +9335,12 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr( Py_CLEAR(p->__pyx_v__); Py_CLEAR(p->__pyx_v_c); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { - __pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7problem___pyx_scope_struct_4_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7problem___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -9950,6 +9354,10 @@ static void __pyx_tp_dealloc_10constraint_7problem___pyx_scope_struct_4_genexpr( static int __pyx_tp_traverse_10constraint_7problem___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10constraint_7problem___pyx_scope_struct_4_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -9991,12 +9399,7 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -10037,13 +9440,11 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -10065,548 +9466,149 @@ static PyTypeObject __pyx_type_10constraint_7problem___pyx_scope_struct_4_genexp static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_Add_a_constraint_to_the_problem, __pyx_k_Add_a_constraint_to_the_problem, sizeof(__pyx_k_Add_a_constraint_to_the_problem), 0, 1, 0, 0}, - {&__pyx_kp_u_Add_a_variable_to_the_problem_Ex, __pyx_k_Add_a_variable_to_the_problem_Ex, sizeof(__pyx_k_Add_a_variable_to_the_problem_Ex), 0, 1, 0, 0}, - {&__pyx_kp_u_Add_one_or_more_variables_to_the, __pyx_k_Add_one_or_more_variables_to_the, sizeof(__pyx_k_Add_one_or_more_variables_to_the), 0, 1, 0, 0}, - {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s_Callable, __pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 0, 1, 1}, - {&__pyx_kp_u_Change_the_problem_solver_curren, __pyx_k_Change_the_problem_solver_curren, sizeof(__pyx_k_Change_the_problem_solver_curren), 0, 1, 0, 0}, - {&__pyx_kp_s_Class_used_to_define_a_problem_a, __pyx_k_Class_used_to_define_a_problem_a, sizeof(__pyx_k_Class_used_to_define_a_problem_a), 0, 0, 1, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Constraints_must_be_instances_of, __pyx_k_Constraints_must_be_instances_of, sizeof(__pyx_k_Constraints_must_be_instances_of), 0, 1, 0, 0}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_kp_u_Domain_is_empty, __pyx_k_Domain_is_empty, sizeof(__pyx_k_Domain_is_empty), 0, 1, 0, 0}, - {&__pyx_kp_u_Domains_must_be_instances_of_sub, __pyx_k_Domains_must_be_instances_of_sub, sizeof(__pyx_k_Domains_must_be_instances_of_sub), 0, 1, 0, 0}, - {&__pyx_kp_u_Expected_constraints_to_be_strin, __pyx_k_Expected_constraints_to_be_strin, sizeof(__pyx_k_Expected_constraints_to_be_strin), 0, 1, 0, 0}, - {&__pyx_kp_u_Find_and_return_a_solution_to_th, __pyx_k_Find_and_return_a_solution_to_th, sizeof(__pyx_k_Find_and_return_a_solution_to_th), 0, 1, 0, 0}, - {&__pyx_kp_u_Find_and_return_all_solutions_to, __pyx_k_Find_and_return_all_solutions_to, sizeof(__pyx_k_Find_and_return_all_solutions_to), 0, 1, 0, 0}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Hashable, __pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 0, 1, 1}, - {&__pyx_kp_u_Obtain_the_problem_solver_curren, __pyx_k_Obtain_the_problem_solver_curren, sizeof(__pyx_k_Obtain_the_problem_solver_curren), 0, 1, 0, 0}, - {&__pyx_n_s_OptimizedBacktrackingSolver, __pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_Optional, __pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 0, 1, 1}, - {&__pyx_kp_s_Optional_Sequence, __pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 0, 1, 0}, - {&__pyx_n_s_ParallelSolver, __pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_ParallelSolver_is_currently_expe, __pyx_k_ParallelSolver_is_currently_expe, sizeof(__pyx_k_ParallelSolver_is_currently_expe), 0, 1, 0, 0}, - {&__pyx_n_s_Problem, __pyx_k_Problem, sizeof(__pyx_k_Problem), 0, 0, 1, 1}, - {&__pyx_n_s_Problem___init, __pyx_k_Problem___init, sizeof(__pyx_k_Problem___init), 0, 0, 1, 1}, - {&__pyx_n_s_Problem__getArgs, __pyx_k_Problem__getArgs, sizeof(__pyx_k_Problem__getArgs), 0, 0, 1, 1}, - {&__pyx_n_s_Problem__getArgs_locals_genexpr, __pyx_k_Problem__getArgs_locals_genexpr, sizeof(__pyx_k_Problem__getArgs_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_addConstraint, __pyx_k_Problem_addConstraint, sizeof(__pyx_k_Problem_addConstraint), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addConstraint_line_128, __pyx_k_Problem_addConstraint_line_128, sizeof(__pyx_k_Problem_addConstraint_line_128), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_addConstraint_locals_gen, __pyx_k_Problem_addConstraint_locals_gen, sizeof(__pyx_k_Problem_addConstraint_locals_gen), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_addVariable, __pyx_k_Problem_addVariable, sizeof(__pyx_k_Problem_addVariable), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addVariable_line_75, __pyx_k_Problem_addVariable_line_75, sizeof(__pyx_k_Problem_addVariable_line_75), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_addVariables, __pyx_k_Problem_addVariables, sizeof(__pyx_k_Problem_addVariables), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_addVariables_line_105, __pyx_k_Problem_addVariables_line_105, sizeof(__pyx_k_Problem_addVariables_line_105), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolution, __pyx_k_Problem_getSolution, sizeof(__pyx_k_Problem_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionIter, __pyx_k_Problem_getSolutionIter, sizeof(__pyx_k_Problem_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolutionIter_line_205, __pyx_k_Problem_getSolutionIter_line_205, sizeof(__pyx_k_Problem_getSolutionIter_line_205), 0, 1, 0, 0}, - {&__pyx_kp_u_Problem_getSolution_line_167, __pyx_k_Problem_getSolution_line_167, sizeof(__pyx_k_Problem_getSolution_line_167), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolutions, __pyx_k_Problem_getSolutions, sizeof(__pyx_k_Problem_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsAsListDict, __pyx_k_Problem_getSolutionsAsListDict, sizeof(__pyx_k_Problem_getSolutionsAsListDict), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsOrderedList, __pyx_k_Problem_getSolutionsOrderedList, sizeof(__pyx_k_Problem_getSolutionsOrderedList), 0, 0, 1, 1}, - {&__pyx_n_s_Problem_getSolutionsOrderedList_2, __pyx_k_Problem_getSolutionsOrderedList_2, sizeof(__pyx_k_Problem_getSolutionsOrderedList_2), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolutions_line_186, __pyx_k_Problem_getSolutions_line_186, sizeof(__pyx_k_Problem_getSolutions_line_186), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_getSolver, __pyx_k_Problem_getSolver, sizeof(__pyx_k_Problem_getSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_getSolver_line_61, __pyx_k_Problem_getSolver_line_61, sizeof(__pyx_k_Problem_getSolver_line_61), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_reset, __pyx_k_Problem_reset, sizeof(__pyx_k_Problem_reset), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_reset_line_33, __pyx_k_Problem_reset_line_33, sizeof(__pyx_k_Problem_reset_line_33), 0, 1, 0, 0}, - {&__pyx_n_s_Problem_setSolver, __pyx_k_Problem_setSolver, sizeof(__pyx_k_Problem_setSolver), 0, 0, 1, 1}, - {&__pyx_kp_u_Problem_setSolver_line_46, __pyx_k_Problem_setSolver_line_46, sizeof(__pyx_k_Problem_setSolver_line_46), 0, 1, 0, 0}, - {&__pyx_kp_u_Reset_the_current_problem_defini, __pyx_k_Reset_the_current_problem_defini, sizeof(__pyx_k_Reset_the_current_problem_defini), 0, 1, 0, 0}, - {&__pyx_kp_u_Return_an_iterator_to_the_soluti, __pyx_k_Return_an_iterator_to_the_soluti, sizeof(__pyx_k_Return_an_iterator_to_the_soluti), 0, 1, 0, 0}, - {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1}, - {&__pyx_n_s_Solver, __pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 0, 1, 1}, - {&__pyx_kp_u_Tried_to_insert_duplicated_varia, __pyx_k_Tried_to_insert_duplicated_varia, sizeof(__pyx_k_Tried_to_insert_duplicated_varia), 0, 1, 0, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s_Union, __pyx_k_Union, sizeof(__pyx_k_Union), 0, 0, 1, 1}, - {&__pyx_kp_s_Union_Constraint_Callable_str, __pyx_k_Union_Constraint_Callable_str, sizeof(__pyx_k_Union_Constraint_Callable_str), 0, 0, 1, 0}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_u_You_have_used_FunctionConstraint, __pyx_k_You_have_used_FunctionConstraint, sizeof(__pyx_k_You_have_used_FunctionConstraint), 0, 1, 0, 0}, - {&__pyx_n_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 1}, - {&__pyx_n_s__32, __pyx_k__32, sizeof(__pyx_k__32), 0, 0, 1, 1}, - {&__pyx_n_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 1}, - {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, - {&__pyx_n_s_addConstraint, __pyx_k_addConstraint, sizeof(__pyx_k_addConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_addVariable, __pyx_k_addVariable, sizeof(__pyx_k_addVariable), 0, 0, 1, 1}, - {&__pyx_n_s_addVariables, __pyx_k_addVariables, sizeof(__pyx_k_addVariables), 0, 0, 1, 1}, - {&__pyx_n_s_allvariables, __pyx_k_allvariables, sizeof(__pyx_k_allvariables), 0, 0, 1, 1}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_constraints, __pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_parser, __pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_problem, __pyx_k_constraint_problem, sizeof(__pyx_k_constraint_problem), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_problem_py, __pyx_k_constraint_problem_py, sizeof(__pyx_k_constraint_problem_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraint_solvers, __pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 0, 1, 1}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraints_2, __pyx_k_constraints_2, sizeof(__pyx_k_constraints_2), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_duplicate_parameter_configurati, __pyx_k_duplicate_parameter_configurati, sizeof(__pyx_k_duplicate_parameter_configurati), 0, 1, 0, 0}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_getArgs, __pyx_k_getArgs, sizeof(__pyx_k_getArgs), 0, 0, 1, 1}, - {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionIter, __pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutions, __pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsAsListDict, __pyx_k_getSolutionsAsListDict, sizeof(__pyx_k_getSolutionsAsListDict), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsOrderedList, __pyx_k_getSolutionsOrderedList, sizeof(__pyx_k_getSolutionsOrderedList), 0, 0, 1, 1}, - {&__pyx_n_s_getSolver, __pyx_k_getSolver, sizeof(__pyx_k_getSolver), 0, 0, 1, 1}, - {&__pyx_n_s_get_in_order, __pyx_k_get_in_order, sizeof(__pyx_k_get_in_order), 0, 0, 1, 1}, - {&__pyx_n_u_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 0, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_kp_s_list_str, __pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, - {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1}, - {&__pyx_n_s_parsed, __pyx_k_parsed, sizeof(__pyx_k_parsed), 0, 0, 1, 1}, - {&__pyx_n_s_picklable, __pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 0, 1, 1}, - {&__pyx_n_s_preProcess, __pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_requires_pickling, __pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 0, 1, 1}, - {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1}, - {&__pyx_n_s_resetState, __pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_setSolver, __pyx_k_setSolver, sizeof(__pyx_k_setSolver), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_size_dict, __pyx_k_size_dict, sizeof(__pyx_k_size_dict), 0, 0, 1, 1}, - {&__pyx_n_s_size_list, __pyx_k_size_list, sizeof(__pyx_k_size_list), 0, 0, 1, 1}, - {&__pyx_n_s_solutions, __pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 0, 1, 1}, - {&__pyx_n_s_solutions_dict, __pyx_k_solutions_dict, sizeof(__pyx_k_solutions_dict), 0, 0, 1, 1}, - {&__pyx_n_s_solutions_list, __pyx_k_solutions_list, sizeof(__pyx_k_solutions_list), 0, 0, 1, 1}, - {&__pyx_n_s_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 0, 1, 1}, - {&__pyx_n_s_solver_2, __pyx_k_solver_2, sizeof(__pyx_k_solver_2), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_str_constraints, __pyx_k_str_constraints, sizeof(__pyx_k_str_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_kp_s_tuple_list_tuple_dict_tuple_int, __pyx_k_tuple_list_tuple_dict_tuple_int, sizeof(__pyx_k_tuple_list_tuple_dict_tuple_int), 0, 0, 1, 0}, - {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_variables_2, __pyx_k_variables_2, sizeof(__pyx_k_variables_2), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, - {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, - {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 93, __pyx_L1_error) - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 100, __pyx_L1_error) - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 151, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 240, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 240, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/problem.py":43 - * >>> - * """ - * del self._constraints[:] # <<<<<<<<<<<<<< - * self._variables.clear() - * - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/problem.py":102 - * raise TypeError(msg) - * if not domain: - * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< - * self._variables[variable] = domain - * - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Domain_is_empty); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "constraint/problem.py":288 - * domain.resetState() - * if not domain: - * return None, None, None # <<<<<<<<<<<<<< - * # doArc8(getArcs(domains, constraints), domains, {}) - * return domains, constraints, vconstraints - */ - __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 288, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "constraint/problem.py":18 - * """Class used to define a problem and retrieve solutions.""" - * - * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_solver); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_tuple__8 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - - /* "constraint/problem.py":33 - * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 - * - * def reset(self): # <<<<<<<<<<<<<< - * """Reset the current problem definition. - * - */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_reset, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 33, __pyx_L1_error) - - /* "constraint/problem.py":46 - * self._variables.clear() - * - * def setSolver(self, solver): # <<<<<<<<<<<<<< - * """Change the problem solver currently in use. - * - */ - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_setSolver, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 46, __pyx_L1_error) - - /* "constraint/problem.py":61 - * self._solver = solver - * - * def getSolver(self): # <<<<<<<<<<<<<< - * """Obtain the problem solver currently in use. - * - */ - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolver, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 61, __pyx_L1_error) - - /* "constraint/problem.py":75 - * return self._solver - * - * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< - * """Add a variable to the problem. - * - */ - __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addVariable, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 75, __pyx_L1_error) - - /* "constraint/problem.py":105 - * self._variables[variable] = domain - * - * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< - * """Add one or more variables to the problem. - * - */ - __pyx_tuple__15 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_variables_2, __pyx_n_s_domain, __pyx_n_s_variable); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addVariables, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 105, __pyx_L1_error) - - /* "constraint/problem.py":128 - * self.addVariable(variable, domain) - * - * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< - * """Add a constraint to the problem. - * - */ - __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_constraint, __pyx_n_s_variables_2, __pyx_n_s_msg, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_addConstraint, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 128, __pyx_L1_error) - - /* "constraint/problem.py":167 - * self._constraints.append((constraint, variables)) - * - * def getSolution(self): # <<<<<<<<<<<<<< - * """Find and return a solution to the problem. - * - */ - __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints_2, __pyx_n_s_vconstraints); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolution, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 167, __pyx_L1_error) - - /* "constraint/problem.py":186 - * return self._solver.getSolution(domains, constraints, vconstraints) - * - * def getSolutions(self): # <<<<<<<<<<<<<< - * """Find and return all solutions to the problem. - * - */ - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutions, 186, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 186, __pyx_L1_error) - - /* "constraint/problem.py":205 - * return self._solver.getSolutions(domains, constraints, vconstraints) - * - * def getSolutionIter(self): # <<<<<<<<<<<<<< - * """Return an iterator to the solutions of the problem. - * - */ - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutionIter, 205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 205, __pyx_L1_error) - - /* "constraint/problem.py":226 - * return self._solver.getSolutionIter(domains, constraints, vconstraints) - * - * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< - * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" - * solutions: list[dict] = self.getSolutions() - */ - __pyx_tuple__23 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_order, __pyx_n_s_solutions, __pyx_n_s_get_in_order, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getSolutionsOrderedList, 226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 226, __pyx_L1_error) - - /* "constraint/problem.py":234 - * return list(get_in_order(params) for params in solutions) - * - * def getSolutionsAsListDict( # <<<<<<<<<<<<<< - * self, order: list[str] = None, validate: bool = True - * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ - __pyx_tuple__25 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_order, __pyx_n_s_validate, __pyx_n_s_solutions_list, __pyx_n_s_size_list, __pyx_n_s_solutions_dict, __pyx_n_s_size_dict); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__25); - __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 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_constraint_problem_py, __pyx_n_s_getSolutionsAsListDict, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 234, __pyx_L1_error) - __pyx_tuple__27 = PyTuple_Pack(2, Py_None, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - - /* "constraint/problem.py":254 - * ) - * - * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< - * domains = self._variables.copy() - * allvariables = domains.keys() - */ - __pyx_tuple__29 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_picklable, __pyx_n_s_domains, __pyx_n_s_allvariables, __pyx_n_s_constraints_2, __pyx_n_s_constraint, __pyx_n_s_parsed, __pyx_n_s_c, __pyx_n_s_v, __pyx_n_s__28, __pyx_n_s_variables_2, __pyx_n_s_vconstraints, __pyx_n_s_variable, __pyx_n_s_domain, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__29); - __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_problem_py, __pyx_n_s_getArgs, 254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 254, __pyx_L1_error) - __pyx_tuple__31 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 254, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - /* AssertionsEnabled.init */ - if (likely(__Pyx_init_assertions_enabled() == 0)); else - -if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) - - return 0; - __pyx_L1_error:; - return -1; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr)) __PYX_ERR(0, 151, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr)) __PYX_ERR(0, 162, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct__genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 162, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)) __PYX_ERR(0, 226, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList)) __PYX_ERR(0, 237, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList = &__pyx_type_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 226, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList) < 0) __PYX_ERR(0, 237, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_1_getSolutionsOrderedList->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 230, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 241, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 241, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_2_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 232, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 243, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 243, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 275, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 286, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) #else - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr = &__pyx_type_10constraint_7problem___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 286, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7problem___pyx_scope_struct_4_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -10616,38 +9618,42 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_problem(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_problem}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + #endif {0, NULL} }; #endif @@ -10665,7 +9671,7 @@ namespace { #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + sizeof(__pyx_mstatetype), /* m_size */ #else -1, /* m_size */ #endif @@ -10688,50 +9694,37 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initproblem(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initproblem(void) -#else __Pyx_PyMODINIT_FUNC PyInit_problem(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_problem(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { + if (__Pyx_VersionSanityCheck() < 0) return NULL; return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif { PyErr_SetString( PyExc_ImportError, @@ -10795,16 +9788,23 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_module) #endif -#endif { + #if !CYTHON_PEP489_MULTI_PHASE_INIT + if (__Pyx_VersionSanityCheck() < 0) return NULL; + #endif int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -10815,7 +9815,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod PyErr_SetString(PyExc_RuntimeError, "Module 'problem' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ @@ -10823,10 +9823,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("problem", __pyx_methods, __pyx_k_Module_containing_the_code_for_p, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE + #if CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); @@ -10838,13 +9835,18 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_problem(PyObject *__pyx_pyinit_mod __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); #endif + #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -10854,14 +9856,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_problem(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_problem", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -10877,48 +9880,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__problem) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.problem")) { if (unlikely((PyDict_SetItemString(modules, "constraint.problem", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/problem.py":3 * """Module containing the code for problem definitions.""" @@ -10926,10 +9915,10 @@ if (!__Pyx_RefNanny) { * import copy # <<<<<<<<<<<<<< * from warnings import warn * from operator import itemgetter - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_copy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_copy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/problem.py":4 @@ -10938,18 +9927,15 @@ if (!__Pyx_RefNanny) { * from warnings import warn # <<<<<<<<<<<<<< * from operator import itemgetter * from typing import Callable, Optional, Union - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_warn); - __Pyx_GIVEREF(__pyx_n_s_warn); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_warn)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_warnings, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_warn, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10959,18 +9945,15 @@ if (!__Pyx_RefNanny) { * from operator import itemgetter # <<<<<<<<<<<<<< * from typing import Callable, Optional, Union * from collections.abc import Sequence, Hashable - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_itemgetter); - __Pyx_GIVEREF(__pyx_n_s_itemgetter); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_itemgetter)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_operator, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemgetter, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_itemgetter, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10980,32 +9963,23 @@ if (!__Pyx_RefNanny) { * from typing import Callable, Optional, Union # <<<<<<<<<<<<<< * from collections.abc import Sequence, Hashable * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Callable); - __Pyx_GIVEREF(__pyx_n_s_Callable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Callable)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Optional); - __Pyx_GIVEREF(__pyx_n_s_Optional); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Optional)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Union); - __Pyx_GIVEREF(__pyx_n_s_Union); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_Union)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Callable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Callable, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Optional); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Optional, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Union); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Union, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Union, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11015,25 +9989,19 @@ if (!__Pyx_RefNanny) { * from collections.abc import Sequence, Hashable # <<<<<<<<<<<<<< * * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint - */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Sequence); - __Pyx_GIVEREF(__pyx_n_s_Sequence); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Sequence)) __PYX_ERR(0, 7, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Hashable); - __Pyx_GIVEREF(__pyx_n_s_Hashable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_Hashable)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sequence, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Sequence, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11043,32 +10011,23 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< * from constraint.domain import Domain * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Constraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 9, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11078,18 +10037,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Domain # <<<<<<<<<<<<<< * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver * from constraint.parser import compile_to_constraints - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Domain); - __Pyx_GIVEREF(__pyx_n_s_Domain); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Domain)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11099,32 +10055,23 @@ if (!__Pyx_RefNanny) { * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver # <<<<<<<<<<<<<< * from constraint.parser import compile_to_constraints * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Solver); - __Pyx_GIVEREF(__pyx_n_s_Solver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Solver)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_OptimizedBacktrackingSolver); - __Pyx_GIVEREF(__pyx_n_s_OptimizedBacktrackingSolver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_OptimizedBacktrackingSolver)) __PYX_ERR(0, 11, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ParallelSolver); - __Pyx_GIVEREF(__pyx_n_s_ParallelSolver); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ParallelSolver)) __PYX_ERR(0, 11, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_solvers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Solver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ParallelSolver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParallelSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -11133,258 +10080,375 @@ if (!__Pyx_RefNanny) { * from constraint.solvers import Solver, OptimizedBacktrackingSolver, ParallelSolver * from constraint.parser import compile_to_constraints # <<<<<<<<<<<<<< * - * - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + * try: +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_compile_to_constraints); - __Pyx_GIVEREF(__pyx_n_s_compile_to_constraints); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_compile_to_constraints)) __PYX_ERR(0, 12, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_parser, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_parser, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_compile_to_constraints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_constraints, __pyx_t_3) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":15 + /* "constraint/problem.py":14 + * from constraint.parser import compile_to_constraints + * + * try: # <<<<<<<<<<<<<< + * from sys import _is_gil_enabled + * freethreading = not _is_gil_enabled() +*/ + { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5); + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_5); + /*try:*/ { + + /* "constraint/problem.py":15 + * + * try: + * from sys import _is_gil_enabled # <<<<<<<<<<<<<< + * freethreading = not _is_gil_enabled() + * except ImportError: +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_gil_enabled, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/problem.py":16 + * try: + * from sys import _is_gil_enabled + * freethreading = not _is_gil_enabled() # <<<<<<<<<<<<<< + * except ImportError: + * freethreading = False +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_is_gil_enabled); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 16, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 16, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L2_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L2_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "constraint/problem.py":14 + * from constraint.parser import compile_to_constraints + * + * try: # <<<<<<<<<<<<<< + * from sys import _is_gil_enabled + * freethreading = not _is_gil_enabled() +*/ + } + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + goto __pyx_L7_try_end; + __pyx_L2_error:; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "constraint/problem.py":17 + * from sys import _is_gil_enabled + * freethreading = not _is_gil_enabled() + * except ImportError: # <<<<<<<<<<<<<< + * freethreading = False + * +*/ + __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); + if (__pyx_t_7) { + __Pyx_AddTraceback("constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_8) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error) + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); + __Pyx_XGOTREF(__pyx_t_8); + + /* "constraint/problem.py":18 + * freethreading = not _is_gil_enabled() + * except ImportError: + * freethreading = False # <<<<<<<<<<<<<< + * + * +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_freethreading, Py_False) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error) + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + goto __pyx_L3_exception_handled; + } + goto __pyx_L4_except_error; + + /* "constraint/problem.py":14 + * from constraint.parser import compile_to_constraints + * + * try: # <<<<<<<<<<<<<< + * from sys import _is_gil_enabled + * freethreading = not _is_gil_enabled() +*/ + __pyx_L4_except_error:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + goto __pyx_L1_error; + __pyx_L3_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_1); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_XGIVEREF(__pyx_t_5); + __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5); + __pyx_L7_try_end:; + } + + /* "constraint/problem.py":21 * * * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * - */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Problem, __pyx_n_s_Problem, (PyObject *) NULL, __pyx_n_s_constraint_problem, __pyx_kp_s_Class_used_to_define_a_problem_a); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); +*/ + __pyx_t_8 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_n_u_Problem, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_kp_u_Class_used_to_define_a_problem_a); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 21, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "constraint/problem.py":18 + /* "constraint/problem.py":24 * """Class used to define a problem and retrieve solutions.""" * * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_solver, __pyx_n_s_Solver) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_1__init__, 0, __pyx_n_s_Problem___init, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_solver, __pyx_mstate_global->__pyx_n_u_Solver) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Problem___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 18, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":33 - * warn("ParallelSolver is currently experimental, and unlikely to be faster than OptimizedBacktrackingSolver. Please report any issues.") # future: remove # noqa E501 + /* "constraint/problem.py":44 + * warn("Using the ParallelSolver in ThreadPool mode without freethreading will cause poor performance.") * * def reset(self): # <<<<<<<<<<<<<< * """Reset the current problem definition. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_3reset, 0, __pyx_n_s_Problem_reset, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_reset, __pyx_t_4) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_3reset, 0, __pyx_mstate_global->__pyx_n_u_Problem_reset, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":46 + /* "constraint/problem.py":57 * self._variables.clear() * * def setSolver(self, solver): # <<<<<<<<<<<<<< * """Change the problem solver currently in use. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_5setSolver, 0, __pyx_n_s_Problem_setSolver, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setSolver, __pyx_t_4) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_5setSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_setSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_setSolver, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":61 + /* "constraint/problem.py":72 * self._solver = solver * * def getSolver(self): # <<<<<<<<<<<<<< * """Obtain the problem solver currently in use. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_7getSolver, 0, __pyx_n_s_Problem_getSolver, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolver, __pyx_t_4) < 0) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_7getSolver, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolver, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolver, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":75 + /* "constraint/problem.py":86 * return self._solver * * def addVariable(self, variable: Hashable, domain): # <<<<<<<<<<<<<< * """Add a variable to the problem. * - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variable, __pyx_n_s_Hashable) < 0) __PYX_ERR(0, 75, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_9addVariable, 0, __pyx_n_s_Problem_addVariable, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variable, __pyx_mstate_global->__pyx_n_u_Hashable) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_9addVariable, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariable, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_addVariable, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_addVariable, __pyx_t_3) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":105 + /* "constraint/problem.py":116 * self._variables[variable] = domain * * def addVariables(self, variables: Sequence, domain): # <<<<<<<<<<<<<< * """Add one or more variables to the problem. * - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_variables_2, __pyx_n_s_Sequence) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_11addVariables, 0, __pyx_n_s_Problem_addVariables, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_n_u_Sequence) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_11addVariables, 0, __pyx_mstate_global->__pyx_n_u_Problem_addVariables, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_addVariables, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_addVariables, __pyx_t_2) < 0) __PYX_ERR(0, 116, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":128 + /* "constraint/problem.py":139 * self.addVariable(variable, domain) * * def addConstraint(self, constraint: Union[Constraint, Callable, str], variables: Optional[Sequence] = None): # <<<<<<<<<<<<<< * """Add a constraint to the problem. * - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraint, __pyx_kp_s_Union_Constraint_Callable_str) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_variables_2, __pyx_kp_s_Optional_Sequence) < 0) __PYX_ERR(0, 128, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_13addConstraint, 0, __pyx_n_s_Problem_addConstraint, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_kp_u_Union_Constraint_Callable_str) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variables_2, __pyx_mstate_global->__pyx_kp_u_Optional_Sequence) < 0) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_13addConstraint, 0, __pyx_mstate_global->__pyx_n_u_Problem_addConstraint, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_addConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_addConstraint, __pyx_t_3) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":167 + /* "constraint/problem.py":178 * self._constraints.append((constraint, variables)) * * def getSolution(self): # <<<<<<<<<<<<<< * """Find and return a solution to the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_15getSolution, 0, __pyx_n_s_Problem_getSolution, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_15getSolution, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolution, __pyx_t_3) < 0) __PYX_ERR(0, 167, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_3) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":186 + /* "constraint/problem.py":197 * return self._solver.getSolution(domains, constraints, vconstraints) * * def getSolutions(self): # <<<<<<<<<<<<<< * """Find and return all solutions to the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_17getSolutions, 0, __pyx_n_s_Problem_getSolutions, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_17getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutions, __pyx_t_3) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_3) < 0) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":205 + /* "constraint/problem.py":216 * return self._solver.getSolutions(domains, constraints, vconstraints) * * def getSolutionIter(self): # <<<<<<<<<<<<<< * """Return an iterator to the solutions of the problem. * - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter, 0, __pyx_n_s_Problem_getSolutionIter, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_19getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutionIter, __pyx_t_3) < 0) __PYX_ERR(0, 205, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_3) < 0) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":226 + /* "constraint/problem.py":237 * return self._solver.getSolutionIter(domains, constraints, vconstraints) * * def getSolutionsOrderedList(self, order: list[str] = None) -> list[tuple]: # <<<<<<<<<<<<<< * """Returns the solutions as a list of tuples, with each solution tuple ordered according to `order`.""" * solutions: list[dict] = self.getSolutions() - */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList, 0, __pyx_n_s_Problem_getSolutionsOrderedList_2, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_21getSolutionsOrderedList, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsOrderedList_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutionsOrderedList, __pyx_t_4) < 0) __PYX_ERR(0, 226, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolutionsOrderedList, __pyx_t_2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "constraint/problem.py":234 + /* "constraint/problem.py":245 * return list(get_in_order(params) for params in solutions) * * def getSolutionsAsListDict( # <<<<<<<<<<<<<< * self, order: list[str] = None, validate: bool = True * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 - */ - __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_kp_s_list_str) < 0) __PYX_ERR(0, 234, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_validate, __pyx_n_s_bool) < 0) __PYX_ERR(0, 234, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_tuple_list_tuple_dict_tuple_int) < 0) __PYX_ERR(0, 234, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict, 0, __pyx_n_s_Problem_getSolutionsAsListDict, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_kp_u_list_str) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_validate, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_tuple_dict_tuple_int) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_23getSolutionsAsListDict, 0, __pyx_mstate_global->__pyx_n_u_Problem_getSolutionsAsListDict, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__27); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutionsAsListDict, __pyx_t_3) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[3]); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getSolutionsAsListDict, __pyx_t_3) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":254 + /* "constraint/problem.py":265 * ) * * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< * domains = self._variables.copy() * allvariables = domains.keys() - */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_25_getArgs, 0, __pyx_n_s_Problem__getArgs, NULL, __pyx_n_s_constraint_problem, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7problem_7Problem_25_getArgs, 0, __pyx_mstate_global->__pyx_n_u_Problem__getArgs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_problem, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__31); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getArgs, __pyx_t_3) < 0) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[4]); + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_getArgs, __pyx_t_3) < 0) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "constraint/problem.py":15 + /* "constraint/problem.py":21 * * * class Problem: # <<<<<<<<<<<<<< * """Class used to define a problem and retrieve solutions.""" * - */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Problem, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Problem, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Problem, __pyx_t_3) < 0) __PYX_ERR(0, 15, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Problem, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/problem.py":1 * """Module containing the code for problem definitions.""" # <<<<<<<<<<<<<< * * import copy - */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_reset_line_33, __pyx_kp_u_Reset_the_current_problem_defini) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_setSolver_line_46, __pyx_kp_u_Change_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_getSolver_line_61, __pyx_kp_u_Obtain_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_addVariable_line_75, __pyx_kp_u_Add_a_variable_to_the_problem_Ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_addVariables_line_105, __pyx_kp_u_Add_one_or_more_variables_to_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_addConstraint_line_128, __pyx_kp_u_Add_a_constraint_to_the_problem) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_getSolution_line_167, __pyx_kp_u_Find_and_return_a_solution_to_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_getSolutions_line_186, __pyx_kp_u_Find_and_return_all_solutions_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_Problem_getSolutionIter_line_205, __pyx_kp_u_Return_an_iterator_to_the_soluti) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +*/ + __pyx_t_8 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_reset_line_44, __pyx_mstate_global->__pyx_kp_u_Reset_the_current_problem_defini) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_setSolver_line_57, __pyx_mstate_global->__pyx_kp_u_Change_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_getSolver_line_72, __pyx_mstate_global->__pyx_kp_u_Obtain_the_problem_solver_curren) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_addVariable_line_86, __pyx_mstate_global->__pyx_kp_u_Add_a_variable_to_the_problem_Ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_addVariables_line_116, __pyx_mstate_global->__pyx_kp_u_Add_one_or_more_variables_to_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_addConstraint_line_139, __pyx_mstate_global->__pyx_kp_u_Add_a_constraint_to_the_problem) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_getSolution_line_178, __pyx_mstate_global->__pyx_kp_u_Find_and_return_a_solution_to_th) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutions_line_197, __pyx_mstate_global->__pyx_kp_u_Find_and_return_all_solutions_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Problem_getSolutionIter_line_216, __pyx_mstate_global->__pyx_kp_u_Return_an_iterator_to_the_soluti) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /*--- Wrapped vars code ---*/ @@ -11392,9 +10456,9 @@ if (!__Pyx_RefNanny) { __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_8); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.problem", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -11415,12 +10479,456 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 1036 <= 65535 + const unsigned short n; +#elif 1036 / 2 < INT_MAX + const unsigned int n; +#elif 1036 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_Add_a_constraint_to_the_problem, sizeof(__pyx_k_Add_a_constraint_to_the_problem), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_a_constraint_to_the_problem */ + {__pyx_k_Add_a_variable_to_the_problem_Ex, sizeof(__pyx_k_Add_a_variable_to_the_problem_Ex), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_a_variable_to_the_problem_Ex */ + {__pyx_k_Add_one_or_more_variables_to_the, sizeof(__pyx_k_Add_one_or_more_variables_to_the), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Add_one_or_more_variables_to_the */ + {__pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AssertionError */ + {__pyx_k_Callable, sizeof(__pyx_k_Callable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Callable */ + {__pyx_k_Change_the_problem_solver_curren, sizeof(__pyx_k_Change_the_problem_solver_curren), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Change_the_problem_solver_curren */ + {__pyx_k_Class_used_to_define_a_problem_a, sizeof(__pyx_k_Class_used_to_define_a_problem_a), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Class_used_to_define_a_problem_a */ + {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ + {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ + {__pyx_k_Constraints_must_be_instances_of, sizeof(__pyx_k_Constraints_must_be_instances_of), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Constraints_must_be_instances_of */ + {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ + {__pyx_k_Domain_is_empty, sizeof(__pyx_k_Domain_is_empty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Domain_is_empty */ + {__pyx_k_Domains_must_be_instances_of_sub, sizeof(__pyx_k_Domains_must_be_instances_of_sub), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Domains_must_be_instances_of_sub */ + {__pyx_k_Expected_constraints_to_be_strin, sizeof(__pyx_k_Expected_constraints_to_be_strin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Expected_constraints_to_be_strin */ + {__pyx_k_Find_and_return_a_solution_to_th, sizeof(__pyx_k_Find_and_return_a_solution_to_th), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Find_and_return_a_solution_to_th */ + {__pyx_k_Find_and_return_all_solutions_to, sizeof(__pyx_k_Find_and_return_all_solutions_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Find_and_return_all_solutions_to */ + {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ + {__pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hashable */ + {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */ + {__pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_None */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_Obtain_the_problem_solver_curren, sizeof(__pyx_k_Obtain_the_problem_solver_curren), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Obtain_the_problem_solver_curren */ + {__pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver */ + {__pyx_k_Optional, sizeof(__pyx_k_Optional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Optional */ + {__pyx_k_Optional_Sequence, sizeof(__pyx_k_Optional_Sequence), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Optional_Sequence */ + {__pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver */ + {__pyx_k_ParallelSolver_is_currently_expe, sizeof(__pyx_k_ParallelSolver_is_currently_expe), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ParallelSolver_is_currently_expe */ + {__pyx_k_Problem, sizeof(__pyx_k_Problem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem */ + {__pyx_k_Problem___init, sizeof(__pyx_k_Problem___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem___init */ + {__pyx_k_Problem__getArgs, sizeof(__pyx_k_Problem__getArgs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem__getArgs */ + {__pyx_k_Problem__getArgs_locals_genexpr, sizeof(__pyx_k_Problem__getArgs_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem__getArgs_locals_genexpr */ + {__pyx_k_Problem_addConstraint, sizeof(__pyx_k_Problem_addConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addConstraint */ + {__pyx_k_Problem_addConstraint_line_139, sizeof(__pyx_k_Problem_addConstraint_line_139), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addConstraint_line_139 */ + {__pyx_k_Problem_addConstraint_locals_gen, sizeof(__pyx_k_Problem_addConstraint_locals_gen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addConstraint_locals_gen */ + {__pyx_k_Problem_addVariable, sizeof(__pyx_k_Problem_addVariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addVariable */ + {__pyx_k_Problem_addVariable_line_86, sizeof(__pyx_k_Problem_addVariable_line_86), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariable_line_86 */ + {__pyx_k_Problem_addVariables, sizeof(__pyx_k_Problem_addVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_addVariables */ + {__pyx_k_Problem_addVariables_line_116, sizeof(__pyx_k_Problem_addVariables_line_116), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_addVariables_line_116 */ + {__pyx_k_Problem_getSolution, sizeof(__pyx_k_Problem_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolution */ + {__pyx_k_Problem_getSolutionIter, sizeof(__pyx_k_Problem_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionIter */ + {__pyx_k_Problem_getSolutionIter_line_216, sizeof(__pyx_k_Problem_getSolutionIter_line_216), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutionIter_line_216 */ + {__pyx_k_Problem_getSolution_line_178, sizeof(__pyx_k_Problem_getSolution_line_178), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolution_line_178 */ + {__pyx_k_Problem_getSolutions, sizeof(__pyx_k_Problem_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutions */ + {__pyx_k_Problem_getSolutionsAsListDict, sizeof(__pyx_k_Problem_getSolutionsAsListDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsAsListDict */ + {__pyx_k_Problem_getSolutionsOrderedList, sizeof(__pyx_k_Problem_getSolutionsOrderedList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsOrderedList */ + {__pyx_k_Problem_getSolutionsOrderedList_2, sizeof(__pyx_k_Problem_getSolutionsOrderedList_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolutionsOrderedList_2 */ + {__pyx_k_Problem_getSolutions_line_197, sizeof(__pyx_k_Problem_getSolutions_line_197), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolutions_line_197 */ + {__pyx_k_Problem_getSolver, sizeof(__pyx_k_Problem_getSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_getSolver */ + {__pyx_k_Problem_getSolver_line_72, sizeof(__pyx_k_Problem_getSolver_line_72), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_getSolver_line_72 */ + {__pyx_k_Problem_reset, sizeof(__pyx_k_Problem_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_reset */ + {__pyx_k_Problem_reset_line_44, sizeof(__pyx_k_Problem_reset_line_44), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_reset_line_44 */ + {__pyx_k_Problem_setSolver, sizeof(__pyx_k_Problem_setSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Problem_setSolver */ + {__pyx_k_Problem_setSolver_line_57, sizeof(__pyx_k_Problem_setSolver_line_57), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_setSolver_line_57 */ + {__pyx_k_Reset_the_current_problem_defini, sizeof(__pyx_k_Reset_the_current_problem_defini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Reset_the_current_problem_defini */ + {__pyx_k_Return_an_iterator_to_the_soluti, sizeof(__pyx_k_Return_an_iterator_to_the_soluti), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Return_an_iterator_to_the_soluti */ + {__pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Sequence */ + {__pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver */ + {__pyx_k_Tried_to_insert_duplicated_varia, sizeof(__pyx_k_Tried_to_insert_duplicated_varia), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tried_to_insert_duplicated_varia */ + {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ + {__pyx_k_Union, sizeof(__pyx_k_Union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Union */ + {__pyx_k_Union_Constraint_Callable_str, sizeof(__pyx_k_Union_Constraint_Callable_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Union_Constraint_Callable_str */ + {__pyx_k_Using_the_ParallelSolver_in_Thre, sizeof(__pyx_k_Using_the_ParallelSolver_in_Thre), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Using_the_ParallelSolver_in_Thre */ + {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */ + {__pyx_k_You_have_used_FunctionConstraint, sizeof(__pyx_k_You_have_used_FunctionConstraint), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_You_have_used_FunctionConstraint */ + {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ + {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */ + {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 1}, /* PyObject cname: __pyx_n_u__6 */ + {__pyx_k_addConstraint, sizeof(__pyx_k_addConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addConstraint */ + {__pyx_k_addVariable, sizeof(__pyx_k_addVariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addVariable */ + {__pyx_k_addVariables, sizeof(__pyx_k_addVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_addVariables */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_allvariables, sizeof(__pyx_k_allvariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allvariables */ + {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ + {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ + {__pyx_k_clear, sizeof(__pyx_k_clear), 0, 1, 1}, /* PyObject cname: __pyx_n_u_clear */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ + {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ + {__pyx_k_compile_to_constraints, sizeof(__pyx_k_compile_to_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_constraints */ + {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ + {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ + {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ + {__pyx_k_constraint_parser, sizeof(__pyx_k_constraint_parser), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_parser */ + {__pyx_k_constraint_problem, sizeof(__pyx_k_constraint_problem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_problem */ + {__pyx_k_constraint_problem_py, sizeof(__pyx_k_constraint_problem_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_problem_py */ + {__pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_solvers */ + {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ + {__pyx_k_constraints_2, sizeof(__pyx_k_constraints_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints_2 */ + {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */ + {__pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_deepcopy */ + {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ + {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ + {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ + {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ + {__pyx_k_duplicate_parameter_configurati, sizeof(__pyx_k_duplicate_parameter_configurati), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_duplicate_parameter_configurati */ + {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ + {__pyx_k_extend, sizeof(__pyx_k_extend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_extend */ + {__pyx_k_freethreading, sizeof(__pyx_k_freethreading), 0, 1, 1}, /* PyObject cname: __pyx_n_u_freethreading */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ + {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ + {__pyx_k_getArgs, sizeof(__pyx_k_getArgs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getArgs */ + {__pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolution */ + {__pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionIter */ + {__pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutions */ + {__pyx_k_getSolutionsAsListDict, sizeof(__pyx_k_getSolutionsAsListDict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsAsListDict */ + {__pyx_k_getSolutionsOrderedList, sizeof(__pyx_k_getSolutionsOrderedList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsOrderedList */ + {__pyx_k_getSolver, sizeof(__pyx_k_getSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolver */ + {__pyx_k_get_in_order, sizeof(__pyx_k_get_in_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_in_order */ + {__pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getitem */ + {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ + {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_is_gil_enabled, sizeof(__pyx_k_is_gil_enabled), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_gil_enabled */ + {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ + {__pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_itemgetter */ + {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ + {__pyx_k_list_str, sizeof(__pyx_k_list_str), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_str */ + {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_msg, sizeof(__pyx_k_msg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_msg */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ + {__pyx_k_operator, sizeof(__pyx_k_operator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_operator */ + {__pyx_k_order, sizeof(__pyx_k_order), 0, 1, 1}, /* PyObject cname: __pyx_n_u_order */ + {__pyx_k_params, sizeof(__pyx_k_params), 0, 1, 1}, /* PyObject cname: __pyx_n_u_params */ + {__pyx_k_parsed, sizeof(__pyx_k_parsed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parsed */ + {__pyx_k_picklable, sizeof(__pyx_k_picklable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_picklable */ + {__pyx_k_preProcess, sizeof(__pyx_k_preProcess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_preProcess */ + {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ + {__pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ + {__pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_requires_pickling */ + {__pyx_k_reset, sizeof(__pyx_k_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reset */ + {__pyx_k_resetState, sizeof(__pyx_k_resetState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_resetState */ + {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ + {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ + {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ + {__pyx_k_setSolver, sizeof(__pyx_k_setSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setSolver */ + {__pyx_k_size_dict, sizeof(__pyx_k_size_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size_dict */ + {__pyx_k_size_list, sizeof(__pyx_k_size_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_size_list */ + {__pyx_k_solution, sizeof(__pyx_k_solution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solution */ + {__pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions */ + {__pyx_k_solutions_dict, sizeof(__pyx_k_solutions_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions_dict */ + {__pyx_k_solutions_list, sizeof(__pyx_k_solutions_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions_list */ + {__pyx_k_solver, sizeof(__pyx_k_solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solver */ + {__pyx_k_solver_2, sizeof(__pyx_k_solver_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solver_2 */ + {__pyx_k_solver_is_not_instance_of_Solve, sizeof(__pyx_k_solver_is_not_instance_of_Solve), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_solver_is_not_instance_of_Solve */ + {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ + {__pyx_k_str_constraints, sizeof(__pyx_k_str_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_str_constraints */ + {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ + {__pyx_k_tuple_list_tuple_dict_tuple_int, sizeof(__pyx_k_tuple_list_tuple_dict_tuple_int), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_list_tuple_dict_tuple_int */ + {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */ + {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ + {__pyx_k_validate, sizeof(__pyx_k_validate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_validate */ + {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */ + {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ + {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ + {__pyx_k_variables_2, sizeof(__pyx_k_variables_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables_2 */ + {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ + {__pyx_k_warn, sizeof(__pyx_k_warn), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warn */ + {__pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warnings */ + {__pyx_k_zip, sizeof(__pyx_k_zip), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zip */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 17, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 111, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 251, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/problem.py":54 + * >>> + * """ + * del self._constraints[:] # <<<<<<<<<<<<<< + * self._variables.clear() + * +*/ + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 54, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/problem.py":113 + * raise TypeError(msg) + * if not domain: + * raise ValueError("Domain is empty") # <<<<<<<<<<<<<< + * self._variables[variable] = domain + * +*/ + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_Domain_is_empty); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/problem.py":299 + * domain.resetState() + * if not domain: + * return None, None, None # <<<<<<<<<<<<<< + * # doArc8(getArcs(domains, constraints), domains, {}) + * return domains, constraints, vconstraints +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/problem.py":24 + * """Class used to define a problem and retrieve solutions.""" + * + * def __init__(self, solver: Solver=None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 24, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + + /* "constraint/problem.py":245 + * return list(get_in_order(params) for params in solutions) + * + * def getSolutionsAsListDict( # <<<<<<<<<<<<<< + * self, order: list[str] = None, validate: bool = True + * ) -> tuple[list[tuple], dict[tuple, int], int]: # noqa: E501 +*/ + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, Py_None, ((PyObject *)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + + /* "constraint/problem.py":265 + * ) + * + * def _getArgs(self, picklable=False): # <<<<<<<<<<<<<< + * domains = self._variables.copy() + * allvariables = domains.keys() +*/ + __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +typedef struct { + unsigned int argcount : 2; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 9; + unsigned int line_table_length : 13; +} __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + PyObject* tuple_dedup_map = PyDict_New(); + if (unlikely(!tuple_dedup_map)) return -1; + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 162, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_c}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 241, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_solution}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 243, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_params}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 286, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u__6}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24, 125}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solver}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_xq_Kwc_A_1_2_z_j_3ddhhiimmn_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 44, 22}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_reset, __pyx_k_A_D_Q_KvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 57, 11}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solver}; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_setSolver, __pyx_k_A_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72, 11}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolver, __pyx_k_A_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 86, 122}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_msg}; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariable, __pyx_k_A_9Ct1_D_AQ_Qha_T_1_AXQ_V1A_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 25}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_variable}; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addVariables, __pyx_k_a_L_AZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139, 157}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_addConstraint, __pyx_k_J_UV_Ql_q_A_Bnno_4z_a_xq_q_1L_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178, 55}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_A_oT_T_QR_4q_1_t8_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 197, 55}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_A_oT_T_QR_4q_1_t8_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 216, 60}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_A_oT_T_QR_4q_4q_t8_1I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 237, 63}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_get_in_order, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsOrderedList, __pyx_k_g_B_M_6_E_Cq_s_vQ_z_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 245, 109}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_validate, __pyx_mstate->__pyx_n_u_solutions_list, __pyx_mstate->__pyx_n_u_size_list, __pyx_mstate->__pyx_n_u_solutions_dict, __pyx_mstate->__pyx_n_u_size_dict}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getSolutionsAsListDict, __pyx_k_A_z_5Qa_Cq_t1Cq_8_Qa_1_1A_z_A_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 265, 278}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_picklable, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_allvariables, __pyx_mstate->__pyx_n_u_constraints_2, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_parsed, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u__6, __pyx_mstate->__pyx_n_u_variables_2, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_problem_py, __pyx_mstate->__pyx_n_u_getArgs, __pyx_k_q_k_a_we1_5Q_3at_b_d_q_izQR_Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* AssertionsEnabled.init */ + if (likely(__Pyx_init_assertions_enabled() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -11461,11 +10969,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif @@ -11587,7 +11089,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -11603,20 +11105,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } - return result; + return result; +} + +/* TupleAndListFromArray */ +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; } - -/* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -11630,8 +11148,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -11654,7 +11171,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -11701,55 +11219,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -11767,9 +11269,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -11779,9 +11278,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -11789,14 +11285,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -11805,14 +11295,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -11846,12 +11347,7 @@ static void __Pyx_RaiseDoubleKeywordsError( PyObject* kw_name) { PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } /* ParseKeywords */ @@ -11874,7 +11370,7 @@ static int __Pyx_ParseOptionalKeywords( Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); @@ -11917,38 +11413,11 @@ static int __Pyx_ParseOptionalKeywords( #endif Py_INCREF(value); name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**name) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); @@ -11967,8 +11436,8 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**argname) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -11995,15 +11464,9 @@ static int __Pyx_ParseOptionalKeywords( "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif bad: Py_XDECREF(key); Py_XDECREF(value); @@ -12070,16 +11533,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } @@ -12087,16 +11541,23 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) +#elif !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif !CYTHON_AVOID_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = PyObject_GetItem(__pyx_mstate_global->__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -12140,9 +11601,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -12150,19 +11609,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -12199,9 +11650,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -12210,17 +11659,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -12235,13 +11677,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -12260,13 +11697,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -12288,7 +11720,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -12317,12 +11749,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -12330,7 +11760,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else @@ -12344,10 +11774,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, (size_t)nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -12356,184 +11788,101 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif -/* SliceObject */ -static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, - Py_ssize_t cstart, Py_ssize_t cstop, - PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, - int has_cstart, int has_cstop, int wraparound) { - __Pyx_TypeName obj_type_name; -#if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; - if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); -#endif - { - int result; - PyObject *py_slice, *py_start, *py_stop; - if (_py_slice) { - py_slice = *_py_slice; +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + if (max_char > 1114111) max_char = 1114111; + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) + goto bad; + #endif + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { - PyObject* owned_start = NULL; - PyObject* owned_stop = NULL; - if (_py_start) { - py_start = *_py_start; - } else { - if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); - if (unlikely(!py_start)) goto bad; - } else - py_start = Py_None; - } - if (_py_stop) { - py_stop = *_py_stop; - } else { - if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); - if (unlikely(!py_stop)) { - Py_XDECREF(owned_start); - goto bad; - } - } else - py_stop = Py_None; + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); } - py_slice = PySlice_New(py_start, py_stop, Py_None); - Py_XDECREF(owned_start); - Py_XDECREF(owned_stop); - if (unlikely(!py_slice)) goto bad; - } -#if CYTHON_USE_TYPE_SLOTS - result = mp->mp_ass_subscript(obj, py_slice, value); -#else - result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); -#endif - if (!_py_slice) { - Py_DECREF(py_slice); + #endif } - return result; + char_pos += ulength; } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", - obj_type_name, value ? "assignment" : "deletion"); - __Pyx_DECREF_TypeName(obj_type_name); + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); bad: - return -1; -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + Py_DECREF(result_uval); + return NULL; +#else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; +#endif } /* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -12618,9 +11967,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -12629,49 +11978,113 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(tmp_tb); } #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} + +/* SliceObject */ +static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, + Py_ssize_t cstart, Py_ssize_t cstop, + PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, + int has_cstart, int has_cstop, int wraparound) { + __Pyx_TypeName obj_type_name; +#if CYTHON_USE_TYPE_SLOTS + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; + CYTHON_UNUSED_VAR(wraparound); + if (likely(mp && mp->mp_ass_subscript)) +#endif + { + int result; + PyObject *py_slice, *py_start, *py_stop; + if (_py_slice) { + py_slice = *_py_slice; + } else { + PyObject* owned_start = NULL; + PyObject* owned_stop = NULL; + if (_py_start) { + py_start = *_py_start; + } else { + if (has_cstart) { + owned_start = py_start = PyLong_FromSsize_t(cstart); + if (unlikely(!py_start)) goto bad; + } else + py_start = Py_None; + } + if (_py_stop) { + py_stop = *_py_stop; + } else { + if (has_cstop) { + owned_stop = py_stop = PyLong_FromSsize_t(cstop); + if (unlikely(!py_stop)) { + Py_XDECREF(owned_start); + goto bad; + } + } else + py_stop = Py_None; + } + py_slice = PySlice_New(py_start, py_stop, Py_None); + Py_XDECREF(owned_start); + Py_XDECREF(owned_stop); + if (unlikely(!py_slice)) goto bad; + } +#if CYTHON_USE_TYPE_SLOTS + result = mp->mp_ass_subscript(obj, py_slice, value); +#else + result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice); #endif + if (!_py_slice) { + Py_DECREF(py_slice); + } + return result; } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object does not support slice %.10s", + obj_type_name, value ? "assignment" : "deletion"); + __Pyx_DECREF_TypeName(obj_type_name); bad: - Py_XDECREF(owned_instance); - return; + return -1; } -#endif -/* GetAttr */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); +/* PyUnicode_Unicode */ +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) { + if (unlikely(obj == Py_None)) + obj = __pyx_mstate_global->__pyx_kp_u_None; + return __Pyx_NewRef(obj); +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); } /* HasAttr */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; - if (unlikely(!__Pyx_PyBaseString_Check(n))) { + if (unlikely(!PyUnicode_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } - r = __Pyx_GetAttr(o, n); + r = __Pyx_PyObject_GetAttrStrNoError(o, n); if (!r) { - PyErr_Clear(); - return 0; + return (unlikely(PyErr_Occurred())) ? -1 : 0; } else { Py_DECREF(r); return 1; } } +#endif /* RaiseUnboundLocalError */ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { @@ -12716,12 +12129,10 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -12775,32 +12186,32 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) /* pep479 */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); } /* PyObjectCall2Args */ @@ -12832,18 +12243,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -12883,13 +12288,8 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -12943,7 +12343,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); @@ -12951,6 +12351,38 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, @@ -12994,23 +12426,44 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; @@ -13033,7 +12486,7 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) } /* UnicodeConcatInPlace */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_unicode_modifiable(PyObject *unicode) { @@ -13097,7 +12550,7 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le #endif /* DictGetItem */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); @@ -13154,12 +12607,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( } #endif -/* PyObjectCallNoArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg[2] = {NULL, NULL}; - return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* PyObjectCallMethod0 */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; @@ -13185,20 +12632,45 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { + if (likely(is_tuple || PyTuple_Check(tuple))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -13209,7 +12681,7 @@ static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -13245,7 +12717,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ -#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -13257,7 +12729,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -13313,8 +12785,20 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( } Py_INCREF(key); Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; + } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif *pitem = tuple; } else { if (pkey) { @@ -13329,15 +12813,33 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #endif + if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyList_GET_ITEM(iter_obj, pos); + #else + next_item = PyList_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else #endif @@ -13360,6 +12862,98 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyVersionSanityCheck */ +static int __Pyx_VersionSanityCheck(void) { + #if CYTHON_COMPILING_IN_CPYTHON + #if PY_VERSION_HEX < 0x03080000 + if (PySys_GetObject("gettotalrefcount")) { + #ifndef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a non-debug version of Python but imported into a debug version." + ); + return -1; + #endif + } else { + #ifdef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a debug version of Python but imported into a non-debug version." + ); + return -1; + #endif + } + #endif // Py_VERSION_HEX < 0x03080000 + #if PY_VERSION_HEX >= 0x030d0000 + if (PyRun_SimpleStringFlags( + "if " + #ifdef Py_GIL_DISABLED + "not " + #endif + "__import__('sysconfig').get_config_var('Py_GIL_DISABLED'): raise ImportError", + NULL + ) == -1) { + PyErr_SetString( + PyExc_ImportError, + #ifdef Py_GIL_DISABLED + "Module was compiled with a freethreading build of Python but imported into a non-freethreading build." + #else + "Module was compiled with a non-freethreading build of Python but imported into a freethreading build." + #endif + ); + return -1; + } + #endif // version hex 3.13+ + if (PySys_GetObject("getobjects")) { + #ifndef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled without Py_TRACE_REFS but imported into a build of Python with." + ); + return -1; + #endif + } else { + #ifdef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with Py_TRACE_REFS but imported into a build of Python without." + ); + return -1; + #endif + } + const char code[] = "if __import__('sys').getsizeof(object()) != %u: raise ImportError"; + char formattedCode[sizeof(code)+50]; + PyOS_snprintf(formattedCode, sizeof(formattedCode), code, (unsigned int)sizeof(PyObject)); + if (PyRun_SimpleStringFlags(formattedCode, NULL) == -1) { + PyErr_SetString( + PyExc_ImportError, + "Runtime and compile-time PyObject size do not match." + ); + return -1; + } + #endif + return 0; +} + /* FixUpExtensionType */ #if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { @@ -13437,14 +13031,15 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -13453,18 +13048,6 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) @@ -13481,7 +13064,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -13501,7 +13084,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -13531,7 +13114,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -13540,12 +13123,13 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -13553,7 +13137,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -13572,7 +13156,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -13581,7 +13165,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -13600,114 +13184,50 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) { #endif } -/* PyObject_GenericGetAttrNoDict */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + Py_ssize_t size; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(parts_tuple); +#else + size = PyTuple_Size(parts_tuple); + if (size < 0) goto bad; +#endif + if (likely(size == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); @@ -13719,28 +13239,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -13751,17 +13261,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; +#if CYTHON_ASSUME_SAFE_SIZE nparts = PyTuple_GET_SIZE(parts_tuple); +#else + nparts = PyTuple_Size(parts_tuple); + if (nparts < 0) return NULL; +#endif for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else - part = PySequence_ITEM(parts_tuple, i); + part = __Pyx_PySequence_ITEM(parts_tuple, i); + if (!part) return NULL; #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -13775,20 +13289,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__4; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -13800,15 +13301,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; @@ -13828,6 +13328,25 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) return __Pyx__ImportDottedModule(name, parts_tuple); } +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_kp_u__2); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -13860,20 +13380,97 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { Py_XDECREF(module_dot); Py_XDECREF(module_name); } - if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + if (unlikely(!value)) { + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); + } + return value; +} + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); } - return value; + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif } +#endif /* FetchSharedCythonModule */ static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ @@ -13977,8 +13574,34 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec } #endif +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + /* PyVectorcallFastCallDict */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -13989,7 +13612,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -14005,10 +13633,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif Py_INCREF(key); Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -14026,16 +13663,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -14043,8 +13693,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -14069,11 +13736,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -14103,10 +13766,8 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -14118,12 +13779,7 @@ static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -14143,12 +13799,7 @@ static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -14328,9 +13979,8 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -14343,7 +13993,7 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); @@ -14354,10 +14004,39 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { ignore: PyErr_Clear(); } -#endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { @@ -14371,24 +14050,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif @@ -14396,23 +14075,21 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, -#endif + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -14421,18 +14098,14 @@ static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -14474,8 +14147,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -14537,14 +14208,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -14561,6 +14225,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -14568,40 +14236,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __Pyx_VISIT_CONST(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -14623,7 +14280,7 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -14631,24 +14288,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -14667,18 +14315,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -14686,16 +14325,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -14712,10 +14343,10 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -14727,11 +14358,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -14739,14 +14370,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -14756,21 +14382,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -14778,13 +14404,18 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -14792,29 +14423,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -14822,29 +14462,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -14852,17 +14501,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -14870,6 +14523,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -14877,12 +14536,17 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS @@ -14905,9 +14569,13 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif +#endif // CYTHON_METH_FASTCALL Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -14927,11 +14595,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #endif 0, 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else 0, -#endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, @@ -14953,11 +14617,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else offsetof(PyCFunctionObject, m_weakreflist), -#endif 0, 0, __pyx_CyFunction_methods, @@ -14980,9 +14640,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -#if PY_VERSION_HEX >= 0x030400a1 0, -#endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif @@ -15001,25 +14659,22 @@ static PyTypeObject __pyx_CyFunctionType_type = { }; #endif static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -15042,7 +14697,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -15054,7 +14709,7 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -15069,10 +14724,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -15091,11 +14742,7 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; @@ -15106,10 +14753,6 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -15130,7 +14773,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -15145,148 +14788,14 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: - Py_DECREF(ns); - return NULL; -} -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); + Py_DECREF(ns); return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif } -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -15294,7 +14803,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -15310,30 +14819,13 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } /* CLineInTraceback */ -#ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -15341,20 +14833,20 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -15365,7 +14857,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; @@ -15376,7 +14868,6 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -15398,8 +14889,8 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; @@ -15412,7 +14903,8 @@ static PyCodeObject *__pyx_find_code_object(int code_line) { Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { @@ -15432,7 +14924,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; @@ -15455,7 +14947,6 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } -#endif /* AddTraceback */ #include "compile.h" @@ -15475,8 +14966,7 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } @@ -15516,20 +15006,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -15555,58 +15051,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -15637,7 +15092,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -15655,18 +15110,18 @@ static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); + __pyx_mstate_global->__pyx_n_u_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__32); + name = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__3); } return name; } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -15678,7 +15133,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG @@ -15688,7 +15143,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -15709,25 +15164,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -15759,7 +15214,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -15769,24 +15224,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -16026,7 +15468,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -16036,24 +15478,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -16333,29 +15762,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -16363,21 +15769,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; iexc_info; - while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && - exc_info->previous_item != NULL) - { - exc_info = exc_info->previous_item; - } - return exc_info; -} -#endif - -/* SaveResetException */ -#if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - PyObject *exc_value = exc_info->exc_value; - if (exc_value == NULL || exc_value == Py_None) { - *value = NULL; - *type = NULL; - *tb = NULL; - } else { - *value = exc_value; - Py_INCREF(*value); - *type = (PyObject*) Py_TYPE(exc_value); - Py_INCREF(*type); - *tb = PyException_GetTraceback(exc_value); - } - #elif CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); - *type = exc_info->exc_type; - *value = exc_info->exc_value; - *tb = exc_info->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #else - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); - #endif -} -static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 - _PyErr_StackItem *exc_info = tstate->exc_info; - PyObject *tmp_value = exc_info->exc_value; - exc_info->exc_value = value; - Py_XDECREF(tmp_value); - Py_XDECREF(type); - Py_XDECREF(tb); - #else - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if CYTHON_USE_EXC_INFO_STACK - _PyErr_StackItem *exc_info = tstate->exc_info; - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = type; - exc_info->exc_value = value; - exc_info->exc_traceback = tb; - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - #endif -} -#endif - /* SwapException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { @@ -16544,7 +15862,76 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif +/* IterNextPlain */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { + if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif +} + +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async) { + if (value == Py_None) { + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if (PY_VERSION_HEX >= 0x030C00A6 + || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ +#if !CYTHON_COMPILING_IN_LIMITED_API #include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE @@ -16552,7 +15939,14 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -16570,20 +15964,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -16611,27 +16020,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -16668,26 +16085,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -16698,26 +16096,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -16727,7 +16121,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -16773,10 +16167,14 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -16803,17 +16201,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif + PyObject *exc = + #ifdef __Pyx_AsyncGen_USED + __Pyx_AsyncGen_CheckExact(gen) ? PyExc_StopAsyncIteration : + #endif + PyExc_StopIteration; __Pyx_PyErr_SetNone(exc); } } return retval; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async); + Py_XDECREF(retval); + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -16850,25 +16263,57 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; +} +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult result; + gen->is_running = 1; + result = gen_am_send(gen->yieldfrom, value, &ret); + gen->is_running = 0; + if (result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + return __Pyx_Coroutine_SendEx(gen, ret, retval, 0); +} +#endif +static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } -static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -16884,66 +16329,65 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } gen->is_running = 0; if (likely(ret)) { - return ret; + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; + result = PYGEN_RETURN; gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -16951,20 +16395,29 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(gen->is_running)) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED @@ -16972,36 +16425,47 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); gen->is_running = 0; if (likely(ret)) { return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; + __Pyx_PySendResult result; PyObject *yf = gen->yieldfrom; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -17010,10 +16474,23 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -17021,25 +16498,14 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { @@ -17048,6 +16514,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -17055,7 +16522,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } gen->is_running = 1; @@ -17073,7 +16540,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { @@ -17094,20 +16561,25 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(self, ret); + if (ret) + return ret; + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -17122,6 +16594,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -17131,7 +16607,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -17152,10 +16628,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -17174,6 +16653,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if !(CYTHON_USE_TYPE_SPECS && !CYTHON_USE_TP_FINALIZE) static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -17210,42 +16690,18 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); @@ -17255,9 +16711,13 @@ static void __Pyx_Coroutine_del(PyObject *self) { return; } { +#if !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); +#else + #error __Pyx_Coroutine_del with Limited API and without CYTHON_USE_TP_FINALIZE should never be compiled +#endif } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && @@ -17270,6 +16730,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif #endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -17283,12 +16744,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -17310,12 +16766,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -17327,6 +16778,7 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { @@ -17336,7 +16788,7 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) @@ -17345,6 +16797,11 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) } Py_INCREF(frame); return frame; +#else + CYTHON_UNUSED_VAR(self); + CYTHON_UNUSED_VAR(context); + Py_RETURN_NONE; +#endif } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -17364,7 +16821,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -17388,131 +16846,34 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( return gen; } -/* PatchModuleWithCoroutine */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ -#ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, + {"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + PyDoc_STR("object being iterated by 'yield from', or None")}, + {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS @@ -17524,9 +16885,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -17538,6 +16902,12 @@ static PyType_Spec __pyx_GeneratorType_spec = { __pyx_GeneratorType_slots }; #else +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async = { + 0, + 0, + 0, + __Pyx_Coroutine_AmSend, +}; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", @@ -17547,6 +16917,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, + __Pyx_SlotTpAsAsync(__pyx_Generator_as_async), 0, 0, 0, @@ -17557,8 +16928,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, @@ -17592,7 +16962,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 +#else 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) @@ -17613,45 +16983,60 @@ static PyTypeObject __pyx_GeneratorType_type = { }; #endif static int __pyx_Generator_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif - if (unlikely(!__pyx_GeneratorType)) { + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ +/* GetRuntimeVersion */ static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -17674,45 +17059,164 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject* filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000)) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -17740,31 +17244,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -17776,16 +17279,12 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif @@ -17817,9 +17316,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -17833,74 +17331,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -17946,23 +17414,19 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } @@ -17970,8 +17434,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } diff --git a/constraint/problem.py b/constraint/problem.py index 0ae1e07..4267bea 100644 --- a/constraint/problem.py +++ b/constraint/problem.py @@ -13,7 +13,7 @@ try: from sys import _is_gil_enabled - freethreading = _is_gil_enabled() + freethreading = not _is_gil_enabled() except ImportError: freethreading = False diff --git a/constraint/solvers.c b/constraint/solvers.c index a43770c..0e8194b 100644 --- a/constraint/solvers.c +++ b/constraint/solvers.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.0a1 */ /* BEGIN: Cython Metadata { @@ -18,32 +18,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_0a1" +#define CYTHON_HEX_VERSION 0x030100A1 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -83,19 +72,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -106,8 +89,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -119,18 +106,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -141,20 +132,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -165,8 +150,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -178,7 +168,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -188,8 +178,13 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -208,7 +203,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -217,8 +212,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -231,8 +224,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -240,7 +238,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -248,11 +246,17 @@ END: Cython Metadata */ #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) + #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK @@ -262,80 +266,20 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #ifndef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 1 - #endif - #ifndef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 0 - #endif - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 - #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -344,22 +288,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -368,20 +309,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -389,51 +342,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -568,6 +519,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -582,6 +536,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CInitCode */ #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) @@ -596,62 +551,12 @@ END: Cython Metadata */ #endif #endif +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED #define CO_OPTIMIZED 0x0001 #endif @@ -673,31 +578,6 @@ END: Cython Metadata */ #ifndef CO_COROUTINE #define CO_COROUTINE 0x0080 #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif #endif #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) @@ -757,7 +637,7 @@ END: Cython Metadata */ #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -795,7 +675,7 @@ END: Cython Metadata */ #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -836,8 +716,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -848,15 +730,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -864,85 +742,40 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -966,17 +799,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -988,24 +815,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1021,20 +844,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1048,8 +857,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1059,33 +867,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1102,26 +884,69 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && PY_VERSION_HEX >= 0x030d00b1 +#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS +#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +#endif +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItem(dict, key); + if (*result == NULL) { + return 0; + } + Py_INCREF(*result); + return 1; +} +#else +#define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i) +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (PyErr_Occurred()) { + return -1; + } else if (*result == NULL) { + return 0; + } + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) @@ -1132,64 +957,48 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#define PyBoolObject PyLongObject +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_pyiter_sendfunc sendfunc #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#define __PYX_HAS_PY_AM_SEND (!CYTHON_USE_TYPE_SPECS || CYTHON_USE_AM_SEND && __PYX_LIMITED_VERSION_HEX >= 0x030A0000) +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_SlotTpAsAsync(s) (&(s)) +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)&(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1209,8 +1018,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1242,12 +1060,8 @@ static CYTHON_INLINE float __PYX_NAN() { #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1290,19 +1104,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1311,32 +1127,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1383,81 +1211,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1469,26 +1228,38 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#include +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "constraint/solvers.py", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif +/* IncludeStructmemberH.proto */ +#include /* #### Code section: numeric_typedefs ### */ /* #### Code section: complex_type_declarations ### */ @@ -1509,7 +1280,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr; * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter { PyObject_HEAD PyObject *__pyx_v_assignments; @@ -1538,7 +1309,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter { PyObject_HEAD PyObject *__pyx_v_assignments; @@ -1565,7 +1336,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList { PyObject_HEAD PyObject *__pyx_v_constraint_lookup; @@ -1582,7 +1353,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList { * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_outer_scope; @@ -1600,7 +1371,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr { * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid { PyObject_HEAD PyObject *__pyx_v_assignment; @@ -1614,7 +1385,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid { * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_outer_scope; @@ -1631,7 +1402,7 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr { * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { PyObject_HEAD struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_outer_scope; @@ -1658,7 +1429,6 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1672,11 +1442,6 @@ struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1788,6 +1553,8 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1821,10 +1588,10 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) @@ -1843,9 +1610,12 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #endif #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) #else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1916,12 +1686,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1970,22 +1734,8 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* dict_setdefault.proto */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type); -/* UnpackUnboundCMethod.proto */ -typedef struct { - PyObject *type; - PyObject **method_name; - PyCFunction func; - PyObject *method; - int flag; -} __Pyx_CachedCFunction; - -/* CallUnboundCMethod2.proto */ -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); -#else -#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) -#endif +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { @@ -1994,7 +1744,7 @@ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, } /* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ @@ -2044,11 +1794,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ PyObject_Format(s, f)) -#elif PY_MAJOR_VERSION < 3 - #define __Pyx_PyObject_FormatSimple(s, f) (\ - likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ - likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\ - PyObject_Format(s, f)) #elif CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_FormatSimple(s, f) (\ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\ @@ -2062,7 +1807,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( #endif /* UnicodeConcatInPlace.proto */ -# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON #if CYTHON_REFNANNY #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny) #else @@ -2091,9 +1836,6 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif -/* PyObjectCallNoArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); - /* PyObjectCallMethod0.proto */ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); @@ -2104,12 +1846,8 @@ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /* UnpackTuple2.proto */ -#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ - (likely(is_tuple || PyTuple_Check(tuple)) ?\ - (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ - __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ - (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ - __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple); static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple); static int __Pyx_unpack_tuple2_generic( @@ -2144,7 +1882,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { /* pop.proto */ static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L); -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\ __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L)) @@ -2153,20 +1891,28 @@ static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L); #define __Pyx_PyObject_Pop(L) __Pyx__PyObject_Pop(L) #endif +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + /* CallUnboundCMethod0.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ - (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ - (PY_VERSION_HEX >= 0x030700A0 ?\ - (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ - (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ - (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ - (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ - ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + (likely((cfunc)->flag == METH_FASTCALL) ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_mstate_global->__pyx_empty_tuple, 0) :\ + ((cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_mstate_global->__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_mstate_global->__pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_mstate_global->__pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else @@ -2184,6 +1930,12 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /* pep479.proto */ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); +/* IterNextPlain.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator); +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void); +#endif + /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); @@ -2241,7 +1993,7 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __Pyx_GetModuleGlobalName(var, name) do {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } while(0) @@ -2260,11 +2012,11 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); /* py_dict_keys.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d); -/* PyIntBinop.proto */ +/* PyLongBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ +#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif @@ -2286,6 +2038,7 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* CallUnboundCMethod1.proto */ +CYTHON_UNUSED static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); @@ -2293,8 +2046,14 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif -/* IncludeStructmemberH.proto */ -#include +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif /* FixUpExtensionType.proto */ #if CYTHON_USE_TYPE_SPECS @@ -2311,35 +2070,18 @@ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); #endif -/* PyMethodNew.proto */ -#if CYTHON_COMPILING_IN_LIMITED_API -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - typesModule = PyImport_ImportModule("types"); - if (!typesModule) return NULL; - methodType = PyObject_GetAttrString(typesModule, "MethodType"); - Py_DECREF(typesModule); - if (!methodType) return NULL; - result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); - Py_DECREF(methodType); - return result; -} -#elif PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { - CYTHON_UNUSED_VAR(typ); - if (!self) - return __Pyx_NewRef(func); - return PyMethod_New(func, self); -} +/* CallTypeTraverse.proto */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0 #else - #define __Pyx_PyMethod_New PyMethod_New +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg); #endif +/* PyMethodNew.proto */ +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ); + /* PyVectorcallFastCallDict.proto */ -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); #endif @@ -2373,10 +2115,11 @@ typedef struct { #else PyCMethodObject func; #endif -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL ||\ + (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL) __pyx_vectorcallfunc func_vectorcall; #endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API PyObject *func_weakreflist; #endif PyObject *func_dict; @@ -2389,9 +2132,7 @@ typedef struct { #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API PyObject *func_classobj; #endif - void *defaults; - int defaults_pyobjects; - size_t defaults_size; + PyObject *defaults; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2400,9 +2141,9 @@ typedef struct { PyObject *func_is_coroutine; } __pyx_CyFunctionObject; #undef __Pyx_CyOrPyCFunction_Check -#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) -#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) -#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType) static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); #undef __Pyx_IsSameCFunction #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) @@ -2412,9 +2153,8 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef * PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, - size_t size, - int pyobjects); +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, + PyTypeObject *defaults_type); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, @@ -2427,7 +2167,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); -#if CYTHON_BACKPORT_VECTORCALL +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) #else #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) @@ -2463,9 +2203,29 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n) #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) PyDict_New() +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* ListExtend.proto */ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00a2 + return PyList_Extend(L, v); +#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 PyObject* none = _PyList_Extend((PyListObject*)L, v); if (unlikely(!none)) return -1; @@ -2482,6 +2242,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* Globals.proto */ static PyObject* __Pyx_Globals(void); +/* PyVersionSanityCheck.proto */ +static int __Pyx_VersionSanityCheck(void); + /* ValidateBasesTuple.proto */ #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); @@ -2490,27 +2253,21 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs /* PyType_Ready.proto */ CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportDottedModule.proto */ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); -#endif + +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* SetNameInClass.proto */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON @@ -2536,16 +2293,20 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases); static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj); /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { @@ -2555,9 +2316,8 @@ struct __Pyx_CodeObjectCache { }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -2569,7 +2329,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API @@ -2585,10 +2345,10 @@ typedef const char *__Pyx_TypeName; #endif /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -2602,10 +2362,17 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE @@ -2615,6 +2382,9 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject * static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif +/* ReturnWithStopIteration.proto */ +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async); + /* CoroutineBase.proto */ struct __pyx_CoroutineObject; typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *); @@ -2635,11 +2405,16 @@ typedef struct __pyx_CoroutineObject { PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; + __Pyx_pyiter_sendfunc yieldfrom_am_send; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; PyObject *gi_frame; +#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE) + PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count]; + uint64_t __pyx_pymonitoring_version; +#endif int resume_label; char is_running; } __pyx_CoroutineObject; @@ -2651,8 +2426,9 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); -static PyObject *__Pyx_Coroutine_Close(PyObject *self); +static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) @@ -2677,28 +2453,45 @@ static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); -/* PatchModuleWithCoroutine.proto */ -static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); - -/* PatchGeneratorABC.proto */ -static int __Pyx_patch_abc(void); - /* Generator.proto */ #define __Pyx_Generator_USED -#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType) +#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ - __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) + __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(PyObject *module); +static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self); -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); -static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* CheckBinaryVersion.proto */ +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #define __PYX_LIMITED_ABI_SUFFIX "limited" +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + /* Module declarations from "constraint.solvers" */ /* #### Code section: typeinfo ### */ @@ -2717,14 +2510,16 @@ static PyObject *__pyx_builtin_super; static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_compile; /* #### Code section: string_decls ### */ +static const char __pyx_k_[] = "."; static const char __pyx_k_c[] = "c"; static const char __pyx_k_v[] = "v"; static const char __pyx_k_x[] = "x"; -static const char __pyx_k__6[] = "*"; -static const char __pyx_k__7[] = "."; +static const char __pyx_k__2[] = "?"; +static const char __pyx_k__3[] = "\220\021"; +static const char __pyx_k__4[] = "\220!"; +static const char __pyx_k__5[] = "_"; static const char __pyx_k_gc[] = "gc"; -static const char __pyx_k__10[] = "_"; -static const char __pyx_k__61[] = "?"; +static const char __pyx_k_UUV[] = "\320\004'\320':\320:U\320UV"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_key[] = "key"; @@ -2732,6 +2527,8 @@ static const char __pyx_k_lst[] = "lst"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_msg[] = "msg"; static const char __pyx_k_pop[] = "pop"; +static const char __pyx_k_q_Q[] = "\320\004\027\220q\360\020\000\t\r\320\014\035\230Q"; +static const char __pyx_k_val[] = "val"; static const char __pyx_k_var[] = "var"; static const char __pyx_k_arcs[] = "arcs"; static const char __pyx_k_args[] = "args"; @@ -2740,7 +2537,7 @@ static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_dict[] = "dict"; static const char __pyx_k_exec[] = "exec"; static const char __pyx_k_exit[] = "__exit__"; -static const char __pyx_k_func[] = "_func"; +static const char __pyx_k_func[] = "__func__"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_item[] = "item"; static const char __pyx_k_iter[] = "iter"; @@ -2748,6 +2545,7 @@ static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_list[] = "list"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_next[] = "next"; static const char __pyx_k_rand[] = "rand"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; @@ -2771,13 +2569,14 @@ static const char __pyx_k_Domain[] = "Domain"; static const char __pyx_k_Solver[] = "Solver"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_choice[] = "choice"; -static const char __pyx_k_dict_2[] = "__dict__"; static const char __pyx_k_doArc8[] = "doArc8"; static const char __pyx_k_domain[] = "domain"; static const char __pyx_k_enable[] = "enable"; -static const char __pyx_k_func_2[] = "func"; -static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_func_2[] = "_func"; +static const char __pyx_k_func_3[] = "func"; +static const char __pyx_k_lambda[] = ""; static const char __pyx_k_module[] = "__module__"; +static const char __pyx_k_q_Ry_Q[] = "\320\004\027\220q\340\010\r\210R\210y\230\001\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021"; static const char __pyx_k_rand_2[] = "_rand"; static const char __pyx_k_random[] = "random"; static const char __pyx_k_result[] = "result"; @@ -2786,6 +2585,9 @@ static const char __pyx_k_single[] = "single"; static const char __pyx_k_sorted[] = "sorted"; static const char __pyx_k_string[] = ""; static const char __pyx_k_values[] = "values"; +static const char __pyx_k_1_Ja_IQ[] = "\320\004\027\220|\2401\360\022\000\t\r\210J\220a\330\010\014\210I\220Q"; +static const char __pyx_k_3awVWWX[] = "\300\032\3103\310a\310w\320VW\320WX"; +static const char __pyx_k_UUV_b_D[] = "\320\004'\320':\320:U\320UV\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; static const char __pyx_k_compile[] = "compile"; static const char __pyx_k_disable[] = "disable"; static const char __pyx_k_domains[] = "domains"; @@ -2797,14 +2599,16 @@ static const char __pyx_k_results[] = "results"; static const char __pyx_k_shuffle[] = "shuffle"; static const char __pyx_k_steps_2[] = "_steps"; static const char __pyx_k_Hashable[] = "Hashable"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_executor[] = "executor"; static const char __pyx_k_fromkeys[] = "fromkeys"; static const char __pyx_k_is_valid[] = "is_valid"; static const char __pyx_k_mincount[] = "mincount"; static const char __pyx_k_popState[] = "popState"; static const char __pyx_k_qualname[] = "__qualname__"; -static const char __pyx_k_set_name[] = "__set_name__"; static const char __pyx_k_variable[] = "variable"; +static const char __pyx_k_66QQR_b_D[] = "\320\004#\320#6\3206Q\320QR\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; +static const char __pyx_k_77RRS_b_D[] = "\320\004$\320$7\3207R\320RS\360\022\000\t\017\210b\220\004\220D\230\n\240!\330\010\016\320\016!\240\021\240!"; static const char __pyx_k_chunksize[] = "chunksize"; static const char __pyx_k_co_consts[] = "co_consts"; static const char __pyx_k_first_var[] = "first_var"; @@ -2824,6 +2628,10 @@ static const char __pyx_k_constraint[] = "constraint"; static const char __pyx_k_list_tuple[] = "list[tuple]"; static const char __pyx_k_othervalue[] = "othervalue"; static const char __pyx_k_setdefault[] = "setdefault"; +static const char __pyx_k_77RRS_t1D_q[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\2201\220D\320\030(\250\001\250\031\260-\270q"; +static const char __pyx_k_77RRS_t_AYa[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023$\240A\240Y\250a"; +static const char __pyx_k_77RRS_t_i_T[] = "\320\004$\320$7\3207R\320RS\330\010\017\210t\320\023)\250\021\250$\250i\260~\300T\310\021"; +static const char __pyx_k_BBn_o_J_J_K[] = "\320\000\031\320\031B\320Bn\360\000\000o\001J\002\360\000\000J\002K\002\340\004\005\330\022\023"; static const char __pyx_k_assignments[] = "assignments"; static const char __pyx_k_code_object[] = "code_object"; static const char __pyx_k_constraints[] = "constraints"; @@ -2846,15 +2654,17 @@ static const char __pyx_k_process_mode[] = "process_mode"; static const char __pyx_k_vconstraints[] = "vconstraints"; static const char __pyx_k_StopIteration[] = "StopIteration"; static const char __pyx_k_class_getitem[] = "__class_getitem__"; -static const char __pyx_k_init_subclass[] = "__init_subclass__"; static const char __pyx_k_list_Hashable[] = "list[Hashable]"; static const char __pyx_k_othervariable[] = "othervariable"; static const char __pyx_k_parallel_pool[] = "parallel_pool"; +static const char __pyx_k_vars_involved[] = "vars_involved"; +static const char __pyx_k_EQ_A_1_q_Qd_Qa[] = "\320\000$\320$E\300Q\340\004\022\220*\230A\330\004\022\220'\230\021\230-\240|\2601\330\004\013\210<\220q\230\013\240:\250Q\250d\260'\270\021\330\004\013\320\013\035\230Q\230a"; static const char __pyx_k_ParallelSolver[] = "ParallelSolver"; static const char __pyx_k_arcconstraints[] = "arcconstraints"; static const char __pyx_k_forwardcheck_2[] = "_forwardcheck"; static const char __pyx_k_process_mode_2[] = "_process_mode"; static const char __pyx_k_remaining_vars[] = "remaining_vars"; +static const char __pyx_k_66QQR_t_1I_4q_1[] = "\320\004#\320#6\3206Q\320QR\330\010\017\210t\320\023#\2401\240I\250]\270!\330\010\t\330\014\023\2204\220q\230\001\330\017\020\330\014\023\2201"; static const char __pyx_k_collections_abc[] = "collections.abc"; static const char __pyx_k_getSolutionIter[] = "getSolutionIter"; static const char __pyx_k_parallel_worker[] = "parallel_worker"; @@ -2886,9 +2696,12 @@ static const char __pyx_k_is_an_abstract_class[] = " is an abstract class"; static const char __pyx_k_ParallelSolver___init[] = "ParallelSolver.__init__"; static const char __pyx_k_constraint_solvers_py[] = "constraint/solvers.py"; static const char __pyx_k_recursiveBacktracking[] = "recursiveBacktracking"; +static const char __pyx_k_66QQR_D_at9N_a_z_Yas_Q[] = "\320\004#\320#6\3206Q\320QR\330\010\024\220D\320\030.\250a\250t\2609\270N\310$\310a\330\010\017\210z\230\024\230Y\240a\240s\250#\250Q"; +static const char __pyx_k_77RRS_4q_4q_AYm1_t_AYa[] = "\320\004$\320$7\3207R\320RS\330\010\013\2104\210q\330\014\023\2204\220q\230\004\320\034,\250A\250Y\260m\3001\330\010\017\210t\320\023$\240A\240Y\250a"; static const char __pyx_k_Solver_getSolutionIter[] = "Solver.getSolutionIter"; static const char __pyx_k_constraint_constraints[] = "constraint.constraints"; static const char __pyx_k_list_dict_Hashable_any[] = "list[dict[Hashable, any]]"; +static const char __pyx_k_iq_b_A_c_jPTT_a_5_q_c_E[] = "\320\004*\320*>\270i\300q\360\026\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\330\010\017\210q\220\002\220$\220c\230\023\230E\240\021"; static const char __pyx_k_is_valid_locals_genexpr[] = "is_valid..genexpr"; static const char __pyx_k_BacktrackingSolver___init[] = "BacktrackingSolver.__init__"; static const char __pyx_k_MinConflictsSolver___init[] = "MinConflictsSolver.__init__"; @@ -2901,16 +2714,26 @@ static const char __pyx_k_only_provides_all_solutions[] = " only provides all so static const char __pyx_k_CompilableFunctionConstraint[] = "CompilableFunctionConstraint"; static const char __pyx_k_BacktrackingSolver_getSolution[] = "BacktrackingSolver.getSolution"; static const char __pyx_k_MinConflictsSolver_getSolution[] = "MinConflictsSolver.getSolution"; +static const char __pyx_k_N_O_E_E_F_P_qPUUaaeeffkkoosszz[] = "\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\006\000\tP\001\310q\320PU\320Ua\320ae\320ef\320fk\320ko\320os\320sz\320z{\360\006\000\t'\240f\250A\250W\260E\270\024\270T\300\021\360\006\000\t\025\220K\230q\240\001\330\010\031\230\033\240A\240Q\360\006\000\t\022\220\021\330\010/\250q\360\006\000\t\031\320\030/\250t\3203G\300q\330\r\032\230&\240\001\340\014\026\220h\230d\240!\320#4\260F\270*\300A\330\014\020\220\n\230!\330\020\031\230\027\240\001\240\021\340\010\017\210q"; +static const char __pyx_k_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1[] = "\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\340\004\007\200t\2101\330\010\017\210q\220\n\230%\230q\340\004\n\210/\230\022\2301\330\004\025\220_\240C\240q\340\004+\2501\330\004\010\210\t\220\027\230\001\230\021\330\010\022\220!\2207\230!\330\010\013\2108\2201\220L\320 1\260\021\260&\270\001\330\014\025\220W\230A\320\035;\2701\270L\320HX\320Xa\320ab\330\010\014\210J\220a\220q\330\004\013\2101"; static const char __pyx_k_list_tuple_Constraint_Hashable[] = "list[tuple[Constraint, Hashable]]"; static const char __pyx_k_sequential_optimized_backtrack[] = "sequential_optimized_backtrack"; static const char __pyx_k_sequential_recursive_backtrack[] = "sequential_recursive_backtrack"; +static const char __pyx_k_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1[] = "\320\000\021\220\037\320 3\2609\270A\360\n\000\005\r\210D\220\t\230\021\230)\2401\330\004\n\210!\330\010\022\220$\220e\2308\2401\330\010\013\2109\220G\2305\240\003\2409\250C\250q\330\014\r\330\010\021\220\027\230\001\230\021\330\010\027\220t\2301\230A\330\010\014\320\014\035\230Q\330\014\035\230\\\250\021\250!\330\014\017\210~\230S\240\001\330\020\036\230a\230{\250!\2501\340\020\036\230g\240Q\240a\330\014\017\210q\340\020\024\220I\230V\2401\330\024\037\230q\240\014\250A\330\024\027\220q\330\030\034\230N\250!\330\034'\240q\320(9\270\021\330\034 \240\014\250M\270\021\330 #\2404\240z\260\021\260+\270Y\300m\320ST\330$%\360\006\000!\"\360\006\000\035#\240*\250A\250Q\340\030\034\230K\240q\250\001\330\020\024\220K\230q\240\001\360\006\000\r\020\210t\2201\330\020\027\220q\330\004\013\2101"; +static const char __pyx_k_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E[] = "\320\004#\320#6\3206Q\320QR\330\010\021\220\024\220V\230;\240d\250'\260\027\270\n\300&\310\001\330\010\022\220$\220f\230L\250\004\250G\2607\270*\300F\310!\330\010\026\220a\340\010\014\210L\230\001\330\014\027\220q\230\014\240F\250!\2507\260!\2601\330\010\014\210E\220\025\220a\220t\2301\330\014\031\230\021\330\014\022\220$\220a\220w\230e\2401\330\014\023\2201\220A\330\014\020\220\014\230A\340\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270!\330\030\031\340\024\025\340\020\033\2303\230a\230|\2501\250A\330\020\034\230A\330\020\024\220I\230W\240A\240Q\330\024\037\230q\240\014\250A\330\024\034\230A\330\024\030\230\014\240M\260\034\270Q\270a\330\030\033\2304\230z\250\021\250+\260Y\270a\330\034%\240Q\330\024\027\220v\230S\240\001\330\030!\240\027\250\001\250\021\330\031\037\230r\240\021\330\030#\2401\330\030\034\230I\240Q\330\030!\240\027\250\001\250\021\340\020\033\2301\230L\250\006\250a\250q\330\020\035\230Q\330\014\017\210t\2201\330\020\027\220q\330\010\017\210q"; +static const char __pyx_k_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q[] = "\320\000\025\320\025(\320(8\270\001\360\n\000\005\014\2101\330\004\010\210\005\210Q\330\010\024\220L\240\001\330\010\013\2103\210a\210{\230#\230Q\330\014\027\220|\2401\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\014\020\220\013\2301\230K\240s\250+\260Q\260k\300\023\300G\3101\310A\330\004\013\2101"; static const char __pyx_k_Abstract_base_class_for_solvers[] = "Abstract base class for solvers."; static const char __pyx_k_BacktrackingSolver_getSolutions[] = "BacktrackingSolver.getSolutions"; +static const char __pyx_k_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA[] = "\320\004(\320(N\360\000\000O\001E\002\360\000\000E\002F\002\360\030\000\t\035\230A\330\010\035\230Q\330\010$\240A\330\010\033\2304\320\0372\260!\2609\270A\340\010\t\340\014\020\220\014\230A\330\020\023\2209\230G\2401\340\024\035\230W\240A\240Y\250a\330\024\025\360\010\000\021\032\230\027\240\001\240\033\250E\260\021\330\020\023\2204\220q\330\024\033\2301\330\020\032\230)\2405\250\004\250A\340\014\r\340\020\023\2204\220q\340\024\030\230\013\2401\240A\330\024\032\230!\330\030\"\240)\2505\260\004\260A\330\030\033\2301\330\034\035\330\030\034\230K\240q\250\001\340\030\037\230q\360\006\000\021\034\2301\230L\250\006\250d\260!\330\020\024\220L\240\r\250\\\270\021\270!\330\024\027\220t\230:\240Q\240k\260\031\270-\300q\340\030\031\340\024\025\360\006\000\r\022\220\027\230\002\230*\240A"; static const char __pyx_k_ParallelSolver_getSolutionsList[] = "ParallelSolver.getSolutionsList..genexpr"; +static const char __pyx_k_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1[] = "\320\000/\320/U\320Un\360\000\000o\001Z\002\360\000\000Z\002P\003\360\000\000P\003Q\003\360\010\000\005\023\220!\330\004\027\220q\330\004\031\230\021\330\004 \240\001\340\004\005\340\010\014\210L\230\001\330\014\017\210y\230\007\230q\340\020\031\230\027\240\001\240\031\250!\330\020\021\360\010\000\r\026\220W\230A\230[\250\005\250Q\330\014\017\210t\2201\330\020\027\220q\330\014\026\220i\230u\240D\250\001\340\010\t\340\014\017\210t\2201\340\020\024\220K\230q\240\001\330\020\026\220a\330\024\036\230i\240u\250D\260\001\330\024\027\220q\330\030\031\330\024\030\230\013\2401\240A\340\024\033\2301\360\006\000\r\030\220q\230\014\240F\250$\250a\330\014\020\220\014\230M\320):\270!\2701\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\340\020\021\360\006\000\t\016\210W\220B\220j\240\001"; +static const char __pyx_k_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P[] = "\320\000\032\360\000\000\033U\002\360\000\000U\002V\002\340\004\022\220)\320\033.\250k\270\035\320FW\320WX\330\004\030\230\013\2401\340\004\007\200q\340\010\014\210E\220\037\320 1\260\026\260q\330\014\035\230Q\230g\240Q\240e\2501\250A\320-@\300\001\300\037\320PZ\320Z[\320[g\360\000\000h\001K\002\360\000\000K\002W\002\360\000\000W\002^\002\360\000\000^\002b\002\360\000\000b\002n\002\360\000\000n\002v\002\360\000\000v\002w\002\360\006\000\005\010\200x\210q\320\020\"\320\"3\2601\260L\300\001\330\010\017\320\017-\250Q\320.@\320@P\320PY\320YZ\330\004\013\2101"; static const char __pyx_k_provides_only_a_single_solution[] = " provides only a single solution"; static const char __pyx_k_tuple_bool_dict_Hashable_Domain[] = "tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]"; +static const char __pyx_k_A_b_A_c_jPTT_a_5_HA_t2S_q_WA_Q_1[] = "\200A\360\032\000\t\017\210b\220\001\220\023\220A\220\\\240\021\240,\250c\260\021\260'\270\021\270,\300j\320PT\320T`\320`a\330\010\013\2105\220\001\330\010\014\210H\220A\330\014\017\210t\2202\220S\230\007\230q\340\020\021\360\006\000\r\026\220W\230A\230[\250\005\250Q\330\014\023\2201\340\010\023\2204\220r\230\021\330\010\023\2201\220L\240\001\340\010\027\220t\2301\330\010\013\2101\330\014\032\230!\2307\240!\2403\240d\250%\250x\260s\270\"\270G\3001\340\014\032\230!\340\010\014\210I\220W\230A\230Q\330\014\027\220q\230\014\240A\330\014\017\210q\330\020\024\220J\230a\330\024\032\230*\240A\330\014\020\220\014\230M\250\034\260Q\260a\330\020\023\2204\220z\240\021\240+\250Y\260m\3001\340\024\025\360\006\000\021\025\320\024*\250!\250;\260i\270~\310]\320Z[\330\020\023\220:\230T\240\021\330\024\033\2301\330\014\017\210q\330\020\024\220J\230a\330\024\032\230)\2401\330\010\014\210K\220q\230\001\330\010\017\210q"; static const char __pyx_k_BacktrackingSolver_getSolutionIt[] = "BacktrackingSolver.getSolutionIter"; static const char __pyx_k_Module_containing_the_code_for_t[] = "Module containing the code for the problem solvers."; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; static const char __pyx_k_OptimizedBacktrackingSolver___in[] = "OptimizedBacktrackingSolver.__init__"; static const char __pyx_k_OptimizedBacktrackingSolver_getS[] = "OptimizedBacktrackingSolver.getSolutionIter"; static const char __pyx_k_Problem_solver_based_on_the_mini[] = "Problem solver based on the minimum conflicts theory.\n\n Examples:\n >>> result = [[('a', 1), ('b', 2)],\n ... [('a', 1), ('b', 3)],\n ... [('a', 2), ('b', 3)]]\n\n >>> problem = Problem(MinConflictsSolver())\n >>> problem.addVariables([\"a\", \"b\"], [1, 2, 3])\n >>> problem.addConstraint(lambda a, b: b > a, [\"a\", \"b\"])\n\n >>> solution = problem.getSolution()\n >>> sorted(solution.items()) in result\n True\n\n >>> problem.getSolutions()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver provides only a single solution\n\n >>> problem.getSolutionIter()\n Traceback (most recent call last):\n ...\n NotImplementedError: MinConflictsSolver doesn't provide iteration\n "; @@ -2972,13 +2795,19 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_setdefault = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_copy = {0, 0, 0, 0, 0}; -static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, 0, 0, 0, 0}; /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -3004,7 +2833,6 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; @@ -3012,7 +2840,6 @@ typedef struct { PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; PyObject *__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; - #endif PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; @@ -3020,307 +2847,306 @@ typedef struct { PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr; PyTypeObject *__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr; - PyObject *__pyx_kp_s_Abstract_base_class_for_solvers; - PyObject *__pyx_n_s_BacktrackingSolver; - PyObject *__pyx_n_s_BacktrackingSolver___init; - PyObject *__pyx_n_s_BacktrackingSolver_getSolution; - PyObject *__pyx_n_s_BacktrackingSolver_getSolutionIt; - PyObject *__pyx_n_s_BacktrackingSolver_getSolutions; - PyObject *__pyx_kp_u_Can_t_happen; - PyObject *__pyx_n_s_CompilableFunctionConstraint; - PyObject *__pyx_n_s_Constraint; - PyObject *__pyx_n_s_Domain; - PyObject *__pyx_n_s_FunctionConstraint; - PyObject *__pyx_n_s_FunctionType; - PyObject *__pyx_n_s_Hashable; - PyObject *__pyx_n_s_MinConflictsSolver; - PyObject *__pyx_n_s_MinConflictsSolver___init; - PyObject *__pyx_n_s_MinConflictsSolver_getSolution; - PyObject *__pyx_n_s_NotImplementedError; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver___in; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_2; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_3; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_4; - PyObject *__pyx_n_s_OptimizedBacktrackingSolver_getS_5; - PyObject *__pyx_n_s_ParallelSolver; - PyObject *__pyx_n_s_ParallelSolver___init; - PyObject *__pyx_n_s_ParallelSolver_getSolution; - PyObject *__pyx_n_s_ParallelSolver_getSolutions; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList_2; - PyObject *__pyx_n_s_ParallelSolver_getSolutionsList_3; - PyObject *__pyx_kp_s_Problem_solver_based_on_the_mini; - PyObject *__pyx_kp_s_Problem_solver_that_executes_all; - PyObject *__pyx_kp_s_Problem_solver_with_backtracking; - PyObject *__pyx_kp_s_Problem_solver_with_backtracking_2; - PyObject *__pyx_n_s_ProcessPoolExecutor; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver___in; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_getS; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_getS_2; - PyObject *__pyx_n_s_RecursiveBacktrackingSolver_recu; - PyObject *__pyx_kp_s_Recursive_problem_solver_with_ba; - PyObject *__pyx_n_s_RuntimeError; - PyObject *__pyx_n_s_Solver; - PyObject *__pyx_n_s_Solver_getSolution; - PyObject *__pyx_n_s_Solver_getSolutionIter; - PyObject *__pyx_n_s_Solver_getSolutions; - PyObject *__pyx_n_s_StopIteration; - PyObject *__pyx_n_s_ThreadPoolExecutor; - PyObject *__pyx_n_s__10; - PyObject *__pyx_n_s__6; - PyObject *__pyx_n_s__61; - PyObject *__pyx_kp_u__7; - PyObject *__pyx_n_s_append; - PyObject *__pyx_n_s_arcconstraints; - PyObject *__pyx_n_s_arcs; - PyObject *__pyx_n_s_arcsvariable; - PyObject *__pyx_n_s_args; - PyObject *__pyx_n_s_assignment; - PyObject *__pyx_n_s_assignments; - PyObject *__pyx_n_s_asyncio_coroutines; - PyObject *__pyx_n_s_bool; - PyObject *__pyx_n_s_c; - PyObject *__pyx_n_s_check; - PyObject *__pyx_n_s_choice; - PyObject *__pyx_n_s_chunksize; - PyObject *__pyx_n_s_class; - PyObject *__pyx_n_s_class_getitem; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_co_consts; - PyObject *__pyx_n_s_code_object; - PyObject *__pyx_n_s_collections_abc; - PyObject *__pyx_n_s_compile; - PyObject *__pyx_n_s_compile_to_function; - PyObject *__pyx_n_s_concurrent_futures; - PyObject *__pyx_n_s_conflicted; - PyObject *__pyx_n_s_constraint; - PyObject *__pyx_n_s_constraint_constraints; - PyObject *__pyx_n_s_constraint_domain; - PyObject *__pyx_n_s_constraint_lookup; - PyObject *__pyx_n_s_constraint_solvers; - PyObject *__pyx_kp_s_constraint_solvers_py; - PyObject *__pyx_n_s_constraints; - PyObject *__pyx_n_s_constraints_lookup; - PyObject *__pyx_n_s_copy; - PyObject *__pyx_n_s_count; - PyObject *__pyx_n_s_dict; - PyObject *__pyx_n_s_dict_2; - PyObject *__pyx_kp_s_dict_Hashable_Domain; - PyObject *__pyx_kp_s_dict_Hashable_any; - PyObject *__pyx_kp_s_dict_Hashable_list_tuple_Constra; - PyObject *__pyx_kp_u_disable; - PyObject *__pyx_n_s_doArc8; - PyObject *__pyx_n_s_doc; - PyObject *__pyx_kp_u_doesn_t_provide_iteration; - PyObject *__pyx_n_s_domain; - PyObject *__pyx_n_s_domains; - PyObject *__pyx_kp_u_enable; - PyObject *__pyx_n_s_enter; - PyObject *__pyx_n_u_exec; - PyObject *__pyx_n_s_executor; - PyObject *__pyx_n_s_exit; - PyObject *__pyx_n_s_first_value; - PyObject *__pyx_n_s_first_var; - PyObject *__pyx_n_s_forwardcheck; - PyObject *__pyx_n_s_forwardcheck_2; - PyObject *__pyx_n_s_fromkeys; - PyObject *__pyx_n_s_func; - PyObject *__pyx_n_s_func_2; - PyObject *__pyx_n_s_func_string; - PyObject *__pyx_kp_u_gc; - PyObject *__pyx_n_s_genexpr; - PyObject *__pyx_n_s_get; - PyObject *__pyx_n_s_getArcs; - PyObject *__pyx_n_s_getSolution; - PyObject *__pyx_n_s_getSolutionIter; - PyObject *__pyx_n_s_getSolutions; - PyObject *__pyx_n_s_getSolutionsList; - PyObject *__pyx_n_s_getSortedVariables; - PyObject *__pyx_n_s_hideValue; - PyObject *__pyx_n_s_import; - PyObject *__pyx_n_s_init; - PyObject *__pyx_n_s_init_subclass; - PyObject *__pyx_n_s_initializing; - PyObject *__pyx_kp_u_is_an_abstract_class; - PyObject *__pyx_n_s_is_coroutine; - PyObject *__pyx_n_s_is_valid; - PyObject *__pyx_n_s_is_valid_locals_genexpr; - PyObject *__pyx_n_s_is_valid_locals_genexpr_locals_g; - PyObject *__pyx_kp_u_isenabled; - PyObject *__pyx_n_s_item; - PyObject *__pyx_n_s_items; - PyObject *__pyx_n_s_iter; - PyObject *__pyx_n_s_key; - PyObject *__pyx_n_s_keys; - PyObject *__pyx_n_s_list; - PyObject *__pyx_kp_s_list_Hashable; - PyObject *__pyx_kp_s_list_dict_Hashable_any; - PyObject *__pyx_kp_s_list_tuple; - PyObject *__pyx_kp_s_list_tuple_Constraint_Hashable; - PyObject *__pyx_n_s_local_assignment; - PyObject *__pyx_n_s_lst; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_map; - PyObject *__pyx_n_s_metaclass; - PyObject *__pyx_n_s_mincount; - PyObject *__pyx_n_s_minvalues; - PyObject *__pyx_n_s_module; - PyObject *__pyx_n_s_mro_entries; - PyObject *__pyx_n_s_msg; - PyObject *__pyx_n_s_name; - PyObject *__pyx_kp_u_only_provides_all_solutions; - PyObject *__pyx_n_s_otherdomain; - PyObject *__pyx_n_s_othervalue; - PyObject *__pyx_n_s_othervariable; - PyObject *__pyx_n_s_parallel_pool; - PyObject *__pyx_n_s_parallel_worker; - PyObject *__pyx_n_s_pop; - PyObject *__pyx_n_s_popState; - PyObject *__pyx_n_s_popitem; - PyObject *__pyx_n_s_prepare; - PyObject *__pyx_n_s_process_mode; - PyObject *__pyx_n_s_process_mode_2; - PyObject *__pyx_kp_u_provides_only_a_single_solution; - PyObject *__pyx_n_s_pushState; - PyObject *__pyx_n_s_pushdomains; - PyObject *__pyx_n_s_qualname; - PyObject *__pyx_n_s_queue; - PyObject *__pyx_n_s_rand; - PyObject *__pyx_n_s_rand_2; - PyObject *__pyx_n_s_random; - PyObject *__pyx_n_s_range; - PyObject *__pyx_n_s_recursiveBacktracking; - PyObject *__pyx_n_s_remaining_vars; - PyObject *__pyx_n_s_requires_pickling; - PyObject *__pyx_n_s_result; - PyObject *__pyx_n_s_results; - PyObject *__pyx_n_s_return; - PyObject *__pyx_n_s_self; - PyObject *__pyx_n_s_send; - PyObject *__pyx_n_s_sequential_optimized_backtrack; - PyObject *__pyx_n_s_sequential_recursive_backtrack; - PyObject *__pyx_n_s_set_name; - PyObject *__pyx_n_s_setdefault; - PyObject *__pyx_n_s_shuffle; - PyObject *__pyx_n_s_single; - PyObject *__pyx_n_s_solutions; - PyObject *__pyx_n_s_sorted; - PyObject *__pyx_n_s_sorted_variables; - PyObject *__pyx_n_s_sorted_vars; - PyObject *__pyx_n_s_spec; - PyObject *__pyx_n_s_steps; - PyObject *__pyx_n_s_steps_2; - PyObject *__pyx_kp_u_string; - PyObject *__pyx_n_s_super; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_throw; - PyObject *__pyx_kp_s_tuple_bool_dict_Hashable_Domain; - PyObject *__pyx_n_s_types; - PyObject *__pyx_n_s_unassigned_vars; - PyObject *__pyx_n_s_v; - PyObject *__pyx_n_s_vals; - PyObject *__pyx_n_s_value; - PyObject *__pyx_n_s_values; - PyObject *__pyx_n_s_var; - PyObject *__pyx_n_s_variable; - PyObject *__pyx_n_s_variable1; - PyObject *__pyx_n_s_variable2; - PyObject *__pyx_n_s_variables; - PyObject *__pyx_n_s_vconstraints; - PyObject *__pyx_n_s_x; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop; + __Pyx_CachedCFunction __pyx_umethod_PyList_Type__copy; + PyObject *__pyx_slice[1]; + PyObject *__pyx_tuple[5]; + PyObject *__pyx_codeobj_tab[34]; + PyObject *__pyx_string_tab[214]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_1000; - PyObject *__pyx_slice_; - PyObject *__pyx_tuple__3; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__8; - PyObject *__pyx_tuple__11; - PyObject *__pyx_tuple__13; - PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__19; - PyObject *__pyx_tuple__20; - PyObject *__pyx_tuple__21; - PyObject *__pyx_tuple__23; - PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__27; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__34; - PyObject *__pyx_tuple__36; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; - PyObject *__pyx_tuple__42; - PyObject *__pyx_tuple__44; - PyObject *__pyx_tuple__46; - PyObject *__pyx_tuple__48; - PyObject *__pyx_tuple__51; - PyObject *__pyx_tuple__53; - PyObject *__pyx_tuple__55; - PyObject *__pyx_tuple__57; - PyObject *__pyx_tuple__59; - PyObject *__pyx_codeobj__2; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__12; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__15; - PyObject *__pyx_codeobj__16; - PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__22; - PyObject *__pyx_codeobj__24; - PyObject *__pyx_codeobj__25; - PyObject *__pyx_codeobj__28; - PyObject *__pyx_codeobj__29; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__32; - PyObject *__pyx_codeobj__33; - PyObject *__pyx_codeobj__35; - PyObject *__pyx_codeobj__37; - PyObject *__pyx_codeobj__38; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__43; - PyObject *__pyx_codeobj__45; - PyObject *__pyx_codeobj__47; - PyObject *__pyx_codeobj__49; - PyObject *__pyx_codeobj__50; - PyObject *__pyx_codeobj__52; - PyObject *__pyx_codeobj__54; - PyObject *__pyx_codeobj__56; - PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__60; -} __pyx_mstate; +/* #### Code section: module_state_contents ### */ +/* IterNextPlain.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache; +#endif + +/* CachedMethodType.module_state_decls */ +#if CYTHON_COMPILING_IN_LIMITED_API +PyObject *__Pyx_CachedMethodType; +#endif + + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr; +#endif + +#if CYTHON_USE_FREELISTS +struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[8]; +int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr; +#endif +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; #if CYTHON_USE_MODULE_STATE #ifdef __cplusplus namespace { - extern struct PyModuleDef __pyx_moduledef; +extern struct PyModuleDef __pyx_moduledef; } /* anonymous namespace */ #else static struct PyModuleDef __pyx_moduledef; #endif -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) +#define __pyx_mstate_global (__Pyx_PyModule_GetState(PyState_FindModule(&__pyx_moduledef))) #define __pyx_m (PyState_FindModule(&__pyx_moduledef)) #else -static __pyx_mstate __pyx_mstate_global_static = +static __pyx_mstatetype __pyx_mstate_global_static = #ifdef __cplusplus {}; #else {0}; #endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif +static __pyx_mstatetype *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_Abstract_base_class_for_solvers __pyx_string_tab[1] +#define __pyx_n_u_BacktrackingSolver __pyx_string_tab[2] +#define __pyx_n_u_BacktrackingSolver___init __pyx_string_tab[3] +#define __pyx_n_u_BacktrackingSolver_getSolution __pyx_string_tab[4] +#define __pyx_n_u_BacktrackingSolver_getSolutionIt __pyx_string_tab[5] +#define __pyx_n_u_BacktrackingSolver_getSolutions __pyx_string_tab[6] +#define __pyx_kp_u_Can_t_happen __pyx_string_tab[7] +#define __pyx_n_u_CompilableFunctionConstraint __pyx_string_tab[8] +#define __pyx_n_u_Constraint __pyx_string_tab[9] +#define __pyx_n_u_Domain __pyx_string_tab[10] +#define __pyx_n_u_FunctionConstraint __pyx_string_tab[11] +#define __pyx_n_u_FunctionType __pyx_string_tab[12] +#define __pyx_n_u_Hashable __pyx_string_tab[13] +#define __pyx_n_u_MinConflictsSolver __pyx_string_tab[14] +#define __pyx_n_u_MinConflictsSolver___init __pyx_string_tab[15] +#define __pyx_n_u_MinConflictsSolver_getSolution __pyx_string_tab[16] +#define __pyx_n_u_NotImplementedError __pyx_string_tab[17] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[18] +#define __pyx_n_u_OptimizedBacktrackingSolver __pyx_string_tab[19] +#define __pyx_n_u_OptimizedBacktrackingSolver___in __pyx_string_tab[20] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS __pyx_string_tab[21] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_2 __pyx_string_tab[22] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_3 __pyx_string_tab[23] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_4 __pyx_string_tab[24] +#define __pyx_n_u_OptimizedBacktrackingSolver_getS_5 __pyx_string_tab[25] +#define __pyx_n_u_ParallelSolver __pyx_string_tab[26] +#define __pyx_n_u_ParallelSolver___init __pyx_string_tab[27] +#define __pyx_n_u_ParallelSolver_getSolution __pyx_string_tab[28] +#define __pyx_n_u_ParallelSolver_getSolutions __pyx_string_tab[29] +#define __pyx_n_u_ParallelSolver_getSolutionsList __pyx_string_tab[30] +#define __pyx_n_u_ParallelSolver_getSolutionsList_2 __pyx_string_tab[31] +#define __pyx_n_u_ParallelSolver_getSolutionsList_3 __pyx_string_tab[32] +#define __pyx_kp_u_Problem_solver_based_on_the_mini __pyx_string_tab[33] +#define __pyx_kp_u_Problem_solver_that_executes_all __pyx_string_tab[34] +#define __pyx_kp_u_Problem_solver_with_backtracking __pyx_string_tab[35] +#define __pyx_kp_u_Problem_solver_with_backtracking_2 __pyx_string_tab[36] +#define __pyx_n_u_ProcessPoolExecutor __pyx_string_tab[37] +#define __pyx_n_u_RecursiveBacktrackingSolver __pyx_string_tab[38] +#define __pyx_n_u_RecursiveBacktrackingSolver___in __pyx_string_tab[39] +#define __pyx_n_u_RecursiveBacktrackingSolver_getS __pyx_string_tab[40] +#define __pyx_n_u_RecursiveBacktrackingSolver_getS_2 __pyx_string_tab[41] +#define __pyx_n_u_RecursiveBacktrackingSolver_recu __pyx_string_tab[42] +#define __pyx_kp_u_Recursive_problem_solver_with_ba __pyx_string_tab[43] +#define __pyx_n_u_RuntimeError __pyx_string_tab[44] +#define __pyx_n_u_Solver __pyx_string_tab[45] +#define __pyx_n_u_Solver_getSolution __pyx_string_tab[46] +#define __pyx_n_u_Solver_getSolutionIter __pyx_string_tab[47] +#define __pyx_n_u_Solver_getSolutions __pyx_string_tab[48] +#define __pyx_n_u_StopIteration __pyx_string_tab[49] +#define __pyx_n_u_ThreadPoolExecutor __pyx_string_tab[50] +#define __pyx_kp_u__2 __pyx_string_tab[51] +#define __pyx_n_u__5 __pyx_string_tab[52] +#define __pyx_kp_u_add_note __pyx_string_tab[53] +#define __pyx_n_u_append __pyx_string_tab[54] +#define __pyx_n_u_arcconstraints __pyx_string_tab[55] +#define __pyx_n_u_arcs __pyx_string_tab[56] +#define __pyx_n_u_arcsvariable __pyx_string_tab[57] +#define __pyx_n_u_args __pyx_string_tab[58] +#define __pyx_n_u_assignment __pyx_string_tab[59] +#define __pyx_n_u_assignments __pyx_string_tab[60] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[61] +#define __pyx_n_u_bool __pyx_string_tab[62] +#define __pyx_n_u_c __pyx_string_tab[63] +#define __pyx_n_u_check __pyx_string_tab[64] +#define __pyx_n_u_choice __pyx_string_tab[65] +#define __pyx_n_u_chunksize __pyx_string_tab[66] +#define __pyx_n_u_class __pyx_string_tab[67] +#define __pyx_n_u_class_getitem __pyx_string_tab[68] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[69] +#define __pyx_n_u_close __pyx_string_tab[70] +#define __pyx_n_u_co_consts __pyx_string_tab[71] +#define __pyx_n_u_code_object __pyx_string_tab[72] +#define __pyx_n_u_collections_abc __pyx_string_tab[73] +#define __pyx_n_u_compile __pyx_string_tab[74] +#define __pyx_n_u_compile_to_function __pyx_string_tab[75] +#define __pyx_n_u_concurrent_futures __pyx_string_tab[76] +#define __pyx_n_u_conflicted __pyx_string_tab[77] +#define __pyx_n_u_constraint __pyx_string_tab[78] +#define __pyx_n_u_constraint_constraints __pyx_string_tab[79] +#define __pyx_n_u_constraint_domain __pyx_string_tab[80] +#define __pyx_n_u_constraint_lookup __pyx_string_tab[81] +#define __pyx_n_u_constraint_solvers __pyx_string_tab[82] +#define __pyx_kp_u_constraint_solvers_py __pyx_string_tab[83] +#define __pyx_n_u_constraints __pyx_string_tab[84] +#define __pyx_n_u_constraints_lookup __pyx_string_tab[85] +#define __pyx_n_u_copy __pyx_string_tab[86] +#define __pyx_n_u_count __pyx_string_tab[87] +#define __pyx_n_u_dict __pyx_string_tab[88] +#define __pyx_kp_u_dict_Hashable_Domain __pyx_string_tab[89] +#define __pyx_kp_u_dict_Hashable_any __pyx_string_tab[90] +#define __pyx_kp_u_dict_Hashable_list_tuple_Constra __pyx_string_tab[91] +#define __pyx_kp_u_disable __pyx_string_tab[92] +#define __pyx_n_u_doArc8 __pyx_string_tab[93] +#define __pyx_n_u_doc __pyx_string_tab[94] +#define __pyx_kp_u_doesn_t_provide_iteration __pyx_string_tab[95] +#define __pyx_n_u_domain __pyx_string_tab[96] +#define __pyx_n_u_domains __pyx_string_tab[97] +#define __pyx_kp_u_enable __pyx_string_tab[98] +#define __pyx_n_u_enter __pyx_string_tab[99] +#define __pyx_n_u_exec __pyx_string_tab[100] +#define __pyx_n_u_executor __pyx_string_tab[101] +#define __pyx_n_u_exit __pyx_string_tab[102] +#define __pyx_n_u_first_value __pyx_string_tab[103] +#define __pyx_n_u_first_var __pyx_string_tab[104] +#define __pyx_n_u_forwardcheck __pyx_string_tab[105] +#define __pyx_n_u_forwardcheck_2 __pyx_string_tab[106] +#define __pyx_n_u_fromkeys __pyx_string_tab[107] +#define __pyx_n_u_func __pyx_string_tab[108] +#define __pyx_n_u_func_2 __pyx_string_tab[109] +#define __pyx_n_u_func_3 __pyx_string_tab[110] +#define __pyx_n_u_func_string __pyx_string_tab[111] +#define __pyx_kp_u_gc __pyx_string_tab[112] +#define __pyx_n_u_genexpr __pyx_string_tab[113] +#define __pyx_n_u_get __pyx_string_tab[114] +#define __pyx_n_u_getArcs __pyx_string_tab[115] +#define __pyx_n_u_getSolution __pyx_string_tab[116] +#define __pyx_n_u_getSolutionIter __pyx_string_tab[117] +#define __pyx_n_u_getSolutions __pyx_string_tab[118] +#define __pyx_n_u_getSolutionsList __pyx_string_tab[119] +#define __pyx_n_u_getSortedVariables __pyx_string_tab[120] +#define __pyx_n_u_hideValue __pyx_string_tab[121] +#define __pyx_n_u_init __pyx_string_tab[122] +#define __pyx_n_u_initializing __pyx_string_tab[123] +#define __pyx_kp_u_is_an_abstract_class __pyx_string_tab[124] +#define __pyx_n_u_is_coroutine __pyx_string_tab[125] +#define __pyx_n_u_is_valid __pyx_string_tab[126] +#define __pyx_n_u_is_valid_locals_genexpr __pyx_string_tab[127] +#define __pyx_n_u_is_valid_locals_genexpr_locals_g __pyx_string_tab[128] +#define __pyx_kp_u_isenabled __pyx_string_tab[129] +#define __pyx_n_u_item __pyx_string_tab[130] +#define __pyx_n_u_items __pyx_string_tab[131] +#define __pyx_n_u_iter __pyx_string_tab[132] +#define __pyx_n_u_key __pyx_string_tab[133] +#define __pyx_n_u_keys __pyx_string_tab[134] +#define __pyx_n_u_lambda __pyx_string_tab[135] +#define __pyx_n_u_list __pyx_string_tab[136] +#define __pyx_kp_u_list_Hashable __pyx_string_tab[137] +#define __pyx_kp_u_list_dict_Hashable_any __pyx_string_tab[138] +#define __pyx_kp_u_list_tuple __pyx_string_tab[139] +#define __pyx_kp_u_list_tuple_Constraint_Hashable __pyx_string_tab[140] +#define __pyx_n_u_local_assignment __pyx_string_tab[141] +#define __pyx_n_u_lst __pyx_string_tab[142] +#define __pyx_n_u_main __pyx_string_tab[143] +#define __pyx_n_u_map __pyx_string_tab[144] +#define __pyx_n_u_metaclass __pyx_string_tab[145] +#define __pyx_n_u_mincount __pyx_string_tab[146] +#define __pyx_n_u_minvalues __pyx_string_tab[147] +#define __pyx_n_u_module __pyx_string_tab[148] +#define __pyx_n_u_mro_entries __pyx_string_tab[149] +#define __pyx_n_u_msg __pyx_string_tab[150] +#define __pyx_n_u_name __pyx_string_tab[151] +#define __pyx_n_u_next __pyx_string_tab[152] +#define __pyx_kp_u_only_provides_all_solutions __pyx_string_tab[153] +#define __pyx_n_u_otherdomain __pyx_string_tab[154] +#define __pyx_n_u_othervalue __pyx_string_tab[155] +#define __pyx_n_u_othervariable __pyx_string_tab[156] +#define __pyx_n_u_parallel_pool __pyx_string_tab[157] +#define __pyx_n_u_parallel_worker __pyx_string_tab[158] +#define __pyx_n_u_pop __pyx_string_tab[159] +#define __pyx_n_u_popState __pyx_string_tab[160] +#define __pyx_n_u_popitem __pyx_string_tab[161] +#define __pyx_n_u_prepare __pyx_string_tab[162] +#define __pyx_n_u_process_mode __pyx_string_tab[163] +#define __pyx_n_u_process_mode_2 __pyx_string_tab[164] +#define __pyx_kp_u_provides_only_a_single_solution __pyx_string_tab[165] +#define __pyx_n_u_pushState __pyx_string_tab[166] +#define __pyx_n_u_pushdomains __pyx_string_tab[167] +#define __pyx_n_u_qualname __pyx_string_tab[168] +#define __pyx_n_u_queue __pyx_string_tab[169] +#define __pyx_n_u_rand __pyx_string_tab[170] +#define __pyx_n_u_rand_2 __pyx_string_tab[171] +#define __pyx_n_u_random __pyx_string_tab[172] +#define __pyx_n_u_range __pyx_string_tab[173] +#define __pyx_n_u_recursiveBacktracking __pyx_string_tab[174] +#define __pyx_n_u_remaining_vars __pyx_string_tab[175] +#define __pyx_n_u_requires_pickling __pyx_string_tab[176] +#define __pyx_n_u_result __pyx_string_tab[177] +#define __pyx_n_u_results __pyx_string_tab[178] +#define __pyx_n_u_return __pyx_string_tab[179] +#define __pyx_n_u_self __pyx_string_tab[180] +#define __pyx_n_u_send __pyx_string_tab[181] +#define __pyx_n_u_sequential_optimized_backtrack __pyx_string_tab[182] +#define __pyx_n_u_sequential_recursive_backtrack __pyx_string_tab[183] +#define __pyx_n_u_setdefault __pyx_string_tab[184] +#define __pyx_n_u_shuffle __pyx_string_tab[185] +#define __pyx_n_u_single __pyx_string_tab[186] +#define __pyx_n_u_solutions __pyx_string_tab[187] +#define __pyx_n_u_sorted __pyx_string_tab[188] +#define __pyx_n_u_sorted_variables __pyx_string_tab[189] +#define __pyx_n_u_sorted_vars __pyx_string_tab[190] +#define __pyx_n_u_spec __pyx_string_tab[191] +#define __pyx_n_u_steps __pyx_string_tab[192] +#define __pyx_n_u_steps_2 __pyx_string_tab[193] +#define __pyx_kp_u_string __pyx_string_tab[194] +#define __pyx_n_u_super __pyx_string_tab[195] +#define __pyx_n_u_test __pyx_string_tab[196] +#define __pyx_n_u_throw __pyx_string_tab[197] +#define __pyx_kp_u_tuple_bool_dict_Hashable_Domain __pyx_string_tab[198] +#define __pyx_n_u_types __pyx_string_tab[199] +#define __pyx_n_u_unassigned_vars __pyx_string_tab[200] +#define __pyx_n_u_v __pyx_string_tab[201] +#define __pyx_n_u_val __pyx_string_tab[202] +#define __pyx_n_u_vals __pyx_string_tab[203] +#define __pyx_n_u_value __pyx_string_tab[204] +#define __pyx_n_u_values __pyx_string_tab[205] +#define __pyx_n_u_var __pyx_string_tab[206] +#define __pyx_n_u_variable __pyx_string_tab[207] +#define __pyx_n_u_variable1 __pyx_string_tab[208] +#define __pyx_n_u_variable2 __pyx_string_tab[209] +#define __pyx_n_u_variables __pyx_string_tab[210] +#define __pyx_n_u_vars_involved __pyx_string_tab[211] +#define __pyx_n_u_vconstraints __pyx_string_tab[212] +#define __pyx_n_u_x __pyx_string_tab[213] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); if (!clear_module_state) return 0; Py_CLEAR(clear_module_state->__pyx_d); Py_CLEAR(clear_module_state->__pyx_b); @@ -3348,292 +3174,27 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr); - Py_CLEAR(clear_module_state->__pyx_kp_s_Abstract_base_class_for_solvers); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt); - Py_CLEAR(clear_module_state->__pyx_n_s_BacktrackingSolver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_kp_u_Can_t_happen); - Py_CLEAR(clear_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionConstraint); - Py_CLEAR(clear_module_state->__pyx_n_s_FunctionType); - Py_CLEAR(clear_module_state->__pyx_n_s_Hashable); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_MinConflictsSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver___in); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_2); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_3); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_4); - Py_CLEAR(clear_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_5); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver___init); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_2); - Py_CLEAR(clear_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_3); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_based_on_the_mini); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_that_executes_all); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_with_backtracking); - Py_CLEAR(clear_module_state->__pyx_kp_s_Problem_solver_with_backtracking_2); - Py_CLEAR(clear_module_state->__pyx_n_s_ProcessPoolExecutor); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver___in); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS_2); - Py_CLEAR(clear_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu); - Py_CLEAR(clear_module_state->__pyx_kp_s_Recursive_problem_solver_with_ba); - Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_Solver_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration); - Py_CLEAR(clear_module_state->__pyx_n_s_ThreadPoolExecutor); - Py_CLEAR(clear_module_state->__pyx_n_s__10); - Py_CLEAR(clear_module_state->__pyx_n_s__6); - Py_CLEAR(clear_module_state->__pyx_n_s__61); - Py_CLEAR(clear_module_state->__pyx_kp_u__7); - Py_CLEAR(clear_module_state->__pyx_n_s_append); - Py_CLEAR(clear_module_state->__pyx_n_s_arcconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_arcs); - Py_CLEAR(clear_module_state->__pyx_n_s_arcsvariable); - Py_CLEAR(clear_module_state->__pyx_n_s_args); - Py_CLEAR(clear_module_state->__pyx_n_s_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_assignments); - Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); - Py_CLEAR(clear_module_state->__pyx_n_s_bool); - Py_CLEAR(clear_module_state->__pyx_n_s_c); - Py_CLEAR(clear_module_state->__pyx_n_s_check); - Py_CLEAR(clear_module_state->__pyx_n_s_choice); - Py_CLEAR(clear_module_state->__pyx_n_s_chunksize); - Py_CLEAR(clear_module_state->__pyx_n_s_class); - Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_co_consts); - Py_CLEAR(clear_module_state->__pyx_n_s_code_object); - Py_CLEAR(clear_module_state->__pyx_n_s_collections_abc); - Py_CLEAR(clear_module_state->__pyx_n_s_compile); - Py_CLEAR(clear_module_state->__pyx_n_s_compile_to_function); - Py_CLEAR(clear_module_state->__pyx_n_s_concurrent_futures); - Py_CLEAR(clear_module_state->__pyx_n_s_conflicted); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_lookup); - Py_CLEAR(clear_module_state->__pyx_n_s_constraint_solvers); - Py_CLEAR(clear_module_state->__pyx_kp_s_constraint_solvers_py); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints); - Py_CLEAR(clear_module_state->__pyx_n_s_constraints_lookup); - Py_CLEAR(clear_module_state->__pyx_n_s_copy); - Py_CLEAR(clear_module_state->__pyx_n_s_count); - Py_CLEAR(clear_module_state->__pyx_n_s_dict); - Py_CLEAR(clear_module_state->__pyx_n_s_dict_2); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_Domain); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_any); - Py_CLEAR(clear_module_state->__pyx_kp_s_dict_Hashable_list_tuple_Constra); - Py_CLEAR(clear_module_state->__pyx_kp_u_disable); - Py_CLEAR(clear_module_state->__pyx_n_s_doArc8); - Py_CLEAR(clear_module_state->__pyx_n_s_doc); - Py_CLEAR(clear_module_state->__pyx_kp_u_doesn_t_provide_iteration); - Py_CLEAR(clear_module_state->__pyx_n_s_domain); - Py_CLEAR(clear_module_state->__pyx_n_s_domains); - Py_CLEAR(clear_module_state->__pyx_kp_u_enable); - Py_CLEAR(clear_module_state->__pyx_n_s_enter); - Py_CLEAR(clear_module_state->__pyx_n_u_exec); - Py_CLEAR(clear_module_state->__pyx_n_s_executor); - Py_CLEAR(clear_module_state->__pyx_n_s_exit); - Py_CLEAR(clear_module_state->__pyx_n_s_first_value); - Py_CLEAR(clear_module_state->__pyx_n_s_first_var); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck); - Py_CLEAR(clear_module_state->__pyx_n_s_forwardcheck_2); - Py_CLEAR(clear_module_state->__pyx_n_s_fromkeys); - Py_CLEAR(clear_module_state->__pyx_n_s_func); - Py_CLEAR(clear_module_state->__pyx_n_s_func_2); - Py_CLEAR(clear_module_state->__pyx_n_s_func_string); - Py_CLEAR(clear_module_state->__pyx_kp_u_gc); - Py_CLEAR(clear_module_state->__pyx_n_s_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_get); - Py_CLEAR(clear_module_state->__pyx_n_s_getArcs); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolution); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionIter); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutions); - Py_CLEAR(clear_module_state->__pyx_n_s_getSolutionsList); - Py_CLEAR(clear_module_state->__pyx_n_s_getSortedVariables); - Py_CLEAR(clear_module_state->__pyx_n_s_hideValue); - Py_CLEAR(clear_module_state->__pyx_n_s_import); - Py_CLEAR(clear_module_state->__pyx_n_s_init); - Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass); - Py_CLEAR(clear_module_state->__pyx_n_s_initializing); - Py_CLEAR(clear_module_state->__pyx_kp_u_is_an_abstract_class); - Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_locals_genexpr); - Py_CLEAR(clear_module_state->__pyx_n_s_is_valid_locals_genexpr_locals_g); - Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); - Py_CLEAR(clear_module_state->__pyx_n_s_item); - Py_CLEAR(clear_module_state->__pyx_n_s_items); - Py_CLEAR(clear_module_state->__pyx_n_s_iter); - Py_CLEAR(clear_module_state->__pyx_n_s_key); - Py_CLEAR(clear_module_state->__pyx_n_s_keys); - Py_CLEAR(clear_module_state->__pyx_n_s_list); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_Hashable); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_dict_Hashable_any); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple); - Py_CLEAR(clear_module_state->__pyx_kp_s_list_tuple_Constraint_Hashable); - Py_CLEAR(clear_module_state->__pyx_n_s_local_assignment); - Py_CLEAR(clear_module_state->__pyx_n_s_lst); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_map); - Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); - Py_CLEAR(clear_module_state->__pyx_n_s_mincount); - Py_CLEAR(clear_module_state->__pyx_n_s_minvalues); - Py_CLEAR(clear_module_state->__pyx_n_s_module); - Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries); - Py_CLEAR(clear_module_state->__pyx_n_s_msg); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_kp_u_only_provides_all_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_otherdomain); - Py_CLEAR(clear_module_state->__pyx_n_s_othervalue); - Py_CLEAR(clear_module_state->__pyx_n_s_othervariable); - Py_CLEAR(clear_module_state->__pyx_n_s_parallel_pool); - Py_CLEAR(clear_module_state->__pyx_n_s_parallel_worker); - Py_CLEAR(clear_module_state->__pyx_n_s_pop); - Py_CLEAR(clear_module_state->__pyx_n_s_popState); - Py_CLEAR(clear_module_state->__pyx_n_s_popitem); - Py_CLEAR(clear_module_state->__pyx_n_s_prepare); - Py_CLEAR(clear_module_state->__pyx_n_s_process_mode); - Py_CLEAR(clear_module_state->__pyx_n_s_process_mode_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_provides_only_a_single_solution); - Py_CLEAR(clear_module_state->__pyx_n_s_pushState); - Py_CLEAR(clear_module_state->__pyx_n_s_pushdomains); - Py_CLEAR(clear_module_state->__pyx_n_s_qualname); - Py_CLEAR(clear_module_state->__pyx_n_s_queue); - Py_CLEAR(clear_module_state->__pyx_n_s_rand); - Py_CLEAR(clear_module_state->__pyx_n_s_rand_2); - Py_CLEAR(clear_module_state->__pyx_n_s_random); - Py_CLEAR(clear_module_state->__pyx_n_s_range); - Py_CLEAR(clear_module_state->__pyx_n_s_recursiveBacktracking); - Py_CLEAR(clear_module_state->__pyx_n_s_remaining_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_requires_pickling); - Py_CLEAR(clear_module_state->__pyx_n_s_result); - Py_CLEAR(clear_module_state->__pyx_n_s_results); - Py_CLEAR(clear_module_state->__pyx_n_s_return); - Py_CLEAR(clear_module_state->__pyx_n_s_self); - Py_CLEAR(clear_module_state->__pyx_n_s_send); - Py_CLEAR(clear_module_state->__pyx_n_s_sequential_optimized_backtrack); - Py_CLEAR(clear_module_state->__pyx_n_s_sequential_recursive_backtrack); - Py_CLEAR(clear_module_state->__pyx_n_s_set_name); - Py_CLEAR(clear_module_state->__pyx_n_s_setdefault); - Py_CLEAR(clear_module_state->__pyx_n_s_shuffle); - Py_CLEAR(clear_module_state->__pyx_n_s_single); - Py_CLEAR(clear_module_state->__pyx_n_s_solutions); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_sorted_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_spec); - Py_CLEAR(clear_module_state->__pyx_n_s_steps); - Py_CLEAR(clear_module_state->__pyx_n_s_steps_2); - Py_CLEAR(clear_module_state->__pyx_kp_u_string); - Py_CLEAR(clear_module_state->__pyx_n_s_super); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_throw); - Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_bool_dict_Hashable_Domain); - Py_CLEAR(clear_module_state->__pyx_n_s_types); - Py_CLEAR(clear_module_state->__pyx_n_s_unassigned_vars); - Py_CLEAR(clear_module_state->__pyx_n_s_v); - Py_CLEAR(clear_module_state->__pyx_n_s_vals); - Py_CLEAR(clear_module_state->__pyx_n_s_value); - Py_CLEAR(clear_module_state->__pyx_n_s_values); - Py_CLEAR(clear_module_state->__pyx_n_s_var); - Py_CLEAR(clear_module_state->__pyx_n_s_variable); - Py_CLEAR(clear_module_state->__pyx_n_s_variable1); - Py_CLEAR(clear_module_state->__pyx_n_s_variable2); - Py_CLEAR(clear_module_state->__pyx_n_s_variables); - Py_CLEAR(clear_module_state->__pyx_n_s_vconstraints); - Py_CLEAR(clear_module_state->__pyx_n_s_x); + for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); } + for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } + for (int i=0; i<34; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<214; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_1000); - Py_CLEAR(clear_module_state->__pyx_slice_); - Py_CLEAR(clear_module_state->__pyx_tuple__3); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__8); - Py_CLEAR(clear_module_state->__pyx_tuple__11); - Py_CLEAR(clear_module_state->__pyx_tuple__13); - Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__19); - Py_CLEAR(clear_module_state->__pyx_tuple__20); - Py_CLEAR(clear_module_state->__pyx_tuple__21); - Py_CLEAR(clear_module_state->__pyx_tuple__23); - Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__27); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__34); - Py_CLEAR(clear_module_state->__pyx_tuple__36); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); - Py_CLEAR(clear_module_state->__pyx_tuple__42); - Py_CLEAR(clear_module_state->__pyx_tuple__44); - Py_CLEAR(clear_module_state->__pyx_tuple__46); - Py_CLEAR(clear_module_state->__pyx_tuple__48); - Py_CLEAR(clear_module_state->__pyx_tuple__51); - Py_CLEAR(clear_module_state->__pyx_tuple__53); - Py_CLEAR(clear_module_state->__pyx_tuple__55); - Py_CLEAR(clear_module_state->__pyx_tuple__57); - Py_CLEAR(clear_module_state->__pyx_tuple__59); - Py_CLEAR(clear_module_state->__pyx_codeobj__2); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__22); - Py_CLEAR(clear_module_state->__pyx_codeobj__24); - Py_CLEAR(clear_module_state->__pyx_codeobj__25); - Py_CLEAR(clear_module_state->__pyx_codeobj__28); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); - Py_CLEAR(clear_module_state->__pyx_codeobj__33); - Py_CLEAR(clear_module_state->__pyx_codeobj__35); - Py_CLEAR(clear_module_state->__pyx_codeobj__37); - Py_CLEAR(clear_module_state->__pyx_codeobj__38); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__43); - Py_CLEAR(clear_module_state->__pyx_codeobj__45); - Py_CLEAR(clear_module_state->__pyx_codeobj__47); - Py_CLEAR(clear_module_state->__pyx_codeobj__49); - Py_CLEAR(clear_module_state->__pyx_codeobj__50); - Py_CLEAR(clear_module_state->__pyx_codeobj__52); - Py_CLEAR(clear_module_state->__pyx_codeobj__54); - Py_CLEAR(clear_module_state->__pyx_codeobj__56); - Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__60); return 0; } #endif /* #### Code section: module_state_traverse ### */ #if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); if (!traverse_module_state) return 0; Py_VISIT(traverse_module_state->__pyx_d); Py_VISIT(traverse_module_state->__pyx_b); Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); #ifdef __Pyx_CyFunction_USED Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif @@ -3654,594 +3215,16 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr); - Py_VISIT(traverse_module_state->__pyx_kp_s_Abstract_base_class_for_solvers); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolutionIt); - Py_VISIT(traverse_module_state->__pyx_n_s_BacktrackingSolver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_kp_u_Can_t_happen); - Py_VISIT(traverse_module_state->__pyx_n_s_CompilableFunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionConstraint); - Py_VISIT(traverse_module_state->__pyx_n_s_FunctionType); - Py_VISIT(traverse_module_state->__pyx_n_s_Hashable); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_MinConflictsSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver___in); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_2); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_3); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_4); - Py_VISIT(traverse_module_state->__pyx_n_s_OptimizedBacktrackingSolver_getS_5); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver___init); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_2); - Py_VISIT(traverse_module_state->__pyx_n_s_ParallelSolver_getSolutionsList_3); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_based_on_the_mini); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_that_executes_all); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_with_backtracking); - Py_VISIT(traverse_module_state->__pyx_kp_s_Problem_solver_with_backtracking_2); - Py_VISIT(traverse_module_state->__pyx_n_s_ProcessPoolExecutor); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver___in); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_getS_2); - Py_VISIT(traverse_module_state->__pyx_n_s_RecursiveBacktrackingSolver_recu); - Py_VISIT(traverse_module_state->__pyx_kp_s_Recursive_problem_solver_with_ba); - Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_Solver_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration); - Py_VISIT(traverse_module_state->__pyx_n_s_ThreadPoolExecutor); - Py_VISIT(traverse_module_state->__pyx_n_s__10); - Py_VISIT(traverse_module_state->__pyx_n_s__6); - Py_VISIT(traverse_module_state->__pyx_n_s__61); - Py_VISIT(traverse_module_state->__pyx_kp_u__7); - Py_VISIT(traverse_module_state->__pyx_n_s_append); - Py_VISIT(traverse_module_state->__pyx_n_s_arcconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_arcs); - Py_VISIT(traverse_module_state->__pyx_n_s_arcsvariable); - Py_VISIT(traverse_module_state->__pyx_n_s_args); - Py_VISIT(traverse_module_state->__pyx_n_s_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_assignments); - Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); - Py_VISIT(traverse_module_state->__pyx_n_s_bool); - Py_VISIT(traverse_module_state->__pyx_n_s_c); - Py_VISIT(traverse_module_state->__pyx_n_s_check); - Py_VISIT(traverse_module_state->__pyx_n_s_choice); - Py_VISIT(traverse_module_state->__pyx_n_s_chunksize); - Py_VISIT(traverse_module_state->__pyx_n_s_class); - Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_co_consts); - Py_VISIT(traverse_module_state->__pyx_n_s_code_object); - Py_VISIT(traverse_module_state->__pyx_n_s_collections_abc); - Py_VISIT(traverse_module_state->__pyx_n_s_compile); - Py_VISIT(traverse_module_state->__pyx_n_s_compile_to_function); - Py_VISIT(traverse_module_state->__pyx_n_s_concurrent_futures); - Py_VISIT(traverse_module_state->__pyx_n_s_conflicted); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_lookup); - Py_VISIT(traverse_module_state->__pyx_n_s_constraint_solvers); - Py_VISIT(traverse_module_state->__pyx_kp_s_constraint_solvers_py); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints); - Py_VISIT(traverse_module_state->__pyx_n_s_constraints_lookup); - Py_VISIT(traverse_module_state->__pyx_n_s_copy); - Py_VISIT(traverse_module_state->__pyx_n_s_count); - Py_VISIT(traverse_module_state->__pyx_n_s_dict); - Py_VISIT(traverse_module_state->__pyx_n_s_dict_2); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_Domain); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_any); - Py_VISIT(traverse_module_state->__pyx_kp_s_dict_Hashable_list_tuple_Constra); - Py_VISIT(traverse_module_state->__pyx_kp_u_disable); - Py_VISIT(traverse_module_state->__pyx_n_s_doArc8); - Py_VISIT(traverse_module_state->__pyx_n_s_doc); - Py_VISIT(traverse_module_state->__pyx_kp_u_doesn_t_provide_iteration); - Py_VISIT(traverse_module_state->__pyx_n_s_domain); - Py_VISIT(traverse_module_state->__pyx_n_s_domains); - Py_VISIT(traverse_module_state->__pyx_kp_u_enable); - Py_VISIT(traverse_module_state->__pyx_n_s_enter); - Py_VISIT(traverse_module_state->__pyx_n_u_exec); - Py_VISIT(traverse_module_state->__pyx_n_s_executor); - Py_VISIT(traverse_module_state->__pyx_n_s_exit); - Py_VISIT(traverse_module_state->__pyx_n_s_first_value); - Py_VISIT(traverse_module_state->__pyx_n_s_first_var); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck); - Py_VISIT(traverse_module_state->__pyx_n_s_forwardcheck_2); - Py_VISIT(traverse_module_state->__pyx_n_s_fromkeys); - Py_VISIT(traverse_module_state->__pyx_n_s_func); - Py_VISIT(traverse_module_state->__pyx_n_s_func_2); - Py_VISIT(traverse_module_state->__pyx_n_s_func_string); - Py_VISIT(traverse_module_state->__pyx_kp_u_gc); - Py_VISIT(traverse_module_state->__pyx_n_s_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_get); - Py_VISIT(traverse_module_state->__pyx_n_s_getArcs); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolution); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionIter); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutions); - Py_VISIT(traverse_module_state->__pyx_n_s_getSolutionsList); - Py_VISIT(traverse_module_state->__pyx_n_s_getSortedVariables); - Py_VISIT(traverse_module_state->__pyx_n_s_hideValue); - Py_VISIT(traverse_module_state->__pyx_n_s_import); - Py_VISIT(traverse_module_state->__pyx_n_s_init); - Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass); - Py_VISIT(traverse_module_state->__pyx_n_s_initializing); - Py_VISIT(traverse_module_state->__pyx_kp_u_is_an_abstract_class); - Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_locals_genexpr); - Py_VISIT(traverse_module_state->__pyx_n_s_is_valid_locals_genexpr_locals_g); - Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); - Py_VISIT(traverse_module_state->__pyx_n_s_item); - Py_VISIT(traverse_module_state->__pyx_n_s_items); - Py_VISIT(traverse_module_state->__pyx_n_s_iter); - Py_VISIT(traverse_module_state->__pyx_n_s_key); - Py_VISIT(traverse_module_state->__pyx_n_s_keys); - Py_VISIT(traverse_module_state->__pyx_n_s_list); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_Hashable); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_dict_Hashable_any); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple); - Py_VISIT(traverse_module_state->__pyx_kp_s_list_tuple_Constraint_Hashable); - Py_VISIT(traverse_module_state->__pyx_n_s_local_assignment); - Py_VISIT(traverse_module_state->__pyx_n_s_lst); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_map); - Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); - Py_VISIT(traverse_module_state->__pyx_n_s_mincount); - Py_VISIT(traverse_module_state->__pyx_n_s_minvalues); - Py_VISIT(traverse_module_state->__pyx_n_s_module); - Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries); - Py_VISIT(traverse_module_state->__pyx_n_s_msg); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_kp_u_only_provides_all_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_otherdomain); - Py_VISIT(traverse_module_state->__pyx_n_s_othervalue); - Py_VISIT(traverse_module_state->__pyx_n_s_othervariable); - Py_VISIT(traverse_module_state->__pyx_n_s_parallel_pool); - Py_VISIT(traverse_module_state->__pyx_n_s_parallel_worker); - Py_VISIT(traverse_module_state->__pyx_n_s_pop); - Py_VISIT(traverse_module_state->__pyx_n_s_popState); - Py_VISIT(traverse_module_state->__pyx_n_s_popitem); - Py_VISIT(traverse_module_state->__pyx_n_s_prepare); - Py_VISIT(traverse_module_state->__pyx_n_s_process_mode); - Py_VISIT(traverse_module_state->__pyx_n_s_process_mode_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_provides_only_a_single_solution); - Py_VISIT(traverse_module_state->__pyx_n_s_pushState); - Py_VISIT(traverse_module_state->__pyx_n_s_pushdomains); - Py_VISIT(traverse_module_state->__pyx_n_s_qualname); - Py_VISIT(traverse_module_state->__pyx_n_s_queue); - Py_VISIT(traverse_module_state->__pyx_n_s_rand); - Py_VISIT(traverse_module_state->__pyx_n_s_rand_2); - Py_VISIT(traverse_module_state->__pyx_n_s_random); - Py_VISIT(traverse_module_state->__pyx_n_s_range); - Py_VISIT(traverse_module_state->__pyx_n_s_recursiveBacktracking); - Py_VISIT(traverse_module_state->__pyx_n_s_remaining_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_requires_pickling); - Py_VISIT(traverse_module_state->__pyx_n_s_result); - Py_VISIT(traverse_module_state->__pyx_n_s_results); - Py_VISIT(traverse_module_state->__pyx_n_s_return); - Py_VISIT(traverse_module_state->__pyx_n_s_self); - Py_VISIT(traverse_module_state->__pyx_n_s_send); - Py_VISIT(traverse_module_state->__pyx_n_s_sequential_optimized_backtrack); - Py_VISIT(traverse_module_state->__pyx_n_s_sequential_recursive_backtrack); - Py_VISIT(traverse_module_state->__pyx_n_s_set_name); - Py_VISIT(traverse_module_state->__pyx_n_s_setdefault); - Py_VISIT(traverse_module_state->__pyx_n_s_shuffle); - Py_VISIT(traverse_module_state->__pyx_n_s_single); - Py_VISIT(traverse_module_state->__pyx_n_s_solutions); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_sorted_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_spec); - Py_VISIT(traverse_module_state->__pyx_n_s_steps); - Py_VISIT(traverse_module_state->__pyx_n_s_steps_2); - Py_VISIT(traverse_module_state->__pyx_kp_u_string); - Py_VISIT(traverse_module_state->__pyx_n_s_super); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_throw); - Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_bool_dict_Hashable_Domain); - Py_VISIT(traverse_module_state->__pyx_n_s_types); - Py_VISIT(traverse_module_state->__pyx_n_s_unassigned_vars); - Py_VISIT(traverse_module_state->__pyx_n_s_v); - Py_VISIT(traverse_module_state->__pyx_n_s_vals); - Py_VISIT(traverse_module_state->__pyx_n_s_value); - Py_VISIT(traverse_module_state->__pyx_n_s_values); - Py_VISIT(traverse_module_state->__pyx_n_s_var); - Py_VISIT(traverse_module_state->__pyx_n_s_variable); - Py_VISIT(traverse_module_state->__pyx_n_s_variable1); - Py_VISIT(traverse_module_state->__pyx_n_s_variable2); - Py_VISIT(traverse_module_state->__pyx_n_s_variables); - Py_VISIT(traverse_module_state->__pyx_n_s_vconstraints); - Py_VISIT(traverse_module_state->__pyx_n_s_x); - Py_VISIT(traverse_module_state->__pyx_int_0); - Py_VISIT(traverse_module_state->__pyx_int_1); - Py_VISIT(traverse_module_state->__pyx_int_1000); - Py_VISIT(traverse_module_state->__pyx_slice_); - Py_VISIT(traverse_module_state->__pyx_tuple__3); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__8); - Py_VISIT(traverse_module_state->__pyx_tuple__11); - Py_VISIT(traverse_module_state->__pyx_tuple__13); - Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__19); - Py_VISIT(traverse_module_state->__pyx_tuple__20); - Py_VISIT(traverse_module_state->__pyx_tuple__21); - Py_VISIT(traverse_module_state->__pyx_tuple__23); - Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__27); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__34); - Py_VISIT(traverse_module_state->__pyx_tuple__36); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); - Py_VISIT(traverse_module_state->__pyx_tuple__42); - Py_VISIT(traverse_module_state->__pyx_tuple__44); - Py_VISIT(traverse_module_state->__pyx_tuple__46); - Py_VISIT(traverse_module_state->__pyx_tuple__48); - Py_VISIT(traverse_module_state->__pyx_tuple__51); - Py_VISIT(traverse_module_state->__pyx_tuple__53); - Py_VISIT(traverse_module_state->__pyx_tuple__55); - Py_VISIT(traverse_module_state->__pyx_tuple__57); - Py_VISIT(traverse_module_state->__pyx_tuple__59); - Py_VISIT(traverse_module_state->__pyx_codeobj__2); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); - Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__22); - Py_VISIT(traverse_module_state->__pyx_codeobj__24); - Py_VISIT(traverse_module_state->__pyx_codeobj__25); - Py_VISIT(traverse_module_state->__pyx_codeobj__28); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); - Py_VISIT(traverse_module_state->__pyx_codeobj__33); - Py_VISIT(traverse_module_state->__pyx_codeobj__35); - Py_VISIT(traverse_module_state->__pyx_codeobj__37); - Py_VISIT(traverse_module_state->__pyx_codeobj__38); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__43); - Py_VISIT(traverse_module_state->__pyx_codeobj__45); - Py_VISIT(traverse_module_state->__pyx_codeobj__47); - Py_VISIT(traverse_module_state->__pyx_codeobj__49); - Py_VISIT(traverse_module_state->__pyx_codeobj__50); - Py_VISIT(traverse_module_state->__pyx_codeobj__52); - Py_VISIT(traverse_module_state->__pyx_codeobj__54); - Py_VISIT(traverse_module_state->__pyx_codeobj__56); - Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__60); + for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); } + for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } + for (int i=0; i<34; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<214; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1000); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#define __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr -#define __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr -#endif -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr -#define __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr -#define __pyx_kp_s_Abstract_base_class_for_solvers __pyx_mstate_global->__pyx_kp_s_Abstract_base_class_for_solvers -#define __pyx_n_s_BacktrackingSolver __pyx_mstate_global->__pyx_n_s_BacktrackingSolver -#define __pyx_n_s_BacktrackingSolver___init __pyx_mstate_global->__pyx_n_s_BacktrackingSolver___init -#define __pyx_n_s_BacktrackingSolver_getSolution __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolution -#define __pyx_n_s_BacktrackingSolver_getSolutionIt __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolutionIt -#define __pyx_n_s_BacktrackingSolver_getSolutions __pyx_mstate_global->__pyx_n_s_BacktrackingSolver_getSolutions -#define __pyx_kp_u_Can_t_happen __pyx_mstate_global->__pyx_kp_u_Can_t_happen -#define __pyx_n_s_CompilableFunctionConstraint __pyx_mstate_global->__pyx_n_s_CompilableFunctionConstraint -#define __pyx_n_s_Constraint __pyx_mstate_global->__pyx_n_s_Constraint -#define __pyx_n_s_Domain __pyx_mstate_global->__pyx_n_s_Domain -#define __pyx_n_s_FunctionConstraint __pyx_mstate_global->__pyx_n_s_FunctionConstraint -#define __pyx_n_s_FunctionType __pyx_mstate_global->__pyx_n_s_FunctionType -#define __pyx_n_s_Hashable __pyx_mstate_global->__pyx_n_s_Hashable -#define __pyx_n_s_MinConflictsSolver __pyx_mstate_global->__pyx_n_s_MinConflictsSolver -#define __pyx_n_s_MinConflictsSolver___init __pyx_mstate_global->__pyx_n_s_MinConflictsSolver___init -#define __pyx_n_s_MinConflictsSolver_getSolution __pyx_mstate_global->__pyx_n_s_MinConflictsSolver_getSolution -#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError -#define __pyx_n_s_OptimizedBacktrackingSolver __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver -#define __pyx_n_s_OptimizedBacktrackingSolver___in __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver___in -#define __pyx_n_s_OptimizedBacktrackingSolver_getS __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_2 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_2 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_3 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_3 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_4 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_4 -#define __pyx_n_s_OptimizedBacktrackingSolver_getS_5 __pyx_mstate_global->__pyx_n_s_OptimizedBacktrackingSolver_getS_5 -#define __pyx_n_s_ParallelSolver __pyx_mstate_global->__pyx_n_s_ParallelSolver -#define __pyx_n_s_ParallelSolver___init __pyx_mstate_global->__pyx_n_s_ParallelSolver___init -#define __pyx_n_s_ParallelSolver_getSolution __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolution -#define __pyx_n_s_ParallelSolver_getSolutions __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutions -#define __pyx_n_s_ParallelSolver_getSolutionsList __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList -#define __pyx_n_s_ParallelSolver_getSolutionsList_2 __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList_2 -#define __pyx_n_s_ParallelSolver_getSolutionsList_3 __pyx_mstate_global->__pyx_n_s_ParallelSolver_getSolutionsList_3 -#define __pyx_kp_s_Problem_solver_based_on_the_mini __pyx_mstate_global->__pyx_kp_s_Problem_solver_based_on_the_mini -#define __pyx_kp_s_Problem_solver_that_executes_all __pyx_mstate_global->__pyx_kp_s_Problem_solver_that_executes_all -#define __pyx_kp_s_Problem_solver_with_backtracking __pyx_mstate_global->__pyx_kp_s_Problem_solver_with_backtracking -#define __pyx_kp_s_Problem_solver_with_backtracking_2 __pyx_mstate_global->__pyx_kp_s_Problem_solver_with_backtracking_2 -#define __pyx_n_s_ProcessPoolExecutor __pyx_mstate_global->__pyx_n_s_ProcessPoolExecutor -#define __pyx_n_s_RecursiveBacktrackingSolver __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver -#define __pyx_n_s_RecursiveBacktrackingSolver___in __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver___in -#define __pyx_n_s_RecursiveBacktrackingSolver_getS __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_getS -#define __pyx_n_s_RecursiveBacktrackingSolver_getS_2 __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_getS_2 -#define __pyx_n_s_RecursiveBacktrackingSolver_recu __pyx_mstate_global->__pyx_n_s_RecursiveBacktrackingSolver_recu -#define __pyx_kp_s_Recursive_problem_solver_with_ba __pyx_mstate_global->__pyx_kp_s_Recursive_problem_solver_with_ba -#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError -#define __pyx_n_s_Solver __pyx_mstate_global->__pyx_n_s_Solver -#define __pyx_n_s_Solver_getSolution __pyx_mstate_global->__pyx_n_s_Solver_getSolution -#define __pyx_n_s_Solver_getSolutionIter __pyx_mstate_global->__pyx_n_s_Solver_getSolutionIter -#define __pyx_n_s_Solver_getSolutions __pyx_mstate_global->__pyx_n_s_Solver_getSolutions -#define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration -#define __pyx_n_s_ThreadPoolExecutor __pyx_mstate_global->__pyx_n_s_ThreadPoolExecutor -#define __pyx_n_s__10 __pyx_mstate_global->__pyx_n_s__10 -#define __pyx_n_s__6 __pyx_mstate_global->__pyx_n_s__6 -#define __pyx_n_s__61 __pyx_mstate_global->__pyx_n_s__61 -#define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 -#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append -#define __pyx_n_s_arcconstraints __pyx_mstate_global->__pyx_n_s_arcconstraints -#define __pyx_n_s_arcs __pyx_mstate_global->__pyx_n_s_arcs -#define __pyx_n_s_arcsvariable __pyx_mstate_global->__pyx_n_s_arcsvariable -#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args -#define __pyx_n_s_assignment __pyx_mstate_global->__pyx_n_s_assignment -#define __pyx_n_s_assignments __pyx_mstate_global->__pyx_n_s_assignments -#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines -#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool -#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c -#define __pyx_n_s_check __pyx_mstate_global->__pyx_n_s_check -#define __pyx_n_s_choice __pyx_mstate_global->__pyx_n_s_choice -#define __pyx_n_s_chunksize __pyx_mstate_global->__pyx_n_s_chunksize -#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class -#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_co_consts __pyx_mstate_global->__pyx_n_s_co_consts -#define __pyx_n_s_code_object __pyx_mstate_global->__pyx_n_s_code_object -#define __pyx_n_s_collections_abc __pyx_mstate_global->__pyx_n_s_collections_abc -#define __pyx_n_s_compile __pyx_mstate_global->__pyx_n_s_compile -#define __pyx_n_s_compile_to_function __pyx_mstate_global->__pyx_n_s_compile_to_function -#define __pyx_n_s_concurrent_futures __pyx_mstate_global->__pyx_n_s_concurrent_futures -#define __pyx_n_s_conflicted __pyx_mstate_global->__pyx_n_s_conflicted -#define __pyx_n_s_constraint __pyx_mstate_global->__pyx_n_s_constraint -#define __pyx_n_s_constraint_constraints __pyx_mstate_global->__pyx_n_s_constraint_constraints -#define __pyx_n_s_constraint_domain __pyx_mstate_global->__pyx_n_s_constraint_domain -#define __pyx_n_s_constraint_lookup __pyx_mstate_global->__pyx_n_s_constraint_lookup -#define __pyx_n_s_constraint_solvers __pyx_mstate_global->__pyx_n_s_constraint_solvers -#define __pyx_kp_s_constraint_solvers_py __pyx_mstate_global->__pyx_kp_s_constraint_solvers_py -#define __pyx_n_s_constraints __pyx_mstate_global->__pyx_n_s_constraints -#define __pyx_n_s_constraints_lookup __pyx_mstate_global->__pyx_n_s_constraints_lookup -#define __pyx_n_s_copy __pyx_mstate_global->__pyx_n_s_copy -#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count -#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict -#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2 -#define __pyx_kp_s_dict_Hashable_Domain __pyx_mstate_global->__pyx_kp_s_dict_Hashable_Domain -#define __pyx_kp_s_dict_Hashable_any __pyx_mstate_global->__pyx_kp_s_dict_Hashable_any -#define __pyx_kp_s_dict_Hashable_list_tuple_Constra __pyx_mstate_global->__pyx_kp_s_dict_Hashable_list_tuple_Constra -#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable -#define __pyx_n_s_doArc8 __pyx_mstate_global->__pyx_n_s_doArc8 -#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc -#define __pyx_kp_u_doesn_t_provide_iteration __pyx_mstate_global->__pyx_kp_u_doesn_t_provide_iteration -#define __pyx_n_s_domain __pyx_mstate_global->__pyx_n_s_domain -#define __pyx_n_s_domains __pyx_mstate_global->__pyx_n_s_domains -#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable -#define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter -#define __pyx_n_u_exec __pyx_mstate_global->__pyx_n_u_exec -#define __pyx_n_s_executor __pyx_mstate_global->__pyx_n_s_executor -#define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit -#define __pyx_n_s_first_value __pyx_mstate_global->__pyx_n_s_first_value -#define __pyx_n_s_first_var __pyx_mstate_global->__pyx_n_s_first_var -#define __pyx_n_s_forwardcheck __pyx_mstate_global->__pyx_n_s_forwardcheck -#define __pyx_n_s_forwardcheck_2 __pyx_mstate_global->__pyx_n_s_forwardcheck_2 -#define __pyx_n_s_fromkeys __pyx_mstate_global->__pyx_n_s_fromkeys -#define __pyx_n_s_func __pyx_mstate_global->__pyx_n_s_func -#define __pyx_n_s_func_2 __pyx_mstate_global->__pyx_n_s_func_2 -#define __pyx_n_s_func_string __pyx_mstate_global->__pyx_n_s_func_string -#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc -#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr -#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get -#define __pyx_n_s_getArcs __pyx_mstate_global->__pyx_n_s_getArcs -#define __pyx_n_s_getSolution __pyx_mstate_global->__pyx_n_s_getSolution -#define __pyx_n_s_getSolutionIter __pyx_mstate_global->__pyx_n_s_getSolutionIter -#define __pyx_n_s_getSolutions __pyx_mstate_global->__pyx_n_s_getSolutions -#define __pyx_n_s_getSolutionsList __pyx_mstate_global->__pyx_n_s_getSolutionsList -#define __pyx_n_s_getSortedVariables __pyx_mstate_global->__pyx_n_s_getSortedVariables -#define __pyx_n_s_hideValue __pyx_mstate_global->__pyx_n_s_hideValue -#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import -#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init -#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass -#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing -#define __pyx_kp_u_is_an_abstract_class __pyx_mstate_global->__pyx_kp_u_is_an_abstract_class -#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine -#define __pyx_n_s_is_valid __pyx_mstate_global->__pyx_n_s_is_valid -#define __pyx_n_s_is_valid_locals_genexpr __pyx_mstate_global->__pyx_n_s_is_valid_locals_genexpr -#define __pyx_n_s_is_valid_locals_genexpr_locals_g __pyx_mstate_global->__pyx_n_s_is_valid_locals_genexpr_locals_g -#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled -#define __pyx_n_s_item __pyx_mstate_global->__pyx_n_s_item -#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items -#define __pyx_n_s_iter __pyx_mstate_global->__pyx_n_s_iter -#define __pyx_n_s_key __pyx_mstate_global->__pyx_n_s_key -#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys -#define __pyx_n_s_list __pyx_mstate_global->__pyx_n_s_list -#define __pyx_kp_s_list_Hashable __pyx_mstate_global->__pyx_kp_s_list_Hashable -#define __pyx_kp_s_list_dict_Hashable_any __pyx_mstate_global->__pyx_kp_s_list_dict_Hashable_any -#define __pyx_kp_s_list_tuple __pyx_mstate_global->__pyx_kp_s_list_tuple -#define __pyx_kp_s_list_tuple_Constraint_Hashable __pyx_mstate_global->__pyx_kp_s_list_tuple_Constraint_Hashable -#define __pyx_n_s_local_assignment __pyx_mstate_global->__pyx_n_s_local_assignment -#define __pyx_n_s_lst __pyx_mstate_global->__pyx_n_s_lst -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_map __pyx_mstate_global->__pyx_n_s_map -#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass -#define __pyx_n_s_mincount __pyx_mstate_global->__pyx_n_s_mincount -#define __pyx_n_s_minvalues __pyx_mstate_global->__pyx_n_s_minvalues -#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module -#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries -#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_kp_u_only_provides_all_solutions __pyx_mstate_global->__pyx_kp_u_only_provides_all_solutions -#define __pyx_n_s_otherdomain __pyx_mstate_global->__pyx_n_s_otherdomain -#define __pyx_n_s_othervalue __pyx_mstate_global->__pyx_n_s_othervalue -#define __pyx_n_s_othervariable __pyx_mstate_global->__pyx_n_s_othervariable -#define __pyx_n_s_parallel_pool __pyx_mstate_global->__pyx_n_s_parallel_pool -#define __pyx_n_s_parallel_worker __pyx_mstate_global->__pyx_n_s_parallel_worker -#define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop -#define __pyx_n_s_popState __pyx_mstate_global->__pyx_n_s_popState -#define __pyx_n_s_popitem __pyx_mstate_global->__pyx_n_s_popitem -#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare -#define __pyx_n_s_process_mode __pyx_mstate_global->__pyx_n_s_process_mode -#define __pyx_n_s_process_mode_2 __pyx_mstate_global->__pyx_n_s_process_mode_2 -#define __pyx_kp_u_provides_only_a_single_solution __pyx_mstate_global->__pyx_kp_u_provides_only_a_single_solution -#define __pyx_n_s_pushState __pyx_mstate_global->__pyx_n_s_pushState -#define __pyx_n_s_pushdomains __pyx_mstate_global->__pyx_n_s_pushdomains -#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname -#define __pyx_n_s_queue __pyx_mstate_global->__pyx_n_s_queue -#define __pyx_n_s_rand __pyx_mstate_global->__pyx_n_s_rand -#define __pyx_n_s_rand_2 __pyx_mstate_global->__pyx_n_s_rand_2 -#define __pyx_n_s_random __pyx_mstate_global->__pyx_n_s_random -#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range -#define __pyx_n_s_recursiveBacktracking __pyx_mstate_global->__pyx_n_s_recursiveBacktracking -#define __pyx_n_s_remaining_vars __pyx_mstate_global->__pyx_n_s_remaining_vars -#define __pyx_n_s_requires_pickling __pyx_mstate_global->__pyx_n_s_requires_pickling -#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result -#define __pyx_n_s_results __pyx_mstate_global->__pyx_n_s_results -#define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return -#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self -#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send -#define __pyx_n_s_sequential_optimized_backtrack __pyx_mstate_global->__pyx_n_s_sequential_optimized_backtrack -#define __pyx_n_s_sequential_recursive_backtrack __pyx_mstate_global->__pyx_n_s_sequential_recursive_backtrack -#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name -#define __pyx_n_s_setdefault __pyx_mstate_global->__pyx_n_s_setdefault -#define __pyx_n_s_shuffle __pyx_mstate_global->__pyx_n_s_shuffle -#define __pyx_n_s_single __pyx_mstate_global->__pyx_n_s_single -#define __pyx_n_s_solutions __pyx_mstate_global->__pyx_n_s_solutions -#define __pyx_n_s_sorted __pyx_mstate_global->__pyx_n_s_sorted -#define __pyx_n_s_sorted_variables __pyx_mstate_global->__pyx_n_s_sorted_variables -#define __pyx_n_s_sorted_vars __pyx_mstate_global->__pyx_n_s_sorted_vars -#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec -#define __pyx_n_s_steps __pyx_mstate_global->__pyx_n_s_steps -#define __pyx_n_s_steps_2 __pyx_mstate_global->__pyx_n_s_steps_2 -#define __pyx_kp_u_string __pyx_mstate_global->__pyx_kp_u_string -#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw -#define __pyx_kp_s_tuple_bool_dict_Hashable_Domain __pyx_mstate_global->__pyx_kp_s_tuple_bool_dict_Hashable_Domain -#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types -#define __pyx_n_s_unassigned_vars __pyx_mstate_global->__pyx_n_s_unassigned_vars -#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v -#define __pyx_n_s_vals __pyx_mstate_global->__pyx_n_s_vals -#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value -#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values -#define __pyx_n_s_var __pyx_mstate_global->__pyx_n_s_var -#define __pyx_n_s_variable __pyx_mstate_global->__pyx_n_s_variable -#define __pyx_n_s_variable1 __pyx_mstate_global->__pyx_n_s_variable1 -#define __pyx_n_s_variable2 __pyx_mstate_global->__pyx_n_s_variable2 -#define __pyx_n_s_variables __pyx_mstate_global->__pyx_n_s_variables -#define __pyx_n_s_vconstraints __pyx_mstate_global->__pyx_n_s_vconstraints -#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x -#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0 -#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1 -#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000 -#define __pyx_slice_ __pyx_mstate_global->__pyx_slice_ -#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 -#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 -#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 -#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 -#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21 -#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 -#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 -#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 -#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 -#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44 -#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 -#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48 -#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 -#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 -#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 -#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 -#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 -#define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 -#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 -#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 -#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 -#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 -#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 -#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 -#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 -#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 -#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 -#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 -#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 -#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 -#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 -#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 -#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 -#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 /* #### Code section: module_code ### */ /* "constraint/solvers.py":13 @@ -4250,7 +3233,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """Return a dictionary mapping pairs (arcs) of constrained variables. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_1getArcs(PyObject *__pyx_self, @@ -4283,7 +3266,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getArcs (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4291,13 +3274,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_domains,&__pyx_n_s_constraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4305,7 +3290,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4313,7 +3298,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -4351,8 +3336,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 13, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 13, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 13, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 13, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_getArcs(__pyx_self, __pyx_v_domains, __pyx_v_constraints); /* function exit code */ @@ -4393,7 +3378,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getArcs", 1); + __Pyx_RefNannySetupContext("getArcs", 0); /* "constraint/solvers.py":18 * @attention: Currently unused. @@ -4401,7 +3386,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs = {} # <<<<<<<<<<<<<< * for x in constraints: * constraint, variables = x - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_arcs = ((PyObject*)__pyx_t_1); @@ -4413,19 +3398,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * for x in constraints: # <<<<<<<<<<<<<< * constraint, variables = x * if len(variables) == 2: - */ +*/ __pyx_t_1 = __pyx_v_constraints; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 19, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 19, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4439,7 +3427,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * constraint, variables = x # <<<<<<<<<<<<<< * if len(variables) == 2: * variable1, variable2 = variables - */ +*/ if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) { PyObject* sequence = __pyx_v_x; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); @@ -4450,25 +3438,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; @@ -4495,7 +3487,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * if len(variables) == 2: # <<<<<<<<<<<<<< * variable1, variable2 = variables * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) - */ +*/ __pyx_t_7 = PyObject_Length(__pyx_v_variables); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 21, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 == 2); if (__pyx_t_8) { @@ -4506,7 +3498,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * variable1, variable2 = variables # <<<<<<<<<<<<<< * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) - */ +*/ if ((likely(PyTuple_CheckExact(__pyx_v_variables))) || (PyList_CheckExact(__pyx_v_variables))) { PyObject* sequence = __pyx_v_variables; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); @@ -4517,25 +3509,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { Py_ssize_t index = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_variables); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed; @@ -4562,13 +3558,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) # <<<<<<<<<<<<<< * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) * return arcs - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable1, __pyx_t_4, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error) @@ -4578,13 +3574,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; - } + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; } #endif { @@ -4605,13 +3600,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * arcs.setdefault(variable2, {}).setdefault(variable1, []).append(x) # <<<<<<<<<<<<<< * return arcs * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyDict_SetDefault(__pyx_v_arcs, __pyx_v_variable2, __pyx_t_4, -1L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_setdefault); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) @@ -4621,13 +3616,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; - } + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; } #endif { @@ -4648,7 +3642,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * if len(variables) == 2: # <<<<<<<<<<<<<< * variable1, variable2 = variables * arcs.setdefault(variable1, {}).setdefault(variable2, []).append(x) - */ +*/ } /* "constraint/solvers.py":19 @@ -4657,7 +3651,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * for x in constraints: # <<<<<<<<<<<<<< * constraint, variables = x * if len(variables) == 2: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -4667,7 +3661,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * return arcs # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_arcs); __pyx_r = __pyx_v_arcs; @@ -4679,7 +3673,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """Return a dictionary mapping pairs (arcs) of constrained variables. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4708,7 +3702,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_getArcs(CYTHON_UNUSED PyObject * * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """Perform the ARC-8 arc checking algorithm and prune domains. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_3doArc8(PyObject *__pyx_self, @@ -4742,7 +3736,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("doArc8 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4750,15 +3744,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arcs,&__pyx_n_s_domains,&__pyx_n_s_assignments,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arcs,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_assignments,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -4766,7 +3763,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_arcs)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_arcs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -4774,7 +3771,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -4784,7 +3781,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -4824,9 +3821,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arcs), (&PyDict_Type), 0, "arcs", 1))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 28, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 1))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arcs), (&PyDict_Type), 0, "arcs", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignments), (&PyDict_Type), 0, "assignments", 2))) __PYX_ERR(0, 28, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_2doArc8(__pyx_self, __pyx_v_arcs, __pyx_v_domains, __pyx_v_assignments); /* function exit code */ @@ -4882,7 +3879,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("doArc8", 1); + __Pyx_RefNannySetupContext("doArc8", 0); /* "constraint/solvers.py":33 * @attention: Currently unused. @@ -4890,21 +3887,20 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * check = dict.fromkeys(domains, True) # <<<<<<<<<<<<<< * while check: * variable, _ = check.popitem() - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_n_s_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyDict_Type)), __pyx_mstate_global->__pyx_n_u_fromkeys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -4924,7 +3920,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * while check: # <<<<<<<<<<<<<< * variable, _ = check.popitem() * if variable not in arcs or variable in assignments: - */ +*/ while (1) { __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_check); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 34, __pyx_L1_error) if (!__pyx_t_5) break; @@ -4935,33 +3931,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * variable, _ = check.popitem() # <<<<<<<<<<<<<< * if variable not in arcs or variable in assignments: * continue - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_check, __pyx_n_s_popitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_check, __pyx_mstate_global->__pyx_n_u_popitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); @@ -4970,29 +3947,33 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 35, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 35, __pyx_L1_error) @@ -5006,8 +3987,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __PYX_ERR(0, 35, __pyx_L1_error) __pyx_L6_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_variable, __pyx_t_1); + __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3); __pyx_t_3 = 0; @@ -5017,7 +3998,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if variable not in arcs or variable in assignments: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_arcs, Py_NE)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 36, __pyx_L1_error) if (!__pyx_t_8) { } else { @@ -5035,7 +4016,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * continue # <<<<<<<<<<<<<< * domain = domains[variable] * arcsvariable = arcs[variable] - */ +*/ goto __pyx_L3_continue; /* "constraint/solvers.py":36 @@ -5044,7 +4025,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if variable not in arcs or variable in assignments: # <<<<<<<<<<<<<< * continue * domain = domains[variable] - */ +*/ } /* "constraint/solvers.py":38 @@ -5053,11 +4034,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * domain = domains[variable] # <<<<<<<<<<<<<< * arcsvariable = arcs[variable] * for othervariable in arcsvariable: - */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":39 * continue @@ -5065,11 +4046,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * arcsvariable = arcs[variable] # <<<<<<<<<<<<<< * for othervariable in arcsvariable: * arcconstraints = arcsvariable[othervariable] - */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_arcs, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_arcsvariable, __pyx_t_1); - __pyx_t_1 = 0; +*/ + __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_arcs, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_arcsvariable, __pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":40 * domain = domains[variable] @@ -5077,49 +4058,55 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervariable in arcsvariable: # <<<<<<<<<<<<<< * arcconstraints = arcsvariable[othervariable] * if othervariable in assignments: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_arcsvariable)) || PyTuple_CheckExact(__pyx_v_arcsvariable)) { - __pyx_t_1 = __pyx_v_arcsvariable; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_arcsvariable; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_arcsvariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_arcsvariable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 40, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 40, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_9); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 40, __pyx_L1_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); + if (unlikely((0 < 0))) __PYX_ERR(0, 40, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_9++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { - __pyx_t_3 = __pyx_t_10(__pyx_t_1); + __pyx_t_3 = __pyx_t_10(__pyx_t_2); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -5139,7 +4126,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * arcconstraints = arcsvariable[othervariable] # <<<<<<<<<<<<<< * if othervariable in assignments: * otherdomain = [assignments[othervariable]] - */ +*/ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_arcsvariable, __pyx_v_othervariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_arcconstraints, __pyx_t_3); @@ -5151,7 +4138,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if othervariable in assignments: # <<<<<<<<<<<<<< * otherdomain = [assignments[othervariable]] * else: - */ +*/ __pyx_t_5 = (__Pyx_PyDict_ContainsTF(__pyx_v_othervariable, __pyx_v_assignments, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 42, __pyx_L1_error) if (__pyx_t_5) { @@ -5161,16 +4148,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * otherdomain = [assignments[othervariable]] # <<<<<<<<<<<<<< * else: * otherdomain = domains[othervariable] - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_assignments, __pyx_v_othervariable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 43, __pyx_L1_error); __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_otherdomain, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_otherdomain, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":42 * for othervariable in arcsvariable: @@ -5178,7 +4165,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if othervariable in assignments: # <<<<<<<<<<<<<< * otherdomain = [assignments[othervariable]] * else: - */ +*/ goto __pyx_L12; } @@ -5188,12 +4175,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * otherdomain = domains[othervariable] # <<<<<<<<<<<<<< * if domain: * # changed = False - */ +*/ /*else*/ { - __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_othervariable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_XDECREF_SET(__pyx_v_otherdomain, __pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_othervariable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_XDECREF_SET(__pyx_v_otherdomain, __pyx_t_1); + __pyx_t_1 = 0; } __pyx_L12:; @@ -5203,7 +4190,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if domain: # <<<<<<<<<<<<<< * # changed = False * for value in domain[:]: - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 46, __pyx_L1_error) if (__pyx_t_5) { @@ -5213,53 +4200,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[variable] = value * if otherdomain: - */ - __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); +*/ + __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_domain, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 48, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_12)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 48, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_11); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 48, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); + if (unlikely((0 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_11++; #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_2 = __pyx_t_12(__pyx_t_3); - if (unlikely(!__pyx_t_2)) { + __pyx_t_1 = __pyx_t_12(__pyx_t_3); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -5267,10 +4260,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } break; } - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); + __pyx_t_1 = 0; /* "constraint/solvers.py":49 * # changed = False @@ -5278,7 +4271,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * assignments[variable] = value # <<<<<<<<<<<<<< * if otherdomain: * for othervalue in otherdomain: - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 49, __pyx_L1_error) /* "constraint/solvers.py":50 @@ -5287,7 +4280,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if otherdomain: # <<<<<<<<<<<<<< * for othervalue in otherdomain: * assignments[othervariable] = othervalue - */ +*/ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_otherdomain); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 50, __pyx_L1_error) if (__pyx_t_5) { @@ -5297,49 +4290,55 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervalue in otherdomain: # <<<<<<<<<<<<<< * assignments[othervariable] = othervalue * for constraint, variables in arcconstraints: - */ +*/ if (likely(PyList_CheckExact(__pyx_v_otherdomain)) || PyTuple_CheckExact(__pyx_v_otherdomain)) { - __pyx_t_2 = __pyx_v_otherdomain; __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_otherdomain; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_otherdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_otherdomain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 51, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 51, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_13); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_13++; #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 51, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); + if (unlikely((0 < 0))) __PYX_ERR(0, 51, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_6); + __pyx_t_13++; #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { - __pyx_t_6 = __pyx_t_14(__pyx_t_2); + __pyx_t_6 = __pyx_t_14(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -5359,7 +4358,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * assignments[othervariable] = othervalue # <<<<<<<<<<<<<< * for constraint, variables in arcconstraints: * if not constraint(variables, domains, assignments, True): - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_othervariable, __pyx_v_othervalue) < 0))) __PYX_ERR(0, 52, __pyx_L1_error) /* "constraint/solvers.py":53 @@ -5368,7 +4367,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for constraint, variables in arcconstraints: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, True): * break - */ +*/ if (likely(PyList_CheckExact(__pyx_v_arcconstraints)) || PyTuple_CheckExact(__pyx_v_arcconstraints)) { __pyx_t_6 = __pyx_v_arcconstraints; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0; @@ -5376,20 +4375,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } else { __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_arcconstraints); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 53, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_16)) { if (likely(PyList_CheckExact(__pyx_t_6))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_17 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyList_GetItemRef(__pyx_t_6, __pyx_t_15); + if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_17); + __pyx_t_15++; #else __pyx_t_17 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); @@ -5397,13 +4399,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 53, __pyx_L1_error) #endif if (__pyx_t_15 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_17); __pyx_t_15++; if (unlikely((0 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); + if (unlikely((0 < 0))) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_17); + __pyx_t_15++; #else __pyx_t_17 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_17); @@ -5431,18 +4436,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_18 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_18); + __pyx_t_19 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_19); } else { - __pyx_t_18 = PyList_GET_ITEM(sequence, 0); - __pyx_t_19 = PyList_GET_ITEM(sequence, 1); + __pyx_t_18 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_18); + __pyx_t_19 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_19); } - __Pyx_INCREF(__pyx_t_18); - __Pyx_INCREF(__pyx_t_19); #else - __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_18 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_19 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); #endif __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; @@ -5451,7 +4460,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * __pyx_t_20 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_20); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_20); index = 0; __pyx_t_18 = __pyx_t_7(__pyx_t_20); if (unlikely(!__pyx_t_18)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_18); index = 1; __pyx_t_19 = __pyx_t_7(__pyx_t_20); if (unlikely(!__pyx_t_19)) goto __pyx_L21_unpacking_failed; @@ -5478,20 +4487,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not constraint(variables, domains, assignments, True): # <<<<<<<<<<<<<< * break * else: - */ +*/ __Pyx_INCREF(__pyx_v_constraint); __pyx_t_19 = __pyx_v_constraint; __pyx_t_18 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_19))) { __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_19); - if (likely(__pyx_t_18)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); - __Pyx_INCREF(__pyx_t_18); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_19, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_18); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + __Pyx_INCREF(__pyx_t_18); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_19, function); + __pyx_t_4 = 1; } #endif { @@ -5513,7 +4521,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * break # <<<<<<<<<<<<<< * else: * # All constraints passed. Value is safe. - */ +*/ goto __pyx_L20_break; /* "constraint/solvers.py":54 @@ -5522,7 +4530,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not constraint(variables, domains, assignments, True): # <<<<<<<<<<<<<< * break * else: - */ +*/ } /* "constraint/solvers.py":53 @@ -5531,7 +4539,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for constraint, variables in arcconstraints: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, True): * break - */ +*/ } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L24_for_else; @@ -5547,7 +4555,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * break # <<<<<<<<<<<<<< * else: * # All othervalues failed. Kill value. - */ +*/ goto __pyx_L18_break; } __pyx_L25_for_end:; @@ -5558,12 +4566,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervalue in otherdomain: # <<<<<<<<<<<<<< * assignments[othervariable] = othervalue * for constraint, variables in arcconstraints: - */ +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L26_for_else; __pyx_L18_break:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L27_for_end; /*else*/ { __pyx_L26_for_else:; @@ -5574,32 +4582,31 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * domain.hideValue(value) # <<<<<<<<<<<<<< * # changed = True * del assignments[othervariable] - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_hideValue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_17 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_17)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_17); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_17); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_17); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_4 = 1; } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_value}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L27_for_end:; @@ -5609,7 +4616,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * del assignments[othervariable] # <<<<<<<<<<<<<< * del assignments[variable] * # if changed: - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_othervariable) < 0))) __PYX_ERR(0, 63, __pyx_L1_error) /* "constraint/solvers.py":50 @@ -5618,7 +4625,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if otherdomain: # <<<<<<<<<<<<<< * for othervalue in otherdomain: * assignments[othervariable] = othervalue - */ +*/ } /* "constraint/solvers.py":48 @@ -5627,7 +4634,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for value in domain[:]: # <<<<<<<<<<<<<< * assignments[variable] = value * if otherdomain: - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -5637,7 +4644,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * del assignments[variable] # <<<<<<<<<<<<<< * # if changed: * # check.update(dict.fromkeys(arcsvariable)) - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 64, __pyx_L1_error) /* "constraint/solvers.py":46 @@ -5646,7 +4653,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if domain: # <<<<<<<<<<<<<< * # changed = False * for value in domain[:]: - */ +*/ } /* "constraint/solvers.py":67 @@ -5655,7 +4662,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_domain); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 67, __pyx_L1_error) __pyx_t_5 = (!__pyx_t_8); if (__pyx_t_5) { @@ -5666,11 +4673,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * return False # <<<<<<<<<<<<<< * return True * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "constraint/solvers.py":67 @@ -5679,7 +4686,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * if not domain: # <<<<<<<<<<<<<< * return False * return True - */ +*/ } /* "constraint/solvers.py":40 @@ -5688,9 +4695,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * for othervariable in arcsvariable: # <<<<<<<<<<<<<< * arcconstraints = arcsvariable[othervariable] * if othervariable in assignments: - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_L3_continue:; } @@ -5700,7 +4707,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * return True # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; @@ -5712,7 +4719,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """Perform the ARC-8 arc checking algorithm and prune domains. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5750,7 +4757,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_2doArc8(CYTHON_UNUSED PyObject * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_1getSolution(PyObject *__pyx_self, @@ -5785,7 +4792,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5793,17 +4800,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -5811,7 +4822,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -5819,7 +4830,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -5829,7 +4840,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -5839,7 +4850,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -5881,9 +4892,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 77, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 77, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 77, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -5910,7 +4921,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":86 * of constraints affecting the given variables. @@ -5918,16 +4929,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * msg = f"{self.__class__.__name__} is an abstract class" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_is_an_abstract_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_is_an_abstract_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -5939,7 +4950,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ +*/ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); @@ -5952,7 +4963,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5972,7 +4983,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_getSolution(CYTHON_UNUSE * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return all solutions for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_3getSolutions(PyObject *__pyx_self, @@ -6007,7 +5018,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6015,17 +5026,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6033,7 +5048,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6041,7 +5056,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -6051,7 +5066,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -6061,7 +5076,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -6103,9 +5118,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 89, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 89, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_2getSolutions(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -6132,7 +5147,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":98 * of constraints affecting the given variables. @@ -6140,16 +5155,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * msg = f"{self.__class__.__name__} provides only a single solution" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_provides_only_a_single_solution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_provides_only_a_single_solution); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -6161,7 +5176,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ +*/ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); @@ -6174,7 +5189,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return all solutions for the given problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6194,7 +5209,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_2getSolutions(CYTHON_UNU * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return an iterator for the solutions of the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_6Solver_5getSolutionIter(PyObject *__pyx_self, @@ -6229,7 +5244,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6237,17 +5252,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6255,7 +5274,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6263,7 +5282,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -6273,7 +5292,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -6283,7 +5302,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -6325,9 +5344,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 101, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 101, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 101, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 101, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -6354,7 +5373,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionIter", 1); + __Pyx_RefNannySetupContext("getSolutionIter", 0); /* "constraint/solvers.py":110 * of constraints affecting the given variables. @@ -6362,16 +5381,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * msg = f"{self.__class__.__name__} doesn't provide iteration" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_doesn_t_provide_iteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_doesn_t_provide_iteration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -6383,7 +5402,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * - */ +*/ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); @@ -6396,7 +5415,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return an iterator for the solutions of the given problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6416,7 +5435,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6Solver_4getSolutionIter(CYTHON_ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -6449,7 +5468,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6457,14 +5476,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6472,7 +5494,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6481,8 +5503,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L3_error) } } @@ -6492,9 +5517,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -6537,7 +5565,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":151 * (default is true) @@ -6545,8 +5573,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 151, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 151, __pyx_L1_error) /* "constraint/solvers.py":143 * """ @@ -6554,7 +5582,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver___init__(CY * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -6575,7 +5603,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, @@ -6609,7 +5637,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6617,17 +5645,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -6635,7 +5667,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -6643,7 +5675,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -6653,7 +5685,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -6663,7 +5695,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -6705,9 +5737,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 153, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 153, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutionIter(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -6733,7 +5765,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutio const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)Py_None); __Pyx_INCREF(Py_None); @@ -6754,7 +5786,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_2getSolutio __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vconstraints); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator, __pyx_codeobj__2, (PyObject *) __pyx_cur_scope, __pyx_n_s_getSolutionIter, __pyx_n_s_BacktrackingSolver_getSolutionIt, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -6803,7 +5835,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(__pyx_sent_value != Py_None)) { + if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); + __PYX_ERR(0, 153, __pyx_L1_error) + } /* "constraint/solvers.py":154 * @@ -6811,8 +5846,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * assignments = {} * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_forwardcheck = __pyx_t_1; @@ -6824,7 +5859,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * assignments = {} # <<<<<<<<<<<<<< * * queue = [] - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -6837,7 +5872,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * queue = [] # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -6850,7 +5885,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] - */ +*/ while (1) { /* "constraint/solvers.py":161 @@ -6859,7 +5894,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort() * for item in lst: - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -6882,23 +5917,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = PyLong_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_7genexpr__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable)) __PYX_ERR(0, 161, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_7genexpr__pyx_v_variable) != (0)) __PYX_ERR(0, 161, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 161, __pyx_L1_error) @@ -6917,7 +5952,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * lst.sort() # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ +*/ __pyx_t_11 = PyList_Sort(__pyx_cur_scope->__pyx_v_lst); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 162, __pyx_L1_error) /* "constraint/solvers.py":163 @@ -6926,19 +5961,22 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found unassigned variable - */ +*/ __pyx_t_1 = __pyx_cur_scope->__pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 163, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -6954,8 +5992,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * variable = item[-1] - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_12 = (__Pyx_PyDict_ContainsTF(__pyx_t_2, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6967,8 +6005,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable = item[-1] # <<<<<<<<<<<<<< * values = domains[variable][:] * if forwardcheck: - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_2); @@ -6981,10 +6019,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * values = domains[variable][:] # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); @@ -6998,7 +6036,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 168, __pyx_L1_error) if (__pyx_t_12) { @@ -7008,7 +6046,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7058,7 +6096,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ goto __pyx_L11; } @@ -7068,7 +6106,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * pushdomains = None # <<<<<<<<<<<<<< * break * else: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); @@ -7083,7 +6121,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L9_break; /* "constraint/solvers.py":164 @@ -7092,7 +6130,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * variable = item[-1] - */ +*/ } /* "constraint/solvers.py":163 @@ -7101,7 +6139,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L17_for_else; @@ -7117,7 +6155,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * yield assignments.copy() # <<<<<<<<<<<<<< * if not queue: * return - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_cur_scope->__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -7137,8 +6175,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ - __pyx_t_12 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); +*/ + __pyx_t_12 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_12 < 0))) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_12); if (__pyx_t_13) { @@ -7148,9 +6187,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * return # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "constraint/solvers.py":177 @@ -7159,7 +6198,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ +*/ } /* "constraint/solvers.py":179 @@ -7168,7 +6207,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -7181,23 +6220,29 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_9); } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_9 = PyList_GET_ITEM(sequence, 2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_9); } - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7206,7 +6251,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L21_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L21_unpacking_failed; @@ -7243,7 +6288,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) if (__pyx_t_13) { @@ -7253,7 +6298,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -7261,20 +6306,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 181, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 181, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -7282,13 +6330,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 181, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_9); + __pyx_t_4++; #else __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); @@ -7317,32 +6368,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) +*/ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; - __pyx_t_16 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_16 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 182, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":181 * variable, values, pushdomains = queue.pop() @@ -7350,7 +6382,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7360,7 +6392,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L18_for_end:; @@ -7371,7 +6403,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":186 @@ -7380,7 +6412,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 186, __pyx_L1_error) __pyx_t_12 = (!__pyx_t_13); if (__pyx_t_12) { @@ -7391,7 +6423,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values, pushdomains = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 188, __pyx_L1_error) /* "constraint/solvers.py":189 @@ -7400,9 +6432,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * while queue: # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ while (1) { - __pyx_t_12 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + __pyx_t_12 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_12 < 0))) __PYX_ERR(0, 189, __pyx_L1_error) if (!__pyx_t_12) break; /* "constraint/solvers.py":190 @@ -7411,7 +6444,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -7424,23 +6457,29 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_10 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7449,11 +6488,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L32_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); index = 2; __pyx_t_10 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) @@ -7468,13 +6507,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_L33_unpacking_done:; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_2); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); @@ -7486,7 +6525,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 191, __pyx_L1_error) if (__pyx_t_12) { @@ -7496,7 +6535,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -7504,20 +6543,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 192, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4++; #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7525,13 +6567,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 192, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_10); + __pyx_t_4++; #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -7560,32 +6605,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * if values: * break - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; - __pyx_t_16 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_16 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } +*/ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "constraint/solvers.py":192 * variable, values, pushdomains = queue.pop() @@ -7593,7 +6619,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7603,7 +6629,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":194 @@ -7612,7 +6638,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 194, __pyx_L1_error) if (__pyx_t_12) { @@ -7622,7 +6648,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L31_break; /* "constraint/solvers.py":194 @@ -7631,7 +6657,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":196 @@ -7640,7 +6666,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * del assignments[variable] # <<<<<<<<<<<<<< * else: * return - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 196, __pyx_L1_error) } @@ -7650,10 +6676,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * return # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L31_break:; @@ -7664,7 +6690,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":201 @@ -7673,7 +6699,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 201, __pyx_L1_error) @@ -7685,7 +6711,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) if (__pyx_t_12) { @@ -7695,7 +6721,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; @@ -7703,42 +6729,48 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 204, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 204, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_4); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4++; #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 204, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_9); + __pyx_t_4++; #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); #endif } } else { - __pyx_t_10 = __pyx_t_15(__pyx_t_1); - if (unlikely(!__pyx_t_10)) { + __pyx_t_9 = __pyx_t_15(__pyx_t_1); + if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -7746,12 +6778,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } break; } - __Pyx_GOTREF(__pyx_t_10); + __Pyx_GOTREF(__pyx_t_9); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_10 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; /* "constraint/solvers.py":205 * if pushdomains: @@ -7759,31 +6791,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.pushState() # <<<<<<<<<<<<<< * * for constraint, variables in vconstraints[variable]: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = NULL; - __pyx_t_16 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_16 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } +*/ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_pushState); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "constraint/solvers.py":204 @@ -7792,7 +6805,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7802,7 +6815,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":207 @@ -7811,7 +6824,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_vconstraints, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -7821,7 +6834,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 207, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7829,13 +6842,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( if (likely(PyList_CheckExact(__pyx_t_10))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7843,13 +6859,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -7877,19 +6896,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_9 = PyList_GET_ITEM(sequence, 1); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -7897,11 +6920,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L45_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L45_unpacking_failed; + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L45_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_2 = __pyx_t_14(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L45_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_6), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -7914,13 +6937,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( __pyx_L46_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_constraint); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_9); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":208 * @@ -7928,29 +6951,28 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); - __pyx_t_9 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_2 = NULL; + __pyx_t_2 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_9 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_16 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_16 = 1; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_16, 4+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[5] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_16, 4+__pyx_t_16); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -7963,7 +6985,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L44_break; /* "constraint/solvers.py":208 @@ -7972,7 +6994,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":207 @@ -7981,7 +7003,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L48_for_else; @@ -7997,7 +7019,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * break # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ goto __pyx_L28_break; } __pyx_L49_for_end:; @@ -8008,7 +7030,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 214, __pyx_L1_error) if (__pyx_t_13) { @@ -8018,7 +7040,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_10 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_10); __pyx_t_4 = 0; @@ -8026,20 +7048,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { __pyx_t_4 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 215, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { if (likely(PyList_CheckExact(__pyx_t_10))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 215, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_10, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8047,13 +7072,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 215, __pyx_L1_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -8082,32 +7110,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * domain.popState() # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = NULL; - __pyx_t_16 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_16 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_16, 0+__pyx_t_16); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":215 * @@ -8115,7 +7124,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -8125,7 +7134,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L28_break:; @@ -8136,18 +7145,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * queue.append((variable, values, pushdomains)) # <<<<<<<<<<<<<< * * raise RuntimeError("Can't happen") - */ +*/ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_variable)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_variable) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_values)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_values) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pushdomains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_pushdomains)) __PYX_ERR(0, 219, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_pushdomains) != (0)) __PYX_ERR(0, 219, __pyx_L1_error); __pyx_t_11 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_10); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -8158,8 +7167,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L1_error) +*/ + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_Raise(__pyx_t_10, 0, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -8172,19 +7181,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -8200,7 +7211,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_18BacktrackingSolver_4generator( * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_6getSolution(PyObject *__pyx_self, @@ -8234,7 +7245,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -8242,17 +7253,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -8260,7 +7275,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -8268,7 +7283,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -8278,7 +7293,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -8288,7 +7303,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -8330,9 +7345,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 223, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 223, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -8365,7 +7380,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":224 * @@ -8373,21 +7388,20 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * iter = self.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * try: * return next(iter) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -8407,7 +7421,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -8423,7 +7437,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * return next(iter) # <<<<<<<<<<<<<< * except StopIteration: * return None - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); @@ -8437,7 +7451,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8450,7 +7464,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * except StopIteration: # <<<<<<<<<<<<<< * return None * - */ +*/ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("constraint.solvers.BacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -8465,7 +7479,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * return None # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -8481,7 +7495,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); @@ -8508,7 +7522,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -8530,7 +7544,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_5getSolutio * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18BacktrackingSolver_8getSolutions(PyObject *__pyx_self, @@ -8564,7 +7578,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -8572,17 +7586,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -8590,7 +7608,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -8598,7 +7616,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -8608,7 +7626,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -8618,7 +7636,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -8660,9 +7678,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 230, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 230, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutions(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -8690,7 +7708,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":231 * @@ -8698,22 +7716,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * return list(self.getSolutionIter(domains, constraints, vconstraints)) # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -8737,7 +7754,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -8758,7 +7775,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18BacktrackingSolver_7getSolutio * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -8791,7 +7808,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -8799,14 +7816,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -8814,7 +7834,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -8823,8 +7843,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) } } @@ -8834,9 +7857,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -8879,7 +7905,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":274 * (default is true) @@ -8887,8 +7913,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 274, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 274, __pyx_L1_error) /* "constraint/solvers.py":266 * """ @@ -8896,7 +7922,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver___ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -8917,7 +7943,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter(PyObject *__pyx_self, @@ -8951,7 +7977,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionIter (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -8959,17 +7985,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -8977,7 +8007,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -8985,7 +8015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -8995,7 +8025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -9005,7 +8035,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -9047,9 +8077,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 276, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2getSolutionIter(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -9075,7 +8105,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2g const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionIter", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)Py_None); __Pyx_INCREF(Py_None); @@ -9096,7 +8126,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_2g __Pyx_INCREF(__pyx_cur_scope->__pyx_v_vconstraints); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_vconstraints); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4generator1, __pyx_codeobj__4, (PyObject *) __pyx_cur_scope, __pyx_n_s_getSolutionIter, __pyx_n_s_OptimizedBacktrackingSolver_getS, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4generator1, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -9145,7 +8175,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(__pyx_sent_value != Py_None)) { + if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); + __PYX_ERR(0, 276, __pyx_L1_error) + } /* "constraint/solvers.py":277 * @@ -9153,8 +8186,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * assignments = {} * sorted_variables = self.getSortedVariables(domains, vconstraints) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_forwardcheck = __pyx_t_1; @@ -9166,7 +8199,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * assignments = {} # <<<<<<<<<<<<<< * sorted_variables = self.getSortedVariables(domains, vconstraints) * - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9179,21 +8212,20 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * sorted_variables = self.getSortedVariables(domains, vconstraints) # <<<<<<<<<<<<<< * * queue = [] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -9214,7 +8246,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * queue = [] # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -9227,7 +8259,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":285 @@ -9236,7 +8268,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_sorted_variables)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_sorted_variables)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_sorted_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -9244,20 +8276,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 285, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9265,13 +8300,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -9300,7 +8338,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_cur_scope->__pyx_v_variable, __pyx_cur_scope->__pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) if (__pyx_t_7) { @@ -9310,10 +8348,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * values = domains[variable][:] # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_values); @@ -9327,7 +8365,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_forwardcheck); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) if (__pyx_t_7) { @@ -9337,7 +8375,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9387,7 +8425,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments and x != variable] * else: - */ +*/ goto __pyx_L9; } @@ -9397,7 +8435,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * pushdomains = None # <<<<<<<<<<<<<< * break * else: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pushdomains); @@ -9412,7 +8450,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L7_break; /* "constraint/solvers.py":286 @@ -9421,7 +8459,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":285 @@ -9430,7 +8468,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L15_for_else; @@ -9446,7 +8484,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * yield assignments.copy() # <<<<<<<<<<<<<< * if not queue: * return - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_cur_scope->__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; @@ -9466,8 +8504,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ - __pyx_t_7 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); +*/ + __pyx_t_7 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_7 < 0))) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_t_13 = (!__pyx_t_7); if (__pyx_t_13) { @@ -9477,9 +8516,9 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * return # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "constraint/solvers.py":298 @@ -9488,7 +8527,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not queue: # <<<<<<<<<<<<<< * return * variable, values, pushdomains = queue.pop() - */ +*/ } /* "constraint/solvers.py":300 @@ -9497,7 +8536,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -9510,23 +8549,29 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_11); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_11 = PyList_GET_ITEM(sequence, 2); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_11); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9535,7 +8580,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_3 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L19_unpacking_failed; @@ -9572,7 +8617,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 301, __pyx_L1_error) if (__pyx_t_13) { @@ -9582,7 +8627,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -9590,20 +8635,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 302, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5++; #else __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); @@ -9611,13 +8659,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 302, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_11); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 302, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_11); + __pyx_t_5++; #else __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); @@ -9646,32 +8697,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) +*/ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":302 * variable, values, pushdomains = queue.pop() @@ -9679,7 +8711,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9689,7 +8721,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L16_for_end:; @@ -9700,7 +8732,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":307 @@ -9709,7 +8741,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_13); if (__pyx_t_7) { @@ -9720,7 +8752,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values, pushdomains = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 309, __pyx_L1_error) /* "constraint/solvers.py":310 @@ -9729,9 +8761,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * while queue: # <<<<<<<<<<<<<< * variable, values, pushdomains = queue.pop() * if pushdomains: - */ +*/ while (1) { - __pyx_t_7 = (PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + __pyx_t_7 = (__Pyx_PyList_GET_SIZE(__pyx_cur_scope->__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_7 < 0))) __PYX_ERR(0, 310, __pyx_L1_error) if (!__pyx_t_7) break; /* "constraint/solvers.py":311 @@ -9740,7 +8773,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * variable, values, pushdomains = queue.pop() # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_cur_scope->__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -9753,23 +8786,29 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_11); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_11 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_3 = PyList_GET_ITEM(sequence, 2); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9778,11 +8817,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L30_unpacking_failed; - __Pyx_GOTREF(__pyx_t_11); - index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L30_unpacking_failed; + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L30_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L30_unpacking_failed; + __Pyx_GOTREF(__pyx_t_11); index = 2; __pyx_t_3 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L30_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 3) < 0) __PYX_ERR(0, 311, __pyx_L1_error) @@ -9797,13 +8836,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_L31_unpacking_done:; } __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_variable); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); - __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_2); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_variable, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_values); + __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_values, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_pushdomains, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -9815,7 +8854,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 312, __pyx_L1_error) if (__pyx_t_7) { @@ -9825,7 +8864,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -9833,20 +8872,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9854,13 +8896,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 313, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 313, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -9889,32 +8934,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * if values: * break - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; /* "constraint/solvers.py":313 * variable, values, pushdomains = queue.pop() @@ -9922,7 +8948,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * if values: - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -9932,7 +8958,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":315 @@ -9941,7 +8967,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 315, __pyx_L1_error) if (__pyx_t_7) { @@ -9951,7 +8977,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L29_break; /* "constraint/solvers.py":315 @@ -9960,7 +8986,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":317 @@ -9969,7 +8995,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * del assignments[variable] # <<<<<<<<<<<<<< * else: * return - */ +*/ if (unlikely((PyDict_DelItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable) < 0))) __PYX_ERR(0, 317, __pyx_L1_error) } @@ -9979,10 +9005,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * return # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_r = NULL; + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; } __pyx_L29_break:; @@ -9993,7 +9019,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":322 @@ -10002,7 +9028,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_cur_scope->__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 322, __pyx_L1_error) @@ -10014,7 +9040,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) if (__pyx_t_7) { @@ -10024,7 +9050,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_1 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -10032,42 +9058,48 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_5++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 325, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_11); + __pyx_t_5++; #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 325, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); #endif } } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_1); - if (unlikely(!__pyx_t_3)) { + __pyx_t_11 = __pyx_t_6(__pyx_t_1); + if (unlikely(!__pyx_t_11)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -10075,12 +9107,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_11); } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_domain); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_domain, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_11 = 0; /* "constraint/solvers.py":326 * if pushdomains: @@ -10088,31 +9120,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.pushState() # <<<<<<<<<<<<<< * * for constraint, variables in vconstraints[variable]: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } +*/ + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_pushState); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":325 @@ -10121,7 +9134,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10131,7 +9144,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":328 @@ -10140,7 +9153,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_vconstraints, __pyx_cur_scope->__pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -10150,7 +9163,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -10158,13 +9171,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10172,13 +9188,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 328, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10206,19 +9225,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_11); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_11 = PyList_GET_ITEM(sequence, 1); + __pyx_t_11 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_11); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -10226,11 +9249,11 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_t_14 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); - index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L43_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L43_unpacking_failed; + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + index = 0; __pyx_t_11 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L43_unpacking_failed; __Pyx_GOTREF(__pyx_t_11); + index = 1; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L43_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 2) < 0) __PYX_ERR(0, 328, __pyx_L1_error) __pyx_t_15 = NULL; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -10243,13 +9266,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g __pyx_L44_unpacking_done:; } __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_constraint); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_11); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_constraint, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_variables); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_variables, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":329 * @@ -10257,29 +9280,28 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); - __pyx_t_11 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_2 = NULL; + __pyx_t_2 = __pyx_cur_scope->__pyx_v_constraint; __pyx_t_11 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_11); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[5] = {__pyx_t_11, __pyx_cur_scope->__pyx_v_variables, __pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_assignments, __pyx_cur_scope->__pyx_v_pushdomains}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10292,7 +9314,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L42_break; /* "constraint/solvers.py":329 @@ -10301,7 +9323,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":328 @@ -10310,7 +9332,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L46_for_else; @@ -10326,7 +9348,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * break # <<<<<<<<<<<<<< * * if pushdomains: - */ +*/ goto __pyx_L26_break; } __pyx_L47_for_end:; @@ -10337,7 +9359,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 335, __pyx_L1_error) if (__pyx_t_13) { @@ -10347,7 +9369,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_pushdomains)) { __pyx_t_3 = __pyx_cur_scope->__pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; @@ -10355,20 +9377,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_pushdomains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10376,13 +9401,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 336, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -10411,32 +9439,13 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * domain.popState() # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":336 * @@ -10444,7 +9453,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10454,7 +9463,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } } __pyx_L26_break:; @@ -10465,18 +9474,18 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * queue.append((variable, values, pushdomains)) # <<<<<<<<<<<<<< * * raise RuntimeError("Can't happen") - */ +*/ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_variable); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_variable)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_variable) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_values); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_values)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_values) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_pushdomains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pushdomains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_pushdomains)) __PYX_ERR(0, 340, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_pushdomains) != (0)) __PYX_ERR(0, 340, __pyx_L1_error); __pyx_t_16 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_queue, __pyx_t_3); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -10487,8 +9496,8 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< * * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -10501,19 +9510,21 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_14); - __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("getSolutionIter", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -10529,7 +9540,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_27OptimizedBacktrackingSolver_4g * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList(PyObject *__pyx_self, @@ -10563,7 +9574,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -10571,15 +9582,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -10587,7 +9601,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -10595,7 +9609,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -10605,7 +9619,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -10645,8 +9659,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 344, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 344, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5getSolutionsList(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_vconstraints); /* function exit code */ @@ -10690,7 +9704,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutionsList", 1); + __Pyx_RefNannySetupContext("getSolutionsList", 0); /* "constraint/solvers.py":356 * # Does not do forwardcheck for simplicity @@ -10698,7 +9712,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * assignments: dict = {} # <<<<<<<<<<<<<< * queue: list[tuple] = [] * solutions: list[dict] = list() - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_assignments = ((PyObject*)__pyx_t_1); @@ -10710,7 +9724,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * queue: list[tuple] = [] # <<<<<<<<<<<<<< * solutions: list[dict] = list() * sorted_variables = self.getSortedVariables(domains, vconstraints) - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_queue = ((PyObject*)__pyx_t_1); @@ -10722,7 +9736,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * solutions: list[dict] = list() # <<<<<<<<<<<<<< * sorted_variables = self.getSortedVariables(domains, vconstraints) * - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -10734,21 +9748,20 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * sorted_variables = self.getSortedVariables(domains, vconstraints) # <<<<<<<<<<<<<< * * while True: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSortedVariables); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -10768,7 +9781,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":363 @@ -10777,7 +9790,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ if (likely(PyList_CheckExact(__pyx_v_sorted_variables)) || PyTuple_CheckExact(__pyx_v_sorted_variables)) { __pyx_t_1 = __pyx_v_sorted_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; @@ -10785,20 +9798,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sorted_variables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -10806,13 +9822,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 363, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -10839,7 +9858,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 364, __pyx_L1_error) if (__pyx_t_7) { @@ -10849,10 +9868,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * values = domains[variable][:] # <<<<<<<<<<<<<< * break * else: - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_3); @@ -10864,7 +9883,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L6_break; /* "constraint/solvers.py":364 @@ -10873,7 +9892,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":363 @@ -10882,7 +9901,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8_for_else; @@ -10898,7 +9917,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * if not queue: * return solutions - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 371, __pyx_L1_error) @@ -10910,8 +9929,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ - __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_queue) != 0); +*/ + __pyx_t_7 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_7 < 0))) __PYX_ERR(0, 372, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_7); if (__pyx_t_9) { @@ -10921,7 +9941,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * return solutions # <<<<<<<<<<<<<< * variable, values = queue.pop() * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -10933,7 +9953,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ +*/ } /* "constraint/solvers.py":374 @@ -10942,7 +9962,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * variable, values = queue.pop() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -10955,18 +9975,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_2); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10975,7 +9999,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; @@ -11004,7 +10028,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":378 @@ -11013,7 +10037,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_9); if (__pyx_t_7) { @@ -11024,7 +10048,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 380, __pyx_L1_error) /* "constraint/solvers.py":381 @@ -11033,9 +10057,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * while queue: # <<<<<<<<<<<<<< * variable, values = queue.pop() * if values: - */ +*/ while (1) { - __pyx_t_7 = (PyList_GET_SIZE(__pyx_v_queue) != 0); + __pyx_t_7 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_7 < 0))) __PYX_ERR(0, 381, __pyx_L1_error) if (!__pyx_t_7) break; /* "constraint/solvers.py":382 @@ -11044,7 +10069,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * variable, values = queue.pop() # <<<<<<<<<<<<<< * if values: * break - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -11057,18 +10082,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11077,7 +10106,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; @@ -11104,7 +10133,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 383, __pyx_L1_error) if (__pyx_t_7) { @@ -11114,7 +10143,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L17_break; /* "constraint/solvers.py":383 @@ -11123,7 +10152,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":385 @@ -11132,7 +10161,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * del assignments[variable] # <<<<<<<<<<<<<< * else: * return solutions - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 385, __pyx_L1_error) } @@ -11142,7 +10171,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * return solutions # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); @@ -11157,7 +10186,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":390 @@ -11166,7 +10195,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments, None): - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 390, __pyx_L1_error) @@ -11178,7 +10207,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -11188,7 +10217,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -11196,13 +10225,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11210,13 +10242,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 391, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -11244,18 +10279,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_10); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_10 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11264,7 +10303,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g __pyx_t_12 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_10 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L23_unpacking_failed; @@ -11291,20 +10330,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ __Pyx_INCREF(__pyx_v_constraint); __pyx_t_10 = __pyx_v_constraint; __pyx_t_2 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_2); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_4 = 1; } #endif { @@ -11326,7 +10364,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L22_break; /* "constraint/solvers.py":392 @@ -11335,7 +10373,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":391 @@ -11344,7 +10382,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L26_for_else; @@ -11360,7 +10398,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * break # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ +*/ goto __pyx_L14_break; } __pyx_L27_for_end:; @@ -11373,15 +10411,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * queue.append((variable, values)) # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_variable); __Pyx_GIVEREF(__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable)) __PYX_ERR(0, 399, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_variable) != (0)) __PYX_ERR(0, 399, __pyx_L1_error); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values)) __PYX_ERR(0, 399, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values) != (0)) __PYX_ERR(0, 399, __pyx_L1_error); __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_queue, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -11392,7 +10430,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * - */ +*/ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); @@ -11425,7 +10463,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_5g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions(PyObject *__pyx_self, @@ -11459,7 +10497,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -11467,17 +10505,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -11485,7 +10527,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -11493,7 +10535,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -11503,7 +10545,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -11513,7 +10555,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -11555,9 +10597,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 401, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 401, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 401, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 401, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7getSolutions(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -11586,7 +10628,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":402 * @@ -11594,8 +10636,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * if self._forwardcheck: # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * return self.getSolutionsList(domains, vconstraints) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11607,22 +10649,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * return list(self.getSolutionIter(domains, constraints, vconstraints)) # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionIter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; } #endif { @@ -11646,7 +10687,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * if self._forwardcheck: # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * return self.getSolutionsList(domains, vconstraints) - */ +*/ } /* "constraint/solvers.py":404 @@ -11655,22 +10696,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * return self.getSolutionsList(domains, vconstraints) # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionsList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } #endif { @@ -11691,7 +10731,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -11712,7 +10752,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_7g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution(PyObject *__pyx_self, @@ -11746,7 +10786,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -11754,17 +10794,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -11772,7 +10816,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -11780,7 +10824,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -11790,7 +10834,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -11800,7 +10844,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -11842,9 +10886,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 406, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 406, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -11877,7 +10921,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":407 * @@ -11885,21 +10929,20 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * iter = self.getSolutionIter(domains, constraints, vconstraints) # <<<<<<<<<<<<<< * try: * return next(iter) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionIter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -11919,7 +10962,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -11935,7 +10978,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * return next(iter) # <<<<<<<<<<<<<< * except StopIteration: * return None - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_iter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); @@ -11949,7 +10992,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11962,7 +11005,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * except StopIteration: # <<<<<<<<<<<<<< * return None * - */ +*/ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("constraint.solvers.OptimizedBacktrackingSolver.getSolution", __pyx_clineno, __pyx_lineno, __pyx_filename); @@ -11977,7 +11020,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * return None # <<<<<<<<<<<<<< * * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11993,7 +11036,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * try: # <<<<<<<<<<<<<< * return next(iter) * except StopIteration: - */ +*/ __pyx_L5_except_error:; __Pyx_XGIVEREF(__pyx_t_5); __Pyx_XGIVEREF(__pyx_t_6); @@ -12020,7 +11063,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -12042,7 +11085,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_9g * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables(PyObject *__pyx_self, @@ -12076,7 +11119,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSortedVariables (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -12084,15 +11127,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -12100,7 +11146,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -12108,7 +11154,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -12118,7 +11164,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -12158,8 +11204,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 413, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11getSortedVariables(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_vconstraints); /* function exit code */ @@ -12201,7 +11247,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSortedVariables", 1); + __Pyx_RefNannySetupContext("getSortedVariables", 0); /* "constraint/solvers.py":424 * the list of variables, sorted from highest number of vconstraints to lowest. @@ -12209,7 +11255,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort() * return [c for _, _, c in lst] - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -12230,23 +11276,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyInt_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error) + __pyx_t_6 = PyLong_FromSsize_t((-__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_8genexpr3__pyx_v_variable); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) + __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 424, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __Pyx_INCREF(__pyx_8genexpr3__pyx_v_variable); __Pyx_GIVEREF(__pyx_8genexpr3__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_8genexpr3__pyx_v_variable)) __PYX_ERR(0, 424, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_8genexpr3__pyx_v_variable) != (0)) __PYX_ERR(0, 424, __pyx_L5_error); __pyx_t_6 = 0; __pyx_t_9 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 424, __pyx_L5_error) @@ -12269,7 +11315,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * lst.sort() # <<<<<<<<<<<<<< * return [c for _, _, c in lst] * - */ +*/ __pyx_t_11 = PyList_Sort(__pyx_v_lst); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 425, __pyx_L1_error) /* "constraint/solvers.py":426 @@ -12278,7 +11324,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * return [c for _, _, c in lst] # <<<<<<<<<<<<<< * * class RecursiveBacktrackingSolver(Solver): - */ +*/ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L11_error) @@ -12288,13 +11334,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 426, __pyx_L11_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_10); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 426, __pyx_L11_error) + __pyx_t_10 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_4); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4++; #else __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_10); @@ -12309,23 +11358,29 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_9); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_6); + __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); + __Pyx_INCREF(__pyx_t_12); } else { - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); + __pyx_t_9 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_XGOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_XGOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_PyList_GetItemRef(sequence, 2); + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) + __Pyx_XGOTREF(__pyx_t_12); } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_12); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L11_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) + __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -12334,7 +11389,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 __pyx_t_13 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 426, __pyx_L11_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L14_unpacking_failed; @@ -12380,7 +11435,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -12409,7 +11464,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27OptimizedBacktrackingSolver_11 * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__(PyObject *__pyx_self, @@ -12442,7 +11497,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -12450,14 +11505,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_forwardcheck,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_forwardcheck,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -12465,7 +11523,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -12474,8 +11532,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_forwardcheck); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_forwardcheck); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error) } } @@ -12485,9 +11546,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -12530,7 +11594,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":464 * (default is true) @@ -12538,8 +11602,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * self._forwardcheck = forwardcheck # <<<<<<<<<<<<<< * * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 464, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2, __pyx_v_forwardcheck) < 0) __PYX_ERR(0, 464, __pyx_L1_error) /* "constraint/solvers.py":456 * """ @@ -12547,7 +11611,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -12567,7 +11631,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver___ * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking(PyObject *__pyx_self, @@ -12604,7 +11668,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("recursiveBacktracking (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -12612,21 +11676,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_solutions,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,&__pyx_n_s_assignments,&__pyx_n_s_single,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_solutions,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,&__pyx_mstate_global->__pyx_n_u_assignments,&__pyx_mstate_global->__pyx_n_u_single,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + case 6: + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + case 5: + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -12634,7 +11704,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -12642,7 +11712,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_solutions)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_solutions)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -12652,7 +11722,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -12662,7 +11732,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -12672,7 +11742,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignments)) != 0)) { + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignments)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } @@ -12682,7 +11752,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_single)) != 0)) { + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_single)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } @@ -12765,15 +11835,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r PyObject *__pyx_t_8 = NULL; int __pyx_t_9; int __pyx_t_10; - unsigned int __pyx_t_11; - PyObject *(*__pyx_t_12)(PyObject *); - PyObject *__pyx_t_13 = NULL; - PyObject *(*__pyx_t_14)(PyObject *); + PyObject *(*__pyx_t_11)(PyObject *); + PyObject *__pyx_t_12 = NULL; + PyObject *(*__pyx_t_13)(PyObject *); + unsigned int __pyx_t_14; int __pyx_t_15; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("recursiveBacktracking", 1); + __Pyx_RefNannySetupContext("recursiveBacktracking", 0); /* "constraint/solvers.py":479 * _description_ @@ -12781,7 +11851,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * lst = [(-len(vconstraints[variable]), len(domains[variable]), variable) for variable in domains] # <<<<<<<<<<<<<< * lst.sort() * for item in lst: - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -12792,20 +11862,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 479, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 479, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3++; #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); @@ -12813,13 +11886,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 479, __pyx_L5_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 479, __pyx_L5_error) + __Pyx_INCREF(__pyx_t_5); + __pyx_t_3++; #else __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); @@ -12843,23 +11919,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyInt_FromSsize_t((-__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_5 = PyLong_FromSsize_t((-__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_8genexpr5__pyx_v_variable); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) + __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __Pyx_INCREF(__pyx_8genexpr5__pyx_v_variable); __Pyx_GIVEREF(__pyx_8genexpr5__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_8genexpr5__pyx_v_variable)) __PYX_ERR(0, 479, __pyx_L5_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_8genexpr5__pyx_v_variable) != (0)) __PYX_ERR(0, 479, __pyx_L5_error); __pyx_t_5 = 0; __pyx_t_7 = 0; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 479, __pyx_L5_error) @@ -12882,7 +11958,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * lst.sort() # <<<<<<<<<<<<<< * for item in lst: * if item[-1] not in assignments: - */ +*/ __pyx_t_9 = PyList_Sort(__pyx_v_lst); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 480, __pyx_L1_error) /* "constraint/solvers.py":481 @@ -12891,19 +11967,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found an unassigned variable. Let's go. - */ +*/ __pyx_t_1 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 481, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -12917,8 +11996,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found an unassigned variable. Let's go. * break - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -12930,7 +12009,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. - */ +*/ goto __pyx_L11_break; /* "constraint/solvers.py":482 @@ -12939,7 +12018,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if item[-1] not in assignments: # <<<<<<<<<<<<<< * # Found an unassigned variable. Let's go. * break - */ +*/ } /* "constraint/solvers.py":481 @@ -12948,7 +12027,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for item in lst: # <<<<<<<<<<<<<< * if item[-1] not in assignments: * # Found an unassigned variable. Let's go. - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L13_for_else; @@ -12964,33 +12043,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * return solutions * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_assignments, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_assignments, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_solutions, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":488 * # No unassigned variables. We've got a solution. @@ -12998,7 +12058,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * * variable = item[-1] - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -13012,11 +12072,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * variable = item[-1] # <<<<<<<<<<<<<< * assignments[variable] = None * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_variable = __pyx_t_1; - __pyx_t_1 = 0; +*/ + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_item, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_variable = __pyx_t_2; + __pyx_t_2 = 0; /* "constraint/solvers.py":491 * @@ -13024,7 +12084,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * assignments[variable] = None # <<<<<<<<<<<<<< * * forwardcheck = self._forwardcheck - */ +*/ if (unlikely((PyObject_SetItem(__pyx_v_assignments, __pyx_v_variable, Py_None) < 0))) __PYX_ERR(0, 491, __pyx_L1_error) /* "constraint/solvers.py":493 @@ -13033,11 +12093,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * forwardcheck = self._forwardcheck # <<<<<<<<<<<<<< * if forwardcheck: * pushdomains = [domains[x] for x in domains if x not in assignments] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forwardcheck_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_forwardcheck = __pyx_t_1; - __pyx_t_1 = 0; +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_forwardcheck_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_forwardcheck = __pyx_t_2; + __pyx_t_2 = 0; /* "constraint/solvers.py":494 * @@ -13045,7 +12105,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments] * else: - */ +*/ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_forwardcheck); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 494, __pyx_L1_error) if (__pyx_t_10) { @@ -13055,52 +12115,58 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * pushdomains = [domains[x] for x in domains if x not in assignments] # <<<<<<<<<<<<<< * else: * pushdomains = None - */ +*/ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_domains)) || PyTuple_CheckExact(__pyx_v_domains)) { - __pyx_t_2 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_v_domains; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L18_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L18_error) } for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3++; #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 495, __pyx_L18_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 495, __pyx_L18_error) + __Pyx_INCREF(__pyx_t_8); + __pyx_t_3++; #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); #endif } } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_2); + __pyx_t_8 = __pyx_t_4(__pyx_t_1); if (unlikely(!__pyx_t_8)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -13117,11 +12183,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r if (__pyx_t_10) { __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_8genexpr6__pyx_v_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 495, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 495, __pyx_L18_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_x); __pyx_8genexpr6__pyx_v_x = 0; goto __pyx_L23_exit_scope; __pyx_L18_error:; @@ -13129,8 +12195,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r goto __pyx_L1_error; __pyx_L23_exit_scope:; } /* exit inner scope */ - __pyx_v_pushdomains = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_v_pushdomains = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":494 * @@ -13138,7 +12204,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if forwardcheck: # <<<<<<<<<<<<<< * pushdomains = [domains[x] for x in domains if x not in assignments] * else: - */ +*/ goto __pyx_L15; } @@ -13148,7 +12214,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * pushdomains = None # <<<<<<<<<<<<<< * * for value in domains[variable]: - */ +*/ /*else*/ { __Pyx_INCREF(Py_None); __pyx_v_pushdomains = ((PyObject*)Py_None); @@ -13161,53 +12227,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * if pushdomains: - */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); +*/ + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { + if (likely(PyList_CheckExact(__pyx_t_1))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_3); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 499, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); + if (unlikely((0 < 0))) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { + __pyx_t_2 = __pyx_t_4(__pyx_t_1); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -13215,10 +12287,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":500 * @@ -13226,7 +12298,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * assignments[variable] = value # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ if (unlikely((PyObject_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 500, __pyx_L1_error) /* "constraint/solvers.py":501 @@ -13235,8 +12307,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ - __pyx_t_10 = (__pyx_v_pushdomains != Py_None)&&(PyList_GET_SIZE(__pyx_v_pushdomains) != 0); +*/ + __pyx_t_10 = (__pyx_v_pushdomains != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_pushdomains) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_10 < 0))) __PYX_ERR(0, 501, __pyx_L1_error) if (__pyx_t_10) { /* "constraint/solvers.py":502 @@ -13245,25 +12318,28 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * for constraint, variables in vconstraints[variable]: - */ +*/ if (unlikely(__pyx_v_pushdomains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 502, __pyx_L1_error) } - __pyx_t_1 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 502, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_6); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6++; #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_8); @@ -13275,32 +12351,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * domain.pushState() # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments, pushdomains): - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_pushState); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error) +*/ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_pushState); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":502 * assignments[variable] = value @@ -13308,9 +12365,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.pushState() * for constraint, variables in vconstraints[variable]: - */ +*/ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":501 * for value in domains[variable]: @@ -13318,7 +12375,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.pushState() - */ +*/ } /* "constraint/solvers.py":504 @@ -13327,53 +12384,59 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); +*/ + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; - __pyx_t_12 = NULL; + __pyx_t_11 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 504, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_7))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_6); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 504, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_1 = __pyx_t_12(__pyx_t_8); - if (unlikely(!__pyx_t_1)) { + __pyx_t_2 = __pyx_t_11(__pyx_t_7); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); @@ -13381,10 +12444,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } break; } - __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_2); } - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); @@ -13393,44 +12456,48 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_8); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_13 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); - index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L32_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed; + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); + index = 0; __pyx_t_8 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L32_unpacking_failed; + __Pyx_GOTREF(__pyx_t_8); + index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L32_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(0, 504, __pyx_L1_error) - __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L33_unpacking_done; __pyx_L32_unpacking_failed:; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_14 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 504, __pyx_L1_error) __pyx_L33_unpacking_done:; } - __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_7); - __pyx_t_7 = 0; + __Pyx_XDECREF_SET(__pyx_v_constraint, __pyx_t_8); + __pyx_t_8 = 0; __Pyx_XDECREF_SET(__pyx_v_variables, __pyx_t_5); __pyx_t_5 = 0; @@ -13440,32 +12507,31 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ __Pyx_INCREF(__pyx_v_constraint); - __pyx_t_5 = __pyx_v_constraint; __pyx_t_7 = NULL; - __pyx_t_11 = 0; + __pyx_t_5 = __pyx_v_constraint; __pyx_t_8 = NULL; + __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_11 = 1; - } + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_14 = 1; } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_pushdomains}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_11, 4+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[5] = {__pyx_t_8, __pyx_v_variables, __pyx_v_domains, __pyx_v_assignments, __pyx_v_pushdomains}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_14, 4+__pyx_t_14); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_15 = (!__pyx_t_10); if (__pyx_t_15) { @@ -13475,7 +12541,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * break # <<<<<<<<<<<<<< * else: * # Value is good. Recurse and get next variable. - */ +*/ goto __pyx_L31_break; /* "constraint/solvers.py":505 @@ -13484,7 +12550,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if not constraint(variables, domains, assignments, pushdomains): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":504 @@ -13493,12 +12559,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, pushdomains): * # Value is not good. - */ +*/ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L35_for_else; __pyx_L31_break:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L36_for_end; /*else*/ { __pyx_L35_for_else:; @@ -13509,32 +12575,31 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * self.recursiveBacktracking(solutions, domains, vconstraints, assignments, single) # <<<<<<<<<<<<<< * if solutions and single: * return solutions - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; - __pyx_t_11 = 0; + __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_11 = 1; - } + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_14 = 1; } #endif { PyObject *__pyx_callargs[6] = {__pyx_t_5, __pyx_v_solutions, __pyx_v_domains, __pyx_v_vconstraints, __pyx_v_assignments, __pyx_v_single}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 5+__pyx_t_11); + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_14, 5+__pyx_t_14); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":511 * # Value is good. Recurse and get next variable. @@ -13542,7 +12607,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if solutions and single: # <<<<<<<<<<<<<< * return solutions * if pushdomains: - */ +*/ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 511, __pyx_L1_error) if (__pyx_t_10) { } else { @@ -13560,11 +12625,11 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * if pushdomains: * for domain in pushdomains: - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "constraint/solvers.py":511 @@ -13573,7 +12638,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if solutions and single: # <<<<<<<<<<<<<< * return solutions * if pushdomains: - */ +*/ } } __pyx_L36_for_end:; @@ -13584,8 +12649,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ - __pyx_t_15 = (__pyx_v_pushdomains != Py_None)&&(PyList_GET_SIZE(__pyx_v_pushdomains) != 0); +*/ + __pyx_t_15 = (__pyx_v_pushdomains != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_pushdomains) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_15 < 0))) __PYX_ERR(0, 513, __pyx_L1_error) if (__pyx_t_15) { /* "constraint/solvers.py":514 @@ -13594,29 +12660,32 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * del assignments[variable] - */ +*/ if (unlikely(__pyx_v_pushdomains == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 514, __pyx_L1_error) } - __pyx_t_8 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = __pyx_v_pushdomains; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; for (;;) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 514, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_6); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_XDECREF_SET(__pyx_v_domain, __pyx_t_2); + __pyx_t_2 = 0; /* "constraint/solvers.py":515 * if pushdomains: @@ -13624,32 +12693,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * domain.popState() # <<<<<<<<<<<<<< * del assignments[variable] * return solutions - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_n_s_popState); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_domain, __pyx_mstate_global->__pyx_n_u_popState); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = NULL; - __pyx_t_11 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_11 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":514 * return solutions @@ -13657,9 +12707,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for domain in pushdomains: # <<<<<<<<<<<<<< * domain.popState() * del assignments[variable] - */ +*/ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":513 * if solutions and single: @@ -13667,7 +12717,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * if pushdomains: # <<<<<<<<<<<<<< * for domain in pushdomains: * domain.popState() - */ +*/ } /* "constraint/solvers.py":499 @@ -13676,9 +12726,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * if pushdomains: - */ +*/ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":516 * for domain in pushdomains: @@ -13686,7 +12736,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * del assignments[variable] # <<<<<<<<<<<<<< * return solutions * - */ +*/ if (unlikely((PyObject_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 516, __pyx_L1_error) /* "constraint/solvers.py":517 @@ -13695,7 +12745,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * return solutions # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -13707,7 +12757,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -13716,7 +12766,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_13); + __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("constraint.solvers.RecursiveBacktrackingSolver.recursiveBacktracking", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -13742,7 +12792,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_2r * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution(PyObject *__pyx_self, @@ -13776,7 +12826,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -13784,17 +12834,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -13802,7 +12856,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -13810,7 +12864,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -13820,7 +12874,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -13830,7 +12884,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -13872,9 +12926,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 519, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 519, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 519, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 519, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -13906,7 +12960,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":520 * @@ -13914,8 +12968,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) # <<<<<<<<<<<<<< * return solutions and solutions[0] or None * - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -13926,13 +12980,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } #endif { @@ -13954,14 +13007,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * return solutions and solutions[0] or None # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_solutions); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) if (!__pyx_t_7) { goto __pyx_L4_next_or; } else { } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_solutions, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 521, __pyx_L1_error) if (!__pyx_t_7) { @@ -13986,7 +13039,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -14010,7 +13063,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_4g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions(PyObject *__pyx_self, @@ -14044,7 +13097,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -14052,17 +13105,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -14070,7 +13127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -14078,7 +13135,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -14088,7 +13145,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -14098,7 +13155,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -14140,9 +13197,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 523, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 523, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 523, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 523, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6getSolutions(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -14172,7 +13229,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":524 * @@ -14180,9 +13237,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * return self.recursiveBacktracking([], domains, vconstraints, {}, False) # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -14193,13 +13250,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } #endif { @@ -14222,7 +13278,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -14245,7 +13301,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_27RecursiveBacktrackingSolver_6g * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_1__init__(PyObject *__pyx_self, @@ -14279,7 +13335,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -14287,17 +13343,22 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_steps,&__pyx_n_s_rand,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_int_1000))); + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_steps,&__pyx_mstate_global->__pyx_n_u_rand,0}; + values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)__pyx_mstate_global->__pyx_int_1000))); values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None)); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -14305,7 +13366,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -14314,15 +13375,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_steps); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_steps); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rand); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_rand); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L3_error) } } @@ -14332,11 +13399,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + __Pyx_Arg_XDECREF_FASTCALL(values[2]); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -14380,7 +13452,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":563 * repeatability. @@ -14388,8 +13460,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * self._steps = steps # <<<<<<<<<<<<<< * self._rand = rand * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_steps_2, __pyx_v_steps) < 0) __PYX_ERR(0, 563, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2, __pyx_v_steps) < 0) __PYX_ERR(0, 563, __pyx_L1_error) /* "constraint/solvers.py":564 * """ @@ -14397,8 +13469,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * self._rand = rand # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rand_2, __pyx_v_rand) < 0) __PYX_ERR(0, 564, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2, __pyx_v_rand) < 0) __PYX_ERR(0, 564, __pyx_L1_error) /* "constraint/solvers.py":554 * """ @@ -14406,7 +13478,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -14426,7 +13498,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver___init__(CY * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * choice = self._rand.choice if self._rand is not None else random.choice * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_18MinConflictsSolver_3getSolution(PyObject *__pyx_self, @@ -14460,7 +13532,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -14468,17 +13540,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -14486,7 +13562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -14494,7 +13570,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -14504,7 +13580,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -14514,7 +13590,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -14556,9 +13632,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 566, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 566, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -14617,7 +13693,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":567 * @@ -14625,23 +13701,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * choice = self._rand.choice if self._rand is not None else random.choice # <<<<<<<<<<<<<< * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle * assignments = {} - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_choice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_choice); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_choice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_choice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; @@ -14656,23 +13732,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle # <<<<<<<<<<<<<< * assignments = {} * # Initial assignment - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != Py_None); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_rand_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_shuffle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shuffle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_2; @@ -14687,7 +13763,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments = {} # <<<<<<<<<<<<<< * # Initial assignment * for variable in domains: - */ +*/ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_assignments = ((PyObject*)__pyx_t_1); @@ -14699,7 +13775,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in domains: # <<<<<<<<<<<<<< * assignments[variable] = choice(domains[variable]) * for _ in range(self._steps): - */ +*/ __pyx_t_5 = 0; __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_domains, 1, ((PyObject *)NULL), (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14720,7 +13796,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = choice(domains[variable]) # <<<<<<<<<<<<<< * for _ in range(self._steps): * conflicted = False - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_choice); @@ -14729,13 +13805,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_11 = 1; } #endif { @@ -14758,8 +13833,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for _ in range(self._steps): # <<<<<<<<<<<<<< * conflicted = False * lst = list(domains.keys()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_steps_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_steps_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14771,7 +13846,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 573, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14779,13 +13854,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 573, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_6); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14793,13 +13871,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 573, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); + if (unlikely((0 < 0))) __PYX_ERR(0, 573, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_6++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14826,7 +13907,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * conflicted = False # <<<<<<<<<<<<<< * lst = list(domains.keys()) * shuffle(lst) - */ +*/ __pyx_v_conflicted = 0; /* "constraint/solvers.py":575 @@ -14835,7 +13916,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * lst = list(domains.keys()) # <<<<<<<<<<<<<< * shuffle(lst) * for variable in lst: - */ +*/ __pyx_t_2 = __Pyx_PyDict_Keys(__pyx_v_domains); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 575, __pyx_L1_error) @@ -14850,20 +13931,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * shuffle(lst) # <<<<<<<<<<<<<< * for variable in lst: * # Check if variable is not in conflict - */ +*/ __Pyx_INCREF(__pyx_v_shuffle); __pyx_t_2 = __pyx_v_shuffle; __pyx_t_4 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_11 = 1; } #endif { @@ -14882,19 +13962,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in lst: # <<<<<<<<<<<<<< * # Check if variable is not in conflict * for constraint, variables in vconstraints[variable]: - */ +*/ __pyx_t_9 = __pyx_v_lst; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 577, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_9, __pyx_t_5); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14908,7 +13991,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * break - */ +*/ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -14918,7 +14001,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 579, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -14926,13 +14009,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 579, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_13); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14940,13 +14026,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 579, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); + if (unlikely((0 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_2); + __pyx_t_13++; #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -14974,18 +14063,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_15); } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_15 = PyList_GET_ITEM(sequence, 1); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_15 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_15); } - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_15); #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -14994,7 +14087,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __pyx_t_16 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_16); + __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_16); index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L11_unpacking_failed; @@ -15021,20 +14114,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * break * else: - */ +*/ __Pyx_INCREF(__pyx_v_constraint); __pyx_t_15 = __pyx_v_constraint; __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_11 = 1; } #endif { @@ -15056,7 +14148,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * break # <<<<<<<<<<<<<< * else: * continue - */ +*/ goto __pyx_L10_break; /* "constraint/solvers.py":580 @@ -15065,7 +14157,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * break * else: - */ +*/ } /* "constraint/solvers.py":579 @@ -15074,7 +14166,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * break - */ +*/ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L14_for_else; @@ -15090,7 +14182,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * continue # <<<<<<<<<<<<<< * # Variable has conflicts. Find values with less conflicts. * mincount = len(vconstraints[variable]) - */ +*/ goto __pyx_L7_continue; } __pyx_L15_for_end:; @@ -15101,12 +14193,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * mincount = len(vconstraints[variable]) # <<<<<<<<<<<<<< * minvalues = [] * for value in domains[variable]: - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_13 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_mincount, __pyx_t_4); __pyx_t_4 = 0; @@ -15117,7 +14209,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues = [] # <<<<<<<<<<<<<< * for value in domains[variable]: * assignments[variable] = value - */ +*/ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_minvalues, ((PyObject*)__pyx_t_4)); @@ -15129,7 +14221,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * count = 0 - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -15139,7 +14231,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 587, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -15147,13 +14239,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_13); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15161,13 +14256,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 587, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); + if (unlikely((0 < 0))) __PYX_ERR(0, 587, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_13++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15194,7 +14292,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = value # <<<<<<<<<<<<<< * count = 0 * for constraint, variables in vconstraints[variable]: - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_v_value) < 0))) __PYX_ERR(0, 588, __pyx_L1_error) /* "constraint/solvers.py":589 @@ -15203,9 +14301,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count = 0 # <<<<<<<<<<<<<< * for constraint, variables in vconstraints[variable]: * if not constraint(variables, domains, assignments): - */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_XDECREF_SET(__pyx_v_count, __pyx_int_0); +*/ + __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0); + __Pyx_XDECREF_SET(__pyx_v_count, __pyx_mstate_global->__pyx_int_0); /* "constraint/solvers.py":590 * assignments[variable] = value @@ -15213,7 +14311,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * count += 1 - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_vconstraints, __pyx_v_variable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -15223,7 +14321,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { __pyx_t_19 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_20 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_15); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 590, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -15231,13 +14329,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio if (likely(PyList_CheckExact(__pyx_t_15))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_15); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_15, __pyx_t_19); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_19++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15245,13 +14346,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_15); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 590, __pyx_L1_error) #endif if (__pyx_t_19 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_19); + if (unlikely((0 < 0))) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_19++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_15, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -15279,18 +14383,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_10); + __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_16); } else { - __pyx_t_10 = PyList_GET_ITEM(sequence, 0); - __pyx_t_16 = PyList_GET_ITEM(sequence, 1); + __pyx_t_10 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_10); + __pyx_t_16 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_16); } - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_16); #else - __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) + __pyx_t_16 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -15299,7 +14407,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio __pyx_t_21 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_21); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); + __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_21); index = 0; __pyx_t_10 = __pyx_t_17(__pyx_t_21); if (unlikely(!__pyx_t_10)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_10); index = 1; __pyx_t_16 = __pyx_t_17(__pyx_t_21); if (unlikely(!__pyx_t_16)) goto __pyx_L20_unpacking_failed; @@ -15326,20 +14434,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * count += 1 * if count == mincount: - */ +*/ __Pyx_INCREF(__pyx_v_constraint); __pyx_t_16 = __pyx_v_constraint; __pyx_t_10 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_16))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_16); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_16, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_16, function); + __pyx_t_11 = 1; } #endif { @@ -15361,8 +14468,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * count += 1 # <<<<<<<<<<<<<< * if count == mincount: * minvalues.append(value) - */ - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_count, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_v_count, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_4); __pyx_t_4 = 0; @@ -15373,7 +14480,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not constraint(variables, domains, assignments): # <<<<<<<<<<<<<< * count += 1 * if count == mincount: - */ +*/ } /* "constraint/solvers.py":590 @@ -15382,7 +14489,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for constraint, variables in vconstraints[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments): * count += 1 - */ +*/ } __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -15392,7 +14499,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if count == mincount: # <<<<<<<<<<<<<< * minvalues.append(value) * elif count < mincount: - */ +*/ __pyx_t_15 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 593, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -15404,7 +14511,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues.append(value) # <<<<<<<<<<<<<< * elif count < mincount: * mincount = count - */ +*/ __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 594, __pyx_L1_error) /* "constraint/solvers.py":593 @@ -15413,7 +14520,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if count == mincount: # <<<<<<<<<<<<<< * minvalues.append(value) * elif count < mincount: - */ +*/ goto __pyx_L24; } @@ -15423,7 +14530,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * elif count < mincount: # <<<<<<<<<<<<<< * mincount = count * del minvalues[:] - */ +*/ __pyx_t_15 = PyObject_RichCompare(__pyx_v_count, __pyx_v_mincount, Py_LT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 595, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -15435,7 +14542,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * mincount = count # <<<<<<<<<<<<<< * del minvalues[:] * minvalues.append(value) - */ +*/ __Pyx_INCREF(__pyx_v_count); __Pyx_DECREF_SET(__pyx_v_mincount, __pyx_v_count); @@ -15445,7 +14552,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * del minvalues[:] # <<<<<<<<<<<<<< * minvalues.append(value) * # Pick a random one from these values. - */ +*/ if (__Pyx_PyObject_DelSlice(__pyx_v_minvalues, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 597, __pyx_L1_error) /* "constraint/solvers.py":598 @@ -15454,7 +14561,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * minvalues.append(value) # <<<<<<<<<<<<<< * # Pick a random one from these values. * assignments[variable] = choice(minvalues) - */ +*/ __pyx_t_22 = __Pyx_PyList_Append(__pyx_v_minvalues, __pyx_v_value); if (unlikely(__pyx_t_22 == ((int)-1))) __PYX_ERR(0, 598, __pyx_L1_error) /* "constraint/solvers.py":595 @@ -15463,7 +14570,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * elif count < mincount: # <<<<<<<<<<<<<< * mincount = count * del minvalues[:] - */ +*/ } __pyx_L24:; @@ -15473,7 +14580,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for value in domains[variable]: # <<<<<<<<<<<<<< * assignments[variable] = value * count = 0 - */ +*/ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15483,20 +14590,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * assignments[variable] = choice(minvalues) # <<<<<<<<<<<<<< * conflicted = True * if not conflicted: - */ +*/ __Pyx_INCREF(__pyx_v_choice); __pyx_t_15 = __pyx_v_choice; __pyx_t_4 = NULL; __pyx_t_11 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_15))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_11 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_11 = 1; } #endif { @@ -15516,7 +14622,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * conflicted = True # <<<<<<<<<<<<<< * if not conflicted: * return assignments - */ +*/ __pyx_v_conflicted = 1; /* "constraint/solvers.py":577 @@ -15525,7 +14631,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for variable in lst: # <<<<<<<<<<<<<< * # Check if variable is not in conflict * for constraint, variables in vconstraints[variable]: - */ +*/ __pyx_L7_continue:; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -15536,7 +14642,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not conflicted: # <<<<<<<<<<<<<< * return assignments * return None - */ +*/ __pyx_t_3 = (!__pyx_v_conflicted); if (__pyx_t_3) { @@ -15546,7 +14652,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * return assignments # <<<<<<<<<<<<<< * return None * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_assignments); __pyx_r = __pyx_v_assignments; @@ -15559,7 +14665,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * if not conflicted: # <<<<<<<<<<<<<< * return assignments * return None - */ +*/ } /* "constraint/solvers.py":573 @@ -15568,7 +14674,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * for _ in range(self._steps): # <<<<<<<<<<<<<< * conflicted = False * lst = list(domains.keys()) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -15578,7 +14684,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * return None # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -15589,7 +14695,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * choice = self._rand.choice if self._rand is not None else random.choice * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -15627,7 +14733,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_18MinConflictsSolver_2getSolutio * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_1__init__(PyObject *__pyx_self, @@ -15660,7 +14766,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -15668,14 +14774,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_process_mode,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_process_mode,0}; values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -15683,7 +14792,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -15692,8 +14801,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_process_mode); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_process_mode); + if (value) { + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; + } else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error) } } @@ -15703,9 +14815,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + __Pyx_Arg_XDECREF_FASTCALL(values[1]); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } @@ -15747,12 +14862,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__init__", 0); /* "constraint/solvers.py":646 * def __init__(self, process_mode=False): @@ -15760,46 +14873,27 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * super().__init__() # <<<<<<<<<<<<<< * self._process_mode = process_mode * self.requires_pickling = process_mode - */ - __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 646, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error); +*/ + __pyx_t_1 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_1) { PyErr_SetString(PyExc_RuntimeError, "super(): empty __class__ cell"); __PYX_ERR(0, 646, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 646, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 646, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self) != (0)) __PYX_ERR(0, 646, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "constraint/solvers.py":647 @@ -15808,8 +14902,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self._process_mode = process_mode # <<<<<<<<<<<<<< * self.requires_pickling = process_mode * - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_process_mode_2, __pyx_v_process_mode) < 0) __PYX_ERR(0, 647, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_process_mode_2, __pyx_v_process_mode) < 0) __PYX_ERR(0, 647, __pyx_L1_error) /* "constraint/solvers.py":648 * super().__init__() @@ -15817,8 +14911,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * self.requires_pickling = process_mode # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_requires_pickling, __pyx_v_process_mode) < 0) __PYX_ERR(0, 648, __pyx_L1_error) +*/ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_requires_pickling, __pyx_v_process_mode) < 0) __PYX_ERR(0, 648, __pyx_L1_error) /* "constraint/solvers.py":644 * """ # noqa E501 @@ -15826,7 +14920,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() - */ +*/ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -15834,7 +14928,6 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -15849,7 +14942,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver___init__(CYTHON * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_3getSolution(PyObject *__pyx_self, @@ -15884,7 +14977,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolution (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -15892,17 +14985,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -15910,7 +15007,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -15918,7 +15015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -15928,7 +15025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -15938,7 +15035,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -15980,9 +15077,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 650, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 650, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 650, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 650, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -16009,7 +15106,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolution", 1); + __Pyx_RefNannySetupContext("getSolution", 0); /* "constraint/solvers.py":659 * of constraints affecting the given variables. @@ -16017,16 +15114,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * msg = f"{self.__class__.__name__} only provides all solutions" # <<<<<<<<<<<<<< * raise NotImplementedError(msg) * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_kp_u_only_provides_all_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_only_provides_all_solutions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_msg = ((PyObject*)__pyx_t_2); @@ -16038,7 +15135,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * raise NotImplementedError(msg) # <<<<<<<<<<<<<< * * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 - */ +*/ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_v_msg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); @@ -16051,7 +15148,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -16071,7 +15168,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_2getSolution(CY * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_5getSolutionsList(PyObject *__pyx_self, @@ -16105,7 +15202,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutionsList (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -16113,15 +15210,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -16129,7 +15229,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -16137,7 +15237,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -16147,7 +15247,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -16187,8 +15287,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 662, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 662, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 662, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsList(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_vconstraints); /* function exit code */ @@ -16212,7 +15312,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds * sorted_vars: list[Hashable] = sorted(domains.keys(), key=lambda v: len(domains[v])) # <<<<<<<<<<<<<< * * # Split parallel and sequential parts - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda(PyObject *__pyx_self, @@ -16243,7 +15343,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -16251,11 +15351,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_v,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -16263,7 +15364,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_v)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_v)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -16320,7 +15421,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda", 1); + __Pyx_RefNannySetupContext("lambda", 0); __pyx_outer_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); @@ -16333,7 +15434,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16357,7 +15458,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_cur_scope; @@ -16367,7 +15468,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsL const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -16382,7 +15483,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsL __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsList_3generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ParallelSolver_getSolutionsList, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsList_3generator2, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -16421,7 +15522,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 675, __pyx_L1_error) + if (unlikely(__pyx_sent_value != Py_None)) { + if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator"); + __PYX_ERR(0, 675, __pyx_L1_error) + } if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 675, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); @@ -16430,20 +15534,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 675, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16451,13 +15558,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 675, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 675, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -16480,32 +15590,32 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 675, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_requires_pickling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup)) { __Pyx_RaiseClosureNameError("constraint_lookup"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var)) { __Pyx_RaiseClosureNameError("first_var"); __PYX_ERR(0, 675, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars)) { __Pyx_RaiseClosureNameError("remaining_vars"); __PYX_ERR(0, 675, __pyx_L1_error) } - __pyx_t_5 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_copy, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_5 = __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type__copy, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_remaining_vars); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_constraint_lookup) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_first_var) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_val); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_cur_scope->__pyx_v_val)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_cur_scope->__pyx_v_val) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5)) __PYX_ERR(0, 675, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5) != (0)) __PYX_ERR(0, 675, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_r = __pyx_t_6; @@ -16532,17 +15642,19 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif @@ -16558,7 +15670,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_14ParallelSolver_16getSolutionsL * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_domains, PyObject *__pyx_v_vconstraints) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_cur_scope; @@ -16582,20 +15694,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi int __pyx_t_7; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; - unsigned int __pyx_t_10; + PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *(*__pyx_t_15)(PyObject *); - int __pyx_t_16; - PyObject *__pyx_t_17 = NULL; - int __pyx_t_18; + unsigned int __pyx_t_14; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); + int __pyx_t_17; + PyObject *__pyx_t_18 = NULL; + int __pyx_t_19; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getSolutionsList", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)Py_None); __Pyx_INCREF(Py_None); @@ -16616,7 +15729,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]] = {var: vconstraints.get(var, []) for var in domains} # noqa: E501 # <<<<<<<<<<<<<< * * # Sort variables by domain size (heuristic) - */ +*/ { /* enter inner scope */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); @@ -16659,19 +15772,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * sorted_vars: list[Hashable] = sorted(domains.keys(), key=lambda v: len(domains[v])) # <<<<<<<<<<<<<< * * # Split parallel and sequential parts - */ +*/ __pyx_t_1 = __Pyx_PyDict_Keys(__pyx_cur_scope->__pyx_v_domains); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 668, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda, 0, __pyx_n_s_ParallelSolver_getSolutionsList_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_constraint_solvers, __pyx_d, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_16getSolutionsList_lambda, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_8) < 0) __PYX_ERR(0, 668, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_key, __pyx_t_8) < 0) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -16687,12 +15800,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * first_var = sorted_vars[0] # <<<<<<<<<<<<<< * remaining_vars = sorted_vars[1:] * - */ +*/ if (unlikely(__pyx_v_sorted_vars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 671, __pyx_L1_error) } - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_sorted_vars, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_cur_scope->__pyx_v_first_var = __pyx_t_8; @@ -16704,7 +15817,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * remaining_vars = sorted_vars[1:] # <<<<<<<<<<<<<< * * # Create the parallel function arguments and solutions lists - */ +*/ if (unlikely(__pyx_v_sorted_vars == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 672, __pyx_L1_error) @@ -16721,7 +15834,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * args = ((self.requires_pickling, domains, constraint_lookup, first_var, val, remaining_vars.copy()) for val in domains[first_var]) # noqa: E501 # <<<<<<<<<<<<<< * solutions: list[dict[Hashable, any]] = [] * - */ +*/ __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_cur_scope->__pyx_v_domains, __pyx_cur_scope->__pyx_v_first_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_pf_10constraint_7solvers_14ParallelSolver_16getSolutionsList_1genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error) @@ -16736,7 +15849,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * solutions: list[dict[Hashable, any]] = [] # <<<<<<<<<<<<<< * * # execute in parallel - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -16748,18 +15861,18 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor # <<<<<<<<<<<<<< * with parallel_pool() as executor: * # results = map(parallel_worker, args) # sequential - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_process_mode_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) +*/ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_mstate_global->__pyx_n_u_process_mode_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ProcessPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; } else { - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_1 = __pyx_t_8; __pyx_t_8 = 0; @@ -16773,71 +15886,31 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * with parallel_pool() as executor: # <<<<<<<<<<<<<< * # results = map(parallel_worker, args) # sequential * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ +*/ /*with:*/ { - __Pyx_INCREF(__pyx_v_parallel_pool); - __pyx_t_8 = __pyx_v_parallel_pool; __pyx_t_2 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_11 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L9_error) + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_v_parallel_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L9_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 0+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L9_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = __pyx_t_8; - __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __pyx_t_2; + __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*try:*/ { { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_11); __Pyx_XGOTREF(__pyx_t_12); __Pyx_XGOTREF(__pyx_t_13); - __Pyx_XGOTREF(__pyx_t_14); /*try:*/ { - __pyx_v_executor = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_executor = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":682 * with parallel_pool() as executor: @@ -16845,29 +15918,39 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * results = executor.map(parallel_worker, args, chunksize=1) # parallel # <<<<<<<<<<<<<< * for result in results: * solutions.extend(result) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_executor, __pyx_n_s_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_parallel_worker); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error); - __Pyx_INCREF(__pyx_v_args); - __Pyx_GIVEREF(__pyx_v_args); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_args)) __PYX_ERR(0, 682, __pyx_L13_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_executor, __pyx_mstate_global->__pyx_n_u_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_chunksize, __pyx_int_1) < 0) __PYX_ERR(0, 682, __pyx_L13_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 682, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_results = __pyx_t_6; - __pyx_t_6 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_parallel_worker); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = NULL; + __pyx_t_14 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); + assert(__pyx_t_6); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_14 = 1; + } + #endif + __pyx_t_15 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 682, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_15); + { + PyObject *__pyx_callargs[3+ ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_6, __pyx_t_2, __pyx_v_args}; + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_chunksize, __pyx_mstate_global->__pyx_int_1, __pyx_t_15, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 682, __pyx_L13_error) + __pyx_t_8 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_1, __pyx_callargs+1-__pyx_t_14, 2+__pyx_t_14, __pyx_t_15); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 682, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_v_results = __pyx_t_8; + __pyx_t_8 = 0; /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -16875,49 +15958,55 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * for result in results: # <<<<<<<<<<<<<< * solutions.extend(result) * - */ +*/ if (likely(PyList_CheckExact(__pyx_v_results)) || PyTuple_CheckExact(__pyx_v_results)) { - __pyx_t_6 = __pyx_v_results; __Pyx_INCREF(__pyx_t_6); + __pyx_t_8 = __pyx_v_results; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; - __pyx_t_15 = NULL; + __pyx_t_16 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 683, __pyx_L13_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 683, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 683, __pyx_L13_error) } for (;;) { - if (likely(!__pyx_t_15)) { - if (likely(PyList_CheckExact(__pyx_t_6))) { + if (likely(!__pyx_t_16)) { + if (likely(PyList_CheckExact(__pyx_t_8))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_8, __pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); - #if !CYTHON_ASSUME_SAFE_MACROS + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 683, __pyx_L13_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); + if (unlikely((0 < 0))) __PYX_ERR(0, 683, __pyx_L13_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_4++; #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 683, __pyx_L13_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_1 = __pyx_t_15(__pyx_t_6); + __pyx_t_1 = __pyx_t_16(__pyx_t_8); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { @@ -16937,8 +16026,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * solutions.extend(result) # <<<<<<<<<<<<<< * * return solutions - */ - __pyx_t_16 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_v_result); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L13_error) +*/ + __pyx_t_17 = __Pyx_PyList_Extend(__pyx_v_solutions, __pyx_v_result); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 684, __pyx_L13_error) /* "constraint/solvers.py":683 * # results = map(parallel_worker, args) # sequential @@ -16946,9 +16035,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * for result in results: # <<<<<<<<<<<<<< * solutions.extend(result) * - */ +*/ } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "constraint/solvers.py":680 * # execute in parallel @@ -16956,69 +16045,70 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * with parallel_pool() as executor: # <<<<<<<<<<<<<< * # results = map(parallel_worker, args) # sequential * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ +*/ } + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L18_try_end; __pyx_L13_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /*except:*/ { __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_XGOTREF(__pyx_t_6); - __Pyx_XGOTREF(__pyx_t_1); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_15) < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) __Pyx_XGOTREF(__pyx_t_8); - __pyx_t_2 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L15_except_error) + __Pyx_XGOTREF(__pyx_t_1); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_2 = PyTuple_Pack(3, __pyx_t_8, __pyx_t_1, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L15_except_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 680, __pyx_L15_except_error) - __Pyx_GOTREF(__pyx_t_17); - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); - __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; + if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 680, __pyx_L15_except_error) + __Pyx_GOTREF(__pyx_t_18); + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_18); + __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; if (__pyx_t_9 < 0) __PYX_ERR(0, 680, __pyx_L15_except_error) - __pyx_t_18 = (!__pyx_t_9); - if (unlikely(__pyx_t_18)) { - __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_19 = (!__pyx_t_9); + if (unlikely(__pyx_t_19)) { + __Pyx_GIVEREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_8); - __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_8); - __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_t_8 = 0; + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ErrRestoreWithState(__pyx_t_8, __pyx_t_1, __pyx_t_15); + __pyx_t_8 = 0; __pyx_t_1 = 0; __pyx_t_15 = 0; __PYX_ERR(0, 680, __pyx_L15_except_error) } - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L14_exception_handled; } __pyx_L15_except_error:; + __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); goto __pyx_L1_error; __pyx_L14_exception_handled:; + __Pyx_XGIVEREF(__pyx_t_11); __Pyx_XGIVEREF(__pyx_t_12); __Pyx_XGIVEREF(__pyx_t_13); - __Pyx_XGIVEREF(__pyx_t_14); - __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); __pyx_L18_try_end:; } } /*finally:*/ { /*normal exit:*/{ - if (__pyx_t_11) { - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__5, NULL); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_10) { + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[1], NULL); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } goto __pyx_L12; } @@ -17026,7 +16116,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi } goto __pyx_L25; __pyx_L9_error:; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L1_error; __pyx_L25:; } @@ -17037,7 +16127,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * return solutions # <<<<<<<<<<<<<< * * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -17049,7 +16139,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -17057,6 +16147,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_15); __Pyx_AddTraceback("constraint.solvers.ParallelSolver.getSolutionsList", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -17081,7 +16172,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_4getSolutionsLi * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_14ParallelSolver_7getSolutions(PyObject *__pyx_self, @@ -17115,7 +16206,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getSolutions (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17123,17 +16214,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_domains,&__pyx_n_s_constraints,&__pyx_n_s_vconstraints,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_vconstraints,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17141,7 +16236,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17149,7 +16244,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17159,7 +16254,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -17169,7 +16264,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vconstraints)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_vconstraints)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -17211,9 +16306,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 1))) __PYX_ERR(0, 688, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 1))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints), (&PyList_Type), 0, "constraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vconstraints), (&PyDict_Type), 0, "vconstraints", 2))) __PYX_ERR(0, 688, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(__pyx_self, __pyx_v_self, __pyx_v_domains, __pyx_v_constraints, __pyx_v_vconstraints); /* function exit code */ @@ -17241,7 +16336,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("getSolutions", 1); + __Pyx_RefNannySetupContext("getSolutions", 0); /* "constraint/solvers.py":689 * @@ -17249,22 +16344,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * return self.getSolutionsList(domains, vconstraints) # <<<<<<<<<<<<<< * * ### Helper functions for parallel solver - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getSolutionsList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_getSolutionsList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; } #endif { @@ -17285,7 +16379,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -17306,7 +16400,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_14ParallelSolver_6getSolutions(C * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_5is_valid(PyObject *__pyx_self, @@ -17340,7 +16434,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("is_valid (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -17348,15 +16442,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_constraints_lookup,&__pyx_n_s_domains,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_constraints_lookup,&__pyx_mstate_global->__pyx_n_u_domains,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -17364,7 +16461,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignment)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -17372,7 +16469,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraints_lookup)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraints_lookup)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -17382,7 +16479,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -17422,9 +16519,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 693, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints_lookup), (&PyList_Type), 0, "constraints_lookup", 1))) __PYX_ERR(0, 693, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraints_lookup), (&PyList_Type), 0, "constraints_lookup", 2))) __PYX_ERR(0, 693, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 693, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_4is_valid(__pyx_self, __pyx_v_assignment, __pyx_v_constraints_lookup, __pyx_v_domains); /* function exit code */ @@ -17450,7 +16547,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_cur_scope; @@ -17460,7 +16557,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -17475,7 +16572,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_valid_locals_genexpr_locals_g, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_is_valid_locals_genexpr_locals_g, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -17522,20 +16619,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 698, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17543,13 +16643,16 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 698, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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(0, 698, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -17598,10 +16701,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -17619,7 +16724,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_7genexpr_2generator4(_ * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_cur_scope; @@ -17630,7 +16735,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__py const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); @@ -17645,7 +16750,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8is_valid_genexpr(PyObject *__py __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_2generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_is_valid_locals_genexpr, __pyx_n_s_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10constraint_7solvers_8is_valid_2generator3, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_is_valid_locals_genexpr, __pyx_mstate_global->__pyx_n_u_constraint_solvers); if (unlikely(!gen)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -17696,20 +16801,23 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * for constraint, vars_involved in constraints_lookup # <<<<<<<<<<<<<< * if all(v in assignment for v in vars_involved) * ) - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 697, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 697, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 697, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -17724,18 +16832,22 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_4 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17744,7 +16856,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; @@ -17775,10 +16887,10 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ __pyx_t_3 = __pyx_pf_10constraint_7solvers_8is_valid_7genexpr_genexpr(((PyObject*)__pyx_cur_scope), __pyx_cur_scope->__pyx_v_vars_involved); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 698, __pyx_L1_error) @@ -17791,7 +16903,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_domains)) { __Pyx_RaiseClosureNameError("domains"); __PYX_ERR(0, 696, __pyx_L1_error) } if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_assignment)) { __Pyx_RaiseClosureNameError("assignment"); __PYX_ERR(0, 696, __pyx_L1_error) } __Pyx_INCREF(__pyx_cur_scope->__pyx_v_constraint); @@ -17800,13 +16912,12 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_9 = 1; - } + assert(__pyx_t_4); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_9 = 1; } #endif { @@ -17828,7 +16939,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -17837,7 +16948,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -17850,7 +16961,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * if all(v in assignment for v in vars_involved) # <<<<<<<<<<<<<< * ) * - */ +*/ } /* "constraint/solvers.py":697 @@ -17859,7 +16970,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * for constraint, vars_involved in constraints_lookup # <<<<<<<<<<<<<< * if all(v in assignment for v in vars_involved) * ) - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*else*/ { @@ -17870,7 +16981,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -17879,7 +16990,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; @@ -17889,13 +17000,15 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + if (__Pyx_PyErr_Occurred()) { + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); #if !CYTHON_USE_EXC_INFO_STACK @@ -17913,7 +17026,7 @@ static PyObject *__pyx_gb_10constraint_7solvers_8is_valid_2generator3(__pyx_Coro * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_assignment, PyObject *__pyx_v_constraints_lookup, PyObject *__pyx_v_domains) { struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_cur_scope; @@ -17926,7 +17039,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("is_valid", 0); - __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(__pyx_mstate_global->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid, __pyx_mstate_global->__pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)Py_None); __Pyx_INCREF(Py_None); @@ -17947,7 +17060,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * return all( # <<<<<<<<<<<<<< * constraint(vars_involved, domains, assignment, None) * for constraint, vars_involved in constraints_lookup - */ +*/ __Pyx_XDECREF(__pyx_r); /* "constraint/solvers.py":696 @@ -17956,10 +17069,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * constraint(vars_involved, domains, assignment, None) # <<<<<<<<<<<<<< * for constraint, vars_involved in constraints_lookup * if all(v in assignment for v in vars_involved) - */ +*/ __pyx_t_1 = __pyx_pf_10constraint_7solvers_8is_valid_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_constraints_lookup); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; @@ -17972,7 +17085,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -17994,7 +17107,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_4is_valid(CYTHON_UNUSED PyObject * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_7compile_to_function(PyObject *__pyx_self, @@ -18026,7 +17139,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compile_to_function (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18034,11 +17147,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_constraint,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constraint,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18046,7 +17160,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18108,7 +17222,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("compile_to_function", 1); + __Pyx_RefNannySetupContext("compile_to_function", 0); /* "constraint/solvers.py":703 * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: @@ -18116,8 +17230,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * func_string = constraint._func # <<<<<<<<<<<<<< * code_object = compile(func_string, "", "exec") * func = FunctionType(code_object.co_consts[0], globals()) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_n_s_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) +*/ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_constraint, __pyx_mstate_global->__pyx_n_u_func_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_func_string = __pyx_t_1; __pyx_t_1 = 0; @@ -18128,18 +17242,18 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * code_object = compile(func_string, "", "exec") # <<<<<<<<<<<<<< * func = FunctionType(code_object.co_consts[0], globals()) * return FunctionConstraint(func) - */ +*/ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_func_string); __Pyx_GIVEREF(__pyx_v_func_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func_string)) __PYX_ERR(0, 704, __pyx_L1_error); - __Pyx_INCREF(__pyx_kp_u_string); - __Pyx_GIVEREF(__pyx_kp_u_string); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_string)) __PYX_ERR(0, 704, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_exec); - __Pyx_GIVEREF(__pyx_n_u_exec); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_n_u_exec)) __PYX_ERR(0, 704, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func_string) != (0)) __PYX_ERR(0, 704, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_string); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_string); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_kp_u_string) != (0)) __PYX_ERR(0, 704, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_exec); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_exec); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_mstate_global->__pyx_n_u_exec) != (0)) __PYX_ERR(0, 704, __pyx_L1_error); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_compile, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -18152,12 +17266,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * func = FunctionType(code_object.co_consts[0], globals()) # <<<<<<<<<<<<<< * return FunctionConstraint(func) * - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_n_s_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_code_object, __pyx_mstate_global->__pyx_n_u_co_consts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) @@ -18167,13 +17281,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; } #endif { @@ -18195,22 +17308,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * return FunctionConstraint(func) # <<<<<<<<<<<<<< * * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_6 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; } #endif { @@ -18231,7 +17343,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -18257,7 +17369,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_6compile_to_function(CYTHON_UNUS * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_9sequential_recursive_backtrack(PyObject *__pyx_self, @@ -18292,7 +17404,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sequential_recursive_backtrack (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18300,17 +17412,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_unassigned_vars,&__pyx_n_s_domains,&__pyx_n_s_constraint_lookup,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_unassigned_vars,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraint_lookup,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18318,7 +17434,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignment)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18326,7 +17442,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned_vars)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned_vars)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -18336,7 +17452,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -18346,7 +17462,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint_lookup)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraint_lookup)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -18388,10 +17504,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 708, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 1))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 708, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 2))) __PYX_ERR(0, 708, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack(__pyx_self, __pyx_v_assignment, __pyx_v_unassigned_vars, __pyx_v_domains, __pyx_v_constraint_lookup); /* function exit code */ @@ -18430,7 +17546,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sequential_recursive_backtrack", 1); + __Pyx_RefNannySetupContext("sequential_recursive_backtrack", 0); /* "constraint/solvers.py":710 * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 @@ -18438,8 +17554,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if not unassigned_vars: # <<<<<<<<<<<<<< * return [assignment.copy()] * - */ - __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); +*/ + __pyx_t_1 = (__Pyx_PyList_GET_SIZE(__pyx_v_unassigned_vars) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 710, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { @@ -18449,14 +17566,14 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * return [assignment.copy()] # <<<<<<<<<<<<<< * * var = unassigned_vars[-1] - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyDict_Copy(__pyx_v_assignment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 711, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 711, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; @@ -18468,7 +17585,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if not unassigned_vars: # <<<<<<<<<<<<<< * return [assignment.copy()] * - */ +*/ } /* "constraint/solvers.py":713 @@ -18477,8 +17594,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * var = unassigned_vars[-1] # <<<<<<<<<<<<<< * remaining_vars = unassigned_vars[:-1] * - */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unassigned_vars, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_unassigned_vars, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_var = __pyx_t_4; __pyx_t_4 = 0; @@ -18489,7 +17606,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * remaining_vars = unassigned_vars[:-1] # <<<<<<<<<<<<<< * * solutions: list[dict[Hashable, any]] = [] - */ +*/ __pyx_t_4 = __Pyx_PyList_GetSlice(__pyx_v_unassigned_vars, 0, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_remaining_vars = ((PyObject*)__pyx_t_4); @@ -18501,7 +17618,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * solutions: list[dict[Hashable, any]] = [] # <<<<<<<<<<<<<< * for value in domains[var]: * assignment[var] = value - */ +*/ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_solutions = ((PyObject*)__pyx_t_4); @@ -18513,7 +17630,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * for value in domains[var]: # <<<<<<<<<<<<<< * assignment[var] = value * if is_valid(assignment, constraint_lookup[var], domains): - */ +*/ __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_var); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { @@ -18523,7 +17640,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 717, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { @@ -18531,13 +17648,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 717, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18545,13 +17665,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 717, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); + if (unlikely((0 < 0))) __PYX_ERR(0, 717, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5++; #else __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); @@ -18578,7 +17701,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * assignment[var] = value # <<<<<<<<<<<<<< * if is_valid(assignment, constraint_lookup[var], domains): * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) - */ +*/ if (unlikely((PyDict_SetItem(__pyx_v_assignment, __pyx_v_var, __pyx_v_value) < 0))) __PYX_ERR(0, 718, __pyx_L1_error) /* "constraint/solvers.py":719 @@ -18587,8 +17710,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if is_valid(assignment, constraint_lookup[var], domains): # <<<<<<<<<<<<<< * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) * del assignment[var] - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_is_valid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_is_valid); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_constraint_lookup, __pyx_v_var); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); @@ -18597,13 +17720,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } + assert(__pyx_t_9); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; } #endif { @@ -18625,21 +17747,20 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) # <<<<<<<<<<<<<< * del assignment[var] * return solutions - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sequential_recursive_backtrack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_10 = 1; - } + assert(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; } #endif { @@ -18659,7 +17780,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * if is_valid(assignment, constraint_lookup[var], domains): # <<<<<<<<<<<<<< * solutions.extend(sequential_recursive_backtrack(assignment, remaining_vars, domains, constraint_lookup)) * del assignment[var] - */ +*/ } /* "constraint/solvers.py":721 @@ -18668,7 +17789,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * del assignment[var] # <<<<<<<<<<<<<< * return solutions * - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignment, __pyx_v_var) < 0))) __PYX_ERR(0, 721, __pyx_L1_error) /* "constraint/solvers.py":717 @@ -18677,7 +17798,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * for value in domains[var]: # <<<<<<<<<<<<<< * assignment[var] = value * if is_valid(assignment, constraint_lookup[var], domains): - */ +*/ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -18687,7 +17808,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * return solutions # <<<<<<<<<<<<<< * * def sequential_optimized_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -18699,7 +17820,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -18726,7 +17847,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_8sequential_recursive_backtrack( * def sequential_optimized_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_11sequential_optimized_backtrack(PyObject *__pyx_self, @@ -18761,7 +17882,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("sequential_optimized_backtrack (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -18769,17 +17890,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_assignment,&__pyx_n_s_unassigned_vars,&__pyx_n_s_domains,&__pyx_n_s_constraint_lookup,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assignment,&__pyx_mstate_global->__pyx_n_u_unassigned_vars,&__pyx_mstate_global->__pyx_n_u_domains,&__pyx_mstate_global->__pyx_n_u_constraint_lookup,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + case 4: + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -18787,7 +17912,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_assignment)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_assignment)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -18795,7 +17920,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unassigned_vars)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_unassigned_vars)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } @@ -18805,7 +17930,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_domains)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_domains)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } @@ -18815,7 +17940,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } CYTHON_FALLTHROUGH; case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_constraint_lookup)) != 0)) { + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_constraint_lookup)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } @@ -18857,10 +17982,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 1))) __PYX_ERR(0, 724, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 1))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_assignment), (&PyDict_Type), 0, "assignment", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_unassigned_vars), (&PyList_Type), 0, "unassigned_vars", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_domains), (&PyDict_Type), 0, "domains", 2))) __PYX_ERR(0, 724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_constraint_lookup), (&PyDict_Type), 0, "constraint_lookup", 2))) __PYX_ERR(0, 724, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack(__pyx_self, __pyx_v_assignment, __pyx_v_unassigned_vars, __pyx_v_domains, __pyx_v_constraint_lookup); /* function exit code */ @@ -18904,7 +18029,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sequential_optimized_backtrack", 1); + __Pyx_RefNannySetupContext("sequential_optimized_backtrack", 0); /* "constraint/solvers.py":728 * # Does not do forwardcheck for simplicity @@ -18912,7 +18037,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * assignments = assignment # <<<<<<<<<<<<<< * sorted_variables = unassigned_vars * queue: list[tuple] = [] - */ +*/ __Pyx_INCREF(__pyx_v_assignment); __pyx_v_assignments = __pyx_v_assignment; @@ -18922,7 +18047,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * sorted_variables = unassigned_vars # <<<<<<<<<<<<<< * queue: list[tuple] = [] * solutions: list[dict] = list() - */ +*/ __Pyx_INCREF(__pyx_v_unassigned_vars); __pyx_v_sorted_variables = __pyx_v_unassigned_vars; @@ -18932,7 +18057,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * queue: list[tuple] = [] # <<<<<<<<<<<<<< * solutions: list[dict] = list() * - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_queue = ((PyObject*)__pyx_t_1); @@ -18944,7 +18069,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * solutions: list[dict] = list() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_solutions = ((PyObject*)__pyx_t_1); @@ -18956,7 +18081,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while True: # <<<<<<<<<<<<<< * # Mix the Degree and Minimum Remaing Values (MRV) heuristics * for variable in sorted_variables: - */ +*/ while (1) { /* "constraint/solvers.py":735 @@ -18965,19 +18090,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ __pyx_t_1 = __pyx_v_sorted_variables; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 735, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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, 735, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -18991,7 +18119,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_variable, __pyx_v_assignments, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 736, __pyx_L1_error) if (__pyx_t_4) { @@ -19001,10 +18129,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * values = domains[variable][:] # <<<<<<<<<<<<<< * break * else: - */ +*/ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_domains, __pyx_v_variable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_5); @@ -19016,7 +18144,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * else: * # No unassigned variables. We've got a solution. Go back - */ +*/ goto __pyx_L6_break; /* "constraint/solvers.py":736 @@ -19025,7 +18153,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if variable not in assignments: # <<<<<<<<<<<<<< * # Found unassigned variable * values = domains[variable][:] - */ +*/ } /* "constraint/solvers.py":735 @@ -19034,7 +18162,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for variable in sorted_variables: # <<<<<<<<<<<<<< * if variable not in assignments: * # Found unassigned variable - */ +*/ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8_for_else; @@ -19050,7 +18178,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * solutions.append(assignments.copy()) # <<<<<<<<<<<<<< * if not queue: * return solutions - */ +*/ __pyx_t_1 = PyDict_Copy(__pyx_v_assignments); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_solutions, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error) @@ -19062,8 +18190,9 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ - __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_queue) != 0); +*/ + __pyx_t_4 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_4 < 0))) __PYX_ERR(0, 744, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_4); if (__pyx_t_7) { @@ -19073,7 +18202,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * return solutions # <<<<<<<<<<<<<< * variable, values = queue.pop() * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); __pyx_r = __pyx_v_solutions; @@ -19085,7 +18214,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not queue: # <<<<<<<<<<<<<< * return solutions * variable, values = queue.pop() - */ +*/ } /* "constraint/solvers.py":746 @@ -19094,7 +18223,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * variable, values = queue.pop() # <<<<<<<<<<<<<< * * while True: - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -19107,18 +18236,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_5); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_3); } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19127,7 +18260,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed; @@ -19156,7 +18289,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while True: # <<<<<<<<<<<<<< * # We have a variable. Do we have any values left? * if not values: - */ +*/ while (1) { /* "constraint/solvers.py":750 @@ -19165,7 +18298,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 750, __pyx_L1_error) __pyx_t_4 = (!__pyx_t_7); if (__pyx_t_4) { @@ -19176,7 +18309,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * del assignments[variable] # <<<<<<<<<<<<<< * while queue: * variable, values = queue.pop() - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 752, __pyx_L1_error) /* "constraint/solvers.py":753 @@ -19185,9 +18318,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * while queue: # <<<<<<<<<<<<<< * variable, values = queue.pop() * if values: - */ +*/ while (1) { - __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_queue) != 0); + __pyx_t_4 = (__Pyx_PyList_GET_SIZE(__pyx_v_queue) != 0); + if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_4 < 0))) __PYX_ERR(0, 753, __pyx_L1_error) if (!__pyx_t_4) break; /* "constraint/solvers.py":754 @@ -19196,7 +18330,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * variable, values = queue.pop() # <<<<<<<<<<<<<< * if values: * break - */ +*/ __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_queue); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { @@ -19209,18 +18343,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_5); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_5); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_5); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19229,7 +18367,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L18_unpacking_failed; @@ -19256,7 +18394,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_values); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) if (__pyx_t_4) { @@ -19266,7 +18404,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * del assignments[variable] * else: - */ +*/ goto __pyx_L17_break; /* "constraint/solvers.py":755 @@ -19275,7 +18413,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if values: # <<<<<<<<<<<<<< * break * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":757 @@ -19284,7 +18422,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * del assignments[variable] # <<<<<<<<<<<<<< * else: * return solutions - */ +*/ if (unlikely((PyDict_DelItem(__pyx_v_assignments, __pyx_v_variable) < 0))) __PYX_ERR(0, 757, __pyx_L1_error) } @@ -19294,7 +18432,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * return solutions # <<<<<<<<<<<<<< * * # Got a value. Check it. - */ +*/ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_solutions); @@ -19309,7 +18447,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not values: # <<<<<<<<<<<<<< * # No. Go back to last variable, if there's one. * del assignments[variable] - */ +*/ } /* "constraint/solvers.py":762 @@ -19318,7 +18456,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * assignments[variable] = values.pop() # <<<<<<<<<<<<<< * for constraint, variables in constraint_lookup[variable]: * if not constraint(variables, domains, assignments, None): - */ +*/ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely((PyDict_SetItem(__pyx_v_assignments, __pyx_v_variable, __pyx_t_1) < 0))) __PYX_ERR(0, 762, __pyx_L1_error) @@ -19330,7 +18468,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for constraint, variables in constraint_lookup[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_constraint_lookup, __pyx_v_variable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -19340,7 +18478,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } else { __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 763, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -19348,13 +18486,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 763, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19362,13 +18503,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 763, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); + if (unlikely((0 < 0))) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2++; #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -19396,18 +18540,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_8); } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_8 = PyList_GET_ITEM(sequence, 1); + __pyx_t_3 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) + __Pyx_XGOTREF(__pyx_t_8); } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19416,7 +18564,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); + __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L23_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_11); if (unlikely(!__pyx_t_8)) goto __pyx_L23_unpacking_failed; @@ -19443,20 +18591,19 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ __Pyx_INCREF(__pyx_v_constraint); __pyx_t_8 = __pyx_v_constraint; __pyx_t_3 = NULL; __pyx_t_12 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_8))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_12 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_12 = 1; } #endif { @@ -19478,7 +18625,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * else: * break - */ +*/ goto __pyx_L22_break; /* "constraint/solvers.py":764 @@ -19487,7 +18634,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * if not constraint(variables, domains, assignments, None): # <<<<<<<<<<<<<< * # Value is not good. * break - */ +*/ } /* "constraint/solvers.py":763 @@ -19496,7 +18643,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * for constraint, variables in constraint_lookup[variable]: # <<<<<<<<<<<<<< * if not constraint(variables, domains, assignments, None): * # Value is not good. - */ +*/ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L26_for_else; @@ -19512,7 +18659,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * break # <<<<<<<<<<<<<< * * # Push state before looking for next variable. - */ +*/ goto __pyx_L14_break; } __pyx_L27_for_end:; @@ -19525,15 +18672,15 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * queue.append((variable, values)) # <<<<<<<<<<<<<< * * - */ +*/ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_variable); __Pyx_GIVEREF(__pyx_v_variable); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable)) __PYX_ERR(0, 771, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_variable) != (0)) __PYX_ERR(0, 771, __pyx_L1_error); __Pyx_INCREF(__pyx_v_values); __Pyx_GIVEREF(__pyx_v_values); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_values)) __PYX_ERR(0, 771, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_values) != (0)) __PYX_ERR(0, 771, __pyx_L1_error); __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_queue, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -19544,7 +18691,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * def sequential_optimized_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity - */ +*/ /* function exit code */ __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); @@ -19577,7 +18724,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_10sequential_optimized_backtrack * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_10constraint_7solvers_13parallel_worker(PyObject *__pyx_self, @@ -19609,7 +18756,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("parallel_worker (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -19617,11 +18764,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_args,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; @@ -19629,7 +18777,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_mstate_global->__pyx_n_u_args)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } @@ -19663,7 +18811,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 0, "args", 1))) __PYX_ERR(0, 774, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 0, "args", 2))) __PYX_ERR(0, 774, __pyx_L1_error) __pyx_r = __pyx_pf_10constraint_7solvers_12parallel_worker(__pyx_self, __pyx_v_args); /* function exit code */ @@ -19714,7 +18862,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("parallel_worker", 1); + __Pyx_RefNannySetupContext("parallel_worker", 0); /* "constraint/solvers.py":776 * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 @@ -19722,34 +18870,34 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args # <<<<<<<<<<<<<< * local_assignment = {first_var: first_value} * - */ +*/ if (1) { PyObject* sequence = __pyx_v_args; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence); if (unlikely(size != 6)) { if (size > 6) __Pyx_RaiseTooManyValuesError(6); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 776, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 4); __Pyx_INCREF(__pyx_t_5); + __pyx_t_6 = PyTuple_GET_ITEM(sequence, 5); __Pyx_INCREF(__pyx_t_6); #else { Py_ssize_t i; PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 6; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 776, __pyx_L1_error) + PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -19775,7 +18923,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * local_assignment = {first_var: first_value} # <<<<<<<<<<<<<< * * if process_mode: - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_v_first_var, __pyx_v_first_value) < 0) __PYX_ERR(0, 777, __pyx_L1_error) @@ -19788,7 +18936,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if process_mode: # <<<<<<<<<<<<<< * # if there are any CompilableFunctionConstraint, they must be compiled locally first * for var, constraints in constraint_lookup.items(): - */ +*/ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_process_mode); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 779, __pyx_L1_error) if (__pyx_t_7) { @@ -19798,13 +18946,13 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * for var, constraints in constraint_lookup.items(): # <<<<<<<<<<<<<< * constraint_lookup[var] = [tuple([compile_to_function(constraint) if isinstance(constraint, CompilableFunctionConstraint) else constraint, vals]) for constraint, vals in constraints] # noqa E501 * - */ +*/ __pyx_t_8 = 0; if (unlikely(__pyx_v_constraint_lookup == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 781, __pyx_L1_error) } - __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_constraint_lookup, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) + __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_constraint_lookup, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_9), (&__pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = __pyx_t_5; @@ -19826,7 +18974,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * constraint_lookup[var] = [tuple([compile_to_function(constraint) if isinstance(constraint, CompilableFunctionConstraint) else constraint, vals]) for constraint, vals in constraints] # noqa E501 # <<<<<<<<<<<<<< * * # continue solving sequentially on this process - */ +*/ { /* enter inner scope */ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); @@ -19837,20 +18985,23 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED } else { __pyx_t_12 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_constraints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_13 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 782, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_13)) { if (likely(PyList_CheckExact(__pyx_t_5))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L8_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_5, __pyx_t_12); + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); @@ -19858,13 +19009,16 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); - #if !CYTHON_ASSUME_SAFE_MACROS + #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 782, __pyx_L8_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); + if (unlikely((0 < 0))) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_INCREF(__pyx_t_3); + __pyx_t_12++; #else __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); @@ -19892,18 +19046,22 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); + __Pyx_INCREF(__pyx_t_1); } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); + __pyx_t_2 = __Pyx_PyList_GetItemRef(sequence, 0); + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_XGOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyList_GetItemRef(sequence, 1); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_XGOTREF(__pyx_t_1); } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -19912,7 +19070,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_14 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + __pyx_t_15 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); index = 0; __pyx_t_2 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); index = 1; __pyx_t_1 = __pyx_t_15(__pyx_t_14); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed; @@ -19932,25 +19090,24 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_vals, __pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyObject_IsInstance(__pyx_9genexpr11__pyx_v_constraint, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compile_to_function); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_compile_to_function); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_14 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_16 = 1; - } + assert(__pyx_t_14); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_14); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_16 = 1; } #endif { @@ -19970,10 +19127,10 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 782, __pyx_L8_error); __Pyx_INCREF(__pyx_9genexpr11__pyx_v_vals); __Pyx_GIVEREF(__pyx_9genexpr11__pyx_v_vals); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_9genexpr11__pyx_v_vals)) __PYX_ERR(0, 782, __pyx_L8_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_9genexpr11__pyx_v_vals) != (0)) __PYX_ERR(0, 782, __pyx_L8_error); __pyx_t_3 = 0; __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 782, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); @@ -20002,7 +19159,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if process_mode: # <<<<<<<<<<<<<< * # if there are any CompilableFunctionConstraint, they must be compiled locally first * for var, constraints in constraint_lookup.items(): - */ +*/ } /* "constraint/solvers.py":785 @@ -20011,8 +19168,8 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if is_valid(local_assignment, constraint_lookup[first_var], domains): # <<<<<<<<<<<<<< * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] - */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_is_valid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_valid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_constraint_lookup, __pyx_v_first_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -20021,13 +19178,12 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_16 = 1; - } + assert(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_16 = 1; } #endif { @@ -20049,22 +19205,21 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) # <<<<<<<<<<<<<< * return [] * - */ +*/ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sequential_optimized_backtrack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_16 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_16 = 1; - } + assert(__pyx_t_5); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_16 = 1; } #endif { @@ -20086,7 +19241,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * if is_valid(local_assignment, constraint_lookup[first_var], domains): # <<<<<<<<<<<<<< * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] - */ +*/ } /* "constraint/solvers.py":787 @@ -20094,7 +19249,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * return sequential_optimized_backtrack(local_assignment, remaining_vars, domains, constraint_lookup) * return [] # <<<<<<<<<<<<<< * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); @@ -20108,7 +19263,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -20137,11 +19292,7 @@ static PyObject *__pyx_pf_10constraint_7solvers_12parallel_worker(CYTHON_UNUSED __Pyx_RefNannyFinishContext(); return __pyx_r; } - -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter = 0; -#endif +/* #### Code section: module_exttypes ### */ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; @@ -20150,8 +19301,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct__getSolut o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20193,12 +19344,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSoluti Py_CLEAR(p->__pyx_v_vconstraints); Py_CLEAR(p->__pyx_8genexpr1__pyx_v_x); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct__getSolutionIter[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct__getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20212,6 +19363,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct__getSoluti static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct__getSolutionIter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct__getSolutionIter *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignments) { e = (*v)(p->__pyx_v_assignments, a); if (e) return e; } @@ -20295,12 +19450,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20341,13 +19491,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20366,11 +19514,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct__getSolu }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -20378,8 +19521,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_1_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20419,12 +19562,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolut Py_CLEAR(p->__pyx_v_vconstraints); Py_CLEAR(p->__pyx_8genexpr2__pyx_v_x); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20438,6 +19581,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_1_getSolut static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignments) { e = (*v)(p->__pyx_v_assignments, a); if (e) return e; } @@ -20515,12 +19662,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20561,13 +19703,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20586,11 +19726,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -20598,8 +19733,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_2_getSolu o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20629,12 +19764,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolut Py_CLEAR(p->__pyx_v_remaining_vars); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20648,6 +19783,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_2_getSolut static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_constraint_lookup) { e = (*v)(p->__pyx_v_constraint_lookup, a); if (e) return e; } @@ -20717,12 +19856,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20763,13 +19897,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20788,11 +19920,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSol }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -20800,8 +19927,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_3_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -20830,12 +19957,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr( Py_CLEAR(p->__pyx_v_val); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_3_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -20849,6 +19976,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_3_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_3_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -20893,12 +20024,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -20939,13 +20065,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -20964,11 +20088,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -20976,8 +20095,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_4_is_vali o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21004,12 +20123,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid Py_CLEAR(p->__pyx_v_assignment); Py_CLEAR(p->__pyx_v_domains); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_4_is_valid[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_4_is_valid++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21023,6 +20142,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_4_is_valid static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_4_is_valid(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_4_is_valid *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_v_assignment) { e = (*v)(p->__pyx_v_assignment, a); if (e) return e; } @@ -21074,12 +20197,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21120,13 +20238,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21145,11 +20261,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_val }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -21157,8 +20268,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_5_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21188,12 +20299,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr( Py_CLEAR(p->__pyx_v_genexpr); Py_CLEAR(p->__pyx_v_vars_involved); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_5_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21207,6 +20318,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_5_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_5_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -21254,12 +20369,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21300,13 +20410,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21325,11 +20433,6 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexp }; #endif -#if CYTHON_USE_FREELISTS -static struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[8]; -static int __pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr = 0; -#endif - static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API @@ -21337,8 +20440,8 @@ static PyObject *__pyx_tp_new_10constraint_7solvers___pyx_scope_struct_6_genexpr o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { - o = (PyObject*)__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[--__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr]; + if (likely((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { + o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[--__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); @@ -21366,12 +20469,12 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr( Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_v); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { - __pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o); + if (((int)(__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr)))) { + __pyx_mstate_global->__pyx_freelist_10constraint_7solvers___pyx_scope_struct_6_genexpr[__pyx_mstate_global->__pyx_freecount_10constraint_7solvers___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o); } else #endif { - #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + #if CYTHON_USE_TYPE_SLOTS (*Py_TYPE(o)->tp_free)(o); #else { @@ -21385,6 +20488,10 @@ static void __pyx_tp_dealloc_10constraint_7solvers___pyx_scope_struct_6_genexpr( static int __pyx_tp_traverse_10constraint_7solvers___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10constraint_7solvers___pyx_scope_struct_6_genexpr *)o; + { + e = __Pyx_call_type_traverse(o, 1, v, a); + if (e) return e; + } if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -21426,12 +20533,7 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #endif - #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ - #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ @@ -21472,13 +20574,11 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ - #if PY_VERSION_HEX >= 0x030400a1 #if CYTHON_USE_TP_FINALIZE 0, /*tp_finalize*/ #else NULL, /*tp_finalize*/ #endif - #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, /*tp_vectorcall*/ #endif @@ -21500,832 +20600,187 @@ static PyTypeObject __pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexp static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_Abstract_base_class_for_solvers, __pyx_k_Abstract_base_class_for_solvers, sizeof(__pyx_k_Abstract_base_class_for_solvers), 0, 0, 1, 0}, - {&__pyx_n_s_BacktrackingSolver, __pyx_k_BacktrackingSolver, sizeof(__pyx_k_BacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver___init, __pyx_k_BacktrackingSolver___init, sizeof(__pyx_k_BacktrackingSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolution, __pyx_k_BacktrackingSolver_getSolution, sizeof(__pyx_k_BacktrackingSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolutionIt, __pyx_k_BacktrackingSolver_getSolutionIt, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt), 0, 0, 1, 1}, - {&__pyx_n_s_BacktrackingSolver_getSolutions, __pyx_k_BacktrackingSolver_getSolutions, sizeof(__pyx_k_BacktrackingSolver_getSolutions), 0, 0, 1, 1}, - {&__pyx_kp_u_Can_t_happen, __pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0, 0}, - {&__pyx_n_s_CompilableFunctionConstraint, __pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_Constraint, __pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 0, 1, 1}, - {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionConstraint, __pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 0, 1, 1}, - {&__pyx_n_s_FunctionType, __pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 0, 1, 1}, - {&__pyx_n_s_Hashable, __pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver, __pyx_k_MinConflictsSolver, sizeof(__pyx_k_MinConflictsSolver), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver___init, __pyx_k_MinConflictsSolver___init, sizeof(__pyx_k_MinConflictsSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_MinConflictsSolver_getSolution, __pyx_k_MinConflictsSolver_getSolution, sizeof(__pyx_k_MinConflictsSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver, __pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver___in, __pyx_k_OptimizedBacktrackingSolver___in, sizeof(__pyx_k_OptimizedBacktrackingSolver___in), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS, __pyx_k_OptimizedBacktrackingSolver_getS, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_2, __pyx_k_OptimizedBacktrackingSolver_getS_2, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_2), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_3, __pyx_k_OptimizedBacktrackingSolver_getS_3, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_3), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_4, __pyx_k_OptimizedBacktrackingSolver_getS_4, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_4), 0, 0, 1, 1}, - {&__pyx_n_s_OptimizedBacktrackingSolver_getS_5, __pyx_k_OptimizedBacktrackingSolver_getS_5, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_5), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver, __pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver___init, __pyx_k_ParallelSolver___init, sizeof(__pyx_k_ParallelSolver___init), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolution, __pyx_k_ParallelSolver_getSolution, sizeof(__pyx_k_ParallelSolver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutions, __pyx_k_ParallelSolver_getSolutions, sizeof(__pyx_k_ParallelSolver_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList, __pyx_k_ParallelSolver_getSolutionsList, sizeof(__pyx_k_ParallelSolver_getSolutionsList), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList_2, __pyx_k_ParallelSolver_getSolutionsList_2, sizeof(__pyx_k_ParallelSolver_getSolutionsList_2), 0, 0, 1, 1}, - {&__pyx_n_s_ParallelSolver_getSolutionsList_3, __pyx_k_ParallelSolver_getSolutionsList_3, sizeof(__pyx_k_ParallelSolver_getSolutionsList_3), 0, 0, 1, 1}, - {&__pyx_kp_s_Problem_solver_based_on_the_mini, __pyx_k_Problem_solver_based_on_the_mini, sizeof(__pyx_k_Problem_solver_based_on_the_mini), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_that_executes_all, __pyx_k_Problem_solver_that_executes_all, sizeof(__pyx_k_Problem_solver_that_executes_all), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_with_backtracking, __pyx_k_Problem_solver_with_backtracking, sizeof(__pyx_k_Problem_solver_with_backtracking), 0, 0, 1, 0}, - {&__pyx_kp_s_Problem_solver_with_backtracking_2, __pyx_k_Problem_solver_with_backtracking_2, sizeof(__pyx_k_Problem_solver_with_backtracking_2), 0, 0, 1, 0}, - {&__pyx_n_s_ProcessPoolExecutor, __pyx_k_ProcessPoolExecutor, sizeof(__pyx_k_ProcessPoolExecutor), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver, __pyx_k_RecursiveBacktrackingSolver, sizeof(__pyx_k_RecursiveBacktrackingSolver), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver___in, __pyx_k_RecursiveBacktrackingSolver___in, sizeof(__pyx_k_RecursiveBacktrackingSolver___in), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_getS, __pyx_k_RecursiveBacktrackingSolver_getS, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_getS_2, __pyx_k_RecursiveBacktrackingSolver_getS_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS_2), 0, 0, 1, 1}, - {&__pyx_n_s_RecursiveBacktrackingSolver_recu, __pyx_k_RecursiveBacktrackingSolver_recu, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu), 0, 0, 1, 1}, - {&__pyx_kp_s_Recursive_problem_solver_with_ba, __pyx_k_Recursive_problem_solver_with_ba, sizeof(__pyx_k_Recursive_problem_solver_with_ba), 0, 0, 1, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_Solver, __pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolution, __pyx_k_Solver_getSolution, sizeof(__pyx_k_Solver_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolutionIter, __pyx_k_Solver_getSolutionIter, sizeof(__pyx_k_Solver_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_Solver_getSolutions, __pyx_k_Solver_getSolutions, sizeof(__pyx_k_Solver_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s_ThreadPoolExecutor, __pyx_k_ThreadPoolExecutor, sizeof(__pyx_k_ThreadPoolExecutor), 0, 0, 1, 1}, - {&__pyx_n_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 1}, - {&__pyx_n_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 1}, - {&__pyx_n_s__61, __pyx_k__61, sizeof(__pyx_k__61), 0, 0, 1, 1}, - {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, - {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, - {&__pyx_n_s_arcconstraints, __pyx_k_arcconstraints, sizeof(__pyx_k_arcconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_arcs, __pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 0, 1, 1}, - {&__pyx_n_s_arcsvariable, __pyx_k_arcsvariable, sizeof(__pyx_k_arcsvariable), 0, 0, 1, 1}, - {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, - {&__pyx_n_s_assignment, __pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_assignments, __pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 0, 1, 1}, - {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, - {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1}, - {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, - {&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1}, - {&__pyx_n_s_choice, __pyx_k_choice, sizeof(__pyx_k_choice), 0, 0, 1, 1}, - {&__pyx_n_s_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 0, 1, 1}, - {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, - {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_co_consts, __pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 0, 1, 1}, - {&__pyx_n_s_code_object, __pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 0, 1, 1}, - {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1}, - {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, - {&__pyx_n_s_compile_to_function, __pyx_k_compile_to_function, sizeof(__pyx_k_compile_to_function), 0, 0, 1, 1}, - {&__pyx_n_s_concurrent_futures, __pyx_k_concurrent_futures, sizeof(__pyx_k_concurrent_futures), 0, 0, 1, 1}, - {&__pyx_n_s_conflicted, __pyx_k_conflicted, sizeof(__pyx_k_conflicted), 0, 0, 1, 1}, - {&__pyx_n_s_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_constraints, __pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_domain, __pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_lookup, __pyx_k_constraint_lookup, sizeof(__pyx_k_constraint_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_constraint_solvers, __pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 0, 1, 1}, - {&__pyx_kp_s_constraint_solvers_py, __pyx_k_constraint_solvers_py, sizeof(__pyx_k_constraint_solvers_py), 0, 0, 1, 0}, - {&__pyx_n_s_constraints, __pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 0, 1, 1}, - {&__pyx_n_s_constraints_lookup, __pyx_k_constraints_lookup, sizeof(__pyx_k_constraints_lookup), 0, 0, 1, 1}, - {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, - {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, - {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, - {&__pyx_kp_s_dict_Hashable_Domain, __pyx_k_dict_Hashable_Domain, sizeof(__pyx_k_dict_Hashable_Domain), 0, 0, 1, 0}, - {&__pyx_kp_s_dict_Hashable_any, __pyx_k_dict_Hashable_any, sizeof(__pyx_k_dict_Hashable_any), 0, 0, 1, 0}, - {&__pyx_kp_s_dict_Hashable_list_tuple_Constra, __pyx_k_dict_Hashable_list_tuple_Constra, sizeof(__pyx_k_dict_Hashable_list_tuple_Constra), 0, 0, 1, 0}, - {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, - {&__pyx_n_s_doArc8, __pyx_k_doArc8, sizeof(__pyx_k_doArc8), 0, 0, 1, 1}, - {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, - {&__pyx_kp_u_doesn_t_provide_iteration, __pyx_k_doesn_t_provide_iteration, sizeof(__pyx_k_doesn_t_provide_iteration), 0, 1, 0, 0}, - {&__pyx_n_s_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 0, 0, 1, 1}, - {&__pyx_n_s_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 0, 0, 1, 1}, - {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, - {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1}, - {&__pyx_n_u_exec, __pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 0, 1}, - {&__pyx_n_s_executor, __pyx_k_executor, sizeof(__pyx_k_executor), 0, 0, 1, 1}, - {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1}, - {&__pyx_n_s_first_value, __pyx_k_first_value, sizeof(__pyx_k_first_value), 0, 0, 1, 1}, - {&__pyx_n_s_first_var, __pyx_k_first_var, sizeof(__pyx_k_first_var), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck, __pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 0, 1, 1}, - {&__pyx_n_s_forwardcheck_2, __pyx_k_forwardcheck_2, sizeof(__pyx_k_forwardcheck_2), 0, 0, 1, 1}, - {&__pyx_n_s_fromkeys, __pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 0, 1, 1}, - {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, - {&__pyx_n_s_func_2, __pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 0, 1, 1}, - {&__pyx_n_s_func_string, __pyx_k_func_string, sizeof(__pyx_k_func_string), 0, 0, 1, 1}, - {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, - {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, - {&__pyx_n_s_getArcs, __pyx_k_getArcs, sizeof(__pyx_k_getArcs), 0, 0, 1, 1}, - {&__pyx_n_s_getSolution, __pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionIter, __pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutions, __pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 0, 1, 1}, - {&__pyx_n_s_getSolutionsList, __pyx_k_getSolutionsList, sizeof(__pyx_k_getSolutionsList), 0, 0, 1, 1}, - {&__pyx_n_s_getSortedVariables, __pyx_k_getSortedVariables, sizeof(__pyx_k_getSortedVariables), 0, 0, 1, 1}, - {&__pyx_n_s_hideValue, __pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, - {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1}, - {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, - {&__pyx_kp_u_is_an_abstract_class, __pyx_k_is_an_abstract_class, sizeof(__pyx_k_is_an_abstract_class), 0, 1, 0, 0}, - {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid, __pyx_k_is_valid, sizeof(__pyx_k_is_valid), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid_locals_genexpr, __pyx_k_is_valid_locals_genexpr, sizeof(__pyx_k_is_valid_locals_genexpr), 0, 0, 1, 1}, - {&__pyx_n_s_is_valid_locals_genexpr_locals_g, __pyx_k_is_valid_locals_genexpr_locals_g, sizeof(__pyx_k_is_valid_locals_genexpr_locals_g), 0, 0, 1, 1}, - {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, - {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1}, - {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, - {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1}, - {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, - {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, - {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1}, - {&__pyx_kp_s_list_Hashable, __pyx_k_list_Hashable, sizeof(__pyx_k_list_Hashable), 0, 0, 1, 0}, - {&__pyx_kp_s_list_dict_Hashable_any, __pyx_k_list_dict_Hashable_any, sizeof(__pyx_k_list_dict_Hashable_any), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple, __pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 0, 1, 0}, - {&__pyx_kp_s_list_tuple_Constraint_Hashable, __pyx_k_list_tuple_Constraint_Hashable, sizeof(__pyx_k_list_tuple_Constraint_Hashable), 0, 0, 1, 0}, - {&__pyx_n_s_local_assignment, __pyx_k_local_assignment, sizeof(__pyx_k_local_assignment), 0, 0, 1, 1}, - {&__pyx_n_s_lst, __pyx_k_lst, sizeof(__pyx_k_lst), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, - {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, - {&__pyx_n_s_mincount, __pyx_k_mincount, sizeof(__pyx_k_mincount), 0, 0, 1, 1}, - {&__pyx_n_s_minvalues, __pyx_k_minvalues, sizeof(__pyx_k_minvalues), 0, 0, 1, 1}, - {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, - {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1}, - {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_kp_u_only_provides_all_solutions, __pyx_k_only_provides_all_solutions, sizeof(__pyx_k_only_provides_all_solutions), 0, 1, 0, 0}, - {&__pyx_n_s_otherdomain, __pyx_k_otherdomain, sizeof(__pyx_k_otherdomain), 0, 0, 1, 1}, - {&__pyx_n_s_othervalue, __pyx_k_othervalue, sizeof(__pyx_k_othervalue), 0, 0, 1, 1}, - {&__pyx_n_s_othervariable, __pyx_k_othervariable, sizeof(__pyx_k_othervariable), 0, 0, 1, 1}, - {&__pyx_n_s_parallel_pool, __pyx_k_parallel_pool, sizeof(__pyx_k_parallel_pool), 0, 0, 1, 1}, - {&__pyx_n_s_parallel_worker, __pyx_k_parallel_worker, sizeof(__pyx_k_parallel_worker), 0, 0, 1, 1}, - {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, - {&__pyx_n_s_popState, __pyx_k_popState, sizeof(__pyx_k_popState), 0, 0, 1, 1}, - {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1}, - {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, - {&__pyx_n_s_process_mode, __pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 0, 1, 1}, - {&__pyx_n_s_process_mode_2, __pyx_k_process_mode_2, sizeof(__pyx_k_process_mode_2), 0, 0, 1, 1}, - {&__pyx_kp_u_provides_only_a_single_solution, __pyx_k_provides_only_a_single_solution, sizeof(__pyx_k_provides_only_a_single_solution), 0, 1, 0, 0}, - {&__pyx_n_s_pushState, __pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 0, 1, 1}, - {&__pyx_n_s_pushdomains, __pyx_k_pushdomains, sizeof(__pyx_k_pushdomains), 0, 0, 1, 1}, - {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, - {&__pyx_n_s_queue, __pyx_k_queue, sizeof(__pyx_k_queue), 0, 0, 1, 1}, - {&__pyx_n_s_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 0, 1, 1}, - {&__pyx_n_s_rand_2, __pyx_k_rand_2, sizeof(__pyx_k_rand_2), 0, 0, 1, 1}, - {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_recursiveBacktracking, __pyx_k_recursiveBacktracking, sizeof(__pyx_k_recursiveBacktracking), 0, 0, 1, 1}, - {&__pyx_n_s_remaining_vars, __pyx_k_remaining_vars, sizeof(__pyx_k_remaining_vars), 0, 0, 1, 1}, - {&__pyx_n_s_requires_pickling, __pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1}, - {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1}, - {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, - {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1}, - {&__pyx_n_s_sequential_optimized_backtrack, __pyx_k_sequential_optimized_backtrack, sizeof(__pyx_k_sequential_optimized_backtrack), 0, 0, 1, 1}, - {&__pyx_n_s_sequential_recursive_backtrack, __pyx_k_sequential_recursive_backtrack, sizeof(__pyx_k_sequential_recursive_backtrack), 0, 0, 1, 1}, - {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1}, - {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1}, - {&__pyx_n_s_shuffle, __pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 0, 1, 1}, - {&__pyx_n_s_single, __pyx_k_single, sizeof(__pyx_k_single), 0, 0, 1, 1}, - {&__pyx_n_s_solutions, __pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 0, 1, 1}, - {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, - {&__pyx_n_s_sorted_variables, __pyx_k_sorted_variables, sizeof(__pyx_k_sorted_variables), 0, 0, 1, 1}, - {&__pyx_n_s_sorted_vars, __pyx_k_sorted_vars, sizeof(__pyx_k_sorted_vars), 0, 0, 1, 1}, - {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, - {&__pyx_n_s_steps, __pyx_k_steps, sizeof(__pyx_k_steps), 0, 0, 1, 1}, - {&__pyx_n_s_steps_2, __pyx_k_steps_2, sizeof(__pyx_k_steps_2), 0, 0, 1, 1}, - {&__pyx_kp_u_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0, 0}, - {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, - {&__pyx_kp_s_tuple_bool_dict_Hashable_Domain, __pyx_k_tuple_bool_dict_Hashable_Domain, sizeof(__pyx_k_tuple_bool_dict_Hashable_Domain), 0, 0, 1, 0}, - {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, - {&__pyx_n_s_unassigned_vars, __pyx_k_unassigned_vars, sizeof(__pyx_k_unassigned_vars), 0, 0, 1, 1}, - {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1}, - {&__pyx_n_s_vals, __pyx_k_vals, sizeof(__pyx_k_vals), 0, 0, 1, 1}, - {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, - {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, - {&__pyx_n_s_var, __pyx_k_var, sizeof(__pyx_k_var), 0, 0, 1, 1}, - {&__pyx_n_s_variable, __pyx_k_variable, sizeof(__pyx_k_variable), 0, 0, 1, 1}, - {&__pyx_n_s_variable1, __pyx_k_variable1, sizeof(__pyx_k_variable1), 0, 0, 1, 1}, - {&__pyx_n_s_variable2, __pyx_k_variable2, sizeof(__pyx_k_variable2), 0, 0, 1, 1}, - {&__pyx_n_s_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 0, 0, 1, 1}, - {&__pyx_n_s_vconstraints, __pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 0, 1, 1}, - {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 87, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 221, __pyx_L1_error) - __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 227, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 573, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 646, __pyx_L1_error) - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 668, __pyx_L1_error) - __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_n_s_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 704, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "constraint/solvers.py":48 - * if domain: - * # changed = False - * for value in domain[:]: # <<<<<<<<<<<<<< - * assignments[variable] = value - * if otherdomain: - */ - __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 48, __pyx_L1_error) - __Pyx_GOTREF(__pyx_slice_); - __Pyx_GIVEREF(__pyx_slice_); - - /* "constraint/solvers.py":221 - * queue.append((variable, values, pushdomains)) - * - * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 221, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "constraint/solvers.py":680 - * # execute in parallel - * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor - * with parallel_pool() as executor: # <<<<<<<<<<<<<< - * # results = map(parallel_worker, args) # sequential - * results = executor.map(parallel_worker, args, chunksize=1) # parallel - */ - __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 680, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "constraint/solvers.py":13 - * - * - * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< - * """Return a dictionary mapping pairs (arcs) of constrained variables. - * - */ - __pyx_tuple__8 = PyTuple_Pack(8, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_arcs, __pyx_n_s_x, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable1, __pyx_n_s_variable2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getArcs, 13, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 13, __pyx_L1_error) - - /* "constraint/solvers.py":28 - * - * - * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< - * """Perform the ARC-8 arc checking algorithm and prune domains. - * - */ - __pyx_tuple__11 = PyTuple_Pack(15, __pyx_n_s_arcs, __pyx_n_s_domains, __pyx_n_s_assignments, __pyx_n_s_check, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_domain, __pyx_n_s_arcsvariable, __pyx_n_s_othervariable, __pyx_n_s_arcconstraints, __pyx_n_s_otherdomain, __pyx_n_s_value, __pyx_n_s_othervalue, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 28, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_doArc8, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 28, __pyx_L1_error) - - /* "constraint/solvers.py":77 - * requires_pickling = False - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return one solution for the given problem. - * - */ - __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__13); - __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 77, __pyx_L1_error) - - /* "constraint/solvers.py":89 - * raise NotImplementedError(msg) - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return all solutions for the given problem. - * - */ - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 89, __pyx_L1_error) - - /* "constraint/solvers.py":101 - * raise NotImplementedError(msg) - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return an iterator for the solutions of the given problem. - * - */ - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 101, __pyx_L1_error) - - /* "constraint/solvers.py":143 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_forwardcheck); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_tuple__19 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__19); - __Pyx_GIVEREF(__pyx_tuple__19); - - /* "constraint/solvers.py":153 - * self._forwardcheck = forwardcheck - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * forwardcheck = self._forwardcheck - * assignments = {} - */ - __pyx_tuple__20 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_forwardcheck, __pyx_n_s_assignments, __pyx_n_s_queue, __pyx_n_s_lst, __pyx_n_s_item, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_pushdomains, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable, __pyx_n_s_x); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 153, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 153, __pyx_L1_error) - - /* "constraint/solvers.py":223 - * raise RuntimeError("Can't happen") - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * iter = self.getSolutionIter(domains, constraints, vconstraints) - * try: - */ - __pyx_tuple__21 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_iter); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 223, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__21); - __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 223, __pyx_L1_error) - - /* "constraint/solvers.py":230 - * return None - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return list(self.getSolutionIter(domains, constraints, vconstraints)) - * - */ - __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 230, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__23); - __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 230, __pyx_L1_error) - - /* "constraint/solvers.py":266 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 266, __pyx_L1_error) - - /* "constraint/solvers.py":276 - * self._forwardcheck = forwardcheck - * - * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * forwardcheck = self._forwardcheck - * assignments = {} - */ - __pyx_tuple__26 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_forwardcheck, __pyx_n_s_assignments, __pyx_n_s_sorted_variables, __pyx_n_s_queue, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_pushdomains, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_x); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 276, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionIter, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 276, __pyx_L1_error) - - /* "constraint/solvers.py":344 - * raise RuntimeError("Can't happen") - * - * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< - * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. - * - */ - __pyx_tuple__27 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_assignments, __pyx_n_s_queue, __pyx_n_s_solutions, __pyx_n_s_sorted_variables, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 344, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__27); - __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutionsList, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 344, __pyx_L1_error) - - /* "constraint/solvers.py":401 - * queue.append((variable, values)) - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * if self._forwardcheck: - * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 401, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 401, __pyx_L1_error) - - /* "constraint/solvers.py":406 - * return self.getSolutionsList(domains, vconstraints) - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * iter = self.getSolutionIter(domains, constraints, vconstraints) - * try: - */ - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 406, __pyx_L1_error) - - /* "constraint/solvers.py":413 - * return None - * - * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< - * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. - * - */ - __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_lst, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 413, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSortedVariables, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 413, __pyx_L1_error) - - /* "constraint/solvers.py":456 - * """ - * - * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 456, __pyx_L1_error) - - /* "constraint/solvers.py":466 - * self._forwardcheck = forwardcheck - * - * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< - * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. - * - */ - __pyx_tuple__34 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_solutions, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_assignments, __pyx_n_s_single, __pyx_n_s_lst, __pyx_n_s_item, __pyx_n_s_variable, __pyx_n_s_forwardcheck, __pyx_n_s_pushdomains, __pyx_n_s_value, __pyx_n_s_domain, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_variable, __pyx_n_s_x); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 17, 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_constraint_solvers_py, __pyx_n_s_recursiveBacktracking, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 466, __pyx_L1_error) - - /* "constraint/solvers.py":519 - * return solutions - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) - * return solutions and solutions[0] or None - */ - __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_solutions); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__36); - __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 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_constraint_solvers_py, __pyx_n_s_getSolution, 519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 519, __pyx_L1_error) - - /* "constraint/solvers.py":523 - * return solutions and solutions[0] or None - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return self.recursiveBacktracking([], domains, vconstraints, {}, False) - * - */ - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 523, __pyx_L1_error) - - /* "constraint/solvers.py":554 - * """ - * - * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< - * """Initialization method. - * - */ - __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_steps, __pyx_n_s_rand); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_init, 554, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_tuple__41 = PyTuple_Pack(2, ((PyObject *)__pyx_int_1000), Py_None); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - - /* "constraint/solvers.py":566 - * self._rand = rand - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * choice = self._rand.choice if self._rand is not None else random.choice - * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle - */ - __pyx_tuple__42 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_constraints, __pyx_n_s_vconstraints, __pyx_n_s_choice, __pyx_n_s_shuffle, __pyx_n_s_assignments, __pyx_n_s_variable, __pyx_n_s__10, __pyx_n_s_conflicted, __pyx_n_s_lst, __pyx_n_s_constraint, __pyx_n_s_variables, __pyx_n_s_mincount, __pyx_n_s_minvalues, __pyx_n_s_value, __pyx_n_s_count); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 566, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__42); - __Pyx_GIVEREF(__pyx_tuple__42); - __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 17, 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_constraint_solvers_py, __pyx_n_s_getSolution, 566, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 566, __pyx_L1_error) - - /* "constraint/solvers.py":644 - * """ # noqa E501 - * - * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< - * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" - * super().__init__() - */ - __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_process_mode); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__44); - __Pyx_GIVEREF(__pyx_tuple__44); - __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 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_constraint_solvers_py, __pyx_n_s_init, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 644, __pyx_L1_error) - __pyx_tuple__46 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 644, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__46); - __Pyx_GIVEREF(__pyx_tuple__46); - - /* "constraint/solvers.py":650 - * self.requires_pickling = process_mode - * - * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< - * """Return one solution for the given problem. - * - */ - __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolution, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 650, __pyx_L1_error) - - /* "constraint/solvers.py":662 - * raise NotImplementedError(msg) - * - * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< - * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" - * # Precompute constraints lookup per variable - */ - __pyx_tuple__48 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_domains, __pyx_n_s_vconstraints, __pyx_n_s_constraint_lookup, __pyx_n_s_sorted_vars, __pyx_n_s_first_var, __pyx_n_s_remaining_vars, __pyx_n_s_args, __pyx_n_s_solutions, __pyx_n_s_parallel_pool, __pyx_n_s_executor, __pyx_n_s_results, __pyx_n_s_result, __pyx_n_s_var, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__48); - __Pyx_GIVEREF(__pyx_tuple__48); - __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 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_constraint_solvers_py, __pyx_n_s_getSolutionsList, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 662, __pyx_L1_error) - - /* "constraint/solvers.py":688 - * return solutions - * - * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< - * return self.getSolutionsList(domains, vconstraints) - * - */ - __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_getSolutions, 688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 688, __pyx_L1_error) - - /* "constraint/solvers.py":693 - * ### Helper functions for parallel solver - * - * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< - * """Check if all constraints are satisfied given the current assignment.""" - * return all( - */ - __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_assignment, __pyx_n_s_constraints_lookup, __pyx_n_s_domains, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 693, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__51); - __Pyx_GIVEREF(__pyx_tuple__51); - __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_is_valid, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 693, __pyx_L1_error) - - /* "constraint/solvers.py":701 - * ) - * - * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< - * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" - * func_string = constraint._func - */ - __pyx_tuple__53 = PyTuple_Pack(4, __pyx_n_s_constraint, __pyx_n_s_func_string, __pyx_n_s_code_object, __pyx_n_s_func_2); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 701, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__53); - __Pyx_GIVEREF(__pyx_tuple__53); - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_compile_to_function, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 701, __pyx_L1_error) - - /* "constraint/solvers.py":708 - * return FunctionConstraint(func) - * - * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< - * """Sequential recursive backtracking function for subproblems.""" - * if not unassigned_vars: - */ - __pyx_tuple__55 = PyTuple_Pack(8, __pyx_n_s_assignment, __pyx_n_s_unassigned_vars, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_var, __pyx_n_s_remaining_vars, __pyx_n_s_solutions, __pyx_n_s_value); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_sequential_recursive_backtrack, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 708, __pyx_L1_error) - - /* "constraint/solvers.py":724 - * return solutions - * - * def sequential_optimized_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< - * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" - * # Does not do forwardcheck for simplicity - */ - __pyx_tuple__57 = PyTuple_Pack(12, __pyx_n_s_assignment, __pyx_n_s_unassigned_vars, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_assignments, __pyx_n_s_sorted_variables, __pyx_n_s_queue, __pyx_n_s_solutions, __pyx_n_s_variable, __pyx_n_s_values, __pyx_n_s_constraint, __pyx_n_s_variables); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 724, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_sequential_optimized_backtrack, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 724, __pyx_L1_error) - - /* "constraint/solvers.py":774 - * - * - * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< - * """Worker function for parallel execution on first variable.""" - * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ - __pyx_tuple__59 = PyTuple_Pack(12, __pyx_n_s_args, __pyx_n_s_process_mode, __pyx_n_s_domains, __pyx_n_s_constraint_lookup, __pyx_n_s_first_var, __pyx_n_s_first_value, __pyx_n_s_remaining_vars, __pyx_n_s_local_assignment, __pyx_n_s_var, __pyx_n_s_constraints, __pyx_n_s_constraint, __pyx_n_s_vals); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__59); - __Pyx_GIVEREF(__pyx_tuple__59); - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_constraint_solvers_py, __pyx_n_s_parallel_worker, 774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get; - __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys; - __pyx_umethod_PyDict_Type_setdefault.type = (PyObject*)&PyDict_Type; - __pyx_umethod_PyDict_Type_setdefault.method_name = &__pyx_n_s_setdefault; - __pyx_umethod_PyList_Type_copy.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_copy.method_name = &__pyx_n_s_copy; - __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; - __pyx_umethod_PyList_Type_pop.method_name = &__pyx_n_s_pop; - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter)) __PYX_ERR(0, 153, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter)) __PYX_ERR(0, 153, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct__getSolutionIter; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter) < 0) __PYX_ERR(0, 153, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct__getSolutionIter->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)) __PYX_ERR(0, 276, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter)) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter = &__pyx_type_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter) < 0) __PYX_ERR(0, 276, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_1_getSolutionIter->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)) __PYX_ERR(0, 662, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList)) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList = &__pyx_type_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList) < 0) __PYX_ERR(0, 662, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_2_getSolutionsList->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 675, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 675, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 675, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_3_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid)) __PYX_ERR(0, 693, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid)) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid = &__pyx_type_10constraint_7solvers___pyx_scope_struct_4_is_valid; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid) < 0) __PYX_ERR(0, 693, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_4_is_valid->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 696, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 696, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 696, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_5_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 698, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 698, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr_spec, __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) #else - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr = &__pyx_type_10constraint_7solvers___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 698, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_print = 0; + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_mstate->__pyx_ptype_10constraint_7solvers___pyx_scope_struct_6_genexpr->tp_getattro = PyObject_GenericGetAttr; } #endif __Pyx_RefNannyFinishContext(); @@ -22335,38 +20790,42 @@ static int __Pyx_modinit_type_init_code(void) { return -1; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_solvers(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_solvers}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_NOT_USED}, + #endif {0, NULL} }; #endif @@ -22384,7 +20843,7 @@ namespace { #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + sizeof(__pyx_mstatetype), /* m_size */ #else -1, /* m_size */ #endif @@ -22407,50 +20866,37 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * -#else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initsolvers(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initsolvers(void) -#else __Pyx_PyMODINIT_FUNC PyInit_solvers(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_solvers(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { + if (__Pyx_VersionSanityCheck() < 0) return NULL; return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif { PyErr_SetString( PyExc_ImportError, @@ -22514,12 +20960,15 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_module) #endif -#endif { + #if !CYTHON_PEP489_MULTI_PHASE_INIT + if (__Pyx_VersionSanityCheck() < 0) return NULL; + #endif int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; @@ -22537,7 +20986,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod PyErr_SetString(PyExc_RuntimeError, "Module 'solvers' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ @@ -22545,10 +20994,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("solvers", __pyx_methods, __pyx_k_Module_containing_the_code_for_t, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE + #if CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); @@ -22560,13 +21006,18 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_solvers(PyObject *__pyx_pyinit_mod __pyx_m = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_NOT_USED); + #endif #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -22576,14 +21027,15 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_solvers(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_solvers", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -22599,48 +21051,34 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) stringtab_initialized = 1; if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_constraint__solvers) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "constraint.solvers")) { if (unlikely((PyDict_SetItemString(modules, "constraint.solvers", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_type_import_code(); - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(__pyx_mstate); + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "constraint/solvers.py":3 * """Module containing the code for the problem solvers.""" @@ -22648,10 +21086,10 @@ if (!__Pyx_RefNanny) { * import random # <<<<<<<<<<<<<< * from types import FunctionType * from constraint.domain import Domain - */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_random, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_random, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_random, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":4 @@ -22660,18 +21098,15 @@ if (!__Pyx_RefNanny) { * from types import FunctionType # <<<<<<<<<<<<<< * from constraint.domain import Domain * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_FunctionType); - __Pyx_GIVEREF(__pyx_n_s_FunctionType); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_FunctionType)) __PYX_ERR(0, 4, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_types, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionType, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22681,18 +21116,15 @@ if (!__Pyx_RefNanny) { * from constraint.domain import Domain # <<<<<<<<<<<<<< * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint * from collections.abc import Hashable - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Domain); - __Pyx_GIVEREF(__pyx_n_s_Domain); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Domain)) __PYX_ERR(0, 5, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_domain, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Domain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Domain, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22702,32 +21134,23 @@ if (!__Pyx_RefNanny) { * from constraint.constraints import Constraint, FunctionConstraint, CompilableFunctionConstraint # <<<<<<<<<<<<<< * from collections.abc import Hashable * - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Constraint); - __Pyx_GIVEREF(__pyx_n_s_Constraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Constraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_FunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_FunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_FunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_CompilableFunctionConstraint); - __Pyx_GIVEREF(__pyx_n_s_CompilableFunctionConstraint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_CompilableFunctionConstraint)) __PYX_ERR(0, 6, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_constraint_constraints, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Constraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Constraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22737,18 +21160,15 @@ if (!__Pyx_RefNanny) { * from collections.abc import Hashable # <<<<<<<<<<<<<< * * # for parallel solver - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_n_s_Hashable); - __Pyx_GIVEREF(__pyx_n_s_Hashable); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Hashable)) __PYX_ERR(0, 7, __pyx_L1_error); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections_abc, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Hashable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Hashable, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -22758,25 +21178,19 @@ if (!__Pyx_RefNanny) { * from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor # <<<<<<<<<<<<<< * * - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(2, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_ProcessPoolExecutor); - __Pyx_GIVEREF(__pyx_n_s_ProcessPoolExecutor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ProcessPoolExecutor)) __PYX_ERR(0, 10, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_ThreadPoolExecutor); - __Pyx_GIVEREF(__pyx_n_s_ThreadPoolExecutor); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ThreadPoolExecutor)) __PYX_ERR(0, 10, __pyx_L1_error); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_concurrent_futures, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_concurrent_futures, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ProcessPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProcessPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ProcessPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ThreadPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ThreadPoolExecutor, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22786,17 +21200,17 @@ if (!__Pyx_RefNanny) { * def getArcs(domains: dict, constraints: list[tuple]) -> dict: # <<<<<<<<<<<<<< * """Return a dictionary mapping pairs (arcs) of constrained variables. * - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_1getArcs, 0, __pyx_n_s_getArcs, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_1getArcs, 0, __pyx_mstate_global->__pyx_n_u_getArcs, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_getArcs, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_getArcs, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":28 @@ -22805,18 +21219,18 @@ if (!__Pyx_RefNanny) { * def doArc8(arcs: dict, domains: dict, assignments: dict) -> bool: # <<<<<<<<<<<<<< * """Perform the ARC-8 arc checking algorithm and prune domains. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arcs, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_assignments, __pyx_n_s_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 28, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_3doArc8, 0, __pyx_n_s_doArc8, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_arcs, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assignments, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_3doArc8, 0, __pyx_mstate_global->__pyx_n_u_doArc8, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_doArc8, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doArc8, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":72 @@ -22825,8 +21239,8 @@ if (!__Pyx_RefNanny) { * class Solver: # <<<<<<<<<<<<<< * """Abstract base class for solvers.""" * - */ - __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Solver, __pyx_n_s_Solver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Abstract_base_class_for_solvers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_n_u_Solver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Abstract_base_class_for_solvers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "constraint/solvers.py":75 @@ -22835,8 +21249,8 @@ if (!__Pyx_RefNanny) { * requires_pickling = False # <<<<<<<<<<<<<< * * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): - */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_requires_pickling, Py_False) < 0) __PYX_ERR(0, 75, __pyx_L1_error) +*/ + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_requires_pickling, Py_False) < 0) __PYX_ERR(0, 75, __pyx_L1_error) /* "constraint/solvers.py":77 * requires_pickling = False @@ -22844,17 +21258,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_1getSolution, 0, __pyx_n_s_Solver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_1getSolution, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":89 @@ -22863,17 +21277,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return all solutions for the given problem. * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_3getSolutions, 0, __pyx_n_s_Solver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_3getSolutions, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getSolutions, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":101 @@ -22882,17 +21296,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return an iterator for the solutions of the given problem. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter, 0, __pyx_n_s_Solver_getSolutionIter, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_6Solver_5getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_Solver_getSolutionIter, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":72 @@ -22901,10 +21315,10 @@ if (!__Pyx_RefNanny) { * class Solver: # <<<<<<<<<<<<<< * """Abstract base class for solvers.""" * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Solver, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_Solver, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Solver, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Solver, __pyx_t_4) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -22914,19 +21328,17 @@ if (!__Pyx_RefNanny) { * class BacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_BacktrackingSolver, __pyx_n_s_BacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_with_backtracking); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 114, __pyx_L1_error) @@ -22939,11 +21351,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__, 0, __pyx_n_s_BacktrackingSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":153 @@ -22952,17 +21364,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, 0, __pyx_n_s_BacktrackingSolver_getSolutionIt, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutionIt, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":223 @@ -22971,17 +21383,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution, 0, __pyx_n_s_BacktrackingSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_6getSolution, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 223, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < 0) __PYX_ERR(0, 223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":230 @@ -22990,17 +21402,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return list(self.getSolutionIter(domains, constraints, vconstraints)) * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions, 0, __pyx_n_s_BacktrackingSolver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18BacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 230, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_6) < 0) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":114 @@ -23009,10 +21421,10 @@ if (!__Pyx_RefNanny) { * class BacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities. * - */ - __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_BacktrackingSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_BacktrackingSolver, __pyx_t_6) < 0) __PYX_ERR(0, 114, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_BacktrackingSolver, __pyx_t_6) < 0) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -23024,19 +21436,17 @@ if (!__Pyx_RefNanny) { * class OptimizedBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_n_s_OptimizedBacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_with_backtracking_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_with_backtracking_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 234, __pyx_L1_error) @@ -23049,11 +21459,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, 0, __pyx_n_s_OptimizedBacktrackingSolver___in, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":276 @@ -23062,17 +21472,17 @@ if (!__Pyx_RefNanny) { * def getSolutionIter(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * forwardcheck = self._forwardcheck * assignments = {} - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_3getSolutionIter, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionIter, __pyx_t_4) < 0) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":344 @@ -23081,17 +21491,17 @@ if (!__Pyx_RefNanny) { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Optimized all-solutions finder that skips forwardchecking and returns the solutions in a list. * - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_return, __pyx_kp_s_list_dict_Hashable_any) < 0) __PYX_ERR(0, 344, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_6getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolutionsList, __pyx_t_2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_2) < 0) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":401 @@ -23100,17 +21510,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * if self._forwardcheck: * return list(self.getSolutionIter(domains, constraints, vconstraints)) - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_3, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_8getSolutions, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolutions, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_4) < 0) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":406 @@ -23119,17 +21529,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * iter = self.getSolutionIter(domains, constraints, vconstraints) * try: - */ +*/ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_4, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_10getSolution, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_4, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":413 @@ -23138,17 +21548,17 @@ if (!__Pyx_RefNanny) { * def getSortedVariables(self, domains: dict, vconstraints: dict) -> list: # <<<<<<<<<<<<<< * """Sorts the list of variables on number of vconstraints to find unassigned variables quicker. * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_list) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, 0, __pyx_n_s_OptimizedBacktrackingSolver_getS_5, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27OptimizedBacktrackingSolver_12getSortedVariables, 0, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver_getS_5, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_getSortedVariables, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_getSortedVariables, __pyx_t_4) < 0) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "constraint/solvers.py":234 @@ -23157,10 +21567,10 @@ if (!__Pyx_RefNanny) { * class OptimizedBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver with backtracking capabilities, implementing several optimizations for increased performance. * - */ - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_OptimizedBacktrackingSolver, __pyx_t_4) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_OptimizedBacktrackingSolver, __pyx_t_4) < 0) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23172,19 +21582,17 @@ if (!__Pyx_RefNanny) { * class RecursiveBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Recursive problem solver with backtracking capabilities. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_n_s_RecursiveBacktrackingSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Recursive_problem_solver_with_ba); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Recursive_problem_solver_with_ba); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_3 != __pyx_t_5) { if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 428, __pyx_L1_error) @@ -23197,11 +21605,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, 0, __pyx_n_s_RecursiveBacktrackingSolver___in, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver___in, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]); + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_5) < 0) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":466 @@ -23210,10 +21618,10 @@ if (!__Pyx_RefNanny) { * def recursiveBacktracking(self, solutions, domains, vconstraints, assignments, single): # <<<<<<<<<<<<<< * """Mix the Degree and Minimum Remaing Values (MRV) heuristics. * - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, 0, __pyx_n_s_RecursiveBacktrackingSolver_recu, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_3recursiveBacktracking, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_recu, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_recursiveBacktracking, __pyx_t_5) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_recursiveBacktracking, __pyx_t_5) < 0) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":519 @@ -23222,17 +21630,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * solutions = self.recursiveBacktracking([], domains, vconstraints, {}, True) * return solutions and solutions[0] or None - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, 0, __pyx_n_s_RecursiveBacktrackingSolver_getS, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_5getSolution, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":523 @@ -23241,17 +21649,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.recursiveBacktracking([], domains, vconstraints, {}, False) * - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, 0, __pyx_n_s_RecursiveBacktrackingSolver_getS_2, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_27RecursiveBacktrackingSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver_getS_2, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_getSolutions, __pyx_t_5) < 0) __PYX_ERR(0, 523, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_5) < 0) __PYX_ERR(0, 523, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":428 @@ -23260,10 +21668,10 @@ if (!__Pyx_RefNanny) { * class RecursiveBacktrackingSolver(Solver): # <<<<<<<<<<<<<< * """Recursive problem solver with backtracking capabilities. * - */ - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RecursiveBacktrackingSolver, __pyx_t_5) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RecursiveBacktrackingSolver, __pyx_t_5) < 0) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -23275,19 +21683,17 @@ if (!__Pyx_RefNanny) { * class MinConflictsSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver based on the minimum conflicts theory. * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_6 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_MinConflictsSolver, __pyx_n_s_MinConflictsSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_based_on_the_mini); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_based_on_the_mini); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_6) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_6) < 0))) __PYX_ERR(0, 527, __pyx_L1_error) @@ -23300,11 +21706,11 @@ if (!__Pyx_RefNanny) { * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< * """Initialization method. * - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__, 0, __pyx_n_s_MinConflictsSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__41); - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[3]); + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 554, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":566 @@ -23313,17 +21719,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * choice = self._rand.choice if self._rand is not None else random.choice * shuffle = self._rand.shuffle if self._rand is not None else random.shuffle - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution, 0, __pyx_n_s_MinConflictsSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_18MinConflictsSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_n_s_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_2) < 0) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "constraint/solvers.py":527 @@ -23332,10 +21738,10 @@ if (!__Pyx_RefNanny) { * class MinConflictsSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver based on the minimum conflicts theory. * - */ - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_MinConflictsSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinConflictsSolver, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MinConflictsSolver, __pyx_t_2) < 0) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -23347,19 +21753,17 @@ if (!__Pyx_RefNanny) { * class ParallelSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Solver); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error); - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_n_s_ParallelSolver, __pyx_n_s_ParallelSolver, (PyObject *) NULL, __pyx_n_s_constraint_solvers, __pyx_kp_s_Problem_solver_that_executes_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_mstate_global->__pyx_n_u_ParallelSolver, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_kp_u_Problem_solver_that_executes_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_3 != __pyx_t_4) { if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 607, __pyx_L1_error) @@ -23374,14 +21778,14 @@ if (!__Pyx_RefNanny) { * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" * super().__init__() - */ - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__, 0, __pyx_n_s_ParallelSolver___init, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error) +*/ + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_1__init__, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver___init, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); PyList_Append(__pyx_t_4, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__46); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_mstate_global->__pyx_tuple[4]); + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_6) < 0) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":650 @@ -23390,17 +21794,17 @@ if (!__Pyx_RefNanny) { * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # <<<<<<<<<<<<<< * """Return one solution for the given problem. * - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution, 0, __pyx_n_s_ParallelSolver_getSolution, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_3getSolution, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolution, __pyx_t_7) < 0) __PYX_ERR(0, 650, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_7) < 0) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":662 @@ -23409,17 +21813,17 @@ if (!__Pyx_RefNanny) { * def getSolutionsList(self, domains: dict[Hashable, Domain], vconstraints: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa: D102, E501 # <<<<<<<<<<<<<< * """Parallelized all-solutions finder using ProcessPoolExecutor for work-stealing.""" * # Precompute constraints lookup per variable - */ +*/ __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vconstraints, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_list_dict_Hashable_any) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList, 0, __pyx_n_s_ParallelSolver_getSolutionsList_3, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_5getSolutionsList, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutionsList_3, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_6, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutionsList, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutionsList, __pyx_t_6) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "constraint/solvers.py":688 @@ -23428,17 +21832,17 @@ if (!__Pyx_RefNanny) { * def getSolutions(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 # <<<<<<<<<<<<<< * return self.getSolutionsList(domains, vconstraints) * - */ +*/ __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_domains, __pyx_n_s_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_constraints, __pyx_kp_s_list_tuple) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_vconstraints, __pyx_n_s_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions, 0, __pyx_n_s_ParallelSolver_getSolutions, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_kp_u_list_tuple) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_vconstraints, __pyx_mstate_global->__pyx_n_u_dict) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_14ParallelSolver_7getSolutions, 0, __pyx_mstate_global->__pyx_n_u_ParallelSolver_getSolutions, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getSolutions, __pyx_t_7) < 0) __PYX_ERR(0, 688, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getSolutions, __pyx_t_7) < 0) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "constraint/solvers.py":607 @@ -23447,12 +21851,12 @@ if (!__Pyx_RefNanny) { * class ParallelSolver(Solver): # <<<<<<<<<<<<<< * """Problem solver that executes all-solution solve in parallel (ProcessPool or ThreadPool mode). * - */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_ParallelSolver, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) +*/ + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__Pyx_CyFunction_InitClassCell(__pyx_t_4, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ParallelSolver, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ParallelSolver, __pyx_t_7) < 0) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -23464,18 +21868,18 @@ if (!__Pyx_RefNanny) { * def is_valid(assignment: dict[Hashable, any], constraints_lookup: list[tuple[Constraint, Hashable]], domains: dict[Hashable, Domain]) -> bool: # noqa E501 # <<<<<<<<<<<<<< * """Check if all constraints are satisfied given the current assignment.""" * return all( - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraints_lookup, __pyx_kp_s_list_tuple_Constraint_Hashable) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 693, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_5is_valid, 0, __pyx_n_s_is_valid, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraints_lookup, __pyx_mstate_global->__pyx_kp_u_list_tuple_Constraint_Hashable) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_5is_valid, 0, __pyx_mstate_global->__pyx_n_u_is_valid, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_valid, __pyx_t_5) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_is_valid, __pyx_t_5) < 0) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":701 @@ -23484,16 +21888,16 @@ if (!__Pyx_RefNanny) { * def compile_to_function(constraint: CompilableFunctionConstraint) -> FunctionConstraint: # <<<<<<<<<<<<<< * """Compile a CompilableFunctionConstraint to a function, wrapped by a FunctionConstraint.""" * func_string = constraint._func - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraint, __pyx_n_s_CompilableFunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_n_s_FunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_7compile_to_function, 0, __pyx_n_s_compile_to_function, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraint, __pyx_mstate_global->__pyx_n_u_CompilableFunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FunctionConstraint) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_7compile_to_function, 0, __pyx_mstate_global->__pyx_n_u_compile_to_function, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_compile_to_function, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compile_to_function, __pyx_t_3) < 0) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":708 @@ -23502,19 +21906,19 @@ if (!__Pyx_RefNanny) { * def sequential_recursive_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential recursive backtracking function for subproblems.""" * if not unassigned_vars: - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unassigned_vars, __pyx_kp_s_list_Hashable) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_constraint_lookup, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack, 0, __pyx_n_s_sequential_recursive_backtrack, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_9sequential_recursive_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sequential_recursive_backtrack, __pyx_t_5) < 0) __PYX_ERR(0, 708, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_recursive_backtrack, __pyx_t_5) < 0) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":724 @@ -23523,19 +21927,19 @@ if (!__Pyx_RefNanny) { * def sequential_optimized_backtrack(assignment: dict[Hashable, any], unassigned_vars: list[Hashable], domains: dict[Hashable, Domain], constraint_lookup: dict[Hashable, list[tuple[Constraint, Hashable]]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Sequential optimized backtracking (as in OptimizedBacktrackingSolver) function for subproblems.""" * # Does not do forwardcheck for simplicity - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_assignment, __pyx_kp_s_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_unassigned_vars, __pyx_kp_s_list_Hashable) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_domains, __pyx_kp_s_dict_Hashable_Domain) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_constraint_lookup, __pyx_kp_s_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_return, __pyx_kp_s_list_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack, 0, __pyx_n_s_sequential_optimized_backtrack, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_assignment, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_unassigned_vars, __pyx_mstate_global->__pyx_kp_u_list_Hashable) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_domains, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_Domain) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraint_lookup, __pyx_mstate_global->__pyx_kp_u_dict_Hashable_list_tuple_Constra) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_11sequential_optimized_backtrack, 0, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_sequential_optimized_backtrack, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sequential_optimized_backtrack, __pyx_t_3) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "constraint/solvers.py":774 @@ -23544,26 +21948,26 @@ if (!__Pyx_RefNanny) { * def parallel_worker(args: tuple[bool, dict[Hashable, Domain], dict[Hashable, list[tuple[Constraint, Hashable]]], Hashable, any, list[Hashable]]) -> list[dict[Hashable, any]]: # noqa E501 # <<<<<<<<<<<<<< * """Worker function for parallel execution on first variable.""" * process_mode, domains, constraint_lookup, first_var, first_value, remaining_vars = args - */ +*/ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_args, __pyx_kp_s_tuple_bool_dict_Hashable_Domain) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_list_dict_Hashable_any) < 0) __PYX_ERR(0, 774, __pyx_L1_error) - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_13parallel_worker, 0, __pyx_n_s_parallel_worker, NULL, __pyx_n_s_constraint_solvers, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_bool_dict_Hashable_Domain) < 0) __PYX_ERR(0, 774, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_dict_Hashable_any) < 0) __PYX_ERR(0, 774, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10constraint_7solvers_13parallel_worker, 0, __pyx_mstate_global->__pyx_n_u_parallel_worker, NULL, __pyx_mstate_global->__pyx_n_u_constraint_solvers, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_parallel_worker, __pyx_t_5) < 0) __PYX_ERR(0, 774, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_parallel_worker, __pyx_t_5) < 0) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "constraint/solvers.py":1 * """Module containing the code for the problem solvers.""" # <<<<<<<<<<<<<< * * import random - */ +*/ __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /*--- Wrapped vars code ---*/ @@ -23577,7 +21981,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init constraint.solvers", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -23598,12 +22002,590 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 1520 <= 65535 + const unsigned short n; +#elif 1520 / 2 < INT_MAX + const unsigned int n; +#elif 1520 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_Abstract_base_class_for_solvers, sizeof(__pyx_k_Abstract_base_class_for_solvers), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Abstract_base_class_for_solvers */ + {__pyx_k_BacktrackingSolver, sizeof(__pyx_k_BacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver */ + {__pyx_k_BacktrackingSolver___init, sizeof(__pyx_k_BacktrackingSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver___init */ + {__pyx_k_BacktrackingSolver_getSolution, sizeof(__pyx_k_BacktrackingSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolution */ + {__pyx_k_BacktrackingSolver_getSolutionIt, sizeof(__pyx_k_BacktrackingSolver_getSolutionIt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolutionIt */ + {__pyx_k_BacktrackingSolver_getSolutions, sizeof(__pyx_k_BacktrackingSolver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BacktrackingSolver_getSolutions */ + {__pyx_k_Can_t_happen, sizeof(__pyx_k_Can_t_happen), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_happen */ + {__pyx_k_CompilableFunctionConstraint, sizeof(__pyx_k_CompilableFunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CompilableFunctionConstraint */ + {__pyx_k_Constraint, sizeof(__pyx_k_Constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Constraint */ + {__pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Domain */ + {__pyx_k_FunctionConstraint, sizeof(__pyx_k_FunctionConstraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionConstraint */ + {__pyx_k_FunctionType, sizeof(__pyx_k_FunctionType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FunctionType */ + {__pyx_k_Hashable, sizeof(__pyx_k_Hashable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Hashable */ + {__pyx_k_MinConflictsSolver, sizeof(__pyx_k_MinConflictsSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver */ + {__pyx_k_MinConflictsSolver___init, sizeof(__pyx_k_MinConflictsSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver___init */ + {__pyx_k_MinConflictsSolver_getSolution, sizeof(__pyx_k_MinConflictsSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MinConflictsSolver_getSolution */ + {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_OptimizedBacktrackingSolver, sizeof(__pyx_k_OptimizedBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver */ + {__pyx_k_OptimizedBacktrackingSolver___in, sizeof(__pyx_k_OptimizedBacktrackingSolver___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver___in */ + {__pyx_k_OptimizedBacktrackingSolver_getS, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS */ + {__pyx_k_OptimizedBacktrackingSolver_getS_2, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_2 */ + {__pyx_k_OptimizedBacktrackingSolver_getS_3, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_3 */ + {__pyx_k_OptimizedBacktrackingSolver_getS_4, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_4), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_4 */ + {__pyx_k_OptimizedBacktrackingSolver_getS_5, sizeof(__pyx_k_OptimizedBacktrackingSolver_getS_5), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OptimizedBacktrackingSolver_getS_5 */ + {__pyx_k_ParallelSolver, sizeof(__pyx_k_ParallelSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver */ + {__pyx_k_ParallelSolver___init, sizeof(__pyx_k_ParallelSolver___init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver___init */ + {__pyx_k_ParallelSolver_getSolution, sizeof(__pyx_k_ParallelSolver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolution */ + {__pyx_k_ParallelSolver_getSolutions, sizeof(__pyx_k_ParallelSolver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutions */ + {__pyx_k_ParallelSolver_getSolutionsList, sizeof(__pyx_k_ParallelSolver_getSolutionsList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList */ + {__pyx_k_ParallelSolver_getSolutionsList_2, sizeof(__pyx_k_ParallelSolver_getSolutionsList_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList_2 */ + {__pyx_k_ParallelSolver_getSolutionsList_3, sizeof(__pyx_k_ParallelSolver_getSolutionsList_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ParallelSolver_getSolutionsList_3 */ + {__pyx_k_Problem_solver_based_on_the_mini, sizeof(__pyx_k_Problem_solver_based_on_the_mini), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_based_on_the_mini */ + {__pyx_k_Problem_solver_that_executes_all, sizeof(__pyx_k_Problem_solver_that_executes_all), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_that_executes_all */ + {__pyx_k_Problem_solver_with_backtracking, sizeof(__pyx_k_Problem_solver_with_backtracking), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_with_backtracking */ + {__pyx_k_Problem_solver_with_backtracking_2, sizeof(__pyx_k_Problem_solver_with_backtracking_2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Problem_solver_with_backtracking_2 */ + {__pyx_k_ProcessPoolExecutor, sizeof(__pyx_k_ProcessPoolExecutor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ProcessPoolExecutor */ + {__pyx_k_RecursiveBacktrackingSolver, sizeof(__pyx_k_RecursiveBacktrackingSolver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver */ + {__pyx_k_RecursiveBacktrackingSolver___in, sizeof(__pyx_k_RecursiveBacktrackingSolver___in), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver___in */ + {__pyx_k_RecursiveBacktrackingSolver_getS, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_getS */ + {__pyx_k_RecursiveBacktrackingSolver_getS_2, sizeof(__pyx_k_RecursiveBacktrackingSolver_getS_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_getS_2 */ + {__pyx_k_RecursiveBacktrackingSolver_recu, sizeof(__pyx_k_RecursiveBacktrackingSolver_recu), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RecursiveBacktrackingSolver_recu */ + {__pyx_k_Recursive_problem_solver_with_ba, sizeof(__pyx_k_Recursive_problem_solver_with_ba), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Recursive_problem_solver_with_ba */ + {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */ + {__pyx_k_Solver, sizeof(__pyx_k_Solver), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver */ + {__pyx_k_Solver_getSolution, sizeof(__pyx_k_Solver_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolution */ + {__pyx_k_Solver_getSolutionIter, sizeof(__pyx_k_Solver_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolutionIter */ + {__pyx_k_Solver_getSolutions, sizeof(__pyx_k_Solver_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Solver_getSolutions */ + {__pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StopIteration */ + {__pyx_k_ThreadPoolExecutor, sizeof(__pyx_k_ThreadPoolExecutor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ThreadPoolExecutor */ + {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */ + {__pyx_k__5, sizeof(__pyx_k__5), 0, 1, 1}, /* PyObject cname: __pyx_n_u__5 */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_append, sizeof(__pyx_k_append), 0, 1, 1}, /* PyObject cname: __pyx_n_u_append */ + {__pyx_k_arcconstraints, sizeof(__pyx_k_arcconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcconstraints */ + {__pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcs */ + {__pyx_k_arcsvariable, sizeof(__pyx_k_arcsvariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcsvariable */ + {__pyx_k_args, sizeof(__pyx_k_args), 0, 1, 1}, /* PyObject cname: __pyx_n_u_args */ + {__pyx_k_assignment, sizeof(__pyx_k_assignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignment */ + {__pyx_k_assignments, sizeof(__pyx_k_assignments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_assignments */ + {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */ + {__pyx_k_bool, sizeof(__pyx_k_bool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_bool */ + {__pyx_k_c, sizeof(__pyx_k_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_c */ + {__pyx_k_check, sizeof(__pyx_k_check), 0, 1, 1}, /* PyObject cname: __pyx_n_u_check */ + {__pyx_k_choice, sizeof(__pyx_k_choice), 0, 1, 1}, /* PyObject cname: __pyx_n_u_choice */ + {__pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_chunksize */ + {__pyx_k_class, sizeof(__pyx_k_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class */ + {__pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_getitem */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_close, sizeof(__pyx_k_close), 0, 1, 1}, /* PyObject cname: __pyx_n_u_close */ + {__pyx_k_co_consts, sizeof(__pyx_k_co_consts), 0, 1, 1}, /* PyObject cname: __pyx_n_u_co_consts */ + {__pyx_k_code_object, sizeof(__pyx_k_code_object), 0, 1, 1}, /* PyObject cname: __pyx_n_u_code_object */ + {__pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_collections_abc */ + {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */ + {__pyx_k_compile_to_function, sizeof(__pyx_k_compile_to_function), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile_to_function */ + {__pyx_k_concurrent_futures, sizeof(__pyx_k_concurrent_futures), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concurrent_futures */ + {__pyx_k_conflicted, sizeof(__pyx_k_conflicted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_conflicted */ + {__pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint */ + {__pyx_k_constraint_constraints, sizeof(__pyx_k_constraint_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_constraints */ + {__pyx_k_constraint_domain, sizeof(__pyx_k_constraint_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_domain */ + {__pyx_k_constraint_lookup, sizeof(__pyx_k_constraint_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_lookup */ + {__pyx_k_constraint_solvers, sizeof(__pyx_k_constraint_solvers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraint_solvers */ + {__pyx_k_constraint_solvers_py, sizeof(__pyx_k_constraint_solvers_py), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_constraint_solvers_py */ + {__pyx_k_constraints, sizeof(__pyx_k_constraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints */ + {__pyx_k_constraints_lookup, sizeof(__pyx_k_constraints_lookup), 0, 1, 1}, /* PyObject cname: __pyx_n_u_constraints_lookup */ + {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */ + {__pyx_k_count, sizeof(__pyx_k_count), 0, 1, 1}, /* PyObject cname: __pyx_n_u_count */ + {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */ + {__pyx_k_dict_Hashable_Domain, sizeof(__pyx_k_dict_Hashable_Domain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_Domain */ + {__pyx_k_dict_Hashable_any, sizeof(__pyx_k_dict_Hashable_any), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_any */ + {__pyx_k_dict_Hashable_list_tuple_Constra, sizeof(__pyx_k_dict_Hashable_list_tuple_Constra), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_dict_Hashable_list_tuple_Constra */ + {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */ + {__pyx_k_doArc8, sizeof(__pyx_k_doArc8), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doArc8 */ + {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */ + {__pyx_k_doesn_t_provide_iteration, sizeof(__pyx_k_doesn_t_provide_iteration), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_doesn_t_provide_iteration */ + {__pyx_k_domain, sizeof(__pyx_k_domain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domain */ + {__pyx_k_domains, sizeof(__pyx_k_domains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_domains */ + {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */ + {__pyx_k_enter, sizeof(__pyx_k_enter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enter */ + {__pyx_k_exec, sizeof(__pyx_k_exec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exec */ + {__pyx_k_executor, sizeof(__pyx_k_executor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_executor */ + {__pyx_k_exit, sizeof(__pyx_k_exit), 0, 1, 1}, /* PyObject cname: __pyx_n_u_exit */ + {__pyx_k_first_value, sizeof(__pyx_k_first_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_first_value */ + {__pyx_k_first_var, sizeof(__pyx_k_first_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_first_var */ + {__pyx_k_forwardcheck, sizeof(__pyx_k_forwardcheck), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck */ + {__pyx_k_forwardcheck_2, sizeof(__pyx_k_forwardcheck_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_forwardcheck_2 */ + {__pyx_k_fromkeys, sizeof(__pyx_k_fromkeys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fromkeys */ + {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */ + {__pyx_k_func_2, sizeof(__pyx_k_func_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_2 */ + {__pyx_k_func_3, sizeof(__pyx_k_func_3), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_3 */ + {__pyx_k_func_string, sizeof(__pyx_k_func_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func_string */ + {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */ + {__pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_genexpr */ + {__pyx_k_get, sizeof(__pyx_k_get), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get */ + {__pyx_k_getArcs, sizeof(__pyx_k_getArcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getArcs */ + {__pyx_k_getSolution, sizeof(__pyx_k_getSolution), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolution */ + {__pyx_k_getSolutionIter, sizeof(__pyx_k_getSolutionIter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionIter */ + {__pyx_k_getSolutions, sizeof(__pyx_k_getSolutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutions */ + {__pyx_k_getSolutionsList, sizeof(__pyx_k_getSolutionsList), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSolutionsList */ + {__pyx_k_getSortedVariables, sizeof(__pyx_k_getSortedVariables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getSortedVariables */ + {__pyx_k_hideValue, sizeof(__pyx_k_hideValue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_hideValue */ + {__pyx_k_init, sizeof(__pyx_k_init), 0, 1, 1}, /* PyObject cname: __pyx_n_u_init */ + {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */ + {__pyx_k_is_an_abstract_class, sizeof(__pyx_k_is_an_abstract_class), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_is_an_abstract_class */ + {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */ + {__pyx_k_is_valid, sizeof(__pyx_k_is_valid), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid */ + {__pyx_k_is_valid_locals_genexpr, sizeof(__pyx_k_is_valid_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid_locals_genexpr */ + {__pyx_k_is_valid_locals_genexpr_locals_g, sizeof(__pyx_k_is_valid_locals_genexpr_locals_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_valid_locals_genexpr_locals_g */ + {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */ + {__pyx_k_item, sizeof(__pyx_k_item), 0, 1, 1}, /* PyObject cname: __pyx_n_u_item */ + {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */ + {__pyx_k_iter, sizeof(__pyx_k_iter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_iter */ + {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */ + {__pyx_k_keys, sizeof(__pyx_k_keys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keys */ + {__pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lambda */ + {__pyx_k_list, sizeof(__pyx_k_list), 0, 1, 1}, /* PyObject cname: __pyx_n_u_list */ + {__pyx_k_list_Hashable, sizeof(__pyx_k_list_Hashable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_Hashable */ + {__pyx_k_list_dict_Hashable_any, sizeof(__pyx_k_list_dict_Hashable_any), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_dict_Hashable_any */ + {__pyx_k_list_tuple, sizeof(__pyx_k_list_tuple), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple */ + {__pyx_k_list_tuple_Constraint_Hashable, sizeof(__pyx_k_list_tuple_Constraint_Hashable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_list_tuple_Constraint_Hashable */ + {__pyx_k_local_assignment, sizeof(__pyx_k_local_assignment), 0, 1, 1}, /* PyObject cname: __pyx_n_u_local_assignment */ + {__pyx_k_lst, sizeof(__pyx_k_lst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lst */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_map, sizeof(__pyx_k_map), 0, 1, 1}, /* PyObject cname: __pyx_n_u_map */ + {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */ + {__pyx_k_mincount, sizeof(__pyx_k_mincount), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mincount */ + {__pyx_k_minvalues, sizeof(__pyx_k_minvalues), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minvalues */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */ + {__pyx_k_msg, sizeof(__pyx_k_msg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_msg */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */ + {__pyx_k_only_provides_all_solutions, sizeof(__pyx_k_only_provides_all_solutions), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_only_provides_all_solutions */ + {__pyx_k_otherdomain, sizeof(__pyx_k_otherdomain), 0, 1, 1}, /* PyObject cname: __pyx_n_u_otherdomain */ + {__pyx_k_othervalue, sizeof(__pyx_k_othervalue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_othervalue */ + {__pyx_k_othervariable, sizeof(__pyx_k_othervariable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_othervariable */ + {__pyx_k_parallel_pool, sizeof(__pyx_k_parallel_pool), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parallel_pool */ + {__pyx_k_parallel_worker, sizeof(__pyx_k_parallel_worker), 0, 1, 1}, /* PyObject cname: __pyx_n_u_parallel_worker */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_popState, sizeof(__pyx_k_popState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popState */ + {__pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 1, 1}, /* PyObject cname: __pyx_n_u_popitem */ + {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */ + {__pyx_k_process_mode, sizeof(__pyx_k_process_mode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode */ + {__pyx_k_process_mode_2, sizeof(__pyx_k_process_mode_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_process_mode_2 */ + {__pyx_k_provides_only_a_single_solution, sizeof(__pyx_k_provides_only_a_single_solution), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_provides_only_a_single_solution */ + {__pyx_k_pushState, sizeof(__pyx_k_pushState), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushState */ + {__pyx_k_pushdomains, sizeof(__pyx_k_pushdomains), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pushdomains */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_queue, sizeof(__pyx_k_queue), 0, 1, 1}, /* PyObject cname: __pyx_n_u_queue */ + {__pyx_k_rand, sizeof(__pyx_k_rand), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rand */ + {__pyx_k_rand_2, sizeof(__pyx_k_rand_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rand_2 */ + {__pyx_k_random, sizeof(__pyx_k_random), 0, 1, 1}, /* PyObject cname: __pyx_n_u_random */ + {__pyx_k_range, sizeof(__pyx_k_range), 0, 1, 1}, /* PyObject cname: __pyx_n_u_range */ + {__pyx_k_recursiveBacktracking, sizeof(__pyx_k_recursiveBacktracking), 0, 1, 1}, /* PyObject cname: __pyx_n_u_recursiveBacktracking */ + {__pyx_k_remaining_vars, sizeof(__pyx_k_remaining_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remaining_vars */ + {__pyx_k_requires_pickling, sizeof(__pyx_k_requires_pickling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_requires_pickling */ + {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */ + {__pyx_k_results, sizeof(__pyx_k_results), 0, 1, 1}, /* PyObject cname: __pyx_n_u_results */ + {__pyx_k_return, sizeof(__pyx_k_return), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return */ + {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */ + {__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */ + {__pyx_k_sequential_optimized_backtrack, sizeof(__pyx_k_sequential_optimized_backtrack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sequential_optimized_backtrack */ + {__pyx_k_sequential_recursive_backtrack, sizeof(__pyx_k_sequential_recursive_backtrack), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sequential_recursive_backtrack */ + {__pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setdefault */ + {__pyx_k_shuffle, sizeof(__pyx_k_shuffle), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shuffle */ + {__pyx_k_single, sizeof(__pyx_k_single), 0, 1, 1}, /* PyObject cname: __pyx_n_u_single */ + {__pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions */ + {__pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted */ + {__pyx_k_sorted_variables, sizeof(__pyx_k_sorted_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted_variables */ + {__pyx_k_sorted_vars, sizeof(__pyx_k_sorted_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sorted_vars */ + {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */ + {__pyx_k_steps, sizeof(__pyx_k_steps), 0, 1, 1}, /* PyObject cname: __pyx_n_u_steps */ + {__pyx_k_steps_2, sizeof(__pyx_k_steps_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_steps_2 */ + {__pyx_k_string, sizeof(__pyx_k_string), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_string */ + {__pyx_k_super, sizeof(__pyx_k_super), 0, 1, 1}, /* PyObject cname: __pyx_n_u_super */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_throw, sizeof(__pyx_k_throw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_throw */ + {__pyx_k_tuple_bool_dict_Hashable_Domain, sizeof(__pyx_k_tuple_bool_dict_Hashable_Domain), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_tuple_bool_dict_Hashable_Domain */ + {__pyx_k_types, sizeof(__pyx_k_types), 0, 1, 1}, /* PyObject cname: __pyx_n_u_types */ + {__pyx_k_unassigned_vars, sizeof(__pyx_k_unassigned_vars), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unassigned_vars */ + {__pyx_k_v, sizeof(__pyx_k_v), 0, 1, 1}, /* PyObject cname: __pyx_n_u_v */ + {__pyx_k_val, sizeof(__pyx_k_val), 0, 1, 1}, /* PyObject cname: __pyx_n_u_val */ + {__pyx_k_vals, sizeof(__pyx_k_vals), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vals */ + {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */ + {__pyx_k_values, sizeof(__pyx_k_values), 0, 1, 1}, /* PyObject cname: __pyx_n_u_values */ + {__pyx_k_var, sizeof(__pyx_k_var), 0, 1, 1}, /* PyObject cname: __pyx_n_u_var */ + {__pyx_k_variable, sizeof(__pyx_k_variable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable */ + {__pyx_k_variable1, sizeof(__pyx_k_variable1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable1 */ + {__pyx_k_variable2, sizeof(__pyx_k_variable2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variable2 */ + {__pyx_k_variables, sizeof(__pyx_k_variables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_variables */ + {__pyx_k_vars_involved, sizeof(__pyx_k_vars_involved), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vars_involved */ + {__pyx_k_vconstraints, sizeof(__pyx_k_vconstraints), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vconstraints */ + {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 221, __pyx_L1_error) + __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_range); if (!__pyx_builtin_range) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_super); if (!__pyx_builtin_super) __PYX_ERR(0, 646, __pyx_L1_error) + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 668, __pyx_L1_error) + __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(0, 704, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "constraint/solvers.py":48 + * if domain: + * # changed = False + * for value in domain[:]: # <<<<<<<<<<<<<< + * assignments[variable] = value + * if otherdomain: +*/ + __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]); + + /* "constraint/solvers.py":221 + * queue.append((variable, values, pushdomains)) + * + * raise RuntimeError("Can't happen") # <<<<<<<<<<<<<< + * + * def getSolution(self, domains: dict, constraints: list[tuple], vconstraints: dict): # noqa: D102 +*/ + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u_Can_t_happen); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); + + /* "constraint/solvers.py":680 + * # execute in parallel + * parallel_pool = ProcessPoolExecutor if self._process_mode else ThreadPoolExecutor + * with parallel_pool() as executor: # <<<<<<<<<<<<<< + * # results = map(parallel_worker, args) # sequential + * results = executor.map(parallel_worker, args, chunksize=1) # parallel +*/ + __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]); + + /* "constraint/solvers.py":143 + * """ + * + * def __init__(self, forwardcheck=True): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]); + + /* "constraint/solvers.py":554 + * """ + * + * def __init__(self, steps=1000, rand=None): # <<<<<<<<<<<<<< + * """Initialization method. + * +*/ + __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(2, ((PyObject *)__pyx_mstate_global->__pyx_int_1000), Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]); + + /* "constraint/solvers.py":644 + * """ # noqa E501 + * + * def __init__(self, process_mode=False): # <<<<<<<<<<<<<< + * """Initialization method. Set `process_mode` to True for using ProcessPool, otherwise uses ThreadPool.""" + * super().__init__() +*/ + __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]); + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type; + __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + __pyx_mstate->__pyx_umethod_PyList_Type__copy.type = (PyObject*)(&PyList_Type); + __pyx_mstate->__pyx_umethod_PyList_Type__copy.method_name = &__pyx_mstate->__pyx_n_u_copy; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_1000 = PyLong_FromLong(1000); if (unlikely(!__pyx_mstate->__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ +typedef struct { + unsigned int argcount : 3; + unsigned int num_posonly_args : 1; + unsigned int num_kwonly_args : 1; + unsigned int nlocals : 5; + unsigned int flags : 10; + unsigned int first_line : 10; + unsigned int line_table_length : 13; +} __Pyx_PyCode_New_function_description; +/* NewCodeObj.proto */ +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject *filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +); + + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + PyObject* tuple_dedup_map = PyDict_New(); + if (unlikely(!tuple_dedup_map)) return -1; + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 153, 12}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_x}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 276, 12}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_x}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 675, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_val}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 668, 14}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_v}; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_lambda, __pyx_k_3awVWWX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 698, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_v}; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {0, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 696, 2}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_vars_involved, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_genexpr, __pyx_k__4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13, 107}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_arcs, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable1, __pyx_mstate->__pyx_n_u_variable2}; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getArcs, __pyx_k_8_1_Q_L_3a_Q_1_1Ks_Qk_G1A_1Ks_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28, 255}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_arcs, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_check, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_arcsvariable, __pyx_mstate->__pyx_n_u_othervariable, __pyx_mstate->__pyx_n_u_arcconstraints, __pyx_mstate->__pyx_n_u_otherdomain, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_othervalue, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_doArc8, __pyx_k_39A_D_1_e81_9G5_9Cq_t1A_Q_S_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77, 37}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89, 37}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101, 37}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionIter, __pyx_k_UUV_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 143, 15}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 223, 48}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_iter}; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230, 32}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266, 15}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344, 243}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_k_N_O_E_E_F_A_Q_A_4_2_9A_A_9G1_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 401, 53}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_4q_4q_AYm1_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406, 48}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_iter}; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_t_1I_4q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413, 74}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_c}; + __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSortedVariables, __pyx_k_iq_b_A_c_jPTT_a_5_q_c_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456, 15}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forwardcheck}; + __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 466, 292}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_single, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_item, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_forwardcheck, __pyx_mstate->__pyx_n_u_pushdomains, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_x}; + __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_recursiveBacktracking, __pyx_k_A_b_A_c_jPTT_a_5_HA_t2S_q_WA_Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519, 49}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_solutions}; + __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_D_at9N_a_z_Yas_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 32}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t_i_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 554, 23}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_steps, __pyx_mstate->__pyx_n_u_rand}; + __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_1_Ja_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 566, 319}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_choice, __pyx_mstate->__pyx_n_u_shuffle, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u__5, __pyx_mstate->__pyx_n_u_conflicted, __pyx_mstate->__pyx_n_u_lst, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables, __pyx_mstate->__pyx_n_u_mincount, __pyx_mstate->__pyx_n_u_minvalues, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_count}; + __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_V_d_fL_G7_F_a_L_q_F_7_1_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644, 30}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_process_mode}; + __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_init, __pyx_k_q_Ry_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650, 37}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_msg}; + __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolution, __pyx_k_66QQR_b_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 662, 167}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_vconstraints, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_sorted_vars, __pyx_mstate->__pyx_n_u_first_var, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_parallel_pool, __pyx_mstate->__pyx_n_u_executor, __pyx_mstate->__pyx_n_u_results, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutionsList, __pyx_k_N_O_E_E_F_P_qPUUaaeeffkkoosszz, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 688, 26}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_vconstraints}; + __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_getSolutions, __pyx_k_77RRS_t_AYa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693, 29}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_constraints_lookup, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr}; + __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_is_valid, __pyx_k_BBn_o_J_J_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701, 57}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_func_string, __pyx_mstate->__pyx_n_u_code_object, __pyx_mstate->__pyx_n_u_func_3}; + __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_compile_to_function, __pyx_k_EQ_A_1_q_Qd_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 708, 146}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_value}; + __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_recursive_backtrack, __pyx_k_UUn_o_Z_Z_P_P_Q_t1_q_q_1__Cq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 724, 245}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_assignment, __pyx_mstate->__pyx_n_u_unassigned_vars, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_assignments, __pyx_mstate->__pyx_n_u_sorted_variables, __pyx_mstate->__pyx_n_u_queue, __pyx_mstate->__pyx_n_u_solutions, __pyx_mstate->__pyx_n_u_variable, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_variables}; + __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_sequential_optimized_backtrack, __pyx_k_UUn_o_Z_Z_P_P_Q_q_L_y_q_WA_Q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad; + } + { + __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 774, 186}; + PyObject* varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_process_mode, __pyx_mstate->__pyx_n_u_domains, __pyx_mstate->__pyx_n_u_constraint_lookup, __pyx_mstate->__pyx_n_u_first_var, __pyx_mstate->__pyx_n_u_first_value, __pyx_mstate->__pyx_n_u_remaining_vars, __pyx_mstate->__pyx_n_u_local_assignment, __pyx_mstate->__pyx_n_u_var, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_constraint, __pyx_mstate->__pyx_n_u_vals}; + __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_constraint_solvers_py, __pyx_mstate->__pyx_n_u_parallel_worker, __pyx_k_U_U_V_k_FWWX_1_q_E_1_q_QgQe1A_P, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad; + } + Py_DECREF(tuple_dedup_map); + return 0; + bad: + Py_DECREF(tuple_dedup_map); + return -1; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* CachedMethodType.init */ + #if CYTHON_COMPILING_IN_LIMITED_API +{ + PyObject *typesModule=NULL; + typesModule = PyImport_ImportModule("types"); + if (typesModule) { + __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + } +} // error handling follows +#endif + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -23644,11 +22626,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif @@ -23770,7 +22746,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -23786,20 +22762,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -23813,8 +22805,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -23837,7 +22828,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -23884,55 +22876,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -23950,9 +22926,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -23962,9 +22935,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -23972,14 +22942,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -23988,14 +22952,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -24055,12 +23030,7 @@ static void __Pyx_RaiseDoubleKeywordsError( PyObject* kw_name) { PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } /* ParseKeywords */ @@ -24083,7 +23053,7 @@ static int __Pyx_ParseOptionalKeywords( Py_XDECREF(value); value = NULL; if (kwds_is_tuple) { Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(kwds); #else size = PyTuple_Size(kwds); @@ -24126,38 +23096,11 @@ static int __Pyx_ParseOptionalKeywords( #endif Py_INCREF(value); name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; -#endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**name) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**name, key) ); @@ -24176,8 +23119,8 @@ static int __Pyx_ParseOptionalKeywords( PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #if CYTHON_ASSUME_SAFE_SIZE + (PyUnicode_GET_LENGTH(**argname) != PyUnicode_GET_LENGTH(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; @@ -24204,15 +23147,9 @@ static int __Pyx_ParseOptionalKeywords( "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif bad: Py_XDECREF(key); Py_XDECREF(value); @@ -24224,23 +23161,44 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } type_name = __Pyx_PyType_GetName(type); obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; @@ -24319,9 +23277,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -24329,19 +23285,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -24378,9 +23326,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -24389,17 +23335,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -24414,13 +23353,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -24439,13 +23373,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -24467,7 +23396,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -24496,12 +23425,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -24509,7 +23436,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API #if PY_VERSION_HEX < 0x03090000 vectorcallfunc f = _PyVectorcall_Function(func); #else @@ -24523,10 +23450,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); if (f) return f(func, args, (size_t)nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, (size_t)nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -24570,18 +23499,12 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me Py_INCREF(descr); #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) -#elif PY_MAJOR_VERSION >= 3 +#else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) #endif -#else - #ifdef __Pyx_CyFunction_USED - if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) - #else - if (likely(PyFunction_Check(descr))) - #endif #endif { meth_found = 1; @@ -24621,13 +23544,8 @@ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **me } type_name = __Pyx_PyType_GetName(tp); PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", type_name, name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(name)); -#endif __Pyx_DECREF_TypeName(type_name); return 0; #else @@ -24681,7 +23599,7 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { - PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); + PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_mstate_global->__pyx_n_u_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); @@ -24689,166 +23607,25 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } -/* UnpackUnboundCMethod */ -static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { - PyObject *result; - PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); - if (unlikely(!selfless_args)) return NULL; - result = PyObject_Call(method, selfless_args, kwargs); - Py_DECREF(selfless_args); - return result; -} -static PyMethodDef __Pyx_UnboundCMethod_Def = { - "CythonUnboundCMethod", - __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), - METH_VARARGS | METH_KEYWORDS, - NULL -}; -static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { - PyObject *method; - method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); - if (unlikely(!method)) - return -1; - target->method = method; -#if CYTHON_COMPILING_IN_CPYTHON - #if PY_MAJOR_VERSION >= 3 - if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) - #else - if (likely(!__Pyx_CyOrPyCFunction_Check(method))) - #endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject*) method; - target->func = descr->d_method->ml_meth; - target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); - } else -#endif -#if CYTHON_COMPILING_IN_PYPY -#else - if (PyCFunction_Check(method)) -#endif - { - PyObject *self; - int self_found; -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - self = PyObject_GetAttrString(method, "__self__"); - if (!self) { - PyErr_Clear(); - } -#else - self = PyCFunction_GET_SELF(method); -#endif - self_found = (self && self != Py_None); -#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY - Py_XDECREF(self); -#endif - if (self_found) { - PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); - if (unlikely(!unbound_method)) return -1; - Py_DECREF(method); - target->method = unbound_method; - } - } - return 0; -} - -/* CallUnboundCMethod2 */ -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 -static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { - if (likely(cfunc->func)) { - PyObject *args[2] = {arg1, arg2}; - if (cfunc->flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - #if PY_VERSION_HEX >= 0x030700A0 - if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); - #endif - } - return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); -} -#endif -static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ - PyObject *args, *result = NULL; - if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_COMPILING_IN_CPYTHON - if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - if (cfunc->flag & METH_KEYWORDS) - result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); - else - result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(3); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 1, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 2, arg2); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(3, self, arg1, arg2); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); -#endif -bad: - Py_XDECREF(args); - return result; -} - /* dict_setdefault */ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type) { PyObject* value; CYTHON_MAYBE_UNUSED_VAR(is_safe_type); -#if PY_VERSION_HEX >= 0x030400A0 - if ((1)) { - value = PyDict_SetDefault(d, key, default_value); - if (unlikely(!value)) return NULL; - Py_INCREF(value); -#else - if (is_safe_type == 1 || (is_safe_type == -1 && -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) - (PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) { - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (unlikely(PyErr_Occurred())) - return NULL; - if (unlikely(PyDict_SetItem(d, key, default_value) == -1)) - return NULL; - value = default_value; - } - Py_INCREF(value); -#else - (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key) || PyLong_CheckExact(key)))) { - value = PyDict_GetItem(d, key); - if (unlikely(!value)) { - if (unlikely(PyDict_SetItem(d, key, default_value) == -1)) - return NULL; - value = default_value; - } - Py_INCREF(value); -#endif -#endif - } else { - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_setdefault, d, key, default_value); - } + value = PyDict_SetDefault(d, key, default_value); + if (unlikely(!value)) return NULL; + Py_INCREF(value); return value; } +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* DictGetItem */ - #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY +#if !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); @@ -24872,7 +23649,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { #endif /* GetItemInt */ - static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (unlikely(!j)) return NULL; r = PyObject_GetItem(o, j); @@ -24882,7 +23659,7 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); @@ -24892,7 +23669,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -24900,7 +23677,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); @@ -24910,7 +23687,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize Py_INCREF(r); return r; } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif @@ -24918,13 +23695,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; + return __Pyx_PyList_GetItemRef(o, n); } } else if (PyTuple_CheckExact(o)) { @@ -24938,7 +23713,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; if (mm && mm->mp_subscript) { - PyObject *r, *key = PyInt_FromSsize_t(i); + PyObject *r, *key = PyLong_FromSsize_t(i); if (unlikely(!key)) return NULL; r = mm->mp_subscript(o, key); Py_DECREF(key); @@ -24963,11 +23738,11 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return PySequence_GetItem(o, i); } #endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i)); } /* ObjectGetItem */ - #if CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { PyObject *runerr = NULL; Py_ssize_t key_value; @@ -24987,7 +23762,7 @@ static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { __Pyx_TypeName obj_type_name; if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem); if (!meth) { PyErr_Clear(); } else { @@ -25017,56 +23792,15 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { #endif /* SliceObject */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_slice(obj, cstart, cstop); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { PyObject* result; @@ -25080,7 +23814,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -25089,7 +23823,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -25121,7 +23855,7 @@ static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { } /* UnicodeConcatInPlace */ - # if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +# if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_unicode_modifiable(PyObject *unicode) { @@ -25174,69 +23908,17 @@ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_le if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL; #else _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len); - #endif - __Pyx_INCREF(*p_left); - __Pyx_GIVEREF(*p_left); - return *p_left; - } else { - return __Pyx_PyUnicode_Concat(left, right); - } - } -#endif - -/* RaiseException */ - #if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } + #endif + __Pyx_INCREF(*p_left); + __Pyx_GIVEREF(*p_left); + return *p_left; + } else { + return __Pyx_PyUnicode_Concat(left, right); } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else + } +#endif + +/* RaiseException */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -25321,9 +24003,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -25343,30 +24025,19 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* PyObjectSetAttrStr */ - #if CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif return PyObject_SetAttr(obj, attr_name, value); } #endif -/* PyObjectCallNoArg */ - static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { - PyObject *arg[2] = {NULL, NULL}; - return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* PyObjectCallMethod0 */ - static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { PyObject *method = NULL, *result = NULL; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { @@ -25382,28 +24053,53 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr } /* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { +static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); } /* UnpackTupleError */ - static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { +static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) { if (t == Py_None) { __Pyx_RaiseNoneNotIterableError(); - } else if (PyTuple_GET_SIZE(t) < index) { - __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t)); } else { - __Pyx_RaiseTooManyValuesError(index); + Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(size < 0)) return; + #endif + if (size < index) { + __Pyx_RaiseNeedMoreValuesError(size); + } else { + __Pyx_RaiseTooManyValuesError(index); + } } } /* UnpackTuple2 */ - static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( +static CYTHON_INLINE int __Pyx_unpack_tuple2( + PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) { + if (likely(is_tuple || PyTuple_Check(tuple))) { + Py_ssize_t size; + if (has_known_size) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + size = __Pyx_PyTuple_GET_SIZE(tuple); + if (likely(size == 2)) { + return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple); + } + if (size >= 0) { + __Pyx_UnpackTupleError(tuple, 2); + } + return -1; + } else { + return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple); + } +} +static CYTHON_INLINE int __Pyx_unpack_tuple2_exact( PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) { PyObject *value1 = NULL, *value2 = NULL; -#if CYTHON_COMPILING_IN_PYPY - value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; - value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS + value1 = __Pyx_PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad; + value2 = __Pyx_PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad; #else value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1); value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2); @@ -25414,7 +24110,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr *pvalue1 = value1; *pvalue2 = value2; return 0; -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS bad: Py_XDECREF(value1); Py_XDECREF(value2); @@ -25450,7 +24146,7 @@ static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyOb } /* dict_iter */ - #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 +#if CYTHON_COMPILING_IN_PYPY #include #endif static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name, @@ -25462,7 +24158,7 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di *p_orig_length = PyDict_Size(iterable); Py_INCREF(iterable); return iterable; -#elif PY_MAJOR_VERSION >= 3 +#else static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL; PyObject **pp = NULL; if (method_name) { @@ -25518,8 +24214,20 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( } Py_INCREF(key); Py_INCREF(value); + #if CYTHON_ASSUME_SAFE_MACROS PyTuple_SET_ITEM(tuple, 0, key); PyTuple_SET_ITEM(tuple, 1, value); + #else + if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) { + Py_DECREF(value); + Py_DECREF(tuple); + return -1; + } + if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) { + Py_DECREF(tuple); + return -1; + } + #endif *pitem = tuple; } else { if (pkey) { @@ -25534,15 +24242,33 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } else if (PyTuple_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0; + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) return -1; + #endif + if (unlikely(pos >= tuple_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyTuple_GET_ITEM(iter_obj, pos); + #else + next_item = PyTuple_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else if (PyList_CheckExact(iter_obj)) { Py_ssize_t pos = *ppos; - if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0; + Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(list_size < 0)) return -1; + #endif + if (unlikely(pos >= list_size)) return 0; *ppos = pos + 1; + #if CYTHON_ASSUME_SAFE_MACROS next_item = PyList_GET_ITEM(iter_obj, pos); + #else + next_item = PyList_GetItem(iter_obj, pos); + if (unlikely(!next_item)) return -1; + #endif Py_INCREF(next_item); } else #endif @@ -25565,44 +24291,91 @@ static CYTHON_INLINE int __Pyx_dict_iter_next( return 1; } -/* CallUnboundCMethod0 */ - static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { - PyObject *args, *result = NULL; - if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; -#if CYTHON_ASSUME_SAFE_MACROS - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY #else - args = PyTuple_Pack(1, self); - if (unlikely(!args)) goto bad; + if (PyCFunction_Check(method)) #endif - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - Py_DECREF(args); -bad: + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *result; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; + result = __Pyx_PyObject_CallOneArg(cfunc->method, self); return result; } /* pop */ - static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { +static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) { if (__Pyx_IS_TYPE(L, &PySet_Type)) { return PySet_Pop(L); } - return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop); + return __Pyx_PyObject_CallMethod0(L, __pyx_mstate_global->__pyx_n_u_pop); } -#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) { if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { __Pyx_SET_SIZE(L, Py_SIZE(L) - 1); return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); } - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L); + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyList_Type_pop, L); } #endif /* GetException */ - #if CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) @@ -25639,12 +24412,10 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) if (unlikely(PyErr_Occurred())) #endif goto bad; - #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } - #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); @@ -25697,37 +24468,69 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) } /* pep479 */ - static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc, *new_exc; __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED int is_async_stopiteration = 0; - #endif CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); + __Pyx_PyThreadState_assign + cur_exc = __Pyx_PyErr_CurrentExceptionType(); if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) { is_async_stopiteration = 1; - } else - #endif + } else { return; + } } - __Pyx_PyThreadState_assign __Pyx_GetException(&exc, &val, &tb); Py_XDECREF(exc); - Py_XDECREF(val); Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED + new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s", is_async_stopiteration ? "async generator raised StopAsyncIteration" : in_async_gen ? "async generator raised StopIteration" : - #endif "generator raised StopIteration"); + if (!new_exc) { + Py_XDECREF(val); + return; + } + PyException_SetCause(new_exc, val); // steals ref to val + PyErr_SetObject(PyExc_RuntimeError, new_exc); +} + +/* IterNextPlain */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 +static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) { + if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache)) + __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next); + return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache; +} +#endif +static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000 + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, iterator, NULL); + return result; +#else + (void)__Pyx_GetBuiltinName; // only for early limited API + iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator); + assert(iternext); + return iternext(iterator); +#endif } /* IterNext */ - static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03080000 +static PyObject *__Pyx_PyIter_Next2(PyObject *o, PyObject *defval) { + PyObject *result; + PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI(); + if (unlikely(!next)) return NULL; + result = PyObject_CallFunctionObjArgs(next, o, defval, NULL); + return result; +} +#else +static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -25754,37 +24557,35 @@ static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; - iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; +#if !CYTHON_COMPILING_IN_LIMITED_API + iternextfunc iternext = __Pyx_PyObject_TryGetSlot(iterator, tp_iternext, iternextfunc); if (likely(iternext)) { -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY next = iternext(iterator); if (likely(next)) return next; -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; + #endif + } else if (CYTHON_USE_TYPE_SLOTS) { + __Pyx_PyIter_Next_ErrorNoIterator(iterator); + return NULL; + } else #endif -#else - next = PyIter_Next(iterator); - if (likely(next)) - return next; -#endif - } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { + if (unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; - } -#if !CYTHON_USE_TYPE_SLOTS - else { - next = PyIter_Next(iterator); + } else { + next = defval ? PyIter_Next(iterator) : __Pyx_PyIter_Next_Plain(iterator); if (likely(next)) return next; } -#endif return __Pyx_PyIter_Next2Default(defval); } +#endif /* GetTopmostException */ - #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { @@ -25799,7 +24600,7 @@ __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) #endif /* SaveResetException */ - #if CYTHON_FAST_THREAD_STATE +#if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); @@ -25866,7 +24667,7 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #endif /* PyDictVersioning */ - #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; @@ -25892,23 +24693,14 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #endif /* GetModuleGlobalName */ - #if CYTHON_USE_DICT_VERSIONS +#if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#elif CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API if (unlikely(!__pyx_m)) { return NULL; } @@ -25916,16 +24708,23 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) if (likely(result)) { return result; } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) +#elif !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif !CYTHON_AVOID_BORROWED_REFS + if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear(); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return result; } -#endif #else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + result = PyObject_GetItem(__pyx_mstate_global->__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } @@ -25935,31 +24734,16 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) } /* py_dict_keys */ - static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { - if (PY_MAJOR_VERSION >= 3) - return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d); - else - return PyDict_Keys(d); +static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) { + return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d); } -/* PyIntBinop */ - #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { +/* PyLongBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { CYTHON_MAYBE_UNUSED_VAR(intval); CYTHON_MAYBE_UNUSED_VAR(inplace); CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long x; - long a = PyInt_AS_LONG(op1); - - x = (long)((unsigned long)a + (unsigned long)b); - if (likely((x^a) >= 0 || (x^b) >= 0)) - return PyInt_FromLong(x); - return PyLong_Type.tp_as_number->nb_add(op1, op2); - } - #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; @@ -26059,16 +24843,10 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, #endif if (PyFloat_CheckExact(op1)) { const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif + double a = __Pyx_PyFloat_AS_DOUBLE(op1); double result; - PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; - PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); @@ -26076,56 +24854,15 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, #endif /* SliceObject */ - static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, +static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice, int has_cstart, int has_cstop, int wraparound) { __Pyx_TypeName obj_type_name; #if CYTHON_USE_TYPE_SLOTS - PyMappingMethods* mp; -#if PY_MAJOR_VERSION < 3 - PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence; - if (likely(ms && ms->sq_ass_slice)) { - if (!has_cstart) { - if (_py_start && (*_py_start != Py_None)) { - cstart = __Pyx_PyIndex_AsSsize_t(*_py_start); - if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstart = 0; - } - if (!has_cstop) { - if (_py_stop && (*_py_stop != Py_None)) { - cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop); - if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; - } else - cstop = PY_SSIZE_T_MAX; - } - if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) { - Py_ssize_t l = ms->sq_length(obj); - if (likely(l >= 0)) { - if (cstop < 0) { - cstop += l; - if (cstop < 0) cstop = 0; - } - if (cstart < 0) { - cstart += l; - if (cstart < 0) cstart = 0; - } - } else { - if (!PyErr_ExceptionMatches(PyExc_OverflowError)) - goto bad; - PyErr_Clear(); - } - } - return ms->sq_ass_slice(obj, cstart, cstop, value); - } -#else + PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping; CYTHON_UNUSED_VAR(wraparound); -#endif - mp = Py_TYPE(obj)->tp_as_mapping; if (likely(mp && mp->mp_ass_subscript)) -#else - CYTHON_UNUSED_VAR(wraparound); #endif { int result; @@ -26139,7 +24876,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, py_start = *_py_start; } else { if (has_cstart) { - owned_start = py_start = PyInt_FromSsize_t(cstart); + owned_start = py_start = PyLong_FromSsize_t(cstart); if (unlikely(!py_start)) goto bad; } else py_start = Py_None; @@ -26148,7 +24885,7 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, py_stop = *_py_stop; } else { if (has_cstop) { - owned_stop = py_stop = PyInt_FromSsize_t(cstop); + owned_stop = py_stop = PyLong_FromSsize_t(cstop); if (unlikely(!py_stop)) { Py_XDECREF(owned_start); goto bad; @@ -26181,29 +24918,25 @@ static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, } /* RaiseClosureNameError */ - static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { +static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* RaiseUnboundLocalError */ - static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); } /* CallUnboundCMethod1 */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); - } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) { - #if PY_VERSION_HEX >= 0x030700A0 - return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); - #else - return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); - #endif - } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) { + } else if (flag == METH_FASTCALL) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); + } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } @@ -26211,41 +24944,70 @@ static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ - PyObject *args, *result = NULL; + PyObject *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { - args = PyTuple_New(1); - if (unlikely(!args)) goto bad; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); - } else { - args = PyTuple_New(2); - if (unlikely(!args)) goto bad; - Py_INCREF(self); - PyTuple_SET_ITEM(args, 0, self); - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 1, arg); - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); - } -#else - args = PyTuple_Pack(2, self, arg); - if (unlikely(!args)) goto bad; - result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); + } else #endif -bad: - Py_XDECREF(args); + { + result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg); + } return result; } +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + if (likely(cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); + } + return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + PyObject *result = NULL; + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); + else + result = (*cfunc->func)(self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + /* dict_getitem_default */ - static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { +static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; -#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#if !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) @@ -26255,7 +25017,7 @@ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObje Py_INCREF(value); if ((1)); #else - if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) { + if (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_CheckExact(key)) { value = PyDict_GetItem(d, key); if (unlikely(!value)) { value = default_value; @@ -26265,15 +25027,15 @@ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObje #endif else { if (default_value == Py_None) - value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); + value = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key); else - value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* FixUpExtensionType */ - #if CYTHON_USE_TYPE_SPECS +#if CYTHON_USE_TYPE_SPECS static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(spec); @@ -26346,12 +25108,12 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject #endif /* FetchSharedCythonModule */ - static PyObject *__Pyx_FetchSharedCythonABIModule(void) { - return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME); } /* FetchCommonType */ - static int __Pyx_VerifyCachedType(PyObject *cached_type, +static int __Pyx_VerifyCachedType(PyObject *cached_type, const char *name, Py_ssize_t basicsize, Py_ssize_t expected_basicsize) { @@ -26451,8 +25213,53 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec } #endif +/* CallTypeTraverse */ +#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000) +#else +static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) { + #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 + if (__Pyx_get_runtime_version() < 0x03090000) return 0; + #endif + if (!always_call) { + PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*); + unsigned long flags = PyType_GetFlags(base); + if (flags & Py_TPFLAGS_HEAPTYPE) { + return 0; + } + } + Py_VISIT((PyObject*)Py_TYPE(o)); + return 0; +} +#endif + +/* PyMethodNew */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *result; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + { + PyObject *args[] = {func, self}; + result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL); + } + #else + result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL); + #endif + return result; +} +#else +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#endif + /* PyVectorcallFastCallDict */ - #if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { PyObject *res = NULL; @@ -26463,7 +25270,12 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector size_t j; PyObject *key, *value; unsigned long keys_are_strings; + #if !CYTHON_ASSUME_SAFE_SIZE + Py_ssize_t nkw = PyDict_Size(kw); + if (unlikely(nkw == -1)) return NULL; + #else Py_ssize_t nkw = PyDict_GET_SIZE(kw); + #endif newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); if (unlikely(newargs == NULL)) { PyErr_NoMemory(); @@ -26479,10 +25291,19 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector pos = i = 0; keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; while (PyDict_Next(kw, &pos, &key, &value)) { - keys_are_strings &= Py_TYPE(key)->tp_flags; + keys_are_strings &= + #if CYTHON_COMPILING_IN_LIMITED_API + PyType_GetFlags(Py_TYPE(key)); + #else + Py_TYPE(key)->tp_flags; + #endif Py_INCREF(key); Py_INCREF(value); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup; + #else PyTuple_SET_ITEM(kwnames, i, key); + #endif kwvalues[i] = value; i++; } @@ -26500,16 +25321,29 @@ static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vector } static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) { - if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + Py_ssize_t kw_size = + likely(kw == NULL) ? + 0 : +#if !CYTHON_ASSUME_SAFE_SIZE + PyDict_Size(kw); +#else + PyDict_GET_SIZE(kw); +#endif + if (kw_size == 0) { return vc(func, args, nargs, NULL); } +#if !CYTHON_ASSUME_SAFE_SIZE + else if (unlikely(kw_size == -1)) { + return NULL; + } +#endif return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); } #endif /* CythonFunctionShared */ - #if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void *cfunc) { if (__Pyx_CyFunction_Check(func)) { return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; } else if (PyCFunction_Check(func)) { @@ -26517,8 +25351,25 @@ static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) } return 0; } +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) { + int result; + PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func); + if (unlikely(!newFunc)) { + PyErr_Clear(); // It's only an optimization, so don't throw an error + return 0; + } + result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc); + Py_DECREF(newFunc); + return result; + } + return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc); +} #else static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (PyMethod_Check(func)) { + func = PyMethod_GET_FUNCTION(func); + } return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; } #endif @@ -26543,11 +25394,7 @@ __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) if (unlikely(!op->func_doc)) return NULL; #else if (((PyCFunctionObject*)op)->m_ml->ml_doc) { -#if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#else - op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); -#endif if (unlikely(op->func_doc == NULL)) return NULL; } else { @@ -26577,10 +25424,8 @@ __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) if (unlikely(op->func_name == NULL)) { #if CYTHON_COMPILING_IN_LIMITED_API op->func_name = PyObject_GetAttrString(op->func, "__name__"); -#elif PY_MAJOR_VERSION >= 3 - op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #else - op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; @@ -26592,12 +25437,7 @@ static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -26617,12 +25457,7 @@ static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -26802,9 +25637,8 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return __Pyx_NewRef(op->func_is_coroutine); } is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; -#if PY_VERSION_HEX >= 0x03050000 if (is_coroutine) { - PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + PyObject *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine; fromlist = PyList_New(1); if (unlikely(!fromlist)) return NULL; Py_INCREF(marker); @@ -26817,7 +25651,7 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { return NULL; } #endif - module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0); Py_DECREF(fromlist); if (unlikely(!module)) goto ignore; op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); @@ -26828,10 +25662,39 @@ __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { ignore: PyErr_Clear(); } -#endif op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); return __Pyx_NewRef(op->func_is_coroutine); } +static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, message, size); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)", + name, message, size); +#endif +} +static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL); + if (!py_name) return; + PyErr_Format(PyExc_TypeError, + "%.200S() %s", + py_name, message); + Py_DECREF(py_name); +#else + const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name; + PyErr_Format(PyExc_TypeError, + "%.200s() %s", + name, message); +#endif +} #if CYTHON_COMPILING_IN_LIMITED_API static PyObject * __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { @@ -26845,24 +25708,24 @@ __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *c } #endif static PyGetSetDef __pyx_CyFunction_getsets[] = { - {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, - {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, - {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, - {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, - {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, - {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, - {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, - {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, - {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, - {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, - {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, + {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, #if CYTHON_COMPILING_IN_LIMITED_API {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, #endif @@ -26870,23 +25733,21 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = { }; static PyMemberDef __pyx_CyFunction_members[] = { #if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, + {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, #endif #if CYTHON_USE_TYPE_SPECS - {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, + {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, #if CYTHON_METH_FASTCALL -#if CYTHON_BACKPORT_VECTORCALL - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API + {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, #else -#if !CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, + {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, #endif #endif -#endif -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, #else - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, #endif #endif {0, 0, 0, 0, 0} @@ -26895,18 +25756,14 @@ static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) { CYTHON_UNUSED_VAR(args); -#if PY_MAJOR_VERSION >= 3 Py_INCREF(m->func_qualname); return m->func_qualname; -#else - return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); -#endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; -#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) @@ -26948,8 +25805,6 @@ static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef * Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; - op->defaults_pyobjects = 0; - op->defaults_size = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; @@ -27011,14 +25866,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); Py_CLEAR(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_XDECREF(pydefaults[i]); - PyObject_Free(m->defaults); - m->defaults = NULL; - } + Py_CLEAR(m->defaults); return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) @@ -27035,6 +25883,10 @@ static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg); + if (e) return e; + } Py_VISIT(m->func_closure); #if CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(m->func); @@ -27042,40 +25894,29 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, Py_VISIT(((PyCFunctionObject*)m)->m_module); #endif Py_VISIT(m->func_dict); - Py_VISIT(m->func_name); - Py_VISIT(m->func_qualname); + __Pyx_VISIT_CONST(m->func_name); + __Pyx_VISIT_CONST(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); - Py_VISIT(m->func_code); + __Pyx_VISIT_CONST(m->func_code); #if !CYTHON_COMPILING_IN_LIMITED_API Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); #endif Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); Py_VISIT(m->func_is_coroutine); - if (m->defaults) { - PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); - int i; - for (i = 0; i < m->defaults_pyobjects; i++) - Py_VISIT(pydefaults[i]); - } + Py_VISIT(m->defaults); return 0; } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { -#if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("", op->func_qualname, (void *)op); -#else - return PyString_FromFormat("", - PyString_AsString(op->func_qualname), (void *)op); -#endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { #if CYTHON_COMPILING_IN_LIMITED_API PyObject *f = ((__pyx_CyFunctionObject*)func)->func; - PyObject *py_name = NULL; PyCFunction meth; int flags; meth = PyCFunction_GetFunction(f); @@ -27097,7 +25938,7 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -27105,24 +25946,15 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif if (likely(size == 0)) return (*meth)(self, NULL); -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes no arguments", size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE size = PyTuple_GET_SIZE(arg); #else size = PyTuple_Size(arg); @@ -27141,18 +25973,9 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py #endif return result; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, - "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - py_name, size); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - f->m_ml->ml_name, size); -#endif + __Pyx_CyFunction_raise_argument_count_error( + (__pyx_CyFunctionObject*)func, + "takes exactly one argument", size); return NULL; } break; @@ -27160,16 +25983,8 @@ static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, Py PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); return NULL; } -#if CYTHON_COMPILING_IN_LIMITED_API - py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); - if (!py_name) return NULL; - PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", - py_name); - Py_DECREF(py_name); -#else - PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", - f->m_ml->ml_name); -#endif + __Pyx_CyFunction_raise_type_error( + (__pyx_CyFunctionObject*)func, "takes no keyword arguments"); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { @@ -27186,10 +26001,10 @@ static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *a static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); if (vc) { -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); #else (void) &__Pyx_PyVectorcall_FastCallDict; @@ -27201,11 +26016,11 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P Py_ssize_t argc; PyObject *new_args; PyObject *self; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE argc = PyTuple_GET_SIZE(args); #else argc = PyTuple_Size(args); - if (unlikely(!argc) < 0) return NULL; + if (unlikely(argc < 0)) return NULL; #endif new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) @@ -27213,14 +26028,9 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); -#if PY_MAJOR_VERSION > 2 PyErr_Format(PyExc_TypeError, "unbound method %.200S() needs an argument", cyfunc->func_qualname); -#else - PyErr_SetString(PyExc_TypeError, - "unbound method needs an argument"); -#endif return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); @@ -27230,21 +26040,21 @@ static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, P } return result; } -#if CYTHON_METH_FASTCALL +#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL) static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) { int ret = 0; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { if (unlikely(nargs < 1)) { - PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", - ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + __Pyx_CyFunction_raise_type_error( + cyfunc, "needs an argument"); return -1; } ret = 1; } - if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) { + __Pyx_CyFunction_raise_type_error( + cyfunc, "takes no keyword arguments"); return -1; } return ret; @@ -27252,13 +26062,18 @@ static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionO static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27266,29 +26081,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *c nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 0)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes no arguments", nargs); return NULL; } - return def->ml_meth(self, NULL); + return meth(self, NULL); } static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { case 1: self = args[0]; @@ -27296,29 +26120,38 @@ static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } if (unlikely(nargs != 1)) { - PyErr_Format(PyExc_TypeError, - "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", - def->ml_name, nargs); + __Pyx_CyFunction_raise_argument_count_error( + cyfunc, "takes exactly one argument", nargs); return NULL; } - return def->ml_meth(self, args[0]); + return meth(self, args[0]); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; #else Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27326,17 +26159,21 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; - PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); #if CYTHON_BACKPORT_VECTORCALL Py_ssize_t nargs = (Py_ssize_t)nargsf; @@ -27344,6 +26181,12 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); #endif PyObject *self; +#if CYTHON_COMPILING_IN_LIMITED_API + PyCFunction meth = PyCFunction_GetFunction(cyfunc->func); + if (unlikely(!meth)) return NULL; +#else + PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth; +#endif switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { case 1: self = args[0]; @@ -27351,12 +26194,17 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject nargs -= 1; break; case 0: +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else self = ((PyCFunctionObject*)cyfunc)->m_self; +#endif break; default: return NULL; } - return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); + return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames); } #endif #if CYTHON_USE_TYPE_SPECS @@ -27379,9 +26227,13 @@ static PyType_Spec __pyx_CyFunctionType_spec = { #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR Py_TPFLAGS_METHOD_DESCRIPTOR | #endif -#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) +#if CYTHON_METH_FASTCALL +#if defined(Py_TPFLAGS_HAVE_VECTORCALL) + Py_TPFLAGS_HAVE_VECTORCALL | +#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL) _Py_TPFLAGS_HAVE_VECTORCALL | #endif +#endif // CYTHON_METH_FASTCALL Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, __pyx_CyFunctionType_slots }; @@ -27401,11 +26253,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { #endif 0, 0, -#if PY_MAJOR_VERSION < 3 - 0, -#else 0, -#endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, @@ -27427,11 +26275,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, -#if PY_VERSION_HEX < 0x030500A0 - offsetof(__pyx_CyFunctionObject, func_weakreflist), -#else offsetof(PyCFunctionObject, m_weakreflist), -#endif 0, 0, __pyx_CyFunction_methods, @@ -27454,9 +26298,7 @@ static PyTypeObject __pyx_CyFunctionType_type = { 0, 0, 0, -#if PY_VERSION_HEX >= 0x030400a1 0, -#endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) 0, #endif @@ -27475,25 +26317,22 @@ static PyTypeObject __pyx_CyFunctionType_type = { }; #endif static int __pyx_CyFunction_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); + mstate->__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); #endif - if (unlikely(__pyx_CyFunctionType == NULL)) { + if (unlikely(mstate->__pyx_CyFunctionType == NULL)) { return -1; } return 0; } -static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { +static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; - m->defaults = PyObject_Malloc(size); + m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type); if (unlikely(!m->defaults)) - return PyErr_NoMemory(); - memset(m->defaults, 0, size); - m->defaults_pyobjects = pyobjects; - m->defaults_size = size; + return NULL; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { @@ -27513,10 +26352,10 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py } /* CythonFunction */ - static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { PyObject *op = __Pyx_CyFunction_Init( - PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType), ml, flags, qualname, closure, module, globals, code ); if (likely(op)) { @@ -27526,7 +26365,7 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py } /* RaiseUnexpectedTypeError */ - static int +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); @@ -27537,7 +26376,7 @@ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) } /* SliceTupleAndList */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) { Py_ssize_t start = *_start, stop = *_stop, length = *_length; if (start < 0) { @@ -27571,14 +26410,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice( #endif /* PyObjectLookupSpecial */ - #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS +#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) { PyObject *res; PyTypeObject *tp = Py_TYPE(obj); -#if PY_MAJOR_VERSION < 3 - if (unlikely(PyInstance_Check(obj))) - return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name); -#endif res = _PyType_Lookup(tp, attr_name); if (likely(res)) { descrgetfunc f = Py_TYPE(res)->tp_descr_get; @@ -27594,36 +26429,138 @@ static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyOb } #endif +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* GetAttr */ - static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { +static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* Globals */ - static PyObject* __Pyx_Globals(void) { - return __Pyx_NewRef(__pyx_d); +static PyObject* __Pyx_Globals(void) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_d); +} + +/* PyVersionSanityCheck */ +static int __Pyx_VersionSanityCheck(void) { + #if CYTHON_COMPILING_IN_CPYTHON + #if PY_VERSION_HEX < 0x03080000 + if (PySys_GetObject("gettotalrefcount")) { + #ifndef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a non-debug version of Python but imported into a debug version." + ); + return -1; + #endif + } else { + #ifdef Py_DEBUG + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with a debug version of Python but imported into a non-debug version." + ); + return -1; + #endif + } + #endif // Py_VERSION_HEX < 0x03080000 + #if PY_VERSION_HEX >= 0x030d0000 + if (PyRun_SimpleStringFlags( + "if " + #ifdef Py_GIL_DISABLED + "not " + #endif + "__import__('sysconfig').get_config_var('Py_GIL_DISABLED'): raise ImportError", + NULL + ) == -1) { + PyErr_SetString( + PyExc_ImportError, + #ifdef Py_GIL_DISABLED + "Module was compiled with a freethreading build of Python but imported into a non-freethreading build." + #else + "Module was compiled with a non-freethreading build of Python but imported into a freethreading build." + #endif + ); + return -1; + } + #endif // version hex 3.13+ + if (PySys_GetObject("getobjects")) { + #ifndef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled without Py_TRACE_REFS but imported into a build of Python with." + ); + return -1; + #endif + } else { + #ifdef Py_TRACE_REFS + PyErr_SetString( + PyExc_ImportError, + "Module was compiled with Py_TRACE_REFS but imported into a build of Python without." + ); + return -1; + #endif + } + const char code[] = "if __import__('sys').getsizeof(object()) != %u: raise ImportError"; + char formattedCode[sizeof(code)+50]; + PyOS_snprintf(formattedCode, sizeof(formattedCode), code, (unsigned int)sizeof(PyObject)); + if (PyRun_SimpleStringFlags(formattedCode, NULL) == -1) { + PyErr_SetString( + PyExc_ImportError, + "Runtime and compile-time PyObject size do not match." + ); + return -1; + } + #endif + return 0; } /* ValidateBasesTuple */ - #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { Py_ssize_t i, n; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE n = PyTuple_GET_SIZE(bases); #else n = PyTuple_Size(bases); - if (n < 0) return -1; + if (unlikely(n < 0)) return -1; #endif for (i = 1; i < n; i++) { + PyTypeObject *b; #if CYTHON_AVOID_BORROWED_REFS PyObject *b0 = PySequence_GetItem(bases, i); if (!b0) return -1; @@ -27632,18 +26569,6 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *b0 = PyTuple_GetItem(bases, i); if (!b0) return -1; -#endif - PyTypeObject *b; -#if PY_MAJOR_VERSION < 3 - if (PyClass_Check(b0)) - { - PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", - PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } #endif b = (PyTypeObject*) b0; if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) @@ -27660,7 +26585,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (dictoffset == 0) { Py_ssize_t b_dictoffset = 0; -#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY +#if CYTHON_USE_TYPE_SLOTS b_dictoffset = b->tp_dictoffset; #else PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); @@ -27680,7 +26605,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs type_name, b_name); __Pyx_DECREF_TypeName(b_name); } -#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) +#if !CYTHON_USE_TYPE_SLOTS dictoffset_return: #endif #if CYTHON_AVOID_BORROWED_REFS @@ -27698,7 +26623,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif /* PyType_Ready */ - static int __Pyx_PyType_Ready(PyTypeObject *t) { +static int __Pyx_PyType_Ready(PyTypeObject *t) { #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) (void)__Pyx_PyObject_CallMethod0; #if CYTHON_USE_TYPE_SPECS @@ -27710,7 +26635,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) return -1; -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) { int gc_was_enabled; #if PY_VERSION_HEX >= 0x030A00b1 @@ -27719,12 +26644,13 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #else PyObject *ret, *py_status; PyObject *gc = NULL; - #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) - gc = PyImport_GetModule(__pyx_kp_u_gc); + #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\ + !CYTHON_COMPILING_IN_GRAAL + gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc); #endif - if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc); if (unlikely(!gc)) return -1; - py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled); if (unlikely(!py_status)) { Py_DECREF(gc); return -1; @@ -27732,7 +26658,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); Py_DECREF(py_status); if (gc_was_enabled > 0) { - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable); if (unlikely(!ret)) { Py_DECREF(gc); return -1; @@ -27751,7 +26677,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs (void)__Pyx_PyObject_CallMethod0; #endif r = PyType_Ready(t); -#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) +#if !defined(PYSTON_MAJOR_VERSION) t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; #if PY_VERSION_HEX >= 0x030A00b1 if (gc_was_enabled) @@ -27760,7 +26686,7 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs if (gc_was_enabled) { PyObject *tp, *v, *tb; PyErr_Fetch(&tp, &v, &tb); - ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable); if (likely(ret || r == -1)) { Py_XDECREF(ret); PyErr_Restore(tp, v, tb); @@ -27779,114 +26705,50 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif } -/* PyObject_GenericGetAttrNoDict */ - #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { - __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); - PyErr_Format(PyExc_AttributeError, -#if PY_MAJOR_VERSION >= 3 - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", - type_name, attr_name); -#else - "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", - type_name, PyString_AS_STRING(attr_name)); -#endif - __Pyx_DECREF_TypeName(type_name); - return NULL; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { - PyObject *descr; - PyTypeObject *tp = Py_TYPE(obj); - if (unlikely(!PyString_Check(attr_name))) { - return PyObject_GenericGetAttr(obj, attr_name); - } - assert(!tp->tp_dictoffset); - descr = _PyType_Lookup(tp, attr_name); - if (unlikely(!descr)) { - return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); - } - Py_INCREF(descr); - #if PY_MAJOR_VERSION < 3 - if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) - #endif - { - descrgetfunc f = Py_TYPE(descr)->tp_descr_get; - if (unlikely(f)) { - PyObject *res = f(descr, obj, (PyObject *)tp); - Py_DECREF(descr); - return res; - } - } - return descr; -} -#endif - /* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *module = 0; PyObject *empty_dict = 0; PyObject *empty_list = 0; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (unlikely(!py_import)) - goto bad; - if (!from_list) { - empty_list = PyList_New(0); - if (unlikely(!empty_list)) - goto bad; - from_list = empty_list; - } - #endif empty_dict = PyDict_New(); if (unlikely(!empty_dict)) goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { - module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, 1); - if (unlikely(!module)) { - if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (unlikely(!py_level)) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != (0)) { module = PyImport_ImportModuleLevelObject( - name, __pyx_d, empty_dict, from_list, level); - #endif + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } } + level = 0; + } + if (!module) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level); } bad: Py_XDECREF(empty_dict); Py_XDECREF(empty_list); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif return module; } /* ImportDottedModule */ - #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + Py_ssize_t size; if (unlikely(PyErr_Occurred())) { PyErr_Clear(); } - if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { +#if CYTHON_ASSUME_SAFE_SIZE + size = PyTuple_GET_SIZE(parts_tuple); +#else + size = PyTuple_Size(parts_tuple); + if (size < 0) goto bad; +#endif + if (likely(size == count)) { partial_name = name; } else { slice = PySequence_GetSlice(parts_tuple, 0, count); @@ -27898,28 +26760,18 @@ static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts partial_name = PyUnicode_Join(sep, slice); } PyErr_Format( -#if PY_MAJOR_VERSION < 3 - PyExc_ImportError, - "No module named '%s'", PyString_AS_STRING(partial_name)); -#else -#if PY_VERSION_HEX >= 0x030600B1 PyExc_ModuleNotFoundError, -#else - PyExc_ImportError, -#endif "No module named '%U'", partial_name); -#endif bad: Py_XDECREF(sep); Py_XDECREF(slice); Py_XDECREF(partial_name); return NULL; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { PyObject *imported_module; -#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) +#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) return NULL; @@ -27930,17 +26782,21 @@ static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { #endif return imported_module; } -#endif -#if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { Py_ssize_t i, nparts; +#if CYTHON_ASSUME_SAFE_SIZE nparts = PyTuple_GET_SIZE(parts_tuple); +#else + nparts = PyTuple_Size(parts_tuple); + if (nparts < 0) return NULL; +#endif for (i=1; i < nparts && module; i++) { PyObject *part, *submodule; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS part = PyTuple_GET_ITEM(parts_tuple, i); #else - part = PySequence_ITEM(parts_tuple, i); + part = __Pyx_PySequence_ITEM(parts_tuple, i); + if (!part) return NULL; #endif submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) @@ -27954,20 +26810,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * } return module; } -#endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__6; - CYTHON_UNUSED_VAR(parts_tuple); - from_list = PyList_New(1); - if (unlikely(!from_list)) - return NULL; - Py_INCREF(star); - PyList_SET_ITEM(from_list, 0, star); - module = __Pyx_Import(name, from_list, 0); - Py_DECREF(from_list); - return module; -#else PyObject *imported_module; PyObject *module = __Pyx_Import(name, NULL, 0); if (!parts_tuple || unlikely(!module)) @@ -27979,15 +26822,14 @@ static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple } PyErr_Clear(); return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); -#endif } static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 +#if CYTHON_COMPILING_IN_CPYTHON PyObject *module = __Pyx__ImportDottedModule_Lookup(name); if (likely(module)) { - PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec); if (likely(spec)) { - PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing); if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { Py_DECREF(spec); spec = NULL; @@ -28007,8 +26849,27 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) return __Pyx__ImportDottedModule(name, parts_tuple); } +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_kp_u_); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } - #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\ + CYTHON_COMPILING_IN_GRAAL { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) @@ -28040,20 +26902,15 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) Py_XDECREF(module_name); } if (unlikely(!value)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif + PyErr_Format(PyExc_ImportError, "cannot import name %S", name); } return value; } /* CalculateMetaclass */ - static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { +static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases; -#if CYTHON_ASSUME_SAFE_MACROS +#if CYTHON_ASSUME_SAFE_SIZE nbases = PyTuple_GET_SIZE(bases); #else nbases = PyTuple_Size(bases); @@ -28068,10 +26925,6 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) if (!tmp) return NULL; #endif tmptype = Py_TYPE(tmp); -#if PY_MAJOR_VERSION < 3 - if (tmptype == &PyClass_Type) - continue; -#endif if (!metaclass) { metaclass = tmptype; continue; @@ -28090,22 +26943,18 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) return NULL; } if (!metaclass) { -#if PY_MAJOR_VERSION < 3 - metaclass = &PyClass_Type; -#else metaclass = &PyType_Type; -#endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ - static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, +static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { - PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare); + PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare); if (prep) { PyObject *pargs[3] = {NULL, name, bases}; ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); @@ -28120,148 +26969,14 @@ static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) } if (unlikely(!ns)) return NULL; - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; -#if PY_VERSION_HEX >= 0x03030000 - if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; -#else - CYTHON_MAYBE_UNUSED_VAR(qualname); -#endif - if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad; + if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad; + if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS -static int __Pyx_SetNamesPEP487(PyObject *type_obj) { - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *names_to_set, *key, *value, *set_name, *tmp; - Py_ssize_t i = 0; -#if CYTHON_USE_TYPE_SLOTS - names_to_set = PyDict_Copy(type->tp_dict); -#else - { - PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict_2); - names_to_set = NULL; - if (likely(d)) { - PyObject *names_to_set = PyDict_New(); - int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1; - Py_DECREF(d); - if (unlikely(ret < 0)) - Py_CLEAR(names_to_set); - } - } -#endif - if (unlikely(names_to_set == NULL)) - goto bad; - while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name); - if (unlikely(set_name != NULL)) { - tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key); - Py_DECREF(set_name); - if (unlikely(tmp == NULL)) { - __Pyx_TypeName value_type_name = - __Pyx_PyType_GetName(Py_TYPE(value)); - __Pyx_TypeName type_name = __Pyx_PyType_GetName(type); - PyErr_Format(PyExc_RuntimeError, -#if PY_MAJOR_VERSION >= 3 - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'", - value_type_name, key, type_name); -#else - "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'", - value_type_name, - PyString_Check(key) ? PyString_AS_STRING(key) : "?", - type_name); -#endif - goto bad; - } else { - Py_DECREF(tmp); - } - } - else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } - Py_DECREF(names_to_set); - return 0; -bad: - Py_XDECREF(names_to_set); - return -1; -} -static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) { -#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyTypeObject *type = (PyTypeObject*) type_obj; - PyObject *mro = type->tp_mro; - Py_ssize_t i, nbases; - if (unlikely(!mro)) goto done; - (void) &__Pyx_GetBuiltinName; - Py_INCREF(mro); - nbases = PyTuple_GET_SIZE(mro); - assert(PyTuple_GET_ITEM(mro, 0) == type_obj); - for (i = 1; i < nbases-1; i++) { - PyObject *base, *dict, *meth; - base = PyTuple_GET_ITEM(mro, i); - dict = ((PyTypeObject *)base)->tp_dict; - meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass); - if (unlikely(meth)) { - descrgetfunc f = Py_TYPE(meth)->tp_descr_get; - PyObject *res; - Py_INCREF(meth); - if (likely(f)) { - res = f(meth, NULL, type_obj); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - meth = res; - } - res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw); - Py_DECREF(meth); - if (unlikely(!res)) goto bad; - Py_DECREF(res); - goto done; - } else if (unlikely(PyErr_Occurred())) { - goto bad; - } - } -done: - Py_XDECREF(mro); - return type_obj; -bad: - Py_XDECREF(mro); - Py_DECREF(type_obj); - return NULL; -#else - PyObject *super_type, *super, *func, *res; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - super_type = __Pyx_GetBuiltinName(__pyx_n_s_super); -#else - super_type = (PyObject*) &PySuper_Type; - (void) &__Pyx_GetBuiltinName; -#endif - super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL; -#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type) - Py_XDECREF(super_type); -#endif - if (unlikely(!super)) { - Py_CLEAR(type_obj); - goto done; - } - func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass); - Py_DECREF(super); - if (likely(!func)) { - if (unlikely(PyErr_Occurred())) - Py_CLEAR(type_obj); - goto done; - } - res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw); - Py_DECREF(func); - if (unlikely(!res)) - Py_CLEAR(type_obj); - Py_XDECREF(res); -done: - return type_obj; -#endif -} -#endif static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { @@ -28269,7 +26984,7 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj PyObject *owned_metaclass = NULL; PyObject *margs[4] = {NULL, name, bases, dict}; if (allow_py2_metaclass) { - owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); + owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { @@ -28285,37 +27000,36 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj return NULL; owned_metaclass = metaclass; } - result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, -#if PY_VERSION_HEX < 0x030600A4 - (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw -#else - mkw -#endif - ); + result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw); Py_XDECREF(owned_metaclass); -#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS - if (likely(result) && likely(PyType_Check(result))) { - if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) { - Py_CLEAR(result); - } else { - result = __Pyx_InitSubclassPEP487(result, mkw); - } - } -#else - (void) &__Pyx_GetBuiltinName; -#endif return result; } /* Py3UpdateBases */ - static PyObject* +static PyObject* __Pyx_PEP560_update_bases(PyObject *bases) { Py_ssize_t i, j, size_bases; - PyObject *base, *meth, *new_base, *result, *new_bases = NULL; + PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL; +#if CYTHON_ASSUME_SAFE_SIZE size_bases = PyTuple_GET_SIZE(bases); +#else + size_bases = PyTuple_Size(bases); + if (size_bases < 0) return NULL; +#endif for (i = 0; i < size_bases; i++) { - base = PyTuple_GET_ITEM(bases, i); +#if CYTHON_AVOID_BORROWED_REFS + Py_CLEAR(base); +#endif +#if CYTHON_ASSUME_SAFE_MACROS + base = PyTuple_GET_ITEM(bases, i); +#else + base = PyTuple_GetItem(bases, i); + if (!base) goto error; +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(base); +#endif if (PyType_Check(base)) { if (new_bases) { if (PyList_Append(new_bases, base) < 0) { @@ -28324,7 +27038,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } continue; } - meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries); + meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries); if (!meth && PyErr_Occurred()) { goto error; } @@ -28352,12 +27066,25 @@ __Pyx_PEP560_update_bases(PyObject *bases) goto error; } for (j = 0; j < i; j++) { - base = PyTuple_GET_ITEM(bases, j); - PyList_SET_ITEM(new_bases, j, base); - Py_INCREF(base); + PyObject *base_from_list; +#if CYTHON_ASSUME_SAFE_MACROS + base_from_list = PyTuple_GET_ITEM(bases, j); + PyList_SET_ITEM(new_bases, j, base_from_list); + Py_INCREF(base_from_list); +#else + base_from_list = PyTuple_GetItem(bases, j); + if (!base_from_list) goto error; + Py_INCREF(base_from_list); + if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error; +#endif } } +#if CYTHON_ASSUME_SAFE_SIZE j = PyList_GET_SIZE(new_bases); +#else + j = PyList_Size(new_bases); + if (j < 0) goto error; +#endif if (PyList_SetSlice(new_bases, j, j, new_base) < 0) { goto error; } @@ -28369,26 +27096,35 @@ __Pyx_PEP560_update_bases(PyObject *bases) } result = PyList_AsTuple(new_bases); Py_DECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return result; error: Py_XDECREF(new_bases); +#if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(base); +#endif return NULL; } /* CyFunctionClassCell */ - static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { - Py_ssize_t i, count = PyList_GET_SIZE(cyfunctions); +static int __Pyx_CyFunction_InitClassCell(PyObject *cyfunctions, PyObject *classobj) { + Py_ssize_t i, count = __Pyx_PyList_GET_SIZE(cyfunctions); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(count < 0)) return -1; + #endif for (i = 0; i < count; i++) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) -#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS PyList_GET_ITEM(cyfunctions, i); #else - PySequence_ITEM(cyfunctions, i); + __Pyx_PySequence_ITEM(cyfunctions, i); if (unlikely(!m)) return -1; #endif __Pyx_CyFunction_SetClassObj(m, classobj); -#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && !CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) Py_DECREF((PyObject*)m); #endif } @@ -28396,7 +27132,7 @@ __Pyx_PEP560_update_bases(PyObject *bases) } /* CLineInTraceback */ - #ifndef CYTHON_CLINE_IN_TRACEBACK +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; @@ -28404,20 +27140,20 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject **cython_runtime_dict; #endif CYTHON_MAYBE_UNUSED_VAR(tstate); - if (unlikely(!__pyx_cython_runtime)) { + if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); @@ -28428,7 +27164,7 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; @@ -28439,7 +27175,6 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { #endif /* CodeObjectCache */ - #if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -28461,8 +27196,8 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; @@ -28475,7 +27210,8 @@ static PyCodeObject *__pyx_find_code_object(int code_line) { Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { @@ -28495,7 +27231,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; @@ -28518,10 +27254,9 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { __pyx_code_cache.count++; Py_INCREF(code_object); } -#endif /* AddTraceback */ - #include "compile.h" +#include "compile.h" #include "frameobject.h" #include "traceback.h" #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) @@ -28538,8 +27273,7 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } @@ -28579,20 +27313,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -28618,58 +27358,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -28700,7 +27399,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -28713,7 +27412,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #endif /* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28725,7 +27424,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG @@ -28735,7 +27434,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -28756,25 +27455,25 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -28784,23 +27483,23 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* FormatTypeName */ - #if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp) { PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); + __pyx_mstate_global->__pyx_n_u_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__61); + name = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2); } return name; } #endif /* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) @@ -28822,7 +27521,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -28832,24 +27531,11 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -29089,7 +27775,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -29099,24 +27785,11 @@ __Pyx_PyType_GetName(PyTypeObject* tp) #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -29356,7 +28029,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) } /* FastTypeChecks */ - #if CYTHON_COMPILING_IN_CPYTHON +#if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); @@ -29396,29 +28069,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -29426,21 +28076,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00a4 @@ -29525,15 +28169,68 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, } #endif +/* ReturnWithStopIteration */ +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async); +static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async) { + if (value == Py_None) { + PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration); + return; + } + __Pyx__ReturnWithStopIteration(value, async); +} +static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) { +#if CYTHON_COMPILING_IN_CPYTHON + __Pyx_PyThreadState_declare +#endif + PyObject *exc; + PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration; +#if CYTHON_COMPILING_IN_CPYTHON + if (PY_VERSION_HEX >= 0x030C00A6 + || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) { + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; + } else { + Py_INCREF(value); + exc = value; + } + #if CYTHON_FAST_THREAD_STATE + __Pyx_PyThreadState_assign + #if CYTHON_USE_EXC_INFO_STACK + if (!__pyx_tstate->exc_info->exc_value) + #else + if (!__pyx_tstate->exc_type) + #endif + { + Py_INCREF(exc_type); + __Pyx_ErrRestore(exc_type, exc, NULL); + return; + } + #endif +#else + exc = __Pyx_PyObject_CallOneArg(exc_type, value); + if (unlikely(!exc)) return; +#endif + PyErr_SetObject(exc_type, exc); + Py_DECREF(exc); +} + /* CoroutineBase */ - #include +#if !CYTHON_COMPILING_IN_LIMITED_API +#include #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION) #ifndef Py_BUILD_CORE #define Py_BUILD_CORE 1 #endif #include "internal/pycore_frame.h" #endif -#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) +#endif // CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void +__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) { +#if CYTHON_USE_AM_SEND + gen->yieldfrom_am_send = NULL; +#endif + Py_CLEAR(gen->yieldfrom); +} static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; @@ -29551,20 +28248,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO Py_INCREF(Py_None); value = Py_None; } -#if PY_VERSION_HEX >= 0x030300A0 else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) { + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); + if (unlikely(!value)) goto limited_api_failure; + #else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); + #endif Py_DECREF(ev); } -#endif else if (unlikely(PyTuple_Check(ev))) { - if (PyTuple_GET_SIZE(ev) >= 1) { + Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(tuple_size < 0)) { + Py_XDECREF(tb); + Py_DECREF(ev); + Py_DECREF(et); + return -1; + } + #endif + if (tuple_size >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); -#else +#elif CYTHON_ASSUME_SAFE_MACROS value = PySequence_ITEM(ev, 0); +#else + value = PySequence_GetItem(ev, 0); + if (!value) goto limited_api_failure; #endif } else { Py_INCREF(Py_None); @@ -29592,27 +28304,35 @@ static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyO } Py_XDECREF(tb); Py_DECREF(et); -#if PY_VERSION_HEX >= 0x030300A0 +#if CYTHON_COMPILING_IN_LIMITED_API + value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value); +#else value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); +#endif Py_DECREF(ev); -#else - { - PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); - Py_DECREF(ev); - if (likely(args)) { - value = PySequence_GetItem(args, 0); - Py_DECREF(args); - } - if (unlikely(!value)) { - __Pyx_ErrRestore(NULL, NULL, NULL); - Py_INCREF(Py_None); - value = Py_None; - } - } +#if CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!value)) return -1; #endif *pvalue = value; return 0; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS + limited_api_failure: + Py_XDECREF(et); + Py_XDECREF(tb); + Py_XDECREF(ev); + return -1; +#endif +} +static CYTHON_INLINE +__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) { + if (*retval) { + return PYGEN_NEXT; + } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) { + return PYGEN_RETURN; + } else { + return PYGEN_ERROR; + } } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { @@ -29649,26 +28369,7 @@ static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) { } PyErr_SetString(PyExc_ValueError, msg); } -#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) -static void __Pyx__Coroutine_NotStartedError(PyObject *gen) { - const char *msg; - CYTHON_MAYBE_UNUSED_VAR(gen); - if ((0)) { - #ifdef __Pyx_Coroutine_USED - } else if (__Pyx_Coroutine_Check(gen)) { - msg = "can't send non-None value to a just-started coroutine"; - #endif - #ifdef __Pyx_AsyncGen_USED - } else if (__Pyx_AsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a just-started async generator"; - #endif - } else { - msg = "can't send non-None value to a just-started generator"; - } - PyErr_SetString(PyExc_TypeError, msg); -} -#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) -static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { +static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) { CYTHON_MAYBE_UNUSED_VAR(gen); CYTHON_MAYBE_UNUSED_VAR(closing); #ifdef __Pyx_Coroutine_USED @@ -29679,26 +28380,22 @@ static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *val if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) - PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); + PyErr_SetNone(PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static -PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { +__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); - if (unlikely(self->resume_label == 0)) { - if (unlikely(value && value != Py_None)) { - return __Pyx_Coroutine_NotStartedError((PyObject*)self); - } - } if (unlikely(self->resume_label == -1)) { - return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); + return PYGEN_ERROR; } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign @@ -29708,7 +28405,7 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i #endif exc_state = &self->gi_exc_state; if (exc_state->exc_value) { - #if CYTHON_COMPILING_IN_PYPY + #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY #else PyObject *exc_tb; #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON @@ -29754,10 +28451,14 @@ PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, i exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif - return retval; + *result = retval; + if (self->resume_label == -1) { + return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR; + } + return PYGEN_NEXT; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { -#if CYTHON_COMPILING_IN_PYPY +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED_VAR(exc_state); #else PyObject *exc_tb; @@ -29784,17 +28485,32 @@ PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { - PyObject *exc = PyExc_StopIteration; - #ifdef __Pyx_AsyncGen_USED - if (__Pyx_AsyncGen_CheckExact(gen)) - exc = __Pyx_PyExc_StopAsyncIteration; - #endif + PyObject *exc = + #ifdef __Pyx_AsyncGen_USED + __Pyx_AsyncGen_CheckExact(gen) ? PyExc_StopAsyncIteration : + #endif + PyExc_StopIteration; __Pyx_PyErr_SetNone(exc); } } return retval; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) +#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval)\ + ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval)) +static PyObject * +__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval) { + CYTHON_MAYBE_UNUSED_VAR(gen); + if (likely(result == PYGEN_RETURN)) { + int is_async = 0; + #ifdef __Pyx_AsyncGen_USED + is_async = __Pyx_AsyncGen_CheckExact(gen); + #endif + __Pyx_ReturnWithStopIteration(retval, is_async); + Py_XDECREF(retval); + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #if PY_VERSION_HEX <= 0x030A00A1 @@ -29831,25 +28547,57 @@ PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) { #endif } #endif -static CYTHON_INLINE -PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { - PyObject *ret; +static CYTHON_INLINE __Pyx_PySendResult +__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) { + __Pyx_PySendResult result; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); - ret = __Pyx_Coroutine_SendEx(gen, val, 0); + result = __Pyx_Coroutine_SendEx(gen, val, retval, 0); Py_XDECREF(val); - return ret; + return result; } +#if CYTHON_USE_AM_SEND +static __Pyx_PySendResult +__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) { + PyObject *ret = NULL; + __Pyx_PySendResult result; + gen->is_running = 1; + result = gen_am_send(gen->yieldfrom, value, &ret); + gen->is_running = 0; + if (result == PYGEN_NEXT) { + assert (ret != NULL); + *retval = ret; + return PYGEN_NEXT; + } + assert (result != PYGEN_ERROR || ret == NULL); + __Pyx_Coroutine_Undelegate(gen); + return __Pyx_Coroutine_SendEx(gen, ret, retval, 0); +} +#endif static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { - PyObject *retval; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); +} +static __Pyx_PySendResult +__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) { + __Pyx_PySendResult result; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; + #if !CYTHON_USE_AM_SEND #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); @@ -29865,66 +28613,65 @@ static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) + #if CYTHON_COMPILING_IN_CPYTHON if (PyGen_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else - #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif + #endif { - if (value == Py_None) - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if !CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x03080000 + if (value == Py_None && PyIter_Check(yf)) + ret = __Pyx_PyIter_Next_Plain(yf); else - ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); + #endif + ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value); } gen->is_running = 0; if (likely(ret)) { - return ret; + *retval = ret; + return PYGEN_NEXT; } - retval = __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, retval); } else { - retval = __Pyx_Coroutine_SendEx(gen, value, 0); + result = __Pyx_Coroutine_SendEx(gen, value, retval, 0); } - return __Pyx_Coroutine_MethodReturn(self, retval); + return result; } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { + __Pyx_PySendResult result; PyObject *retval = NULL; - int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { - retval = __Pyx_Coroutine_Close(yf); - if (!retval) - return -1; + result = __Pyx_Coroutine_Close(yf, &retval); } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { - retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); - if (!retval) - return -1; + result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); + result = PYGEN_RETURN; } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); + result = PYGEN_RETURN; } else #endif { PyObject *meth; + result = PYGEN_RETURN; gen->is_running = 1; - meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close); + meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close); if (unlikely(!meth)) { if (unlikely(PyErr_Occurred())) { PyErr_WriteUnraisable(yf); @@ -29932,20 +28679,29 @@ static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { } else { retval = __Pyx_PyObject_CallNoArg(meth); Py_DECREF(meth); - if (unlikely(!retval)) - err = -1; + if (unlikely(!retval)) { + result = PYGEN_ERROR; + } } gen->is_running = 0; } Py_XDECREF(retval); - return err; + return result == PYGEN_ERROR ? -1 : 0; } static PyObject *__Pyx_Generator_Next(PyObject *self) { + __Pyx_PySendResult result; + PyObject *retval = NULL; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; - PyObject *yf = gen->yieldfrom; - if (unlikely(gen->is_running)) + if (unlikely(gen->is_running)) { return __Pyx_Coroutine_AlreadyRunningError(gen); - if (yf) { + } + #if CYTHON_USE_AM_SEND + if (gen->yieldfrom_am_send) { + result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval); + } else + #endif + if (gen->yieldfrom) { + PyObject *yf = gen->yieldfrom; PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED @@ -29953,36 +28709,47 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) { ret = __Pyx_Generator_Next(yf); } else #endif - #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) - if (PyGen_CheckExact(yf)) { - ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); - } else - #endif #ifdef __Pyx_Coroutine_USED - if (__Pyx_Coroutine_Check(yf)) { + if (__Pyx_Coroutine_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif - ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf); + #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND) + if (PyGen_CheckExact(yf)) { + ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL); + } else + #endif + ret = __Pyx_PyIter_Next_Plain(yf); gen->is_running = 0; if (likely(ret)) { return ret; } - return __Pyx_Coroutine_FinishDelegation(gen); + result = __Pyx_Coroutine_FinishDelegation(gen, &retval); + } else { + result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); } - return __Pyx_Coroutine_SendEx(gen, Py_None, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) { + PyObject *retval = NULL; + __Pyx_PySendResult result; CYTHON_UNUSED_VAR(arg); - return __Pyx_Coroutine_Close(self); + result = __Pyx_Coroutine_Close(self, &retval); + if (unlikely(result == PYGEN_ERROR)) + return NULL; + Py_XDECREF(retval); + Py_RETURN_NONE; } -static PyObject *__Pyx_Coroutine_Close(PyObject *self) { +static __Pyx_PySendResult +__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; - PyObject *retval, *raised_exception; + __Pyx_PySendResult result; PyObject *yf = gen->yieldfrom; int err = 0; - if (unlikely(gen->is_running)) - return __Pyx_Coroutine_AlreadyRunningError(gen); + if (unlikely(gen->is_running)) { + *retval = __Pyx_Coroutine_AlreadyRunningError(gen); + return PYGEN_ERROR; + } if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); @@ -29991,10 +28758,23 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); - retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); - if (unlikely(retval)) { + result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1); + if (result == PYGEN_ERROR) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (!__Pyx_PyErr_Occurred()) { + return PYGEN_RETURN; + } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) { + __Pyx_PyErr_Clear(); + return PYGEN_RETURN; + } + return PYGEN_ERROR; + } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) { + return PYGEN_RETURN; + } else { const char *msg; - Py_DECREF(retval); + Py_DECREF(*retval); + *retval = NULL; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { @@ -30002,25 +28782,14 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) { #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { -#if PY_VERSION_HEX < 0x03060000 - msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; -#else msg = "async generator ignored GeneratorExit"; -#endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); - return NULL; - } - raised_exception = PyErr_Occurred(); - if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { - if (raised_exception) PyErr_Clear(); - Py_INCREF(Py_None); - return Py_None; + return PYGEN_ERROR; } - return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { @@ -30029,6 +28798,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { + __Pyx_PySendResult result; PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { @@ -30036,7 +28806,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); + goto propagate_exception; goto throw_here; } gen->is_running = 1; @@ -30054,7 +28824,7 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw); + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw); if (unlikely(!meth)) { Py_DECREF(yf); if (unlikely(PyErr_Occurred())) { @@ -30075,20 +28845,25 @@ static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject } gen->is_running = 0; Py_DECREF(yf); - if (!ret) { - ret = __Pyx_Coroutine_FinishDelegation(gen); - } - return __Pyx_Coroutine_MethodReturn(self, ret); + if (ret) + return ret; + result = __Pyx_Coroutine_FinishDelegation(gen, &ret); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); - return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); +propagate_exception: + { + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0); + return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval); + } } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; - if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))) + if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb))) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } @@ -30103,6 +28878,10 @@ static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { + { + int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg); + if (e) return e; + } Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); @@ -30112,7 +28891,7 @@ static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); - Py_CLEAR(gen->yieldfrom); + __Pyx_Coroutine_Undelegate(gen); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { @@ -30133,10 +28912,13 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { PyObject_ClearWeakRefs(self); if (gen->resume_label >= 0) { PyObject_GC_Track(self); -#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE +#if CYTHON_USE_TP_FINALIZE if (unlikely(PyObject_CallFinalizerFromDealloc(self))) #else - Py_TYPE(gen)->tp_del(self); + { + destructor del = __Pyx_PyObject_GetSlot(gen, tp_del, destructor); + if (del) del(self); + } if (unlikely(Py_REFCNT(self) > 0)) #endif { @@ -30155,6 +28937,7 @@ static void __Pyx_Coroutine_dealloc(PyObject *self) { __Pyx_Coroutine_clear(self); __Pyx_PyHeapTypeObject_GC_Del(gen); } +#if !(CYTHON_USE_TYPE_SPECS && !CYTHON_USE_TP_FINALIZE) static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; @@ -30191,42 +28974,18 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif { PyObject_GC_UnTrack(self); -#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); -#else - {PyObject *msg; - char *cmsg; - #if CYTHON_COMPILING_IN_PYPY - msg = NULL; - cmsg = (char*) "coroutine was never awaited"; - #else - char *cname; - PyObject *qualname; - qualname = gen->gi_qualname; - cname = PyString_AS_STRING(qualname); - msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); - if (unlikely(!msg)) { - PyErr_Clear(); - cmsg = (char*) "coroutine was never awaited"; - } else { - cmsg = PyString_AS_STRING(msg); - } - #endif - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) - PyErr_WriteUnraisable(self); - Py_XDECREF(msg);} -#endif PyObject_GC_Track(self); } #endif } else { - PyObject *res = __Pyx_Coroutine_Close(self); - if (unlikely(!res)) { - if (PyErr_Occurred()) - PyErr_WriteUnraisable(self); + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval); + if (result == PYGEN_ERROR) { + PyErr_WriteUnraisable(self); } else { - Py_DECREF(res); + Py_XDECREF(retval); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); @@ -30236,9 +28995,13 @@ static void __Pyx_Coroutine_del(PyObject *self) { return; } { +#if !CYTHON_COMPILING_IN_LIMITED_API Py_ssize_t refcnt = Py_REFCNT(self); _Py_NewReference(self); __Pyx_SET_REFCNT(self, refcnt); +#else + #error __Pyx_Coroutine_del with Limited API and without CYTHON_USE_TP_FINALIZE should never be compiled +#endif } #if CYTHON_COMPILING_IN_CPYTHON assert(PyType_IS_GC(Py_TYPE(self)) && @@ -30251,6 +29014,7 @@ static void __Pyx_Coroutine_del(PyObject *self) { #endif #endif } +#endif static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context) { @@ -30264,12 +29028,7 @@ static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; @@ -30291,12 +29050,7 @@ static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context) { CYTHON_UNUSED_VAR(context); -#if PY_MAJOR_VERSION >= 3 - if (unlikely(value == NULL || !PyUnicode_Check(value))) -#else - if (unlikely(value == NULL || !PyString_Check(value))) -#endif - { + if (unlikely(value == NULL || !PyUnicode_Check(value))) { PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; @@ -30308,6 +29062,7 @@ __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void static PyObject * __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) { +#if !CYTHON_COMPILING_IN_LIMITED_API PyObject *frame = self->gi_frame; CYTHON_UNUSED_VAR(context); if (!frame) { @@ -30317,7 +29072,7 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) frame = (PyObject *) PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (unlikely(!frame)) @@ -30326,6 +29081,11 @@ __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) } Py_INCREF(frame); return frame; +#else + CYTHON_UNUSED_VAR(self); + CYTHON_UNUSED_VAR(context); + Py_RETURN_NONE; +#endif } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, @@ -30345,7 +29105,8 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; - #if PY_VERSION_HEX >= 0x030B00a4 + gen->yieldfrom_am_send = NULL; + #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API gen->gi_exc_state.exc_value = NULL; #else gen->gi_exc_state.exc_type = NULL; @@ -30369,131 +29130,34 @@ static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( return gen; } -/* PatchModuleWithCoroutine */ - static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - int result; - PyObject *globals, *result_obj; - globals = PyDict_New(); if (unlikely(!globals)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_coroutine_type", - #ifdef __Pyx_Coroutine_USED - (PyObject*)__pyx_CoroutineType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - result = PyDict_SetItemString(globals, "_cython_generator_type", - #ifdef __Pyx_Generator_USED - (PyObject*)__pyx_GeneratorType); - #else - Py_None); - #endif - if (unlikely(result < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; - if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; - result_obj = PyRun_String(py_code, Py_file_input, globals, globals); - if (unlikely(!result_obj)) goto ignore; - Py_DECREF(result_obj); - Py_DECREF(globals); - return module; -ignore: - Py_XDECREF(globals); - PyErr_WriteUnraisable(module); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { - Py_DECREF(module); - module = NULL; - } -#else - py_code++; -#endif - return module; -} - -/* PatchGeneratorABC */ - #ifndef CYTHON_REGISTER_ABCS -#define CYTHON_REGISTER_ABCS 1 -#endif -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) -static PyObject* __Pyx_patch_abc_module(PyObject *module); -static PyObject* __Pyx_patch_abc_module(PyObject *module) { - module = __Pyx_Coroutine_patch_module( - module, "" -"if _cython_generator_type is not None:\n" -" try: Generator = _module.Generator\n" -" except AttributeError: pass\n" -" else: Generator.register(_cython_generator_type)\n" -"if _cython_coroutine_type is not None:\n" -" try: Coroutine = _module.Coroutine\n" -" except AttributeError: pass\n" -" else: Coroutine.register(_cython_coroutine_type)\n" - ); - return module; -} -#endif -static int __Pyx_patch_abc(void) { -#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - static int abc_patched = 0; - if (CYTHON_REGISTER_ABCS && !abc_patched) { - PyObject *module; - module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); - if (unlikely(!module)) { - PyErr_WriteUnraisable(NULL); - if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, - ((PY_MAJOR_VERSION >= 3) ? - "Cython module failed to register with collections.abc module" : - "Cython module failed to register with collections module"), 1) < 0)) { - return -1; - } - } else { - module = __Pyx_patch_abc_module(module); - abc_patched = 1; - if (unlikely(!module)) - return -1; - Py_DECREF(module); - } - module = PyImport_ImportModule("backports_abc"); - if (module) { - module = __Pyx_patch_abc_module(module); - Py_XDECREF(module); - } - if (!module) { - PyErr_Clear(); - } - } -#else - if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); -#endif - return 0; -} - /* Generator */ - static PyMethodDef __pyx_Generator_methods[] = { +static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, - (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, - (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, + PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, - (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, + PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { - {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, - {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, - (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, - {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, - {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, + {"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, + {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, + PyDoc_STR("object being iterated by 'yield from', or None")}, + {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, + {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0}, #if CYTHON_USE_TYPE_SPECS - {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, + {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0}, #endif {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { - {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, - (char*) PyDoc_STR("name of the generator"), 0}, - {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, - (char*) PyDoc_STR("qualified name of the generator"), 0}, - {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, - (char*) PyDoc_STR("Frame of the generator"), 0}, + {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, + PyDoc_STR("name of the generator"), 0}, + {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, + PyDoc_STR("qualified name of the generator"), 0}, + {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL, + PyDoc_STR("Frame of the generator"), 0}, {0, 0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS @@ -30505,9 +29169,12 @@ static PyType_Slot __pyx_GeneratorType_slots[] = { {Py_tp_methods, (void *)__pyx_Generator_methods}, {Py_tp_members, (void *)__pyx_Generator_memberlist}, {Py_tp_getset, (void *)__pyx_Generator_getsets}, - {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict}, + {Py_tp_getattro, (void *) PyObject_GenericGetAttr}, #if CYTHON_USE_TP_FINALIZE {Py_tp_finalize, (void *)__Pyx_Coroutine_del}, +#endif +#if __PYX_HAS_PY_AM_SEND + {Py_am_send, (void *)__Pyx_Coroutine_AmSend}, #endif {0, 0}, }; @@ -30519,6 +29186,12 @@ static PyType_Spec __pyx_GeneratorType_spec = { __pyx_GeneratorType_slots }; #else +static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async = { + 0, + 0, + 0, + __Pyx_Coroutine_AmSend, +}; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) __PYX_TYPE_MODULE_PREFIX "generator", @@ -30528,6 +29201,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, + __Pyx_SlotTpAsAsync(__pyx_Generator_as_async), 0, 0, 0, @@ -30538,8 +29212,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, 0, 0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE | __Pyx_TPFLAGS_HAVE_AM_SEND, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, @@ -30573,7 +29246,7 @@ static PyTypeObject __pyx_GeneratorType_type = { 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, -#elif PY_VERSION_HEX >= 0x030400a1 +#else 0, #endif #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) @@ -30594,45 +29267,60 @@ static PyTypeObject __pyx_GeneratorType_type = { }; #endif static int __pyx_Generator_init(PyObject *module) { + __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module); #if CYTHON_USE_TYPE_SPECS - __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL); #else - CYTHON_UNUSED_VAR(module); - __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; - __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); + mstate->__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); #endif - if (unlikely(!__pyx_GeneratorType)) { + if (unlikely(!mstate->__pyx_GeneratorType)) { return -1; } return 0; } +static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) { + __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; + PyObject *retval = NULL; + __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0); + (void) result; + assert (result == PYGEN_RETURN || result == PYGEN_ERROR); + assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL)); + return retval; +} -/* CheckBinaryVersion */ - static unsigned long __Pyx_get_runtime_version(void) { +/* GetRuntimeVersion */ +static unsigned long __Pyx_get_runtime_version(void) { #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -30655,45 +29343,164 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } } -/* InitStrings */ - #if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); +/* NewCodeObj */ +#if CYTHON_COMPILING_IN_LIMITED_API + static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} +#elif PY_VERSION_HEX >= 0x030B0000 + static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static PyObject* __Pyx_PyCode_New( + __Pyx_PyCode_New_function_description descr, + PyObject **varnames, + PyObject* filename, + PyObject *funcname, + const char *line_table, + PyObject *tuple_dedup_map +) { + PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL; + Py_ssize_t var_count = (Py_ssize_t) descr.nlocals; + PyObject *varnames_tuple = PyTuple_New(var_count); + if (unlikely(!varnames_tuple)) return NULL; + for (Py_ssize_t i=0; i < var_count; i++) { + Py_INCREF(varnames[i]); + if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done; + } + #if CYTHON_COMPILING_IN_LIMITED_API + varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple); + if (!varnames_tuple_dedup) { + if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done; + varnames_tuple_dedup = varnames_tuple; + } + #else + varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple); + if (unlikely(!varnames_tuple_dedup)) goto done; + #endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(varnames_tuple_dedup); + #endif + if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL) { + line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length); + if (unlikely(!line_table_bytes)) goto done; + Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3; + code_bytes = PyBytes_FromStringAndSize(NULL, code_len); + if (unlikely(!code_bytes)) goto done; + char* c_code_bytes = PyBytes_AsString(code_bytes); + if (unlikely(!c_code_bytes)) goto done; + memset(c_code_bytes, 0, (size_t) code_len); + } + code_obj = (PyObject*) __Pyx__PyCode_New( + (int) descr.argcount, + (int) descr.num_posonly_args, + (int) descr.num_kwonly_args, + (int) descr.nlocals, + 0, + (int) descr.flags, + code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + varnames_tuple_dedup, + __pyx_mstate_global->__pyx_empty_tuple, + __pyx_mstate_global->__pyx_empty_tuple, + filename, + funcname, + (int) descr.first_line, + (__PYX_LIMITED_VERSION_HEX >= (0x030b0000)) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes + ); +done: + Py_XDECREF(code_bytes); + Py_XDECREF(line_table_bytes); + #if CYTHON_AVOID_BORROWED_REFS + Py_XDECREF(varnames_tuple_dedup); + #endif + Py_DECREF(varnames_tuple); + return code_obj; +} + +/* InitStrings */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -30721,31 +29528,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -30757,16 +29563,12 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif @@ -30798,9 +29600,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -30814,74 +29615,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -30927,23 +29698,19 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } @@ -30951,8 +29718,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } diff --git a/cythonize_build.py b/cythonize_build.py index e94b520..50e0307 100644 --- a/cythonize_build.py +++ b/cythonize_build.py @@ -7,7 +7,9 @@ import shutil from subprocess import CalledProcessError from warnings import warn +from packaging.version import Version +from Cython.Compiler.Version import version as cython_version from Cython.Build import build_ext, cythonize from setuptools import Distribution, Extension @@ -20,8 +22,23 @@ for module in cython_modules ] +# set compiler directives +compiler_directives = {} +try: + from sys import _is_gil_enabled + if not _is_gil_enabled() and Version(cython_version) >= Version("3.1.0a0"): + compiler_directives["freethreading_compatible"] = True +except ImportError: + pass + # Cythonize the files -ext_modules = cythonize(extensions, include_path=[module_name], language_level=3, force=True) +ext_modules = cythonize( + extensions, + include_path=[module_name], + language_level=3, + force=True, + compiler_directives=compiler_directives +) dist = Distribution({"ext_modules": ext_modules}) try: cmd = build_ext(dist) # bundle into a library file diff --git a/poetry.lock b/poetry.lock index 45fc111..e04a24e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -288,76 +288,74 @@ toml = ["tomli"] [[package]] name = "cython" -version = "3.0.12" +version = "3.1.0a1" description = "The Cython compiler for writing C extensions in the Python language." optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" +python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "Cython-3.0.12-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ba67eee9413b66dd9fbacd33f0bc2e028a2a120991d77b5fd4b19d0b1e4039b9"}, - {file = "Cython-3.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bee2717e5b5f7d966d0c6e27d2efe3698c357aa4d61bb3201997c7a4f9fe485a"}, - {file = "Cython-3.0.12-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7cffc3464f641c8d0dda942c7c53015291beea11ec4d32421bed2f13b386b819"}, - {file = "Cython-3.0.12-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d3a8f81980ffbd74e52f9186d8f1654e347d0c44bfea6b5997028977f481a179"}, - {file = "Cython-3.0.12-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8d32856716c369d01f2385ad9177cdd1a11079ac89ea0932dc4882de1aa19174"}, - {file = "Cython-3.0.12-cp310-cp310-win32.whl", hash = "sha256:712c3f31adec140dc60d064a7f84741f50e2c25a8edd7ae746d5eb4d3ef7072a"}, - {file = "Cython-3.0.12-cp310-cp310-win_amd64.whl", hash = "sha256:d6945694c5b9170cfbd5f2c0d00ef7487a2de7aba83713a64ee4ebce7fad9e05"}, - {file = "Cython-3.0.12-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:feb86122a823937cc06e4c029d80ff69f082ebb0b959ab52a5af6cdd271c5dc3"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfdbea486e702c328338314adb8e80f5f9741f06a0ae83aaec7463bc166d12e8"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:563de1728c8e48869d2380a1b76bbc1b1b1d01aba948480d68c1d05e52d20c92"}, - {file = "Cython-3.0.12-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:398d4576c1e1f6316282aa0b4a55139254fbed965cba7813e6d9900d3092b128"}, - {file = "Cython-3.0.12-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1e5eadef80143026944ea8f9904715a008f5108d1d644a89f63094cc37351e73"}, - {file = "Cython-3.0.12-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5a93cbda00a5451175b97dea5a9440a3fcee9e54b4cba7a7dbcba9a764b22aec"}, - {file = "Cython-3.0.12-cp311-cp311-win32.whl", hash = "sha256:3109e1d44425a2639e9a677b66cd7711721a5b606b65867cb2d8ef7a97e2237b"}, - {file = "Cython-3.0.12-cp311-cp311-win_amd64.whl", hash = "sha256:d4b70fc339adba1e2111b074ee6119fe9fd6072c957d8597bce9a0dd1c3c6784"}, - {file = "Cython-3.0.12-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe030d4a00afb2844f5f70896b7f2a1a0d7da09bf3aa3d884cbe5f73fff5d310"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7fec4f052b8fe173fe70eae75091389955b9a23d5cec3d576d21c5913b49d47"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0faa5e39e5c8cdf6f9c3b1c3f24972826e45911e7f5b99cf99453fca5432f45e"}, - {file = "Cython-3.0.12-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d53de996ed340e9ab0fc85a88aaa8932f2591a2746e1ab1c06e262bd4ec4be7"}, - {file = "Cython-3.0.12-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ea3a0e19ab77266c738aa110684a753a04da4e709472cadeff487133354d6ab8"}, - {file = "Cython-3.0.12-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c151082884be468f2f405645858a857298ac7f7592729e5b54788b5c572717ba"}, - {file = "Cython-3.0.12-cp312-cp312-win32.whl", hash = "sha256:3083465749911ac3b2ce001b6bf17f404ac9dd35d8b08469d19dc7e717f5877a"}, - {file = "Cython-3.0.12-cp312-cp312-win_amd64.whl", hash = "sha256:c0b91c7ebace030dd558ea28730de8c580680b50768e5af66db2904a3716c3e3"}, - {file = "Cython-3.0.12-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4ee6f1ea1bead8e6cbc4e64571505b5d8dbdb3b58e679d31f3a84160cebf1a1a"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57aefa6d3341109e46ec1a13e3a763aaa2cbeb14e82af2485b318194be1d9170"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:879ae9023958d63c0675015369384642d0afb9c9d1f3473df9186c42f7a9d265"}, - {file = "Cython-3.0.12-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:36fcd584dae547de6f095500a380f4a0cce72b7a7e409e9ff03cb9beed6ac7a1"}, - {file = "Cython-3.0.12-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:62b79dcc0de49efe9e84b9d0e2ae0a6fc9b14691a65565da727aa2e2e63c6a28"}, - {file = "Cython-3.0.12-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4aa255781b093a8401109d8f2104bbb2e52de7639d5896aefafddc85c30e0894"}, - {file = "Cython-3.0.12-cp313-cp313-win32.whl", hash = "sha256:77d48f2d4bab9fe1236eb753d18f03e8b2619af5b6f05d51df0532a92dfb38ab"}, - {file = "Cython-3.0.12-cp313-cp313-win_amd64.whl", hash = "sha256:86c304b20bd57c727c7357e90d5ba1a2b6f1c45492de2373814d7745ef2e63b4"}, - {file = "Cython-3.0.12-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ff5c0b6a65b08117d0534941d404833d516dac422eee88c6b4fd55feb409a5ed"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:680f1d6ed4436ae94805db264d6155ed076d2835d84f20dcb31a7a3ad7f8668c"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebc24609613fa06d0d896309f7164ba168f7e8d71c1e490ed2a08d23351c3f41"}, - {file = "Cython-3.0.12-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1879c073e2b34924ce9b7ca64c212705dcc416af4337c45f371242b2e5f6d32"}, - {file = "Cython-3.0.12-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:bfb75123dd4ff767baa37d7036da0de2dfb6781ff256eef69b11b88b9a0691d1"}, - {file = "Cython-3.0.12-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:f39640f8df0400cde6882e23c734f15bb8196de0a008ae5dc6c8d1ec5957d7c8"}, - {file = "Cython-3.0.12-cp36-cp36m-win32.whl", hash = "sha256:8c9efe9a0895abee3cadfdad4130b30f7b5e57f6e6a51ef2a44f9fc66a913880"}, - {file = "Cython-3.0.12-cp36-cp36m-win_amd64.whl", hash = "sha256:63d840f2975e44d74512f8f34f1f7cb8121c9428e26a3f6116ff273deb5e60a2"}, - {file = "Cython-3.0.12-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:75c5acd40b97cff16fadcf6901a91586cbca5dcdba81f738efaf1f4c6bc8dccb"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e62564457851db1c40399bd95a5346b9bb99e17a819bf583b362f418d8f3457a"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ccd1228cc203b1f1b8a3d403f5a20ad1c40e5879b3fbf5851ce09d948982f2c"}, - {file = "Cython-3.0.12-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:25529ee948f44d9a165ff960c49d4903267c20b5edf2df79b45924802e4cca6e"}, - {file = "Cython-3.0.12-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:90cf599372c5a22120609f7d3a963f17814799335d56dd0dcf8fe615980a8ae1"}, - {file = "Cython-3.0.12-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:9f8c48748a9c94ea5d59c26ab49ad0fad514d36f894985879cf3c3ca0e600bf4"}, - {file = "Cython-3.0.12-cp37-cp37m-win32.whl", hash = "sha256:3e4fa855d98bc7bd6a2049e0c7dc0dcf595e2e7f571a26e808f3efd84d2db374"}, - {file = "Cython-3.0.12-cp37-cp37m-win_amd64.whl", hash = "sha256:120681093772bf3600caddb296a65b352a0d3556e962b9b147efcfb8e8c9801b"}, - {file = "Cython-3.0.12-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:731d719423e041242c9303c80cae4327467299b90ffe62d4cc407e11e9ea3160"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3238a29f37999e27494d120983eca90d14896b2887a0bd858a381204549137a"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b588c0a089a9f4dd316d2f9275230bad4a7271e5af04e1dc41d2707c816be44b"}, - {file = "Cython-3.0.12-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ab9f5198af74eb16502cc143cdde9ca1cbbf66ea2912e67440dd18a36e3b5fa"}, - {file = "Cython-3.0.12-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:8ee841c0e114efa1e849c281ac9b8df8aa189af10b4a103b1c5fd71cbb799679"}, - {file = "Cython-3.0.12-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:43c48b5789398b228ea97499f5b864843ba9b1ab837562a9227c6f58d16ede8b"}, - {file = "Cython-3.0.12-cp38-cp38-win32.whl", hash = "sha256:5e5f17c48a4f41557fbcc7ee660ccfebe4536a34c557f553b6893c1b3c83df2d"}, - {file = "Cython-3.0.12-cp38-cp38-win_amd64.whl", hash = "sha256:309c081057930bb79dc9ea3061a1af5086c679c968206e9c9c2ec90ab7cb471a"}, - {file = "Cython-3.0.12-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:54115fcc126840926ff3b53cfd2152eae17b3522ae7f74888f8a41413bd32f25"}, - {file = "Cython-3.0.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:629db614b9c364596d7c975fa3fb3978e8c5349524353dbe11429896a783fc1e"}, - {file = "Cython-3.0.12-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af081838b0f9e12a83ec4c3809a00a64c817f489f7c512b0e3ecaf5f90a2a816"}, - {file = "Cython-3.0.12-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:34ce459808f7d8d5d4007bc5486fe50532529096b43957af6cbffcb4d9cc5c8d"}, - {file = "Cython-3.0.12-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:d6c6cd6a75c8393e6805d17f7126b96a894f310a1a9ea91c47d141fb9341bfa8"}, - {file = "Cython-3.0.12-cp39-cp39-win32.whl", hash = "sha256:a4032e48d4734d2df68235d21920c715c451ac9de15fa14c71b378e8986b83be"}, - {file = "Cython-3.0.12-cp39-cp39-win_amd64.whl", hash = "sha256:dcdc3e5d4ce0e7a4af6903ed580833015641e968d18d528d8371e2435a34132c"}, - {file = "Cython-3.0.12-py2.py3-none-any.whl", hash = "sha256:0038c9bae46c459669390e53a1ec115f8096b2e4647ae007ff1bf4e6dee92806"}, - {file = "cython-3.0.12.tar.gz", hash = "sha256:b988bb297ce76c671e28c97d017b95411010f7c77fa6623dd0bb47eed1aee1bc"}, + {file = "Cython-3.1.0a1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c1e4c2147dc6008aa180532f125d5796f868aa94a261ac9f6995e89a6858f62f"}, + {file = "Cython-3.1.0a1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7c57d1c942169f684ac85903f2482ef31e4ce311ce603252e03faab97c3777d2"}, + {file = "Cython-3.1.0a1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a06d775f9fca3dfdc8ae253621ddf43c74e9b3cc36d738fff0e80a146e881070"}, + {file = "Cython-3.1.0a1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f4c07447bcec0699ed880dc45c7dfa5a65571c2d66069cae706fe6dada3d84d"}, + {file = "Cython-3.1.0a1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83a7a54df19007395e40a3555fb4ac8658a44c0b6eaea23487e93290ed43f4ae"}, + {file = "Cython-3.1.0a1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a802a9ef5007b1aeb0b69ee10370624de4c4b4878903b28610579fd4a8f2365a"}, + {file = "Cython-3.1.0a1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e6b7893d73ef568a54eaddb83d2c6b412fe97909d9d557121ed303e0e0aea926"}, + {file = "Cython-3.1.0a1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ddf3e87e3f2c33eba936adcbd8cc1adb6bd9eb1449fa13bac1bb6cdefc1ef2cc"}, + {file = "Cython-3.1.0a1-cp310-cp310-win32.whl", hash = "sha256:48664ab41181579fbe9bda2e83f8ed5ae06a4655f28c6e7d54b66f42ef6b4389"}, + {file = "Cython-3.1.0a1-cp310-cp310-win_amd64.whl", hash = "sha256:8da7d9e03bc11c34d1ad432d72d93961c6cc6ba1801874f6e46fa6bd1e2206c8"}, + {file = "Cython-3.1.0a1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e20a4100ad315ef951cfd47516f803da4a2a9466859c93be0036314765bbf1c1"}, + {file = "Cython-3.1.0a1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aa64ac7ee21afa2ab2f5f5346eed2a044e002af7eac0cabd8c393156c2ad77fd"}, + {file = "Cython-3.1.0a1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41723163bafe249afa01b0e7b9c1636101d9fa2bdd3c69caff7c4a598a63f325"}, + {file = "Cython-3.1.0a1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e02fbcff942ad944208b19c338bd8957462a4b0b11b16bf8c9499372292a4ff3"}, + {file = "Cython-3.1.0a1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18f6a4fdd8c17c86b89477af88a09e0e7f30601d5f78687cad4ee4d0bdaf463f"}, + {file = "Cython-3.1.0a1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6029bef4bfd55d1b4951eaaaff64a1853edbe888d07717574f9c8de4967e7f0"}, + {file = "Cython-3.1.0a1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:249ab22172379eda8bd18ab608eec6b4f19e873cffae17b4e75388cf9e9d5d55"}, + {file = "Cython-3.1.0a1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:e5c6b85f16de1d4291ed6fbf5e8f4f2ab225fe1a2acc23bd9621f5629313188c"}, + {file = "Cython-3.1.0a1-cp311-cp311-win32.whl", hash = "sha256:0f1b8c3369cd03af3598a619addd1d4e14def0e9663fd245c4dffd56a3268e8a"}, + {file = "Cython-3.1.0a1-cp311-cp311-win_amd64.whl", hash = "sha256:1cc0ef4b95cfa47a7997b28a29a5edc028eaf085b40b9733df4c80ab2eaa98a7"}, + {file = "Cython-3.1.0a1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ae39d5433b5ce8f20488d8f15564bf9dbe60485d289f8414ead22e4ff12300e5"}, + {file = "Cython-3.1.0a1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1ba885c752b90b95a2ee1cb2f11d7c3d8b8f8a050ce92d26424fe364169027da"}, + {file = "Cython-3.1.0a1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:283ebc232a1c40094289d63948cbfdaa68e1ad6063e85df09723ddfa42b2c1b5"}, + {file = "Cython-3.1.0a1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e963b832ac2bbdf2339f702fda01bfd7b58b6dc63d016166e433856723781582"}, + {file = "Cython-3.1.0a1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:143608ede2f174ab2a5ca38f9176e25de78f1ea190f7f1ebd69c8723b194d49c"}, + {file = "Cython-3.1.0a1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4fe45159862b938d880f870330e859ca558760e682eb823f5bc4f899aa2b9341"}, + {file = "Cython-3.1.0a1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:90fe12ad2df8b771a4c6331c201bb270c111a5c05996a39507d867baaab30d6f"}, + {file = "Cython-3.1.0a1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4db8376cbc593fb098ae5bad630f49ffcd8bc316f15e88140c75aaf783ca1711"}, + {file = "Cython-3.1.0a1-cp312-cp312-win32.whl", hash = "sha256:8d1ba35229437d52e97a8528664a110be2459a0c5c92d0a90742e20f72efd710"}, + {file = "Cython-3.1.0a1-cp312-cp312-win_amd64.whl", hash = "sha256:9b7772e89992089343c2c8d3c87805a6e9b9596b27c11d128f72deeac6fc1d18"}, + {file = "Cython-3.1.0a1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:fd1bce08aba8a877fb80e06f76cb538b6052df41dc6e0a51cc06e77dd31b5066"}, + {file = "Cython-3.1.0a1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1a047a0c7d97aa490ef5578084b31c5daeedb4b09d6702012d438c740636adb1"}, + {file = "Cython-3.1.0a1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2215af12740658246f6c82d77dd8ce2c5f761274d797349c5715cac1b37f667a"}, + {file = "Cython-3.1.0a1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:866633cc97dbe8502b22e306293f696dcfc31c062431301d16de82faf4cb7ade"}, + {file = "Cython-3.1.0a1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bc00b33a762c609925063f367b2560bdc4e674621c84e7274922b5e1007863d0"}, + {file = "Cython-3.1.0a1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3e987fde4bf7067c96a5735a61ca88e62d7e40fbda36d3aeeb90950df42142f8"}, + {file = "Cython-3.1.0a1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:3ed286f0f946227ec6f154b27a899bd120ff57008f43bdcb4e33eb46e89b3864"}, + {file = "Cython-3.1.0a1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ac278d0e516aec36fa44a9ac88a35dd5f80fb8e5ab7a80e4a561a530d0d80975"}, + {file = "Cython-3.1.0a1-cp313-cp313-win32.whl", hash = "sha256:8f7abe5a81712c65b4c85e027980d60d8704357074ed463c69a9022ab707147d"}, + {file = "Cython-3.1.0a1-cp313-cp313-win_amd64.whl", hash = "sha256:1b0832576e717b91e6f82b1367f2d9b5e0da5d65ff6c1a5399574b93226d33a5"}, + {file = "Cython-3.1.0a1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ac62d020f0b6d693c64470d785b7b0864e014d7c1605b2889930258e2205173c"}, + {file = "Cython-3.1.0a1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f87036abdb83ed213e297f78d47f91d37f2fd91202498d0ee9c566617970ee67"}, + {file = "Cython-3.1.0a1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68a63e03395a11817f1cfe6120b1c672dcdc13dcb27a62cbb5cdc2aade272e1e"}, + {file = "Cython-3.1.0a1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c19b7e8b88d9a1480e5380ba48f6dbb4a2b7295afdfb518ccf44a3b917f798b1"}, + {file = "Cython-3.1.0a1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7fa1d0442e1c97ae43d14f40949650b42f1275262e3071c709dca9c96946f714"}, + {file = "Cython-3.1.0a1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:92bccb6d9eda46705cb74d54232ef0aa575b5677638b895ddfc877c1da6f7cb0"}, + {file = "Cython-3.1.0a1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:2afa2becf3c323976dbafd934ceb60f0cc3eb561ca297529b53b001ac66f7dc1"}, + {file = "Cython-3.1.0a1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:92ef6cc5b573335603fcbb5c460c50b7cc26f129ad7646a47c5f7a1fb45ae1e3"}, + {file = "Cython-3.1.0a1-cp38-cp38-win32.whl", hash = "sha256:ea5dbbfc67729d3d0659e445ef61ec2c74c93e8be4af2f84ef0587f92797e71e"}, + {file = "Cython-3.1.0a1-cp38-cp38-win_amd64.whl", hash = "sha256:424ae6f5f7c335fe5eab41dbca905ef7096525545bfccb3cf1d8ae8888f80a4d"}, + {file = "Cython-3.1.0a1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d80ddea49b5739309bc4f452a737adae747fb572b96c6e868fb2db759f3e1495"}, + {file = "Cython-3.1.0a1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f157c125fc5fc0124da6570534d2fca5dd6d90af9ac38640b2f4ed054112cea8"}, + {file = "Cython-3.1.0a1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0b6867dbf9ab2df1f0c7140e95e09c958b34abaf126c82082ca8412c001d94f"}, + {file = "Cython-3.1.0a1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bc263cf1d07d881f3375466e9235162c9a02e8e9337f9308224060c2702ac51"}, + {file = "Cython-3.1.0a1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a84d6aab9eabb9a69a13a3c95bbb0abcfe10c08e1ef6792acfa71ea728195e6"}, + {file = "Cython-3.1.0a1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:97c751542e9d4baad221c7c30565617f9f89a1380bc4fb05821c5d74c75ceaf5"}, + {file = "Cython-3.1.0a1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:0da801866172ac094c3969315b5a8f3c0d969b164d21545bd16161dc87f4b8a3"}, + {file = "Cython-3.1.0a1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:01c0fa03bd518db2d21424e74ac07e1049d50eed820881450495e58dfbae69be"}, + {file = "Cython-3.1.0a1-cp39-cp39-win32.whl", hash = "sha256:2b03a353b253e7b733b4b4899a17155d5f7d10540830f8b822c03d00c4fb3511"}, + {file = "Cython-3.1.0a1-cp39-cp39-win_amd64.whl", hash = "sha256:ec847ff17395c4c05086bb400737c191f3244999a75ddce0077b84e58fc15a14"}, + {file = "Cython-3.1.0a1-py3-none-any.whl", hash = "sha256:c1ac7004561ff28b6fd5d949355d888405b790322e7af8f638592498dd25022b"}, + {file = "cython-3.1.0a1.tar.gz", hash = "sha256:35b53f6947c3133452b84f0f9703f222deb9b02874861427a45e63c891379440"}, ] [[package]] @@ -678,22 +676,6 @@ files = [ {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] -[[package]] -name = "pep440" -version = "0.1.2" -description = "A simple package with utils to check whether versions number match PEP 440." -optional = false -python-versions = ">=3.7" -groups = ["test"] -files = [ - {file = "pep440-0.1.2-py3-none-any.whl", hash = "sha256:36d6ad73f2b5d07769294cafe183500ac89d848c922a3d3f521b968481880d51"}, - {file = "pep440-0.1.2.tar.gz", hash = "sha256:58b37246cc2b13fee1ca2a3c092cb3704d21ecf621a5bdbb168e44e697f6d04d"}, -] - -[package.extras] -lint = ["check-manifest", "mypy"] -test = ["pytest", "pytest-console-scripts", "pytest-cov"] - [[package]] name = "platformdirs" version = "4.3.6" @@ -1204,4 +1186,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">= 3.9" -content-hash = "38fbbe57866b8c63e3de60d3edef54a30fe5fe3e5274d4423caeb0afe9cda15c" +content-hash = "476a2ee500489fae1bc627e8dcd0b532ef31b91b803eaa04eadc84a28d08d8e7" diff --git a/pyproject.toml b/pyproject.toml index b886e5c..0b52e91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["poetry-core>=2.0.1", "setuptools>=75.8.0", "Cython>=3.0.12"] +requires = ["poetry-core>=2.0.1", "setuptools>=75.8.0", "packaging>=24.2", "Cython>=3.1.0a1"] build-backend = "poetry.core.masonry.api" [project] @@ -14,8 +14,6 @@ authors = [ license = "BSD-2-Clause" readme = "README.rst" maintainers = [{name = "Floris-Jan Willemsen", email = "fjwillemsen97@gmail.com"}] -repository = "https://github.com/python-constraint/python-constraint" -documentation = "http://python-constraint.github.io/python-constraint/" keywords = [ "CSP", "constraint solving problems", @@ -40,6 +38,15 @@ classifiers = [ # ATTENTION: if anything is changed here, run `poetry update` requires-python = ">= 3.9" # when changing the Python versions, also change the test versions in the Noxfile and GitHub Actions +[project.urls] +Homepage = "http://python-constraint.github.io/python-constraint" +Documentation = "http://python-constraint.github.io/python-constraint/" +Repository = "https://github.com/python-constraint/python-constraint" +Issues = "https://github.com/python-constraint/python-constraint/issues" +Changelog = "https://github.com/python-constraint/python-constraint/blob/main/CHANGELOG.md" +Download = "https://pypi.org/project/python-constraint/" + +# ATTENTION: if anything is changed here, run `poetry update` [tool.poetry] include = [{ path = "constraint/*.so", format = "wheel" }] packages = [ @@ -63,16 +70,16 @@ sphinx-pyproject = "^0.3.0" # ATTENTION: if anything is changed here, run `poetry update` [tool.poetry.group.dev.dependencies] -Cython = "^3.0.12" +Cython = "^3.1.0a1" [tool.poetry.group.test] optional = true [tool.poetry.group.test.dependencies] pytest = "^8.3.3" pytest-benchmark = "^5.1.0" pytest-cov = "^6.0.0" +packaging = "^24.2" nox = "^2025.2.9" ruff = "^0.9.6" -pep440 = "^0.1.2" tomli = "^2.2.1" # can be replaced by built-in [tomllib](https://docs.python.org/3.11/library/tomllib.html) from Python 3.11 # development dependencies are unused for now, as this is already covered by test and docs diff --git a/tests/test_toml_file.py b/tests/test_toml_file.py index 4e4b19b..78ad810 100644 --- a/tests/test_toml_file.py +++ b/tests/test_toml_file.py @@ -26,10 +26,10 @@ def test_name(): def test_versioning(): """Test whether the versioning is PEP440 compliant.""" - from pep440 import is_canonical + from packaging.version import Version assert "version" in project - assert is_canonical(project["version"]) + assert isinstance(Version(project["version"]).release, tuple) def test_authors():